@agent-canvas/cli 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -1
- package/dist/commands/start.d.ts +2 -1
- package/dist/commands/start.js +10 -28
- package/dist/index.js +112 -4
- package/dist/lib/protocol.d.ts +50 -0
- package/dist/static/assets/{ar-SA-G6X2FPQ2-arrVHh-R.js → ar-SA-G6X2FPQ2-DrFZc17I.js} +1 -1
- package/dist/static/assets/{arc-BSZ1V6rZ.js → arc-BE4RRWho.js} +1 -1
- package/dist/static/assets/{az-AZ-76LH7QW2-fdAWbJfK.js → az-AZ-76LH7QW2-DgHo0c8x.js} +1 -1
- package/dist/static/assets/{bg-BG-XCXSNQG7-BoFoXhnh.js → bg-BG-XCXSNQG7-D6Qfq7sN.js} +1 -1
- package/dist/static/assets/{blockDiagram-38ab4fdb-Bxef-CjK.js → blockDiagram-38ab4fdb-j4QCKNBJ.js} +1 -1
- package/dist/static/assets/{bn-BD-2XOGV67Q-ndF9n7WJ.js → bn-BD-2XOGV67Q-DtD_GeTA.js} +1 -1
- package/dist/static/assets/{c4Diagram-3d4e48cf-C3yMhEw0.js → c4Diagram-3d4e48cf-BmQ9mE4L.js} +1 -1
- package/dist/static/assets/{ca-ES-6MX7JW3Y-C_0BDGUU.js → ca-ES-6MX7JW3Y-pqblEVH2.js} +1 -1
- package/dist/static/assets/channel-DjiT9qJ0.js +1 -0
- package/dist/static/assets/{classDiagram-70f12bd4-bH-gcQtS.js → classDiagram-70f12bd4-CUF5vm_X.js} +1 -1
- package/dist/static/assets/{classDiagram-v2-f2320105-Cl9lY9_U.js → classDiagram-v2-f2320105-Cpj_A_lB.js} +1 -1
- package/dist/static/assets/clone-nkJpLn4s.js +1 -0
- package/dist/static/assets/{createText-2e5e7dd3-Cc_vKWjW.js → createText-2e5e7dd3-pnM7Sebc.js} +1 -1
- package/dist/static/assets/{cs-CZ-2BRQDIVT-DKW63K3n.js → cs-CZ-2BRQDIVT-CybzkHZt.js} +1 -1
- package/dist/static/assets/{da-DK-5WZEPLOC-Bjee6Z_b.js → da-DK-5WZEPLOC-pqELhXiQ.js} +1 -1
- package/dist/static/assets/{de-DE-XR44H4JA-CsJan8pQ.js → de-DE-XR44H4JA-ZL76WiIL.js} +1 -1
- package/dist/static/assets/{edges-e0da2a9e-0s_Sa930.js → edges-e0da2a9e-B9extNmC.js} +1 -1
- package/dist/static/assets/{el-GR-BZB4AONW-DX7HY6O7.js → el-GR-BZB4AONW-rKEdKItN.js} +1 -1
- package/dist/static/assets/{erDiagram-9861fffd-6iRyvEYL.js → erDiagram-9861fffd-Bf-1lr9-.js} +1 -1
- package/dist/static/assets/{es-ES-U4NZUMDT-C01QO10u.js → es-ES-U4NZUMDT-BB6riLIk.js} +1 -1
- package/dist/static/assets/{eu-ES-A7QVB2H4-ddS8i933.js → eu-ES-A7QVB2H4-ChqJNrpA.js} +1 -1
- package/dist/static/assets/{fa-IR-HGAKTJCU-CiXe-oxM.js → fa-IR-HGAKTJCU--KEd62Xu.js} +1 -1
- package/dist/static/assets/{fi-FI-Z5N7JZ37-BZIfeLUf.js → fi-FI-Z5N7JZ37-CdB0adCJ.js} +1 -1
- package/dist/static/assets/{flowDb-956e92f1-BIl8lRNE.js → flowDb-956e92f1-Dbca38tY.js} +1 -1
- package/dist/static/assets/{flowDiagram-66a62f08-zpF9Qnns.js → flowDiagram-66a62f08-DpQc0ZQB.js} +1 -1
- package/dist/static/assets/flowDiagram-v2-96b9c2cf-Dlfh8z7R.js +1 -0
- package/dist/static/assets/{flowchart-elk-definition-4a651766-Ncu1gJ3U.js → flowchart-elk-definition-4a651766-CAxl2EAj.js} +1 -1
- package/dist/static/assets/{fr-FR-RHASNOE6-CiguADcA.js → fr-FR-RHASNOE6-LEJbMD3b.js} +1 -1
- package/dist/static/assets/{ganttDiagram-c361ad54-C830-IEs.js → ganttDiagram-c361ad54-BsKueDb1.js} +1 -1
- package/dist/static/assets/{gitGraphDiagram-72cf32ee-dbNIxRl5.js → gitGraphDiagram-72cf32ee-BySoTKcT.js} +1 -1
- package/dist/static/assets/{gl-ES-HMX3MZ6V-aGNCryOk.js → gl-ES-HMX3MZ6V-Bi3P3M7W.js} +1 -1
- package/dist/static/assets/{graph-BakS7DKh.js → graph-B_0qOa-k.js} +1 -1
- package/dist/static/assets/{he-IL-6SHJWFNN-CSV_HYXG.js → he-IL-6SHJWFNN-DE7_aRwg.js} +1 -1
- package/dist/static/assets/{hi-IN-IWLTKZ5I-dXhxK0r4.js → hi-IN-IWLTKZ5I-CjARmJ8i.js} +1 -1
- package/dist/static/assets/{hu-HU-A5ZG7DT2-Ce-fgGja.js → hu-HU-A5ZG7DT2-d79urL5L.js} +1 -1
- package/dist/static/assets/{id-ID-SAP4L64H-BYzpDke5.js → id-ID-SAP4L64H-bxo8Q0Jv.js} +1 -1
- package/dist/static/assets/{index-3862675e-BHr3FCoR.js → index-3862675e-BLm8h60G.js} +1 -1
- package/dist/static/assets/index-B6CTdFKu.js +311 -0
- package/dist/static/assets/{index-CR_5PySk.js → index-BkW4NM9R.js} +4 -4
- package/dist/static/assets/{infoDiagram-f8f76790-CHH-Ag4-.js → infoDiagram-f8f76790-CZ4J5sjk.js} +1 -1
- package/dist/static/assets/{it-IT-JPQ66NNP-CfovVgtb.js → it-IT-JPQ66NNP-D41R3uEK.js} +1 -1
- package/dist/static/assets/{ja-JP-DBVTYXUO-B6MoSFsx.js → ja-JP-DBVTYXUO-zK8NUJnS.js} +1 -1
- package/dist/static/assets/{journeyDiagram-49397b02-DzKIS4ib.js → journeyDiagram-49397b02-DtFcZaIk.js} +1 -1
- package/dist/static/assets/{kaa-6HZHGXH3-CoaIzpDg.js → kaa-6HZHGXH3-CbGIc6V6.js} +1 -1
- package/dist/static/assets/{kab-KAB-ZGHBKWFO-CbqmW1j2.js → kab-KAB-ZGHBKWFO-BweHPuX1.js} +1 -1
- package/dist/static/assets/{kk-KZ-P5N5QNE5-BP6c5DwX.js → kk-KZ-P5N5QNE5-DSokMm7h.js} +1 -1
- package/dist/static/assets/{km-KH-HSX4SM5Z-C8Gv7a4I.js → km-KH-HSX4SM5Z-LYiEs3ge.js} +1 -1
- package/dist/static/assets/{ko-KR-MTYHY66A-B7iC_KOj.js → ko-KR-MTYHY66A-BzgMEtcU.js} +1 -1
- package/dist/static/assets/{ku-TR-6OUDTVRD-BpNwMMwX.js → ku-TR-6OUDTVRD-D1FtjbSs.js} +1 -1
- package/dist/static/assets/{layout-CHyRR10V.js → layout-CQWIZrii.js} +1 -1
- package/dist/static/assets/{line-CZy9XRkt.js → line-BryEd-Ku.js} +1 -1
- package/dist/static/assets/{linear-DtoJruu5.js → linear-SXhM57Mz.js} +1 -1
- package/dist/static/assets/{lt-LT-XHIRWOB4-DaMkVJpc.js → lt-LT-XHIRWOB4-BPrhIUrC.js} +1 -1
- package/dist/static/assets/{lv-LV-5QDEKY6T-BcDcug3j.js → lv-LV-5QDEKY6T-CXJse_rs.js} +1 -1
- package/dist/static/assets/{mindmap-definition-fc14e90a-C9S0s9SX.js → mindmap-definition-fc14e90a-C8giDsiX.js} +1 -1
- package/dist/static/assets/{mr-IN-CRQNXWMA-B5aFOOH9.js → mr-IN-CRQNXWMA-Clab-bAO.js} +1 -1
- package/dist/static/assets/{my-MM-5M5IBNSE-C093_-er.js → my-MM-5M5IBNSE-Dp08JzEw.js} +1 -1
- package/dist/static/assets/{nb-NO-T6EIAALU-DCyZaYw9.js → nb-NO-T6EIAALU-CiaXJA-W.js} +1 -1
- package/dist/static/assets/{nl-NL-IS3SIHDZ-wOYebQ8C.js → nl-NL-IS3SIHDZ-D-9KUTnx.js} +1 -1
- package/dist/static/assets/{nn-NO-6E72VCQL-CxrSDVPc.js → nn-NO-6E72VCQL-Bg5gsQ4h.js} +1 -1
- package/dist/static/assets/{oc-FR-POXYY2M6-DyVYhP2Q.js → oc-FR-POXYY2M6-G4iqllhL.js} +1 -1
- package/dist/static/assets/{pa-IN-N4M65BXN-BDzqaJoO.js → pa-IN-N4M65BXN-l6Lk41uX.js} +1 -1
- package/dist/static/assets/{pica-C_sll1eQ.js → pica-CtkejCRD.js} +1 -1
- package/dist/static/assets/{pieDiagram-8a3498a8-CmfjEOMy.js → pieDiagram-8a3498a8-CG6gQ14H.js} +1 -1
- package/dist/static/assets/{pl-PL-T2D74RX3-DtbwxdSw.js → pl-PL-T2D74RX3-BZPbB8S3.js} +1 -1
- package/dist/static/assets/{pt-BR-5N22H2LF-CMUeihxR.js → pt-BR-5N22H2LF-CIC4vRyd.js} +1 -1
- package/dist/static/assets/{pt-PT-UZXXM6DQ-Dlp0Nss3.js → pt-PT-UZXXM6DQ-rkGTBEI0.js} +1 -1
- package/dist/static/assets/{quadrantDiagram-120e2f19-D6X1Zr2v.js → quadrantDiagram-120e2f19-BL9eFu4M.js} +1 -1
- package/dist/static/assets/{requirementDiagram-deff3bca-C_VMf9Rd.js → requirementDiagram-deff3bca-crxdUpVK.js} +1 -1
- package/dist/static/assets/{ro-RO-JPDTUUEW-D_lp9bqb.js → ro-RO-JPDTUUEW-GDhpTKBO.js} +1 -1
- package/dist/static/assets/{ru-RU-B4JR7IUQ-DPCD9e_U.js → ru-RU-B4JR7IUQ-BzHvMwjC.js} +1 -1
- package/dist/static/assets/{sankeyDiagram-04a897e0-Bz6-YQWw.js → sankeyDiagram-04a897e0-bM05WQw3.js} +1 -1
- package/dist/static/assets/{sequenceDiagram-704730f1-YfiI471U.js → sequenceDiagram-704730f1-DjknV0Qp.js} +1 -1
- package/dist/static/assets/{si-LK-N5RQ5JYF-IwE_HKES.js → si-LK-N5RQ5JYF-D3P3TNDH.js} +1 -1
- package/dist/static/assets/{sk-SK-C5VTKIMK-sJf2D3-U.js → sk-SK-C5VTKIMK-CM8yTXlZ.js} +1 -1
- package/dist/static/assets/{sl-SI-NN7IZMDC-BnoAudTY.js → sl-SI-NN7IZMDC-CxoGm3aM.js} +1 -1
- package/dist/static/assets/{stateDiagram-587899a1-ChWk2k6S.js → stateDiagram-587899a1-CmWqIdF5.js} +1 -1
- package/dist/static/assets/{stateDiagram-v2-d93cdb3a-DK3YwHVK.js → stateDiagram-v2-d93cdb3a-CgzNTiHW.js} +1 -1
- package/dist/static/assets/{styles-6aaf32cf-cgRjMlNF.js → styles-6aaf32cf-CI4s6NIA.js} +1 -1
- package/dist/static/assets/{styles-9a916d00-BByocrZU.js → styles-9a916d00-ZcdN6rtW.js} +1 -1
- package/dist/static/assets/{styles-c10674c1-Vmtn-NN_.js → styles-c10674c1-ZFkD6ta7.js} +1 -1
- package/dist/static/assets/{subset-shared.chunk-Duh8cfOn.js → subset-shared.chunk-B4F4dEPr.js} +1 -1
- package/dist/static/assets/{subset-worker.chunk-0N0uCEmC.js → subset-worker.chunk-CmgaOgn3.js} +1 -1
- package/dist/static/assets/{sv-SE-XGPEYMSR-CSl5mqmx.js → sv-SE-XGPEYMSR-CnVZlafq.js} +1 -1
- package/dist/static/assets/{svgDrawCommon-08f97a94-DnLp-yXc.js → svgDrawCommon-08f97a94-DbN3OiBf.js} +1 -1
- package/dist/static/assets/{ta-IN-2NMHFXQM-k4nndW_F.js → ta-IN-2NMHFXQM-Bl-eCjzL.js} +1 -1
- package/dist/static/assets/{th-TH-HPSO5L25-BeS-Tucs.js → th-TH-HPSO5L25-CNIGPjSR.js} +1 -1
- package/dist/static/assets/{timeline-definition-85554ec2-tqqwvkCk.js → timeline-definition-85554ec2-Cmr82Iq1.js} +1 -1
- package/dist/static/assets/{tr-TR-DEFEU3FU-C58xhKQH.js → tr-TR-DEFEU3FU-Cx7HbGIA.js} +1 -1
- package/dist/static/assets/{uk-UA-QMV73CPH-Bzx1zo1l.js → uk-UA-QMV73CPH-BxcA50Ze.js} +1 -1
- package/dist/static/assets/{vi-VN-M7AON7JQ-CQUm5v8s.js → vi-VN-M7AON7JQ-BvGuRh0c.js} +1 -1
- package/dist/static/assets/{xychartDiagram-e933f94c-D0MclM5Z.js → xychartDiagram-e933f94c-BcWLDEHu.js} +1 -1
- package/dist/static/assets/{zh-CN-LNUGB5OW-CUaYzBFY.js → zh-CN-LNUGB5OW-SQH8i3l5.js} +1 -1
- package/dist/static/assets/{zh-HK-E62DVLB3-BKRYGHvF.js → zh-HK-E62DVLB3-COWoLNur.js} +1 -1
- package/dist/static/assets/{zh-TW-RAJ6MFWO-DtRCYJcI.js → zh-TW-RAJ6MFWO-Cm5B69ig.js} +1 -1
- package/dist/static/index.html +1 -1
- package/package.json +1 -1
- package/dist/static/assets/channel-CeRBGFfz.js +0 -1
- package/dist/static/assets/clone-jzJ5eIJ9.js +0 -1
- package/dist/static/assets/flowDiagram-v2-96b9c2cf-oZXIDLC-.js +0 -1
- package/dist/static/assets/index-4gF2cKRg.js +0 -256
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/subset-worker.chunk-CmgaOgn3.js","assets/subset-shared.chunk-B4F4dEPr.js","assets/pica-CtkejCRD.js","assets/_commonjs-dynamic-modules-TDtrdbi3.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
function VR(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var rs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n2={exports:{}},eu={},r2={exports:{}},ct={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var a4;function GR(){if(a4)return ct;a4=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),o=Symbol.for("react.lazy"),f=Symbol.iterator;function m(X){return X===null||typeof X!="object"?null:(X=f&&X[f]||X["@@iterator"],typeof X=="function"?X:null)}var U={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,v={};function y(X,se,ge){this.props=X,this.context=se,this.refs=v,this.updater=ge||U}y.prototype.isReactComponent={},y.prototype.setState=function(X,se){if(typeof X!="object"&&typeof X!="function"&&X!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,X,se,"setState")},y.prototype.forceUpdate=function(X){this.updater.enqueueForceUpdate(this,X,"forceUpdate")};function w(){}w.prototype=y.prototype;function E(X,se,ge){this.props=X,this.context=se,this.refs=v,this.updater=ge||U}var S=E.prototype=new w;S.constructor=E,g(S,y.prototype),S.isPureReactComponent=!0;var k=Array.isArray,I=Object.prototype.hasOwnProperty,T={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function j(X,se,ge){var _e,Y={},H=null,re=null;if(se!=null)for(_e in se.ref!==void 0&&(re=se.ref),se.key!==void 0&&(H=""+se.key),se)I.call(se,_e)&&!M.hasOwnProperty(_e)&&(Y[_e]=se[_e]);var te=arguments.length-2;if(te===1)Y.children=ge;else if(1<te){for(var de=Array(te),me=0;me<te;me++)de[me]=arguments[me+2];Y.children=de}if(X&&X.defaultProps)for(_e in te=X.defaultProps,te)Y[_e]===void 0&&(Y[_e]=te[_e]);return{$$typeof:e,type:X,key:H,ref:re,props:Y,_owner:T.current}}function D(X,se){return{$$typeof:e,type:X.type,key:se,ref:X.ref,props:X.props,_owner:X._owner}}function P(X){return typeof X=="object"&&X!==null&&X.$$typeof===e}function N(X){var se={"=":"=0",":":"=2"};return"$"+X.replace(/[=:]/g,function(ge){return se[ge]})}var $=/\/+/g;function z(X,se){return typeof X=="object"&&X!==null&&X.key!=null?N(""+X.key):se.toString(36)}function Z(X,se,ge,_e,Y){var H=typeof X;(H==="undefined"||H==="boolean")&&(X=null);var re=!1;if(X===null)re=!0;else switch(H){case"string":case"number":re=!0;break;case"object":switch(X.$$typeof){case e:case t:re=!0}}if(re)return re=X,Y=Y(re),X=_e===""?"."+z(re,0):_e,k(Y)?(ge="",X!=null&&(ge=X.replace($,"$&/")+"/"),Z(Y,se,ge,"",function(me){return me})):Y!=null&&(P(Y)&&(Y=D(Y,ge+(!Y.key||re&&re.key===Y.key?"":(""+Y.key).replace($,"$&/")+"/")+X)),se.push(Y)),1;if(re=0,_e=_e===""?".":_e+":",k(X))for(var te=0;te<X.length;te++){H=X[te];var de=_e+z(H,te);re+=Z(H,se,ge,de,Y)}else if(de=m(X),typeof de=="function")for(X=de.call(X),te=0;!(H=X.next()).done;)H=H.value,de=_e+z(H,te++),re+=Z(H,se,ge,de,Y);else if(H==="object")throw se=String(X),Error("Objects are not valid as a React child (found: "+(se==="[object Object]"?"object with keys {"+Object.keys(X).join(", ")+"}":se)+"). If you meant to render a collection of children, use an array instead.");return re}function K(X,se,ge){if(X==null)return X;var _e=[],Y=0;return Z(X,_e,"","",function(H){return se.call(ge,H,Y++)}),_e}function Q(X){if(X._status===-1){var se=X._result;se=se(),se.then(function(ge){(X._status===0||X._status===-1)&&(X._status=1,X._result=ge)},function(ge){(X._status===0||X._status===-1)&&(X._status=2,X._result=ge)}),X._status===-1&&(X._status=0,X._result=se)}if(X._status===1)return X._result.default;throw X._result}var W={current:null},q={transition:null},V={ReactCurrentDispatcher:W,ReactCurrentBatchConfig:q,ReactCurrentOwner:T};function ee(){throw Error("act(...) is not supported in production builds of React.")}return ct.Children={map:K,forEach:function(X,se,ge){K(X,function(){se.apply(this,arguments)},ge)},count:function(X){var se=0;return K(X,function(){se++}),se},toArray:function(X){return K(X,function(se){return se})||[]},only:function(X){if(!P(X))throw Error("React.Children.only expected to receive a single React element child.");return X}},ct.Component=y,ct.Fragment=n,ct.Profiler=a,ct.PureComponent=E,ct.StrictMode=r,ct.Suspense=d,ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,ct.act=ee,ct.cloneElement=function(X,se,ge){if(X==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+X+".");var _e=g({},X.props),Y=X.key,H=X.ref,re=X._owner;if(se!=null){if(se.ref!==void 0&&(H=se.ref,re=T.current),se.key!==void 0&&(Y=""+se.key),X.type&&X.type.defaultProps)var te=X.type.defaultProps;for(de in se)I.call(se,de)&&!M.hasOwnProperty(de)&&(_e[de]=se[de]===void 0&&te!==void 0?te[de]:se[de])}var de=arguments.length-2;if(de===1)_e.children=ge;else if(1<de){te=Array(de);for(var me=0;me<de;me++)te[me]=arguments[me+2];_e.children=te}return{$$typeof:e,type:X.type,key:Y,ref:H,props:_e,_owner:re}},ct.createContext=function(X){return X={$$typeof:l,_currentValue:X,_currentValue2:X,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},X.Provider={$$typeof:i,_context:X},X.Consumer=X},ct.createElement=j,ct.createFactory=function(X){var se=j.bind(null,X);return se.type=X,se},ct.createRef=function(){return{current:null}},ct.forwardRef=function(X){return{$$typeof:s,render:X}},ct.isValidElement=P,ct.lazy=function(X){return{$$typeof:o,_payload:{_status:-1,_result:X},_init:Q}},ct.memo=function(X,se){return{$$typeof:u,type:X,compare:se===void 0?null:se}},ct.startTransition=function(X){var se=q.transition;q.transition={};try{X()}finally{q.transition=se}},ct.unstable_act=ee,ct.useCallback=function(X,se){return W.current.useCallback(X,se)},ct.useContext=function(X){return W.current.useContext(X)},ct.useDebugValue=function(){},ct.useDeferredValue=function(X){return W.current.useDeferredValue(X)},ct.useEffect=function(X,se){return W.current.useEffect(X,se)},ct.useId=function(){return W.current.useId()},ct.useImperativeHandle=function(X,se,ge){return W.current.useImperativeHandle(X,se,ge)},ct.useInsertionEffect=function(X,se){return W.current.useInsertionEffect(X,se)},ct.useLayoutEffect=function(X,se){return W.current.useLayoutEffect(X,se)},ct.useMemo=function(X,se){return W.current.useMemo(X,se)},ct.useReducer=function(X,se,ge){return W.current.useReducer(X,se,ge)},ct.useRef=function(X){return W.current.useRef(X)},ct.useState=function(X){return W.current.useState(X)},ct.useSyncExternalStore=function(X,se,ge){return W.current.useSyncExternalStore(X,se,ge)},ct.useTransition=function(){return W.current.useTransition()},ct.version="18.3.1",ct}var i4;function If(){return i4||(i4=1,r2.exports=GR()),r2.exports}/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-jsx-runtime.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var l4;function YR(){if(l4)return eu;l4=1;var e=If(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(s,d,u){var o,f={},m=null,U=null;u!==void 0&&(m=""+u),d.key!==void 0&&(m=""+d.key),d.ref!==void 0&&(U=d.ref);for(o in d)r.call(d,o)&&!i.hasOwnProperty(o)&&(f[o]=d[o]);if(s&&s.defaultProps)for(o in d=s.defaultProps,d)f[o]===void 0&&(f[o]=d[o]);return{$$typeof:t,type:s,key:m,ref:U,props:f,_owner:a.current}}return eu.Fragment=n,eu.jsx=l,eu.jsxs=l,eu}var s4;function ZR(){return s4||(s4=1,n2.exports=YR()),n2.exports}var p=ZR(),_=If();const we=_i(_),r5=VR({__proto__:null,default:we},[_]);var d1={},a2={exports:{}},wr={},i2={exports:{}},l2={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var o4;function KR(){return o4||(o4=1,(function(e){function t(q,V){var ee=q.length;q.push(V);e:for(;0<ee;){var X=ee-1>>>1,se=q[X];if(0<a(se,V))q[X]=V,q[ee]=se,ee=X;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var V=q[0],ee=q.pop();if(ee!==V){q[0]=ee;e:for(var X=0,se=q.length,ge=se>>>1;X<ge;){var _e=2*(X+1)-1,Y=q[_e],H=_e+1,re=q[H];if(0>a(Y,ee))H<se&&0>a(re,Y)?(q[X]=re,q[H]=ee,X=H):(q[X]=Y,q[_e]=ee,X=_e);else if(H<se&&0>a(re,ee))q[X]=re,q[H]=ee,X=H;else break e}}return V}function a(q,V){var ee=q.sortIndex-V.sortIndex;return ee!==0?ee:q.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var d=[],u=[],o=1,f=null,m=3,U=!1,g=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(q){for(var V=n(u);V!==null;){if(V.callback===null)r(u);else if(V.startTime<=q)r(u),V.sortIndex=V.expirationTime,t(d,V);else break;V=n(u)}}function k(q){if(v=!1,S(q),!g)if(n(d)!==null)g=!0,Q(I);else{var V=n(u);V!==null&&W(k,V.startTime-q)}}function I(q,V){g=!1,v&&(v=!1,w(j),j=-1),U=!0;var ee=m;try{for(S(V),f=n(d);f!==null&&(!(f.expirationTime>V)||q&&!N());){var X=f.callback;if(typeof X=="function"){f.callback=null,m=f.priorityLevel;var se=X(f.expirationTime<=V);V=e.unstable_now(),typeof se=="function"?f.callback=se:f===n(d)&&r(d),S(V)}else r(d);f=n(d)}if(f!==null)var ge=!0;else{var _e=n(u);_e!==null&&W(k,_e.startTime-V),ge=!1}return ge}finally{f=null,m=ee,U=!1}}var T=!1,M=null,j=-1,D=5,P=-1;function N(){return!(e.unstable_now()-P<D)}function $(){if(M!==null){var q=e.unstable_now();P=q;var V=!0;try{V=M(!0,q)}finally{V?z():(T=!1,M=null)}}else T=!1}var z;if(typeof E=="function")z=function(){E($)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,K=Z.port2;Z.port1.onmessage=$,z=function(){K.postMessage(null)}}else z=function(){y($,0)};function Q(q){M=q,T||(T=!0,z())}function W(q,V){j=y(function(){q(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_continueExecution=function(){g||U||(g=!0,Q(I))},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(q){switch(m){case 1:case 2:case 3:var V=3;break;default:V=m}var ee=m;m=V;try{return q()}finally{m=ee}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(q,V){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var ee=m;m=q;try{return V()}finally{m=ee}},e.unstable_scheduleCallback=function(q,V,ee){var X=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?X+ee:X):ee=X,q){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=ee+se,q={id:o++,callback:V,priorityLevel:q,startTime:ee,expirationTime:se,sortIndex:-1},ee>X?(q.sortIndex=ee,t(u,q),n(d)===null&&q===n(u)&&(v?(w(j),j=-1):v=!0,W(k,ee-X))):(q.sortIndex=se,t(d,q),g||U||(g=!0,Q(I))),q},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(q){var V=m;return function(){var ee=m;m=V;try{return q.apply(this,arguments)}finally{m=ee}}}})(l2)),l2}var c4;function qR(){return c4||(c4=1,i2.exports=KR()),i2.exports}/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var d4;function QR(){if(d4)return wr;d4=1;var e=If(),t=qR();function n(c){for(var h="https://reactjs.org/docs/error-decoder.html?invariant="+c,b=1;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b]);return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function i(c,h){l(c,h),l(c+"Capture",h)}function l(c,h){for(a[c]=h,c=0;c<h.length;c++)r.add(h[c])}var s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,o={},f={};function m(c){return d.call(f,c)?!0:d.call(o,c)?!1:u.test(c)?f[c]=!0:(o[c]=!0,!1)}function U(c,h,b,x){if(b!==null&&b.type===0)return!1;switch(typeof h){case"function":case"symbol":return!0;case"boolean":return x?!1:b!==null?!b.acceptsBooleans:(c=c.toLowerCase().slice(0,5),c!=="data-"&&c!=="aria-");default:return!1}}function g(c,h,b,x){if(h===null||typeof h>"u"||U(c,h,b,x))return!0;if(x)return!1;if(b!==null)switch(b.type){case 3:return!h;case 4:return h===!1;case 5:return isNaN(h);case 6:return isNaN(h)||1>h}return!1}function v(c,h,b,x,C,R,O){this.acceptsBooleans=h===2||h===3||h===4,this.attributeName=x,this.attributeNamespace=C,this.mustUseProperty=b,this.propertyName=c,this.type=h,this.sanitizeURL=R,this.removeEmptyString=O}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(c){y[c]=new v(c,0,!1,c,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(c){var h=c[0];y[h]=new v(h,1,!1,c[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(c){y[c]=new v(c,2,!1,c.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(c){y[c]=new v(c,2,!1,c,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(c){y[c]=new v(c,3,!1,c.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(c){y[c]=new v(c,3,!0,c,null,!1,!1)}),["capture","download"].forEach(function(c){y[c]=new v(c,4,!1,c,null,!1,!1)}),["cols","rows","size","span"].forEach(function(c){y[c]=new v(c,6,!1,c,null,!1,!1)}),["rowSpan","start"].forEach(function(c){y[c]=new v(c,5,!1,c.toLowerCase(),null,!1,!1)});var w=/[\-:]([a-z])/g;function E(c){return c[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(c){var h=c.replace(w,E);y[h]=new v(h,1,!1,c,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(c){var h=c.replace(w,E);y[h]=new v(h,1,!1,c,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(c){var h=c.replace(w,E);y[h]=new v(h,1,!1,c,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(c){y[c]=new v(c,1,!1,c.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(c){y[c]=new v(c,1,!1,c.toLowerCase(),null,!0,!0)});function S(c,h,b,x){var C=y.hasOwnProperty(h)?y[h]:null;(C!==null?C.type!==0:x||!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(g(h,b,C,x)&&(b=null),x||C===null?m(h)&&(b===null?c.removeAttribute(h):c.setAttribute(h,""+b)):C.mustUseProperty?c[C.propertyName]=b===null?C.type===3?!1:"":b:(h=C.attributeName,x=C.attributeNamespace,b===null?c.removeAttribute(h):(C=C.type,b=C===3||C===4&&b===!0?"":""+b,x?c.setAttributeNS(x,h,b):c.setAttribute(h,b))))}var k=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),T=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),N=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),q=Symbol.iterator;function V(c){return c===null||typeof c!="object"?null:(c=q&&c[q]||c["@@iterator"],typeof c=="function"?c:null)}var ee=Object.assign,X;function se(c){if(X===void 0)try{throw Error()}catch(b){var h=b.stack.trim().match(/\n( *(at )?)/);X=h&&h[1]||""}return`
|
|
35
|
+
`+X+c}var ge=!1;function _e(c,h){if(!c||ge)return"";ge=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(h)if(h=function(){throw Error()},Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(ue){var x=ue}Reflect.construct(c,[],h)}else{try{h.call()}catch(ue){x=ue}c.call(h.prototype)}else{try{throw Error()}catch(ue){x=ue}c()}}catch(ue){if(ue&&x&&typeof ue.stack=="string"){for(var C=ue.stack.split(`
|
|
36
|
+
`),R=x.stack.split(`
|
|
37
|
+
`),O=C.length-1,G=R.length-1;1<=O&&0<=G&&C[O]!==R[G];)G--;for(;1<=O&&0<=G;O--,G--)if(C[O]!==R[G]){if(O!==1||G!==1)do if(O--,G--,0>G||C[O]!==R[G]){var J=`
|
|
38
|
+
`+C[O].replace(" at new "," at ");return c.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",c.displayName)),J}while(1<=O&&0<=G);break}}}finally{ge=!1,Error.prepareStackTrace=b}return(c=c?c.displayName||c.name:"")?se(c):""}function Y(c){switch(c.tag){case 5:return se(c.type);case 16:return se("Lazy");case 13:return se("Suspense");case 19:return se("SuspenseList");case 0:case 2:case 15:return c=_e(c.type,!1),c;case 11:return c=_e(c.type.render,!1),c;case 1:return c=_e(c.type,!0),c;default:return""}}function H(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case M:return"Fragment";case T:return"Portal";case D:return"Profiler";case j:return"StrictMode";case z:return"Suspense";case Z:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case N:return(c.displayName||"Context")+".Consumer";case P:return(c._context.displayName||"Context")+".Provider";case $:var h=c.render;return c=c.displayName,c||(c=h.displayName||h.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case K:return h=c.displayName||null,h!==null?h:H(c.type)||"Memo";case Q:h=c._payload,c=c._init;try{return H(c(h))}catch{}}return null}function re(c){var h=c.type;switch(c.tag){case 24:return"Cache";case 9:return(h.displayName||"Context")+".Consumer";case 10:return(h._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=h.render,c=c.displayName||c.name||"",h.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return h;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return H(h);case 8:return h===j?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h}return null}function te(c){switch(typeof c){case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function de(c){var h=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function me(c){var h=de(c)?"checked":"value",b=Object.getOwnPropertyDescriptor(c.constructor.prototype,h),x=""+c[h];if(!c.hasOwnProperty(h)&&typeof b<"u"&&typeof b.get=="function"&&typeof b.set=="function"){var C=b.get,R=b.set;return Object.defineProperty(c,h,{configurable:!0,get:function(){return C.call(this)},set:function(O){x=""+O,R.call(this,O)}}),Object.defineProperty(c,h,{enumerable:b.enumerable}),{getValue:function(){return x},setValue:function(O){x=""+O},stopTracking:function(){c._valueTracker=null,delete c[h]}}}}function fe(c){c._valueTracker||(c._valueTracker=me(c))}function Ue(c){if(!c)return!1;var h=c._valueTracker;if(!h)return!0;var b=h.getValue(),x="";return c&&(x=de(c)?c.checked?"true":"false":c.value),c=x,c!==b?(h.setValue(c),!0):!1}function Te(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}function it(c,h){var b=h.checked;return ee({},h,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:b??c._wrapperState.initialChecked})}function mt(c,h){var b=h.defaultValue==null?"":h.defaultValue,x=h.checked!=null?h.checked:h.defaultChecked;b=te(h.value!=null?h.value:b),c._wrapperState={initialChecked:x,initialValue:b,controlled:h.type==="checkbox"||h.type==="radio"?h.checked!=null:h.value!=null}}function Be(c,h){h=h.checked,h!=null&&S(c,"checked",h,!1)}function Mt(c,h){Be(c,h);var b=te(h.value),x=h.type;if(b!=null)x==="number"?(b===0&&c.value===""||c.value!=b)&&(c.value=""+b):c.value!==""+b&&(c.value=""+b);else if(x==="submit"||x==="reset"){c.removeAttribute("value");return}h.hasOwnProperty("value")?ze(c,h.type,b):h.hasOwnProperty("defaultValue")&&ze(c,h.type,te(h.defaultValue)),h.checked==null&&h.defaultChecked!=null&&(c.defaultChecked=!!h.defaultChecked)}function on(c,h,b){if(h.hasOwnProperty("value")||h.hasOwnProperty("defaultValue")){var x=h.type;if(!(x!=="submit"&&x!=="reset"||h.value!==void 0&&h.value!==null))return;h=""+c._wrapperState.initialValue,b||h===c.value||(c.value=h),c.defaultValue=h}b=c.name,b!==""&&(c.name=""),c.defaultChecked=!!c._wrapperState.initialChecked,b!==""&&(c.name=b)}function ze(c,h,b){(h!=="number"||Te(c.ownerDocument)!==c)&&(b==null?c.defaultValue=""+c._wrapperState.initialValue:c.defaultValue!==""+b&&(c.defaultValue=""+b))}var ht=Array.isArray;function Gr(c,h,b,x){if(c=c.options,h){h={};for(var C=0;C<b.length;C++)h["$"+b[C]]=!0;for(b=0;b<c.length;b++)C=h.hasOwnProperty("$"+c[b].value),c[b].selected!==C&&(c[b].selected=C),C&&x&&(c[b].defaultSelected=!0)}else{for(b=""+te(b),h=null,C=0;C<c.length;C++){if(c[C].value===b){c[C].selected=!0,x&&(c[C].defaultSelected=!0);return}h!==null||c[C].disabled||(h=c[C])}h!==null&&(h.selected=!0)}}function El(c,h){if(h.dangerouslySetInnerHTML!=null)throw Error(n(91));return ee({},h,{value:void 0,defaultValue:void 0,children:""+c._wrapperState.initialValue})}function Yr(c,h){var b=h.value;if(b==null){if(b=h.children,h=h.defaultValue,b!=null){if(h!=null)throw Error(n(92));if(ht(b)){if(1<b.length)throw Error(n(93));b=b[0]}h=b}h==null&&(h=""),b=h}c._wrapperState={initialValue:te(b)}}function Zr(c,h){var b=te(h.value),x=te(h.defaultValue);b!=null&&(b=""+b,b!==c.value&&(c.value=b),h.defaultValue==null&&c.defaultValue!==b&&(c.defaultValue=b)),x!=null&&(c.defaultValue=""+x)}function Ms(c){var h=c.textContent;h===c._wrapperState.initialValue&&h!==""&&h!==null&&(c.value=h)}function Is(c){switch(c){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Sl(c,h){return c==null||c==="http://www.w3.org/1999/xhtml"?Is(h):c==="http://www.w3.org/2000/svg"&&h==="foreignObject"?"http://www.w3.org/1999/xhtml":c}var Li,th=(function(c){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(h,b,x,C){MSApp.execUnsafeLocalFunction(function(){return c(h,b,x,C)})}:c})(function(c,h){if(c.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in c)c.innerHTML=h;else{for(Li=Li||document.createElement("div"),Li.innerHTML="<svg>"+h.valueOf().toString()+"</svg>",h=Li.firstChild;c.firstChild;)c.removeChild(c.firstChild);for(;h.firstChild;)c.appendChild(h.firstChild)}});function _s(c,h){if(h){var b=c.firstChild;if(b&&b===c.lastChild&&b.nodeType===3){b.nodeValue=h;return}}c.textContent=h}var kl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nh=["Webkit","ms","Moz","O"];Object.keys(kl).forEach(function(c){nh.forEach(function(h){h=h+c.charAt(0).toUpperCase()+c.substring(1),kl[h]=kl[c]})});function vb(c,h,b){return h==null||typeof h=="boolean"||h===""?"":b||typeof h!="number"||h===0||kl.hasOwnProperty(c)&&kl[c]?(""+h).trim():h+"px"}function yb(c,h){c=c.style;for(var b in h)if(h.hasOwnProperty(b)){var x=b.indexOf("--")===0,C=vb(b,h[b],x);b==="float"&&(b="cssFloat"),x?c.setProperty(b,C):c[b]=C}}var qT=ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pm(c,h){if(h){if(qT[c]&&(h.children!=null||h.dangerouslySetInnerHTML!=null))throw Error(n(137,c));if(h.dangerouslySetInnerHTML!=null){if(h.children!=null)throw Error(n(60));if(typeof h.dangerouslySetInnerHTML!="object"||!("__html"in h.dangerouslySetInnerHTML))throw Error(n(61))}if(h.style!=null&&typeof h.style!="object")throw Error(n(62))}}function mm(c,h){if(c.indexOf("-")===-1)return typeof h.is=="string";switch(c){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Um=null;function gm(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var bm=null,$o=null,zo=null;function xb(c){if(c=$d(c)){if(typeof bm!="function")throw Error(n(280));var h=c.stateNode;h&&(h=kh(h),bm(c.stateNode,c.type,h))}}function wb(c){$o?zo?zo.push(c):zo=[c]:$o=c}function Eb(){if($o){var c=$o,h=zo;if(zo=$o=null,xb(c),h)for(c=0;c<h.length;c++)xb(h[c])}}function Sb(c,h){return c(h)}function kb(){}var vm=!1;function Cb(c,h,b){if(vm)return c(h,b);vm=!0;try{return Sb(c,h,b)}finally{vm=!1,($o!==null||zo!==null)&&(kb(),Eb())}}function bd(c,h){var b=c.stateNode;if(b===null)return null;var x=kh(b);if(x===null)return null;b=x[h];e:switch(h){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(c=c.type,x=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!x;break e;default:c=!1}if(c)return null;if(b&&typeof b!="function")throw Error(n(231,h,typeof b));return b}var ym=!1;if(s)try{var vd={};Object.defineProperty(vd,"passive",{get:function(){ym=!0}}),window.addEventListener("test",vd,vd),window.removeEventListener("test",vd,vd)}catch{ym=!1}function QT(c,h,b,x,C,R,O,G,J){var ue=Array.prototype.slice.call(arguments,3);try{h.apply(b,ue)}catch(ve){this.onError(ve)}}var yd=!1,rh=null,ah=!1,xm=null,JT={onError:function(c){yd=!0,rh=c}};function eA(c,h,b,x,C,R,O,G,J){yd=!1,rh=null,QT.apply(JT,arguments)}function tA(c,h,b,x,C,R,O,G,J){if(eA.apply(this,arguments),yd){if(yd){var ue=rh;yd=!1,rh=null}else throw Error(n(198));ah||(ah=!0,xm=ue)}}function Ts(c){var h=c,b=c;if(c.alternate)for(;h.return;)h=h.return;else{c=h;do h=c,(h.flags&4098)!==0&&(b=h.return),c=h.return;while(c)}return h.tag===3?b:null}function Mb(c){if(c.tag===13){var h=c.memoizedState;if(h===null&&(c=c.alternate,c!==null&&(h=c.memoizedState)),h!==null)return h.dehydrated}return null}function Ib(c){if(Ts(c)!==c)throw Error(n(188))}function nA(c){var h=c.alternate;if(!h){if(h=Ts(c),h===null)throw Error(n(188));return h!==c?null:c}for(var b=c,x=h;;){var C=b.return;if(C===null)break;var R=C.alternate;if(R===null){if(x=C.return,x!==null){b=x;continue}break}if(C.child===R.child){for(R=C.child;R;){if(R===b)return Ib(C),c;if(R===x)return Ib(C),h;R=R.sibling}throw Error(n(188))}if(b.return!==x.return)b=C,x=R;else{for(var O=!1,G=C.child;G;){if(G===b){O=!0,b=C,x=R;break}if(G===x){O=!0,x=C,b=R;break}G=G.sibling}if(!O){for(G=R.child;G;){if(G===b){O=!0,b=R,x=C;break}if(G===x){O=!0,x=R,b=C;break}G=G.sibling}if(!O)throw Error(n(189))}}if(b.alternate!==x)throw Error(n(190))}if(b.tag!==3)throw Error(n(188));return b.stateNode.current===b?c:h}function _b(c){return c=nA(c),c!==null?Tb(c):null}function Tb(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var h=Tb(c);if(h!==null)return h;c=c.sibling}return null}var Ab=t.unstable_scheduleCallback,Rb=t.unstable_cancelCallback,rA=t.unstable_shouldYield,aA=t.unstable_requestPaint,pn=t.unstable_now,iA=t.unstable_getCurrentPriorityLevel,wm=t.unstable_ImmediatePriority,jb=t.unstable_UserBlockingPriority,ih=t.unstable_NormalPriority,lA=t.unstable_LowPriority,Lb=t.unstable_IdlePriority,lh=null,Qa=null;function sA(c){if(Qa&&typeof Qa.onCommitFiberRoot=="function")try{Qa.onCommitFiberRoot(lh,c,void 0,(c.current.flags&128)===128)}catch{}}var va=Math.clz32?Math.clz32:dA,oA=Math.log,cA=Math.LN2;function dA(c){return c>>>=0,c===0?32:31-(oA(c)/cA|0)|0}var sh=64,oh=4194304;function xd(c){switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function ch(c,h){var b=c.pendingLanes;if(b===0)return 0;var x=0,C=c.suspendedLanes,R=c.pingedLanes,O=b&268435455;if(O!==0){var G=O&~C;G!==0?x=xd(G):(R&=O,R!==0&&(x=xd(R)))}else O=b&~C,O!==0?x=xd(O):R!==0&&(x=xd(R));if(x===0)return 0;if(h!==0&&h!==x&&(h&C)===0&&(C=x&-x,R=h&-h,C>=R||C===16&&(R&4194240)!==0))return h;if((x&4)!==0&&(x|=b&16),h=c.entangledLanes,h!==0)for(c=c.entanglements,h&=x;0<h;)b=31-va(h),C=1<<b,x|=c[b],h&=~C;return x}function uA(c,h){switch(c){case 1:case 2:case 4:return h+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return h+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fA(c,h){for(var b=c.suspendedLanes,x=c.pingedLanes,C=c.expirationTimes,R=c.pendingLanes;0<R;){var O=31-va(R),G=1<<O,J=C[O];J===-1?((G&b)===0||(G&x)!==0)&&(C[O]=uA(G,h)):J<=h&&(c.expiredLanes|=G),R&=~G}}function Em(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function Db(){var c=sh;return sh<<=1,(sh&4194240)===0&&(sh=64),c}function Sm(c){for(var h=[],b=0;31>b;b++)h.push(c);return h}function wd(c,h,b){c.pendingLanes|=h,h!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,h=31-va(h),c[h]=b}function hA(c,h){var b=c.pendingLanes&~h;c.pendingLanes=h,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=h,c.mutableReadLanes&=h,c.entangledLanes&=h,h=c.entanglements;var x=c.eventTimes;for(c=c.expirationTimes;0<b;){var C=31-va(b),R=1<<C;h[C]=0,x[C]=-1,c[C]=-1,b&=~R}}function km(c,h){var b=c.entangledLanes|=h;for(c=c.entanglements;b;){var x=31-va(b),C=1<<x;C&h|c[x]&h&&(c[x]|=h),b&=~C}}var Tt=0;function Pb(c){return c&=-c,1<c?4<c?(c&268435455)!==0?16:536870912:4:1}var Nb,Cm,Ob,$b,zb,Mm=!1,dh=[],Cl=null,Ml=null,Il=null,Ed=new Map,Sd=new Map,_l=[],pA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Fb(c,h){switch(c){case"focusin":case"focusout":Cl=null;break;case"dragenter":case"dragleave":Ml=null;break;case"mouseover":case"mouseout":Il=null;break;case"pointerover":case"pointerout":Ed.delete(h.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sd.delete(h.pointerId)}}function kd(c,h,b,x,C,R){return c===null||c.nativeEvent!==R?(c={blockedOn:h,domEventName:b,eventSystemFlags:x,nativeEvent:R,targetContainers:[C]},h!==null&&(h=$d(h),h!==null&&Cm(h)),c):(c.eventSystemFlags|=x,h=c.targetContainers,C!==null&&h.indexOf(C)===-1&&h.push(C),c)}function mA(c,h,b,x,C){switch(h){case"focusin":return Cl=kd(Cl,c,h,b,x,C),!0;case"dragenter":return Ml=kd(Ml,c,h,b,x,C),!0;case"mouseover":return Il=kd(Il,c,h,b,x,C),!0;case"pointerover":var R=C.pointerId;return Ed.set(R,kd(Ed.get(R)||null,c,h,b,x,C)),!0;case"gotpointercapture":return R=C.pointerId,Sd.set(R,kd(Sd.get(R)||null,c,h,b,x,C)),!0}return!1}function Bb(c){var h=As(c.target);if(h!==null){var b=Ts(h);if(b!==null){if(h=b.tag,h===13){if(h=Mb(b),h!==null){c.blockedOn=h,zb(c.priority,function(){Ob(b)});return}}else if(h===3&&b.stateNode.current.memoizedState.isDehydrated){c.blockedOn=b.tag===3?b.stateNode.containerInfo:null;return}}}c.blockedOn=null}function uh(c){if(c.blockedOn!==null)return!1;for(var h=c.targetContainers;0<h.length;){var b=_m(c.domEventName,c.eventSystemFlags,h[0],c.nativeEvent);if(b===null){b=c.nativeEvent;var x=new b.constructor(b.type,b);Um=x,b.target.dispatchEvent(x),Um=null}else return h=$d(b),h!==null&&Cm(h),c.blockedOn=b,!1;h.shift()}return!0}function Hb(c,h,b){uh(c)&&b.delete(h)}function UA(){Mm=!1,Cl!==null&&uh(Cl)&&(Cl=null),Ml!==null&&uh(Ml)&&(Ml=null),Il!==null&&uh(Il)&&(Il=null),Ed.forEach(Hb),Sd.forEach(Hb)}function Cd(c,h){c.blockedOn===h&&(c.blockedOn=null,Mm||(Mm=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,UA)))}function Md(c){function h(C){return Cd(C,c)}if(0<dh.length){Cd(dh[0],c);for(var b=1;b<dh.length;b++){var x=dh[b];x.blockedOn===c&&(x.blockedOn=null)}}for(Cl!==null&&Cd(Cl,c),Ml!==null&&Cd(Ml,c),Il!==null&&Cd(Il,c),Ed.forEach(h),Sd.forEach(h),b=0;b<_l.length;b++)x=_l[b],x.blockedOn===c&&(x.blockedOn=null);for(;0<_l.length&&(b=_l[0],b.blockedOn===null);)Bb(b),b.blockedOn===null&&_l.shift()}var Fo=k.ReactCurrentBatchConfig,fh=!0;function gA(c,h,b,x){var C=Tt,R=Fo.transition;Fo.transition=null;try{Tt=1,Im(c,h,b,x)}finally{Tt=C,Fo.transition=R}}function bA(c,h,b,x){var C=Tt,R=Fo.transition;Fo.transition=null;try{Tt=4,Im(c,h,b,x)}finally{Tt=C,Fo.transition=R}}function Im(c,h,b,x){if(fh){var C=_m(c,h,b,x);if(C===null)Vm(c,h,x,hh,b),Fb(c,x);else if(mA(C,c,h,b,x))x.stopPropagation();else if(Fb(c,x),h&4&&-1<pA.indexOf(c)){for(;C!==null;){var R=$d(C);if(R!==null&&Nb(R),R=_m(c,h,b,x),R===null&&Vm(c,h,x,hh,b),R===C)break;C=R}C!==null&&x.stopPropagation()}else Vm(c,h,x,null,b)}}var hh=null;function _m(c,h,b,x){if(hh=null,c=gm(x),c=As(c),c!==null)if(h=Ts(c),h===null)c=null;else if(b=h.tag,b===13){if(c=Mb(h),c!==null)return c;c=null}else if(b===3){if(h.stateNode.current.memoizedState.isDehydrated)return h.tag===3?h.stateNode.containerInfo:null;c=null}else h!==c&&(c=null);return hh=c,null}function Wb(c){switch(c){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(iA()){case wm:return 1;case jb:return 4;case ih:case lA:return 16;case Lb:return 536870912;default:return 16}default:return 16}}var Tl=null,Tm=null,ph=null;function Xb(){if(ph)return ph;var c,h=Tm,b=h.length,x,C="value"in Tl?Tl.value:Tl.textContent,R=C.length;for(c=0;c<b&&h[c]===C[c];c++);var O=b-c;for(x=1;x<=O&&h[b-x]===C[R-x];x++);return ph=C.slice(c,1<x?1-x:void 0)}function mh(c){var h=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&h===13&&(c=13)):c=h,c===10&&(c=13),32<=c||c===13?c:0}function Uh(){return!0}function Vb(){return!1}function Dr(c){function h(b,x,C,R,O){this._reactName=b,this._targetInst=C,this.type=x,this.nativeEvent=R,this.target=O,this.currentTarget=null;for(var G in c)c.hasOwnProperty(G)&&(b=c[G],this[G]=b?b(R):R[G]);return this.isDefaultPrevented=(R.defaultPrevented!=null?R.defaultPrevented:R.returnValue===!1)?Uh:Vb,this.isPropagationStopped=Vb,this}return ee(h.prototype,{preventDefault:function(){this.defaultPrevented=!0;var b=this.nativeEvent;b&&(b.preventDefault?b.preventDefault():typeof b.returnValue!="unknown"&&(b.returnValue=!1),this.isDefaultPrevented=Uh)},stopPropagation:function(){var b=this.nativeEvent;b&&(b.stopPropagation?b.stopPropagation():typeof b.cancelBubble!="unknown"&&(b.cancelBubble=!0),this.isPropagationStopped=Uh)},persist:function(){},isPersistent:Uh}),h}var Bo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Am=Dr(Bo),Id=ee({},Bo,{view:0,detail:0}),vA=Dr(Id),Rm,jm,_d,gh=ee({},Id,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dm,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==_d&&(_d&&c.type==="mousemove"?(Rm=c.screenX-_d.screenX,jm=c.screenY-_d.screenY):jm=Rm=0,_d=c),Rm)},movementY:function(c){return"movementY"in c?c.movementY:jm}}),Gb=Dr(gh),yA=ee({},gh,{dataTransfer:0}),xA=Dr(yA),wA=ee({},Id,{relatedTarget:0}),Lm=Dr(wA),EA=ee({},Bo,{animationName:0,elapsedTime:0,pseudoElement:0}),SA=Dr(EA),kA=ee({},Bo,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),CA=Dr(kA),MA=ee({},Bo,{data:0}),Yb=Dr(MA),IA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_A={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},TA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AA(c){var h=this.nativeEvent;return h.getModifierState?h.getModifierState(c):(c=TA[c])?!!h[c]:!1}function Dm(){return AA}var RA=ee({},Id,{key:function(c){if(c.key){var h=IA[c.key]||c.key;if(h!=="Unidentified")return h}return c.type==="keypress"?(c=mh(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?_A[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dm,charCode:function(c){return c.type==="keypress"?mh(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?mh(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),jA=Dr(RA),LA=ee({},gh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zb=Dr(LA),DA=ee({},Id,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),PA=Dr(DA),NA=ee({},Bo,{propertyName:0,elapsedTime:0,pseudoElement:0}),OA=Dr(NA),$A=ee({},gh,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),zA=Dr($A),FA=[9,13,27,32],Pm=s&&"CompositionEvent"in window,Td=null;s&&"documentMode"in document&&(Td=document.documentMode);var BA=s&&"TextEvent"in window&&!Td,Kb=s&&(!Pm||Td&&8<Td&&11>=Td),qb=" ",Qb=!1;function Jb(c,h){switch(c){case"keyup":return FA.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function e7(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var Ho=!1;function HA(c,h){switch(c){case"compositionend":return e7(h);case"keypress":return h.which!==32?null:(Qb=!0,qb);case"textInput":return c=h.data,c===qb&&Qb?null:c;default:return null}}function WA(c,h){if(Ho)return c==="compositionend"||!Pm&&Jb(c,h)?(c=Xb(),ph=Tm=Tl=null,Ho=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1<h.char.length)return h.char;if(h.which)return String.fromCharCode(h.which)}return null;case"compositionend":return Kb&&h.locale!=="ko"?null:h.data;default:return null}}var XA={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function t7(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h==="input"?!!XA[c.type]:h==="textarea"}function n7(c,h,b,x){wb(x),h=wh(h,"onChange"),0<h.length&&(b=new Am("onChange","change",null,b,x),c.push({event:b,listeners:h}))}var Ad=null,Rd=null;function VA(c){y7(c,0)}function bh(c){var h=Yo(c);if(Ue(h))return c}function GA(c,h){if(c==="change")return h}var r7=!1;if(s){var Nm;if(s){var Om="oninput"in document;if(!Om){var a7=document.createElement("div");a7.setAttribute("oninput","return;"),Om=typeof a7.oninput=="function"}Nm=Om}else Nm=!1;r7=Nm&&(!document.documentMode||9<document.documentMode)}function i7(){Ad&&(Ad.detachEvent("onpropertychange",l7),Rd=Ad=null)}function l7(c){if(c.propertyName==="value"&&bh(Rd)){var h=[];n7(h,Rd,c,gm(c)),Cb(VA,h)}}function YA(c,h,b){c==="focusin"?(i7(),Ad=h,Rd=b,Ad.attachEvent("onpropertychange",l7)):c==="focusout"&&i7()}function ZA(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return bh(Rd)}function KA(c,h){if(c==="click")return bh(h)}function qA(c,h){if(c==="input"||c==="change")return bh(h)}function QA(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var ya=typeof Object.is=="function"?Object.is:QA;function jd(c,h){if(ya(c,h))return!0;if(typeof c!="object"||c===null||typeof h!="object"||h===null)return!1;var b=Object.keys(c),x=Object.keys(h);if(b.length!==x.length)return!1;for(x=0;x<b.length;x++){var C=b[x];if(!d.call(h,C)||!ya(c[C],h[C]))return!1}return!0}function s7(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function o7(c,h){var b=s7(c);c=0;for(var x;b;){if(b.nodeType===3){if(x=c+b.textContent.length,c<=h&&x>=h)return{node:b,offset:h-c};c=x}e:{for(;b;){if(b.nextSibling){b=b.nextSibling;break e}b=b.parentNode}b=void 0}b=s7(b)}}function c7(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?c7(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function d7(){for(var c=window,h=Te();h instanceof c.HTMLIFrameElement;){try{var b=typeof h.contentWindow.location.href=="string"}catch{b=!1}if(b)c=h.contentWindow;else break;h=Te(c.document)}return h}function $m(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}function JA(c){var h=d7(),b=c.focusedElem,x=c.selectionRange;if(h!==b&&b&&b.ownerDocument&&c7(b.ownerDocument.documentElement,b)){if(x!==null&&$m(b)){if(h=x.start,c=x.end,c===void 0&&(c=h),"selectionStart"in b)b.selectionStart=h,b.selectionEnd=Math.min(c,b.value.length);else if(c=(h=b.ownerDocument||document)&&h.defaultView||window,c.getSelection){c=c.getSelection();var C=b.textContent.length,R=Math.min(x.start,C);x=x.end===void 0?R:Math.min(x.end,C),!c.extend&&R>x&&(C=x,x=R,R=C),C=o7(b,R);var O=o7(b,x);C&&O&&(c.rangeCount!==1||c.anchorNode!==C.node||c.anchorOffset!==C.offset||c.focusNode!==O.node||c.focusOffset!==O.offset)&&(h=h.createRange(),h.setStart(C.node,C.offset),c.removeAllRanges(),R>x?(c.addRange(h),c.extend(O.node,O.offset)):(h.setEnd(O.node,O.offset),c.addRange(h)))}}for(h=[],c=b;c=c.parentNode;)c.nodeType===1&&h.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<h.length;b++)c=h[b],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var eR=s&&"documentMode"in document&&11>=document.documentMode,Wo=null,zm=null,Ld=null,Fm=!1;function u7(c,h,b){var x=b.window===b?b.document:b.nodeType===9?b:b.ownerDocument;Fm||Wo==null||Wo!==Te(x)||(x=Wo,"selectionStart"in x&&$m(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Ld&&jd(Ld,x)||(Ld=x,x=wh(zm,"onSelect"),0<x.length&&(h=new Am("onSelect","select",null,h,b),c.push({event:h,listeners:x}),h.target=Wo)))}function vh(c,h){var b={};return b[c.toLowerCase()]=h.toLowerCase(),b["Webkit"+c]="webkit"+h,b["Moz"+c]="moz"+h,b}var Xo={animationend:vh("Animation","AnimationEnd"),animationiteration:vh("Animation","AnimationIteration"),animationstart:vh("Animation","AnimationStart"),transitionend:vh("Transition","TransitionEnd")},Bm={},f7={};s&&(f7=document.createElement("div").style,"AnimationEvent"in window||(delete Xo.animationend.animation,delete Xo.animationiteration.animation,delete Xo.animationstart.animation),"TransitionEvent"in window||delete Xo.transitionend.transition);function yh(c){if(Bm[c])return Bm[c];if(!Xo[c])return c;var h=Xo[c],b;for(b in h)if(h.hasOwnProperty(b)&&b in f7)return Bm[c]=h[b];return c}var h7=yh("animationend"),p7=yh("animationiteration"),m7=yh("animationstart"),U7=yh("transitionend"),g7=new Map,b7="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Al(c,h){g7.set(c,h),i(h,[c])}for(var Hm=0;Hm<b7.length;Hm++){var Wm=b7[Hm],tR=Wm.toLowerCase(),nR=Wm[0].toUpperCase()+Wm.slice(1);Al(tR,"on"+nR)}Al(h7,"onAnimationEnd"),Al(p7,"onAnimationIteration"),Al(m7,"onAnimationStart"),Al("dblclick","onDoubleClick"),Al("focusin","onFocus"),Al("focusout","onBlur"),Al(U7,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),rR=new Set("cancel close invalid load scroll toggle".split(" ").concat(Dd));function v7(c,h,b){var x=c.type||"unknown-event";c.currentTarget=b,tA(x,h,void 0,c),c.currentTarget=null}function y7(c,h){h=(h&4)!==0;for(var b=0;b<c.length;b++){var x=c[b],C=x.event;x=x.listeners;e:{var R=void 0;if(h)for(var O=x.length-1;0<=O;O--){var G=x[O],J=G.instance,ue=G.currentTarget;if(G=G.listener,J!==R&&C.isPropagationStopped())break e;v7(C,G,ue),R=J}else for(O=0;O<x.length;O++){if(G=x[O],J=G.instance,ue=G.currentTarget,G=G.listener,J!==R&&C.isPropagationStopped())break e;v7(C,G,ue),R=J}}}if(ah)throw c=xm,ah=!1,xm=null,c}function Bt(c,h){var b=h[Qm];b===void 0&&(b=h[Qm]=new Set);var x=c+"__bubble";b.has(x)||(x7(h,c,2,!1),b.add(x))}function Xm(c,h,b){var x=0;h&&(x|=4),x7(b,c,x,h)}var xh="_reactListening"+Math.random().toString(36).slice(2);function Pd(c){if(!c[xh]){c[xh]=!0,r.forEach(function(b){b!=="selectionchange"&&(rR.has(b)||Xm(b,!1,c),Xm(b,!0,c))});var h=c.nodeType===9?c:c.ownerDocument;h===null||h[xh]||(h[xh]=!0,Xm("selectionchange",!1,h))}}function x7(c,h,b,x){switch(Wb(h)){case 1:var C=gA;break;case 4:C=bA;break;default:C=Im}b=C.bind(null,h,b,c),C=void 0,!ym||h!=="touchstart"&&h!=="touchmove"&&h!=="wheel"||(C=!0),x?C!==void 0?c.addEventListener(h,b,{capture:!0,passive:C}):c.addEventListener(h,b,!0):C!==void 0?c.addEventListener(h,b,{passive:C}):c.addEventListener(h,b,!1)}function Vm(c,h,b,x,C){var R=x;if((h&1)===0&&(h&2)===0&&x!==null)e:for(;;){if(x===null)return;var O=x.tag;if(O===3||O===4){var G=x.stateNode.containerInfo;if(G===C||G.nodeType===8&&G.parentNode===C)break;if(O===4)for(O=x.return;O!==null;){var J=O.tag;if((J===3||J===4)&&(J=O.stateNode.containerInfo,J===C||J.nodeType===8&&J.parentNode===C))return;O=O.return}for(;G!==null;){if(O=As(G),O===null)return;if(J=O.tag,J===5||J===6){x=R=O;continue e}G=G.parentNode}}x=x.return}Cb(function(){var ue=R,ve=gm(b),ye=[];e:{var be=g7.get(c);if(be!==void 0){var je=Am,Ne=c;switch(c){case"keypress":if(mh(b)===0)break e;case"keydown":case"keyup":je=jA;break;case"focusin":Ne="focus",je=Lm;break;case"focusout":Ne="blur",je=Lm;break;case"beforeblur":case"afterblur":je=Lm;break;case"click":if(b.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":je=Gb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":je=xA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":je=PA;break;case h7:case p7:case m7:je=SA;break;case U7:je=OA;break;case"scroll":je=vA;break;case"wheel":je=zA;break;case"copy":case"cut":case"paste":je=CA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":je=Zb}var $e=(h&4)!==0,mn=!$e&&c==="scroll",le=$e?be!==null?be+"Capture":null:be;$e=[];for(var ne=ue,oe;ne!==null;){oe=ne;var Ee=oe.stateNode;if(oe.tag===5&&Ee!==null&&(oe=Ee,le!==null&&(Ee=bd(ne,le),Ee!=null&&$e.push(Nd(ne,Ee,oe)))),mn)break;ne=ne.return}0<$e.length&&(be=new je(be,Ne,null,b,ve),ye.push({event:be,listeners:$e}))}}if((h&7)===0){e:{if(be=c==="mouseover"||c==="pointerover",je=c==="mouseout"||c==="pointerout",be&&b!==Um&&(Ne=b.relatedTarget||b.fromElement)&&(As(Ne)||Ne[Di]))break e;if((je||be)&&(be=ve.window===ve?ve:(be=ve.ownerDocument)?be.defaultView||be.parentWindow:window,je?(Ne=b.relatedTarget||b.toElement,je=ue,Ne=Ne?As(Ne):null,Ne!==null&&(mn=Ts(Ne),Ne!==mn||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(je=null,Ne=ue),je!==Ne)){if($e=Gb,Ee="onMouseLeave",le="onMouseEnter",ne="mouse",(c==="pointerout"||c==="pointerover")&&($e=Zb,Ee="onPointerLeave",le="onPointerEnter",ne="pointer"),mn=je==null?be:Yo(je),oe=Ne==null?be:Yo(Ne),be=new $e(Ee,ne+"leave",je,b,ve),be.target=mn,be.relatedTarget=oe,Ee=null,As(ve)===ue&&($e=new $e(le,ne+"enter",Ne,b,ve),$e.target=oe,$e.relatedTarget=mn,Ee=$e),mn=Ee,je&&Ne)t:{for($e=je,le=Ne,ne=0,oe=$e;oe;oe=Vo(oe))ne++;for(oe=0,Ee=le;Ee;Ee=Vo(Ee))oe++;for(;0<ne-oe;)$e=Vo($e),ne--;for(;0<oe-ne;)le=Vo(le),oe--;for(;ne--;){if($e===le||le!==null&&$e===le.alternate)break t;$e=Vo($e),le=Vo(le)}$e=null}else $e=null;je!==null&&w7(ye,be,je,$e,!1),Ne!==null&&mn!==null&&w7(ye,mn,Ne,$e,!0)}}e:{if(be=ue?Yo(ue):window,je=be.nodeName&&be.nodeName.toLowerCase(),je==="select"||je==="input"&&be.type==="file")var Fe=GA;else if(t7(be))if(r7)Fe=qA;else{Fe=ZA;var Xe=YA}else(je=be.nodeName)&&je.toLowerCase()==="input"&&(be.type==="checkbox"||be.type==="radio")&&(Fe=KA);if(Fe&&(Fe=Fe(c,ue))){n7(ye,Fe,b,ve);break e}Xe&&Xe(c,be,ue),c==="focusout"&&(Xe=be._wrapperState)&&Xe.controlled&&be.type==="number"&&ze(be,"number",be.value)}switch(Xe=ue?Yo(ue):window,c){case"focusin":(t7(Xe)||Xe.contentEditable==="true")&&(Wo=Xe,zm=ue,Ld=null);break;case"focusout":Ld=zm=Wo=null;break;case"mousedown":Fm=!0;break;case"contextmenu":case"mouseup":case"dragend":Fm=!1,u7(ye,b,ve);break;case"selectionchange":if(eR)break;case"keydown":case"keyup":u7(ye,b,ve)}var Ve;if(Pm)e:{switch(c){case"compositionstart":var Qe="onCompositionStart";break e;case"compositionend":Qe="onCompositionEnd";break e;case"compositionupdate":Qe="onCompositionUpdate";break e}Qe=void 0}else Ho?Jb(c,b)&&(Qe="onCompositionEnd"):c==="keydown"&&b.keyCode===229&&(Qe="onCompositionStart");Qe&&(Kb&&b.locale!=="ko"&&(Ho||Qe!=="onCompositionStart"?Qe==="onCompositionEnd"&&Ho&&(Ve=Xb()):(Tl=ve,Tm="value"in Tl?Tl.value:Tl.textContent,Ho=!0)),Xe=wh(ue,Qe),0<Xe.length&&(Qe=new Yb(Qe,c,null,b,ve),ye.push({event:Qe,listeners:Xe}),Ve?Qe.data=Ve:(Ve=e7(b),Ve!==null&&(Qe.data=Ve)))),(Ve=BA?HA(c,b):WA(c,b))&&(ue=wh(ue,"onBeforeInput"),0<ue.length&&(ve=new Yb("onBeforeInput","beforeinput",null,b,ve),ye.push({event:ve,listeners:ue}),ve.data=Ve))}y7(ye,h)})}function Nd(c,h,b){return{instance:c,listener:h,currentTarget:b}}function wh(c,h){for(var b=h+"Capture",x=[];c!==null;){var C=c,R=C.stateNode;C.tag===5&&R!==null&&(C=R,R=bd(c,b),R!=null&&x.unshift(Nd(c,R,C)),R=bd(c,h),R!=null&&x.push(Nd(c,R,C))),c=c.return}return x}function Vo(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5);return c||null}function w7(c,h,b,x,C){for(var R=h._reactName,O=[];b!==null&&b!==x;){var G=b,J=G.alternate,ue=G.stateNode;if(J!==null&&J===x)break;G.tag===5&&ue!==null&&(G=ue,C?(J=bd(b,R),J!=null&&O.unshift(Nd(b,J,G))):C||(J=bd(b,R),J!=null&&O.push(Nd(b,J,G)))),b=b.return}O.length!==0&&c.push({event:h,listeners:O})}var aR=/\r\n?/g,iR=/\u0000|\uFFFD/g;function E7(c){return(typeof c=="string"?c:""+c).replace(aR,`
|
|
39
|
+
`).replace(iR,"")}function Eh(c,h,b){if(h=E7(h),E7(c)!==h&&b)throw Error(n(425))}function Sh(){}var Gm=null,Ym=null;function Zm(c,h){return c==="textarea"||c==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var Km=typeof setTimeout=="function"?setTimeout:void 0,lR=typeof clearTimeout=="function"?clearTimeout:void 0,S7=typeof Promise=="function"?Promise:void 0,sR=typeof queueMicrotask=="function"?queueMicrotask:typeof S7<"u"?function(c){return S7.resolve(null).then(c).catch(oR)}:Km;function oR(c){setTimeout(function(){throw c})}function qm(c,h){var b=h,x=0;do{var C=b.nextSibling;if(c.removeChild(b),C&&C.nodeType===8)if(b=C.data,b==="/$"){if(x===0){c.removeChild(C),Md(h);return}x--}else b!=="$"&&b!=="$?"&&b!=="$!"||x++;b=C}while(b);Md(h)}function Rl(c){for(;c!=null;c=c.nextSibling){var h=c.nodeType;if(h===1||h===3)break;if(h===8){if(h=c.data,h==="$"||h==="$!"||h==="$?")break;if(h==="/$")return null}}return c}function k7(c){c=c.previousSibling;for(var h=0;c;){if(c.nodeType===8){var b=c.data;if(b==="$"||b==="$!"||b==="$?"){if(h===0)return c;h--}else b==="/$"&&h++}c=c.previousSibling}return null}var Go=Math.random().toString(36).slice(2),Ja="__reactFiber$"+Go,Od="__reactProps$"+Go,Di="__reactContainer$"+Go,Qm="__reactEvents$"+Go,cR="__reactListeners$"+Go,dR="__reactHandles$"+Go;function As(c){var h=c[Ja];if(h)return h;for(var b=c.parentNode;b;){if(h=b[Di]||b[Ja]){if(b=h.alternate,h.child!==null||b!==null&&b.child!==null)for(c=k7(c);c!==null;){if(b=c[Ja])return b;c=k7(c)}return h}c=b,b=c.parentNode}return null}function $d(c){return c=c[Ja]||c[Di],!c||c.tag!==5&&c.tag!==6&&c.tag!==13&&c.tag!==3?null:c}function Yo(c){if(c.tag===5||c.tag===6)return c.stateNode;throw Error(n(33))}function kh(c){return c[Od]||null}var Jm=[],Zo=-1;function jl(c){return{current:c}}function Ht(c){0>Zo||(c.current=Jm[Zo],Jm[Zo]=null,Zo--)}function Ot(c,h){Zo++,Jm[Zo]=c.current,c.current=h}var Ll={},Kn=jl(Ll),gr=jl(!1),Rs=Ll;function Ko(c,h){var b=c.type.contextTypes;if(!b)return Ll;var x=c.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===h)return x.__reactInternalMemoizedMaskedChildContext;var C={},R;for(R in b)C[R]=h[R];return x&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=h,c.__reactInternalMemoizedMaskedChildContext=C),C}function br(c){return c=c.childContextTypes,c!=null}function Ch(){Ht(gr),Ht(Kn)}function C7(c,h,b){if(Kn.current!==Ll)throw Error(n(168));Ot(Kn,h),Ot(gr,b)}function M7(c,h,b){var x=c.stateNode;if(h=h.childContextTypes,typeof x.getChildContext!="function")return b;x=x.getChildContext();for(var C in x)if(!(C in h))throw Error(n(108,re(c)||"Unknown",C));return ee({},b,x)}function Mh(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Ll,Rs=Kn.current,Ot(Kn,c),Ot(gr,gr.current),!0}function I7(c,h,b){var x=c.stateNode;if(!x)throw Error(n(169));b?(c=M7(c,h,Rs),x.__reactInternalMemoizedMergedChildContext=c,Ht(gr),Ht(Kn),Ot(Kn,c)):Ht(gr),Ot(gr,b)}var Pi=null,Ih=!1,eU=!1;function _7(c){Pi===null?Pi=[c]:Pi.push(c)}function uR(c){Ih=!0,_7(c)}function Dl(){if(!eU&&Pi!==null){eU=!0;var c=0,h=Tt;try{var b=Pi;for(Tt=1;c<b.length;c++){var x=b[c];do x=x(!0);while(x!==null)}Pi=null,Ih=!1}catch(C){throw Pi!==null&&(Pi=Pi.slice(c+1)),Ab(wm,Dl),C}finally{Tt=h,eU=!1}}return null}var qo=[],Qo=0,_h=null,Th=0,Kr=[],qr=0,js=null,Ni=1,Oi="";function Ls(c,h){qo[Qo++]=Th,qo[Qo++]=_h,_h=c,Th=h}function T7(c,h,b){Kr[qr++]=Ni,Kr[qr++]=Oi,Kr[qr++]=js,js=c;var x=Ni;c=Oi;var C=32-va(x)-1;x&=~(1<<C),b+=1;var R=32-va(h)+C;if(30<R){var O=C-C%5;R=(x&(1<<O)-1).toString(32),x>>=O,C-=O,Ni=1<<32-va(h)+C|b<<C|x,Oi=R+c}else Ni=1<<R|b<<C|x,Oi=c}function tU(c){c.return!==null&&(Ls(c,1),T7(c,1,0))}function nU(c){for(;c===_h;)_h=qo[--Qo],qo[Qo]=null,Th=qo[--Qo],qo[Qo]=null;for(;c===js;)js=Kr[--qr],Kr[qr]=null,Oi=Kr[--qr],Kr[qr]=null,Ni=Kr[--qr],Kr[qr]=null}var Pr=null,Nr=null,Vt=!1,xa=null;function A7(c,h){var b=ta(5,null,null,0);b.elementType="DELETED",b.stateNode=h,b.return=c,h=c.deletions,h===null?(c.deletions=[b],c.flags|=16):h.push(b)}function R7(c,h){switch(c.tag){case 5:var b=c.type;return h=h.nodeType!==1||b.toLowerCase()!==h.nodeName.toLowerCase()?null:h,h!==null?(c.stateNode=h,Pr=c,Nr=Rl(h.firstChild),!0):!1;case 6:return h=c.pendingProps===""||h.nodeType!==3?null:h,h!==null?(c.stateNode=h,Pr=c,Nr=null,!0):!1;case 13:return h=h.nodeType!==8?null:h,h!==null?(b=js!==null?{id:Ni,overflow:Oi}:null,c.memoizedState={dehydrated:h,treeContext:b,retryLane:1073741824},b=ta(18,null,null,0),b.stateNode=h,b.return=c,c.child=b,Pr=c,Nr=null,!0):!1;default:return!1}}function rU(c){return(c.mode&1)!==0&&(c.flags&128)===0}function aU(c){if(Vt){var h=Nr;if(h){var b=h;if(!R7(c,h)){if(rU(c))throw Error(n(418));h=Rl(b.nextSibling);var x=Pr;h&&R7(c,h)?A7(x,b):(c.flags=c.flags&-4097|2,Vt=!1,Pr=c)}}else{if(rU(c))throw Error(n(418));c.flags=c.flags&-4097|2,Vt=!1,Pr=c}}}function j7(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;Pr=c}function Ah(c){if(c!==Pr)return!1;if(!Vt)return j7(c),Vt=!0,!1;var h;if((h=c.tag!==3)&&!(h=c.tag!==5)&&(h=c.type,h=h!=="head"&&h!=="body"&&!Zm(c.type,c.memoizedProps)),h&&(h=Nr)){if(rU(c))throw L7(),Error(n(418));for(;h;)A7(c,h),h=Rl(h.nextSibling)}if(j7(c),c.tag===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(n(317));e:{for(c=c.nextSibling,h=0;c;){if(c.nodeType===8){var b=c.data;if(b==="/$"){if(h===0){Nr=Rl(c.nextSibling);break e}h--}else b!=="$"&&b!=="$!"&&b!=="$?"||h++}c=c.nextSibling}Nr=null}}else Nr=Pr?Rl(c.stateNode.nextSibling):null;return!0}function L7(){for(var c=Nr;c;)c=Rl(c.nextSibling)}function Jo(){Nr=Pr=null,Vt=!1}function iU(c){xa===null?xa=[c]:xa.push(c)}var fR=k.ReactCurrentBatchConfig;function zd(c,h,b){if(c=b.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(b._owner){if(b=b._owner,b){if(b.tag!==1)throw Error(n(309));var x=b.stateNode}if(!x)throw Error(n(147,c));var C=x,R=""+c;return h!==null&&h.ref!==null&&typeof h.ref=="function"&&h.ref._stringRef===R?h.ref:(h=function(O){var G=C.refs;O===null?delete G[R]:G[R]=O},h._stringRef=R,h)}if(typeof c!="string")throw Error(n(284));if(!b._owner)throw Error(n(290,c))}return c}function Rh(c,h){throw c=Object.prototype.toString.call(h),Error(n(31,c==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":c))}function D7(c){var h=c._init;return h(c._payload)}function P7(c){function h(le,ne){if(c){var oe=le.deletions;oe===null?(le.deletions=[ne],le.flags|=16):oe.push(ne)}}function b(le,ne){if(!c)return null;for(;ne!==null;)h(le,ne),ne=ne.sibling;return null}function x(le,ne){for(le=new Map;ne!==null;)ne.key!==null?le.set(ne.key,ne):le.set(ne.index,ne),ne=ne.sibling;return le}function C(le,ne){return le=Hl(le,ne),le.index=0,le.sibling=null,le}function R(le,ne,oe){return le.index=oe,c?(oe=le.alternate,oe!==null?(oe=oe.index,oe<ne?(le.flags|=2,ne):oe):(le.flags|=2,ne)):(le.flags|=1048576,ne)}function O(le){return c&&le.alternate===null&&(le.flags|=2),le}function G(le,ne,oe,Ee){return ne===null||ne.tag!==6?(ne=KU(oe,le.mode,Ee),ne.return=le,ne):(ne=C(ne,oe),ne.return=le,ne)}function J(le,ne,oe,Ee){var Fe=oe.type;return Fe===M?ve(le,ne,oe.props.children,Ee,oe.key):ne!==null&&(ne.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===Q&&D7(Fe)===ne.type)?(Ee=C(ne,oe.props),Ee.ref=zd(le,ne,oe),Ee.return=le,Ee):(Ee=n1(oe.type,oe.key,oe.props,null,le.mode,Ee),Ee.ref=zd(le,ne,oe),Ee.return=le,Ee)}function ue(le,ne,oe,Ee){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==oe.containerInfo||ne.stateNode.implementation!==oe.implementation?(ne=qU(oe,le.mode,Ee),ne.return=le,ne):(ne=C(ne,oe.children||[]),ne.return=le,ne)}function ve(le,ne,oe,Ee,Fe){return ne===null||ne.tag!==7?(ne=Bs(oe,le.mode,Ee,Fe),ne.return=le,ne):(ne=C(ne,oe),ne.return=le,ne)}function ye(le,ne,oe){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=KU(""+ne,le.mode,oe),ne.return=le,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case I:return oe=n1(ne.type,ne.key,ne.props,null,le.mode,oe),oe.ref=zd(le,null,ne),oe.return=le,oe;case T:return ne=qU(ne,le.mode,oe),ne.return=le,ne;case Q:var Ee=ne._init;return ye(le,Ee(ne._payload),oe)}if(ht(ne)||V(ne))return ne=Bs(ne,le.mode,oe,null),ne.return=le,ne;Rh(le,ne)}return null}function be(le,ne,oe,Ee){var Fe=ne!==null?ne.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number")return Fe!==null?null:G(le,ne,""+oe,Ee);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case I:return oe.key===Fe?J(le,ne,oe,Ee):null;case T:return oe.key===Fe?ue(le,ne,oe,Ee):null;case Q:return Fe=oe._init,be(le,ne,Fe(oe._payload),Ee)}if(ht(oe)||V(oe))return Fe!==null?null:ve(le,ne,oe,Ee,null);Rh(le,oe)}return null}function je(le,ne,oe,Ee,Fe){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number")return le=le.get(oe)||null,G(ne,le,""+Ee,Fe);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case I:return le=le.get(Ee.key===null?oe:Ee.key)||null,J(ne,le,Ee,Fe);case T:return le=le.get(Ee.key===null?oe:Ee.key)||null,ue(ne,le,Ee,Fe);case Q:var Xe=Ee._init;return je(le,ne,oe,Xe(Ee._payload),Fe)}if(ht(Ee)||V(Ee))return le=le.get(oe)||null,ve(ne,le,Ee,Fe,null);Rh(ne,Ee)}return null}function Ne(le,ne,oe,Ee){for(var Fe=null,Xe=null,Ve=ne,Qe=ne=0,Dn=null;Ve!==null&&Qe<oe.length;Qe++){Ve.index>Qe?(Dn=Ve,Ve=null):Dn=Ve.sibling;var wt=be(le,Ve,oe[Qe],Ee);if(wt===null){Ve===null&&(Ve=Dn);break}c&&Ve&&wt.alternate===null&&h(le,Ve),ne=R(wt,ne,Qe),Xe===null?Fe=wt:Xe.sibling=wt,Xe=wt,Ve=Dn}if(Qe===oe.length)return b(le,Ve),Vt&&Ls(le,Qe),Fe;if(Ve===null){for(;Qe<oe.length;Qe++)Ve=ye(le,oe[Qe],Ee),Ve!==null&&(ne=R(Ve,ne,Qe),Xe===null?Fe=Ve:Xe.sibling=Ve,Xe=Ve);return Vt&&Ls(le,Qe),Fe}for(Ve=x(le,Ve);Qe<oe.length;Qe++)Dn=je(Ve,le,Qe,oe[Qe],Ee),Dn!==null&&(c&&Dn.alternate!==null&&Ve.delete(Dn.key===null?Qe:Dn.key),ne=R(Dn,ne,Qe),Xe===null?Fe=Dn:Xe.sibling=Dn,Xe=Dn);return c&&Ve.forEach(function(Wl){return h(le,Wl)}),Vt&&Ls(le,Qe),Fe}function $e(le,ne,oe,Ee){var Fe=V(oe);if(typeof Fe!="function")throw Error(n(150));if(oe=Fe.call(oe),oe==null)throw Error(n(151));for(var Xe=Fe=null,Ve=ne,Qe=ne=0,Dn=null,wt=oe.next();Ve!==null&&!wt.done;Qe++,wt=oe.next()){Ve.index>Qe?(Dn=Ve,Ve=null):Dn=Ve.sibling;var Wl=be(le,Ve,wt.value,Ee);if(Wl===null){Ve===null&&(Ve=Dn);break}c&&Ve&&Wl.alternate===null&&h(le,Ve),ne=R(Wl,ne,Qe),Xe===null?Fe=Wl:Xe.sibling=Wl,Xe=Wl,Ve=Dn}if(wt.done)return b(le,Ve),Vt&&Ls(le,Qe),Fe;if(Ve===null){for(;!wt.done;Qe++,wt=oe.next())wt=ye(le,wt.value,Ee),wt!==null&&(ne=R(wt,ne,Qe),Xe===null?Fe=wt:Xe.sibling=wt,Xe=wt);return Vt&&Ls(le,Qe),Fe}for(Ve=x(le,Ve);!wt.done;Qe++,wt=oe.next())wt=je(Ve,le,Qe,wt.value,Ee),wt!==null&&(c&&wt.alternate!==null&&Ve.delete(wt.key===null?Qe:wt.key),ne=R(wt,ne,Qe),Xe===null?Fe=wt:Xe.sibling=wt,Xe=wt);return c&&Ve.forEach(function(XR){return h(le,XR)}),Vt&&Ls(le,Qe),Fe}function mn(le,ne,oe,Ee){if(typeof oe=="object"&&oe!==null&&oe.type===M&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case I:e:{for(var Fe=oe.key,Xe=ne;Xe!==null;){if(Xe.key===Fe){if(Fe=oe.type,Fe===M){if(Xe.tag===7){b(le,Xe.sibling),ne=C(Xe,oe.props.children),ne.return=le,le=ne;break e}}else if(Xe.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===Q&&D7(Fe)===Xe.type){b(le,Xe.sibling),ne=C(Xe,oe.props),ne.ref=zd(le,Xe,oe),ne.return=le,le=ne;break e}b(le,Xe);break}else h(le,Xe);Xe=Xe.sibling}oe.type===M?(ne=Bs(oe.props.children,le.mode,Ee,oe.key),ne.return=le,le=ne):(Ee=n1(oe.type,oe.key,oe.props,null,le.mode,Ee),Ee.ref=zd(le,ne,oe),Ee.return=le,le=Ee)}return O(le);case T:e:{for(Xe=oe.key;ne!==null;){if(ne.key===Xe)if(ne.tag===4&&ne.stateNode.containerInfo===oe.containerInfo&&ne.stateNode.implementation===oe.implementation){b(le,ne.sibling),ne=C(ne,oe.children||[]),ne.return=le,le=ne;break e}else{b(le,ne);break}else h(le,ne);ne=ne.sibling}ne=qU(oe,le.mode,Ee),ne.return=le,le=ne}return O(le);case Q:return Xe=oe._init,mn(le,ne,Xe(oe._payload),Ee)}if(ht(oe))return Ne(le,ne,oe,Ee);if(V(oe))return $e(le,ne,oe,Ee);Rh(le,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"?(oe=""+oe,ne!==null&&ne.tag===6?(b(le,ne.sibling),ne=C(ne,oe),ne.return=le,le=ne):(b(le,ne),ne=KU(oe,le.mode,Ee),ne.return=le,le=ne),O(le)):b(le,ne)}return mn}var ec=P7(!0),N7=P7(!1),jh=jl(null),Lh=null,tc=null,lU=null;function sU(){lU=tc=Lh=null}function oU(c){var h=jh.current;Ht(jh),c._currentValue=h}function cU(c,h,b){for(;c!==null;){var x=c.alternate;if((c.childLanes&h)!==h?(c.childLanes|=h,x!==null&&(x.childLanes|=h)):x!==null&&(x.childLanes&h)!==h&&(x.childLanes|=h),c===b)break;c=c.return}}function nc(c,h){Lh=c,lU=tc=null,c=c.dependencies,c!==null&&c.firstContext!==null&&((c.lanes&h)!==0&&(vr=!0),c.firstContext=null)}function Qr(c){var h=c._currentValue;if(lU!==c)if(c={context:c,memoizedValue:h,next:null},tc===null){if(Lh===null)throw Error(n(308));tc=c,Lh.dependencies={lanes:0,firstContext:c}}else tc=tc.next=c;return h}var Ds=null;function dU(c){Ds===null?Ds=[c]:Ds.push(c)}function O7(c,h,b,x){var C=h.interleaved;return C===null?(b.next=b,dU(h)):(b.next=C.next,C.next=b),h.interleaved=b,$i(c,x)}function $i(c,h){c.lanes|=h;var b=c.alternate;for(b!==null&&(b.lanes|=h),b=c,c=c.return;c!==null;)c.childLanes|=h,b=c.alternate,b!==null&&(b.childLanes|=h),b=c,c=c.return;return b.tag===3?b.stateNode:null}var Pl=!1;function uU(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $7(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function zi(c,h){return{eventTime:c,lane:h,tag:0,payload:null,callback:null,next:null}}function Nl(c,h,b){var x=c.updateQueue;if(x===null)return null;if(x=x.shared,(Ut&2)!==0){var C=x.pending;return C===null?h.next=h:(h.next=C.next,C.next=h),x.pending=h,$i(c,b)}return C=x.interleaved,C===null?(h.next=h,dU(x)):(h.next=C.next,C.next=h),x.interleaved=h,$i(c,b)}function Dh(c,h,b){if(h=h.updateQueue,h!==null&&(h=h.shared,(b&4194240)!==0)){var x=h.lanes;x&=c.pendingLanes,b|=x,h.lanes=b,km(c,b)}}function z7(c,h){var b=c.updateQueue,x=c.alternate;if(x!==null&&(x=x.updateQueue,b===x)){var C=null,R=null;if(b=b.firstBaseUpdate,b!==null){do{var O={eventTime:b.eventTime,lane:b.lane,tag:b.tag,payload:b.payload,callback:b.callback,next:null};R===null?C=R=O:R=R.next=O,b=b.next}while(b!==null);R===null?C=R=h:R=R.next=h}else C=R=h;b={baseState:x.baseState,firstBaseUpdate:C,lastBaseUpdate:R,shared:x.shared,effects:x.effects},c.updateQueue=b;return}c=b.lastBaseUpdate,c===null?b.firstBaseUpdate=h:c.next=h,b.lastBaseUpdate=h}function Ph(c,h,b,x){var C=c.updateQueue;Pl=!1;var R=C.firstBaseUpdate,O=C.lastBaseUpdate,G=C.shared.pending;if(G!==null){C.shared.pending=null;var J=G,ue=J.next;J.next=null,O===null?R=ue:O.next=ue,O=J;var ve=c.alternate;ve!==null&&(ve=ve.updateQueue,G=ve.lastBaseUpdate,G!==O&&(G===null?ve.firstBaseUpdate=ue:G.next=ue,ve.lastBaseUpdate=J))}if(R!==null){var ye=C.baseState;O=0,ve=ue=J=null,G=R;do{var be=G.lane,je=G.eventTime;if((x&be)===be){ve!==null&&(ve=ve.next={eventTime:je,lane:0,tag:G.tag,payload:G.payload,callback:G.callback,next:null});e:{var Ne=c,$e=G;switch(be=h,je=b,$e.tag){case 1:if(Ne=$e.payload,typeof Ne=="function"){ye=Ne.call(je,ye,be);break e}ye=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=$e.payload,be=typeof Ne=="function"?Ne.call(je,ye,be):Ne,be==null)break e;ye=ee({},ye,be);break e;case 2:Pl=!0}}G.callback!==null&&G.lane!==0&&(c.flags|=64,be=C.effects,be===null?C.effects=[G]:be.push(G))}else je={eventTime:je,lane:be,tag:G.tag,payload:G.payload,callback:G.callback,next:null},ve===null?(ue=ve=je,J=ye):ve=ve.next=je,O|=be;if(G=G.next,G===null){if(G=C.shared.pending,G===null)break;be=G,G=be.next,be.next=null,C.lastBaseUpdate=be,C.shared.pending=null}}while(!0);if(ve===null&&(J=ye),C.baseState=J,C.firstBaseUpdate=ue,C.lastBaseUpdate=ve,h=C.shared.interleaved,h!==null){C=h;do O|=C.lane,C=C.next;while(C!==h)}else R===null&&(C.shared.lanes=0);Os|=O,c.lanes=O,c.memoizedState=ye}}function F7(c,h,b){if(c=h.effects,h.effects=null,c!==null)for(h=0;h<c.length;h++){var x=c[h],C=x.callback;if(C!==null){if(x.callback=null,x=b,typeof C!="function")throw Error(n(191,C));C.call(x)}}}var Fd={},ei=jl(Fd),Bd=jl(Fd),Hd=jl(Fd);function Ps(c){if(c===Fd)throw Error(n(174));return c}function fU(c,h){switch(Ot(Hd,h),Ot(Bd,c),Ot(ei,Fd),c=h.nodeType,c){case 9:case 11:h=(h=h.documentElement)?h.namespaceURI:Sl(null,"");break;default:c=c===8?h.parentNode:h,h=c.namespaceURI||null,c=c.tagName,h=Sl(h,c)}Ht(ei),Ot(ei,h)}function rc(){Ht(ei),Ht(Bd),Ht(Hd)}function B7(c){Ps(Hd.current);var h=Ps(ei.current),b=Sl(h,c.type);h!==b&&(Ot(Bd,c),Ot(ei,b))}function hU(c){Bd.current===c&&(Ht(ei),Ht(Bd))}var Jt=jl(0);function Nh(c){for(var h=c;h!==null;){if(h.tag===13){var b=h.memoizedState;if(b!==null&&(b=b.dehydrated,b===null||b.data==="$?"||b.data==="$!"))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var pU=[];function mU(){for(var c=0;c<pU.length;c++)pU[c]._workInProgressVersionPrimary=null;pU.length=0}var Oh=k.ReactCurrentDispatcher,UU=k.ReactCurrentBatchConfig,Ns=0,en=null,kn=null,jn=null,$h=!1,Wd=!1,Xd=0,hR=0;function qn(){throw Error(n(321))}function gU(c,h){if(h===null)return!1;for(var b=0;b<h.length&&b<c.length;b++)if(!ya(c[b],h[b]))return!1;return!0}function bU(c,h,b,x,C,R){if(Ns=R,en=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,Oh.current=c===null||c.memoizedState===null?gR:bR,c=b(x,C),Wd){R=0;do{if(Wd=!1,Xd=0,25<=R)throw Error(n(301));R+=1,jn=kn=null,h.updateQueue=null,Oh.current=vR,c=b(x,C)}while(Wd)}if(Oh.current=Bh,h=kn!==null&&kn.next!==null,Ns=0,jn=kn=en=null,$h=!1,h)throw Error(n(300));return c}function vU(){var c=Xd!==0;return Xd=0,c}function ti(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?en.memoizedState=jn=c:jn=jn.next=c,jn}function Jr(){if(kn===null){var c=en.alternate;c=c!==null?c.memoizedState:null}else c=kn.next;var h=jn===null?en.memoizedState:jn.next;if(h!==null)jn=h,kn=c;else{if(c===null)throw Error(n(310));kn=c,c={memoizedState:kn.memoizedState,baseState:kn.baseState,baseQueue:kn.baseQueue,queue:kn.queue,next:null},jn===null?en.memoizedState=jn=c:jn=jn.next=c}return jn}function Vd(c,h){return typeof h=="function"?h(c):h}function yU(c){var h=Jr(),b=h.queue;if(b===null)throw Error(n(311));b.lastRenderedReducer=c;var x=kn,C=x.baseQueue,R=b.pending;if(R!==null){if(C!==null){var O=C.next;C.next=R.next,R.next=O}x.baseQueue=C=R,b.pending=null}if(C!==null){R=C.next,x=x.baseState;var G=O=null,J=null,ue=R;do{var ve=ue.lane;if((Ns&ve)===ve)J!==null&&(J=J.next={lane:0,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),x=ue.hasEagerState?ue.eagerState:c(x,ue.action);else{var ye={lane:ve,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null};J===null?(G=J=ye,O=x):J=J.next=ye,en.lanes|=ve,Os|=ve}ue=ue.next}while(ue!==null&&ue!==R);J===null?O=x:J.next=G,ya(x,h.memoizedState)||(vr=!0),h.memoizedState=x,h.baseState=O,h.baseQueue=J,b.lastRenderedState=x}if(c=b.interleaved,c!==null){C=c;do R=C.lane,en.lanes|=R,Os|=R,C=C.next;while(C!==c)}else C===null&&(b.lanes=0);return[h.memoizedState,b.dispatch]}function xU(c){var h=Jr(),b=h.queue;if(b===null)throw Error(n(311));b.lastRenderedReducer=c;var x=b.dispatch,C=b.pending,R=h.memoizedState;if(C!==null){b.pending=null;var O=C=C.next;do R=c(R,O.action),O=O.next;while(O!==C);ya(R,h.memoizedState)||(vr=!0),h.memoizedState=R,h.baseQueue===null&&(h.baseState=R),b.lastRenderedState=R}return[R,x]}function H7(){}function W7(c,h){var b=en,x=Jr(),C=h(),R=!ya(x.memoizedState,C);if(R&&(x.memoizedState=C,vr=!0),x=x.queue,wU(G7.bind(null,b,x,c),[c]),x.getSnapshot!==h||R||jn!==null&&jn.memoizedState.tag&1){if(b.flags|=2048,Gd(9,V7.bind(null,b,x,C,h),void 0,null),Ln===null)throw Error(n(349));(Ns&30)!==0||X7(b,h,C)}return C}function X7(c,h,b){c.flags|=16384,c={getSnapshot:h,value:b},h=en.updateQueue,h===null?(h={lastEffect:null,stores:null},en.updateQueue=h,h.stores=[c]):(b=h.stores,b===null?h.stores=[c]:b.push(c))}function V7(c,h,b,x){h.value=b,h.getSnapshot=x,Y7(h)&&Z7(c)}function G7(c,h,b){return b(function(){Y7(h)&&Z7(c)})}function Y7(c){var h=c.getSnapshot;c=c.value;try{var b=h();return!ya(c,b)}catch{return!0}}function Z7(c){var h=$i(c,1);h!==null&&ka(h,c,1,-1)}function K7(c){var h=ti();return typeof c=="function"&&(c=c()),h.memoizedState=h.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vd,lastRenderedState:c},h.queue=c,c=c.dispatch=UR.bind(null,en,c),[h.memoizedState,c]}function Gd(c,h,b,x){return c={tag:c,create:h,destroy:b,deps:x,next:null},h=en.updateQueue,h===null?(h={lastEffect:null,stores:null},en.updateQueue=h,h.lastEffect=c.next=c):(b=h.lastEffect,b===null?h.lastEffect=c.next=c:(x=b.next,b.next=c,c.next=x,h.lastEffect=c)),c}function q7(){return Jr().memoizedState}function zh(c,h,b,x){var C=ti();en.flags|=c,C.memoizedState=Gd(1|h,b,void 0,x===void 0?null:x)}function Fh(c,h,b,x){var C=Jr();x=x===void 0?null:x;var R=void 0;if(kn!==null){var O=kn.memoizedState;if(R=O.destroy,x!==null&&gU(x,O.deps)){C.memoizedState=Gd(h,b,R,x);return}}en.flags|=c,C.memoizedState=Gd(1|h,b,R,x)}function Q7(c,h){return zh(8390656,8,c,h)}function wU(c,h){return Fh(2048,8,c,h)}function J7(c,h){return Fh(4,2,c,h)}function e3(c,h){return Fh(4,4,c,h)}function t3(c,h){if(typeof h=="function")return c=c(),h(c),function(){h(null)};if(h!=null)return c=c(),h.current=c,function(){h.current=null}}function n3(c,h,b){return b=b!=null?b.concat([c]):null,Fh(4,4,t3.bind(null,h,c),b)}function EU(){}function r3(c,h){var b=Jr();h=h===void 0?null:h;var x=b.memoizedState;return x!==null&&h!==null&&gU(h,x[1])?x[0]:(b.memoizedState=[c,h],c)}function a3(c,h){var b=Jr();h=h===void 0?null:h;var x=b.memoizedState;return x!==null&&h!==null&&gU(h,x[1])?x[0]:(c=c(),b.memoizedState=[c,h],c)}function i3(c,h,b){return(Ns&21)===0?(c.baseState&&(c.baseState=!1,vr=!0),c.memoizedState=b):(ya(b,h)||(b=Db(),en.lanes|=b,Os|=b,c.baseState=!0),h)}function pR(c,h){var b=Tt;Tt=b!==0&&4>b?b:4,c(!0);var x=UU.transition;UU.transition={};try{c(!1),h()}finally{Tt=b,UU.transition=x}}function l3(){return Jr().memoizedState}function mR(c,h,b){var x=Fl(c);if(b={lane:x,action:b,hasEagerState:!1,eagerState:null,next:null},s3(c))o3(h,b);else if(b=O7(c,h,b,x),b!==null){var C=cr();ka(b,c,x,C),c3(b,h,x)}}function UR(c,h,b){var x=Fl(c),C={lane:x,action:b,hasEagerState:!1,eagerState:null,next:null};if(s3(c))o3(h,C);else{var R=c.alternate;if(c.lanes===0&&(R===null||R.lanes===0)&&(R=h.lastRenderedReducer,R!==null))try{var O=h.lastRenderedState,G=R(O,b);if(C.hasEagerState=!0,C.eagerState=G,ya(G,O)){var J=h.interleaved;J===null?(C.next=C,dU(h)):(C.next=J.next,J.next=C),h.interleaved=C;return}}catch{}finally{}b=O7(c,h,C,x),b!==null&&(C=cr(),ka(b,c,x,C),c3(b,h,x))}}function s3(c){var h=c.alternate;return c===en||h!==null&&h===en}function o3(c,h){Wd=$h=!0;var b=c.pending;b===null?h.next=h:(h.next=b.next,b.next=h),c.pending=h}function c3(c,h,b){if((b&4194240)!==0){var x=h.lanes;x&=c.pendingLanes,b|=x,h.lanes=b,km(c,b)}}var Bh={readContext:Qr,useCallback:qn,useContext:qn,useEffect:qn,useImperativeHandle:qn,useInsertionEffect:qn,useLayoutEffect:qn,useMemo:qn,useReducer:qn,useRef:qn,useState:qn,useDebugValue:qn,useDeferredValue:qn,useTransition:qn,useMutableSource:qn,useSyncExternalStore:qn,useId:qn,unstable_isNewReconciler:!1},gR={readContext:Qr,useCallback:function(c,h){return ti().memoizedState=[c,h===void 0?null:h],c},useContext:Qr,useEffect:Q7,useImperativeHandle:function(c,h,b){return b=b!=null?b.concat([c]):null,zh(4194308,4,t3.bind(null,h,c),b)},useLayoutEffect:function(c,h){return zh(4194308,4,c,h)},useInsertionEffect:function(c,h){return zh(4,2,c,h)},useMemo:function(c,h){var b=ti();return h=h===void 0?null:h,c=c(),b.memoizedState=[c,h],c},useReducer:function(c,h,b){var x=ti();return h=b!==void 0?b(h):h,x.memoizedState=x.baseState=h,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:h},x.queue=c,c=c.dispatch=mR.bind(null,en,c),[x.memoizedState,c]},useRef:function(c){var h=ti();return c={current:c},h.memoizedState=c},useState:K7,useDebugValue:EU,useDeferredValue:function(c){return ti().memoizedState=c},useTransition:function(){var c=K7(!1),h=c[0];return c=pR.bind(null,c[1]),ti().memoizedState=c,[h,c]},useMutableSource:function(){},useSyncExternalStore:function(c,h,b){var x=en,C=ti();if(Vt){if(b===void 0)throw Error(n(407));b=b()}else{if(b=h(),Ln===null)throw Error(n(349));(Ns&30)!==0||X7(x,h,b)}C.memoizedState=b;var R={value:b,getSnapshot:h};return C.queue=R,Q7(G7.bind(null,x,R,c),[c]),x.flags|=2048,Gd(9,V7.bind(null,x,R,b,h),void 0,null),b},useId:function(){var c=ti(),h=Ln.identifierPrefix;if(Vt){var b=Oi,x=Ni;b=(x&~(1<<32-va(x)-1)).toString(32)+b,h=":"+h+"R"+b,b=Xd++,0<b&&(h+="H"+b.toString(32)),h+=":"}else b=hR++,h=":"+h+"r"+b.toString(32)+":";return c.memoizedState=h},unstable_isNewReconciler:!1},bR={readContext:Qr,useCallback:r3,useContext:Qr,useEffect:wU,useImperativeHandle:n3,useInsertionEffect:J7,useLayoutEffect:e3,useMemo:a3,useReducer:yU,useRef:q7,useState:function(){return yU(Vd)},useDebugValue:EU,useDeferredValue:function(c){var h=Jr();return i3(h,kn.memoizedState,c)},useTransition:function(){var c=yU(Vd)[0],h=Jr().memoizedState;return[c,h]},useMutableSource:H7,useSyncExternalStore:W7,useId:l3,unstable_isNewReconciler:!1},vR={readContext:Qr,useCallback:r3,useContext:Qr,useEffect:wU,useImperativeHandle:n3,useInsertionEffect:J7,useLayoutEffect:e3,useMemo:a3,useReducer:xU,useRef:q7,useState:function(){return xU(Vd)},useDebugValue:EU,useDeferredValue:function(c){var h=Jr();return kn===null?h.memoizedState=c:i3(h,kn.memoizedState,c)},useTransition:function(){var c=xU(Vd)[0],h=Jr().memoizedState;return[c,h]},useMutableSource:H7,useSyncExternalStore:W7,useId:l3,unstable_isNewReconciler:!1};function wa(c,h){if(c&&c.defaultProps){h=ee({},h),c=c.defaultProps;for(var b in c)h[b]===void 0&&(h[b]=c[b]);return h}return h}function SU(c,h,b,x){h=c.memoizedState,b=b(x,h),b=b==null?h:ee({},h,b),c.memoizedState=b,c.lanes===0&&(c.updateQueue.baseState=b)}var Hh={isMounted:function(c){return(c=c._reactInternals)?Ts(c)===c:!1},enqueueSetState:function(c,h,b){c=c._reactInternals;var x=cr(),C=Fl(c),R=zi(x,C);R.payload=h,b!=null&&(R.callback=b),h=Nl(c,R,C),h!==null&&(ka(h,c,C,x),Dh(h,c,C))},enqueueReplaceState:function(c,h,b){c=c._reactInternals;var x=cr(),C=Fl(c),R=zi(x,C);R.tag=1,R.payload=h,b!=null&&(R.callback=b),h=Nl(c,R,C),h!==null&&(ka(h,c,C,x),Dh(h,c,C))},enqueueForceUpdate:function(c,h){c=c._reactInternals;var b=cr(),x=Fl(c),C=zi(b,x);C.tag=2,h!=null&&(C.callback=h),h=Nl(c,C,x),h!==null&&(ka(h,c,x,b),Dh(h,c,x))}};function d3(c,h,b,x,C,R,O){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(x,R,O):h.prototype&&h.prototype.isPureReactComponent?!jd(b,x)||!jd(C,R):!0}function u3(c,h,b){var x=!1,C=Ll,R=h.contextType;return typeof R=="object"&&R!==null?R=Qr(R):(C=br(h)?Rs:Kn.current,x=h.contextTypes,R=(x=x!=null)?Ko(c,C):Ll),h=new h(b,R),c.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Hh,c.stateNode=h,h._reactInternals=c,x&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=C,c.__reactInternalMemoizedMaskedChildContext=R),h}function f3(c,h,b,x){c=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(b,x),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(b,x),h.state!==c&&Hh.enqueueReplaceState(h,h.state,null)}function kU(c,h,b,x){var C=c.stateNode;C.props=b,C.state=c.memoizedState,C.refs={},uU(c);var R=h.contextType;typeof R=="object"&&R!==null?C.context=Qr(R):(R=br(h)?Rs:Kn.current,C.context=Ko(c,R)),C.state=c.memoizedState,R=h.getDerivedStateFromProps,typeof R=="function"&&(SU(c,h,R,b),C.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(h=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),h!==C.state&&Hh.enqueueReplaceState(C,C.state,null),Ph(c,b,C,x),C.state=c.memoizedState),typeof C.componentDidMount=="function"&&(c.flags|=4194308)}function ac(c,h){try{var b="",x=h;do b+=Y(x),x=x.return;while(x);var C=b}catch(R){C=`
|
|
40
|
+
Error generating stack: `+R.message+`
|
|
41
|
+
`+R.stack}return{value:c,source:h,stack:C,digest:null}}function CU(c,h,b){return{value:c,source:null,stack:b??null,digest:h??null}}function MU(c,h){try{console.error(h.value)}catch(b){setTimeout(function(){throw b})}}var yR=typeof WeakMap=="function"?WeakMap:Map;function h3(c,h,b){b=zi(-1,b),b.tag=3,b.payload={element:null};var x=h.value;return b.callback=function(){Kh||(Kh=!0,BU=x),MU(c,h)},b}function p3(c,h,b){b=zi(-1,b),b.tag=3;var x=c.type.getDerivedStateFromError;if(typeof x=="function"){var C=h.value;b.payload=function(){return x(C)},b.callback=function(){MU(c,h)}}var R=c.stateNode;return R!==null&&typeof R.componentDidCatch=="function"&&(b.callback=function(){MU(c,h),typeof x!="function"&&($l===null?$l=new Set([this]):$l.add(this));var O=h.stack;this.componentDidCatch(h.value,{componentStack:O!==null?O:""})}),b}function m3(c,h,b){var x=c.pingCache;if(x===null){x=c.pingCache=new yR;var C=new Set;x.set(h,C)}else C=x.get(h),C===void 0&&(C=new Set,x.set(h,C));C.has(b)||(C.add(b),c=LR.bind(null,c,h,b),h.then(c,c))}function U3(c){do{var h;if((h=c.tag===13)&&(h=c.memoizedState,h=h!==null?h.dehydrated!==null:!0),h)return c;c=c.return}while(c!==null);return null}function g3(c,h,b,x,C){return(c.mode&1)===0?(c===h?c.flags|=65536:(c.flags|=128,b.flags|=131072,b.flags&=-52805,b.tag===1&&(b.alternate===null?b.tag=17:(h=zi(-1,1),h.tag=2,Nl(b,h,1))),b.lanes|=1),c):(c.flags|=65536,c.lanes=C,c)}var xR=k.ReactCurrentOwner,vr=!1;function or(c,h,b,x){h.child=c===null?N7(h,null,b,x):ec(h,c.child,b,x)}function b3(c,h,b,x,C){b=b.render;var R=h.ref;return nc(h,C),x=bU(c,h,b,x,R,C),b=vU(),c!==null&&!vr?(h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~C,Fi(c,h,C)):(Vt&&b&&tU(h),h.flags|=1,or(c,h,x,C),h.child)}function v3(c,h,b,x,C){if(c===null){var R=b.type;return typeof R=="function"&&!ZU(R)&&R.defaultProps===void 0&&b.compare===null&&b.defaultProps===void 0?(h.tag=15,h.type=R,y3(c,h,R,x,C)):(c=n1(b.type,null,x,h,h.mode,C),c.ref=h.ref,c.return=h,h.child=c)}if(R=c.child,(c.lanes&C)===0){var O=R.memoizedProps;if(b=b.compare,b=b!==null?b:jd,b(O,x)&&c.ref===h.ref)return Fi(c,h,C)}return h.flags|=1,c=Hl(R,x),c.ref=h.ref,c.return=h,h.child=c}function y3(c,h,b,x,C){if(c!==null){var R=c.memoizedProps;if(jd(R,x)&&c.ref===h.ref)if(vr=!1,h.pendingProps=x=R,(c.lanes&C)!==0)(c.flags&131072)!==0&&(vr=!0);else return h.lanes=c.lanes,Fi(c,h,C)}return IU(c,h,b,x,C)}function x3(c,h,b){var x=h.pendingProps,C=x.children,R=c!==null?c.memoizedState:null;if(x.mode==="hidden")if((h.mode&1)===0)h.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ot(lc,Or),Or|=b;else{if((b&1073741824)===0)return c=R!==null?R.baseLanes|b:b,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:c,cachePool:null,transitions:null},h.updateQueue=null,Ot(lc,Or),Or|=c,null;h.memoizedState={baseLanes:0,cachePool:null,transitions:null},x=R!==null?R.baseLanes:b,Ot(lc,Or),Or|=x}else R!==null?(x=R.baseLanes|b,h.memoizedState=null):x=b,Ot(lc,Or),Or|=x;return or(c,h,C,b),h.child}function w3(c,h){var b=h.ref;(c===null&&b!==null||c!==null&&c.ref!==b)&&(h.flags|=512,h.flags|=2097152)}function IU(c,h,b,x,C){var R=br(b)?Rs:Kn.current;return R=Ko(h,R),nc(h,C),b=bU(c,h,b,x,R,C),x=vU(),c!==null&&!vr?(h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~C,Fi(c,h,C)):(Vt&&x&&tU(h),h.flags|=1,or(c,h,b,C),h.child)}function E3(c,h,b,x,C){if(br(b)){var R=!0;Mh(h)}else R=!1;if(nc(h,C),h.stateNode===null)Xh(c,h),u3(h,b,x),kU(h,b,x,C),x=!0;else if(c===null){var O=h.stateNode,G=h.memoizedProps;O.props=G;var J=O.context,ue=b.contextType;typeof ue=="object"&&ue!==null?ue=Qr(ue):(ue=br(b)?Rs:Kn.current,ue=Ko(h,ue));var ve=b.getDerivedStateFromProps,ye=typeof ve=="function"||typeof O.getSnapshotBeforeUpdate=="function";ye||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(G!==x||J!==ue)&&f3(h,O,x,ue),Pl=!1;var be=h.memoizedState;O.state=be,Ph(h,x,O,C),J=h.memoizedState,G!==x||be!==J||gr.current||Pl?(typeof ve=="function"&&(SU(h,b,ve,x),J=h.memoizedState),(G=Pl||d3(h,b,G,x,be,J,ue))?(ye||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(h.flags|=4194308)):(typeof O.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=x,h.memoizedState=J),O.props=x,O.state=J,O.context=ue,x=G):(typeof O.componentDidMount=="function"&&(h.flags|=4194308),x=!1)}else{O=h.stateNode,$7(c,h),G=h.memoizedProps,ue=h.type===h.elementType?G:wa(h.type,G),O.props=ue,ye=h.pendingProps,be=O.context,J=b.contextType,typeof J=="object"&&J!==null?J=Qr(J):(J=br(b)?Rs:Kn.current,J=Ko(h,J));var je=b.getDerivedStateFromProps;(ve=typeof je=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(G!==ye||be!==J)&&f3(h,O,x,J),Pl=!1,be=h.memoizedState,O.state=be,Ph(h,x,O,C);var Ne=h.memoizedState;G!==ye||be!==Ne||gr.current||Pl?(typeof je=="function"&&(SU(h,b,je,x),Ne=h.memoizedState),(ue=Pl||d3(h,b,ue,x,be,Ne,J)||!1)?(ve||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(x,Ne,J),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(x,Ne,J)),typeof O.componentDidUpdate=="function"&&(h.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof O.componentDidUpdate!="function"||G===c.memoizedProps&&be===c.memoizedState||(h.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||G===c.memoizedProps&&be===c.memoizedState||(h.flags|=1024),h.memoizedProps=x,h.memoizedState=Ne),O.props=x,O.state=Ne,O.context=J,x=ue):(typeof O.componentDidUpdate!="function"||G===c.memoizedProps&&be===c.memoizedState||(h.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||G===c.memoizedProps&&be===c.memoizedState||(h.flags|=1024),x=!1)}return _U(c,h,b,x,R,C)}function _U(c,h,b,x,C,R){w3(c,h);var O=(h.flags&128)!==0;if(!x&&!O)return C&&I7(h,b,!1),Fi(c,h,R);x=h.stateNode,xR.current=h;var G=O&&typeof b.getDerivedStateFromError!="function"?null:x.render();return h.flags|=1,c!==null&&O?(h.child=ec(h,c.child,null,R),h.child=ec(h,null,G,R)):or(c,h,G,R),h.memoizedState=x.state,C&&I7(h,b,!0),h.child}function S3(c){var h=c.stateNode;h.pendingContext?C7(c,h.pendingContext,h.pendingContext!==h.context):h.context&&C7(c,h.context,!1),fU(c,h.containerInfo)}function k3(c,h,b,x,C){return Jo(),iU(C),h.flags|=256,or(c,h,b,x),h.child}var TU={dehydrated:null,treeContext:null,retryLane:0};function AU(c){return{baseLanes:c,cachePool:null,transitions:null}}function C3(c,h,b){var x=h.pendingProps,C=Jt.current,R=!1,O=(h.flags&128)!==0,G;if((G=O)||(G=c!==null&&c.memoizedState===null?!1:(C&2)!==0),G?(R=!0,h.flags&=-129):(c===null||c.memoizedState!==null)&&(C|=1),Ot(Jt,C&1),c===null)return aU(h),c=h.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?((h.mode&1)===0?h.lanes=1:c.data==="$!"?h.lanes=8:h.lanes=1073741824,null):(O=x.children,c=x.fallback,R?(x=h.mode,R=h.child,O={mode:"hidden",children:O},(x&1)===0&&R!==null?(R.childLanes=0,R.pendingProps=O):R=r1(O,x,0,null),c=Bs(c,x,b,null),R.return=h,c.return=h,R.sibling=c,h.child=R,h.child.memoizedState=AU(b),h.memoizedState=TU,c):RU(h,O));if(C=c.memoizedState,C!==null&&(G=C.dehydrated,G!==null))return wR(c,h,O,x,G,C,b);if(R){R=x.fallback,O=h.mode,C=c.child,G=C.sibling;var J={mode:"hidden",children:x.children};return(O&1)===0&&h.child!==C?(x=h.child,x.childLanes=0,x.pendingProps=J,h.deletions=null):(x=Hl(C,J),x.subtreeFlags=C.subtreeFlags&14680064),G!==null?R=Hl(G,R):(R=Bs(R,O,b,null),R.flags|=2),R.return=h,x.return=h,x.sibling=R,h.child=x,x=R,R=h.child,O=c.child.memoizedState,O=O===null?AU(b):{baseLanes:O.baseLanes|b,cachePool:null,transitions:O.transitions},R.memoizedState=O,R.childLanes=c.childLanes&~b,h.memoizedState=TU,x}return R=c.child,c=R.sibling,x=Hl(R,{mode:"visible",children:x.children}),(h.mode&1)===0&&(x.lanes=b),x.return=h,x.sibling=null,c!==null&&(b=h.deletions,b===null?(h.deletions=[c],h.flags|=16):b.push(c)),h.child=x,h.memoizedState=null,x}function RU(c,h){return h=r1({mode:"visible",children:h},c.mode,0,null),h.return=c,c.child=h}function Wh(c,h,b,x){return x!==null&&iU(x),ec(h,c.child,null,b),c=RU(h,h.pendingProps.children),c.flags|=2,h.memoizedState=null,c}function wR(c,h,b,x,C,R,O){if(b)return h.flags&256?(h.flags&=-257,x=CU(Error(n(422))),Wh(c,h,O,x)):h.memoizedState!==null?(h.child=c.child,h.flags|=128,null):(R=x.fallback,C=h.mode,x=r1({mode:"visible",children:x.children},C,0,null),R=Bs(R,C,O,null),R.flags|=2,x.return=h,R.return=h,x.sibling=R,h.child=x,(h.mode&1)!==0&&ec(h,c.child,null,O),h.child.memoizedState=AU(O),h.memoizedState=TU,R);if((h.mode&1)===0)return Wh(c,h,O,null);if(C.data==="$!"){if(x=C.nextSibling&&C.nextSibling.dataset,x)var G=x.dgst;return x=G,R=Error(n(419)),x=CU(R,x,void 0),Wh(c,h,O,x)}if(G=(O&c.childLanes)!==0,vr||G){if(x=Ln,x!==null){switch(O&-O){case 4:C=2;break;case 16:C=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:C=32;break;case 536870912:C=268435456;break;default:C=0}C=(C&(x.suspendedLanes|O))!==0?0:C,C!==0&&C!==R.retryLane&&(R.retryLane=C,$i(c,C),ka(x,c,C,-1))}return YU(),x=CU(Error(n(421))),Wh(c,h,O,x)}return C.data==="$?"?(h.flags|=128,h.child=c.child,h=DR.bind(null,c),C._reactRetry=h,null):(c=R.treeContext,Nr=Rl(C.nextSibling),Pr=h,Vt=!0,xa=null,c!==null&&(Kr[qr++]=Ni,Kr[qr++]=Oi,Kr[qr++]=js,Ni=c.id,Oi=c.overflow,js=h),h=RU(h,x.children),h.flags|=4096,h)}function M3(c,h,b){c.lanes|=h;var x=c.alternate;x!==null&&(x.lanes|=h),cU(c.return,h,b)}function jU(c,h,b,x,C){var R=c.memoizedState;R===null?c.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:x,tail:b,tailMode:C}:(R.isBackwards=h,R.rendering=null,R.renderingStartTime=0,R.last=x,R.tail=b,R.tailMode=C)}function I3(c,h,b){var x=h.pendingProps,C=x.revealOrder,R=x.tail;if(or(c,h,x.children,b),x=Jt.current,(x&2)!==0)x=x&1|2,h.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=h.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&M3(c,b,h);else if(c.tag===19)M3(c,b,h);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===h)break e;for(;c.sibling===null;){if(c.return===null||c.return===h)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}x&=1}if(Ot(Jt,x),(h.mode&1)===0)h.memoizedState=null;else switch(C){case"forwards":for(b=h.child,C=null;b!==null;)c=b.alternate,c!==null&&Nh(c)===null&&(C=b),b=b.sibling;b=C,b===null?(C=h.child,h.child=null):(C=b.sibling,b.sibling=null),jU(h,!1,C,b,R);break;case"backwards":for(b=null,C=h.child,h.child=null;C!==null;){if(c=C.alternate,c!==null&&Nh(c)===null){h.child=C;break}c=C.sibling,C.sibling=b,b=C,C=c}jU(h,!0,b,null,R);break;case"together":jU(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function Xh(c,h){(h.mode&1)===0&&c!==null&&(c.alternate=null,h.alternate=null,h.flags|=2)}function Fi(c,h,b){if(c!==null&&(h.dependencies=c.dependencies),Os|=h.lanes,(b&h.childLanes)===0)return null;if(c!==null&&h.child!==c.child)throw Error(n(153));if(h.child!==null){for(c=h.child,b=Hl(c,c.pendingProps),h.child=b,b.return=h;c.sibling!==null;)c=c.sibling,b=b.sibling=Hl(c,c.pendingProps),b.return=h;b.sibling=null}return h.child}function ER(c,h,b){switch(h.tag){case 3:S3(h),Jo();break;case 5:B7(h);break;case 1:br(h.type)&&Mh(h);break;case 4:fU(h,h.stateNode.containerInfo);break;case 10:var x=h.type._context,C=h.memoizedProps.value;Ot(jh,x._currentValue),x._currentValue=C;break;case 13:if(x=h.memoizedState,x!==null)return x.dehydrated!==null?(Ot(Jt,Jt.current&1),h.flags|=128,null):(b&h.child.childLanes)!==0?C3(c,h,b):(Ot(Jt,Jt.current&1),c=Fi(c,h,b),c!==null?c.sibling:null);Ot(Jt,Jt.current&1);break;case 19:if(x=(b&h.childLanes)!==0,(c.flags&128)!==0){if(x)return I3(c,h,b);h.flags|=128}if(C=h.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Ot(Jt,Jt.current),x)break;return null;case 22:case 23:return h.lanes=0,x3(c,h,b)}return Fi(c,h,b)}var _3,LU,T3,A3;_3=function(c,h){for(var b=h.child;b!==null;){if(b.tag===5||b.tag===6)c.appendChild(b.stateNode);else if(b.tag!==4&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===h)break;for(;b.sibling===null;){if(b.return===null||b.return===h)return;b=b.return}b.sibling.return=b.return,b=b.sibling}},LU=function(){},T3=function(c,h,b,x){var C=c.memoizedProps;if(C!==x){c=h.stateNode,Ps(ei.current);var R=null;switch(b){case"input":C=it(c,C),x=it(c,x),R=[];break;case"select":C=ee({},C,{value:void 0}),x=ee({},x,{value:void 0}),R=[];break;case"textarea":C=El(c,C),x=El(c,x),R=[];break;default:typeof C.onClick!="function"&&typeof x.onClick=="function"&&(c.onclick=Sh)}pm(b,x);var O;b=null;for(ue in C)if(!x.hasOwnProperty(ue)&&C.hasOwnProperty(ue)&&C[ue]!=null)if(ue==="style"){var G=C[ue];for(O in G)G.hasOwnProperty(O)&&(b||(b={}),b[O]="")}else ue!=="dangerouslySetInnerHTML"&&ue!=="children"&&ue!=="suppressContentEditableWarning"&&ue!=="suppressHydrationWarning"&&ue!=="autoFocus"&&(a.hasOwnProperty(ue)?R||(R=[]):(R=R||[]).push(ue,null));for(ue in x){var J=x[ue];if(G=C!=null?C[ue]:void 0,x.hasOwnProperty(ue)&&J!==G&&(J!=null||G!=null))if(ue==="style")if(G){for(O in G)!G.hasOwnProperty(O)||J&&J.hasOwnProperty(O)||(b||(b={}),b[O]="");for(O in J)J.hasOwnProperty(O)&&G[O]!==J[O]&&(b||(b={}),b[O]=J[O])}else b||(R||(R=[]),R.push(ue,b)),b=J;else ue==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,G=G?G.__html:void 0,J!=null&&G!==J&&(R=R||[]).push(ue,J)):ue==="children"?typeof J!="string"&&typeof J!="number"||(R=R||[]).push(ue,""+J):ue!=="suppressContentEditableWarning"&&ue!=="suppressHydrationWarning"&&(a.hasOwnProperty(ue)?(J!=null&&ue==="onScroll"&&Bt("scroll",c),R||G===J||(R=[])):(R=R||[]).push(ue,J))}b&&(R=R||[]).push("style",b);var ue=R;(h.updateQueue=ue)&&(h.flags|=4)}},A3=function(c,h,b,x){b!==x&&(h.flags|=4)};function Yd(c,h){if(!Vt)switch(c.tailMode){case"hidden":h=c.tail;for(var b=null;h!==null;)h.alternate!==null&&(b=h),h=h.sibling;b===null?c.tail=null:b.sibling=null;break;case"collapsed":b=c.tail;for(var x=null;b!==null;)b.alternate!==null&&(x=b),b=b.sibling;x===null?h||c.tail===null?c.tail=null:c.tail.sibling=null:x.sibling=null}}function Qn(c){var h=c.alternate!==null&&c.alternate.child===c.child,b=0,x=0;if(h)for(var C=c.child;C!==null;)b|=C.lanes|C.childLanes,x|=C.subtreeFlags&14680064,x|=C.flags&14680064,C.return=c,C=C.sibling;else for(C=c.child;C!==null;)b|=C.lanes|C.childLanes,x|=C.subtreeFlags,x|=C.flags,C.return=c,C=C.sibling;return c.subtreeFlags|=x,c.childLanes=b,h}function SR(c,h,b){var x=h.pendingProps;switch(nU(h),h.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qn(h),null;case 1:return br(h.type)&&Ch(),Qn(h),null;case 3:return x=h.stateNode,rc(),Ht(gr),Ht(Kn),mU(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(c===null||c.child===null)&&(Ah(h)?h.flags|=4:c===null||c.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,xa!==null&&(XU(xa),xa=null))),LU(c,h),Qn(h),null;case 5:hU(h);var C=Ps(Hd.current);if(b=h.type,c!==null&&h.stateNode!=null)T3(c,h,b,x,C),c.ref!==h.ref&&(h.flags|=512,h.flags|=2097152);else{if(!x){if(h.stateNode===null)throw Error(n(166));return Qn(h),null}if(c=Ps(ei.current),Ah(h)){x=h.stateNode,b=h.type;var R=h.memoizedProps;switch(x[Ja]=h,x[Od]=R,c=(h.mode&1)!==0,b){case"dialog":Bt("cancel",x),Bt("close",x);break;case"iframe":case"object":case"embed":Bt("load",x);break;case"video":case"audio":for(C=0;C<Dd.length;C++)Bt(Dd[C],x);break;case"source":Bt("error",x);break;case"img":case"image":case"link":Bt("error",x),Bt("load",x);break;case"details":Bt("toggle",x);break;case"input":mt(x,R),Bt("invalid",x);break;case"select":x._wrapperState={wasMultiple:!!R.multiple},Bt("invalid",x);break;case"textarea":Yr(x,R),Bt("invalid",x)}pm(b,R),C=null;for(var O in R)if(R.hasOwnProperty(O)){var G=R[O];O==="children"?typeof G=="string"?x.textContent!==G&&(R.suppressHydrationWarning!==!0&&Eh(x.textContent,G,c),C=["children",G]):typeof G=="number"&&x.textContent!==""+G&&(R.suppressHydrationWarning!==!0&&Eh(x.textContent,G,c),C=["children",""+G]):a.hasOwnProperty(O)&&G!=null&&O==="onScroll"&&Bt("scroll",x)}switch(b){case"input":fe(x),on(x,R,!0);break;case"textarea":fe(x),Ms(x);break;case"select":case"option":break;default:typeof R.onClick=="function"&&(x.onclick=Sh)}x=C,h.updateQueue=x,x!==null&&(h.flags|=4)}else{O=C.nodeType===9?C:C.ownerDocument,c==="http://www.w3.org/1999/xhtml"&&(c=Is(b)),c==="http://www.w3.org/1999/xhtml"?b==="script"?(c=O.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild)):typeof x.is=="string"?c=O.createElement(b,{is:x.is}):(c=O.createElement(b),b==="select"&&(O=c,x.multiple?O.multiple=!0:x.size&&(O.size=x.size))):c=O.createElementNS(c,b),c[Ja]=h,c[Od]=x,_3(c,h,!1,!1),h.stateNode=c;e:{switch(O=mm(b,x),b){case"dialog":Bt("cancel",c),Bt("close",c),C=x;break;case"iframe":case"object":case"embed":Bt("load",c),C=x;break;case"video":case"audio":for(C=0;C<Dd.length;C++)Bt(Dd[C],c);C=x;break;case"source":Bt("error",c),C=x;break;case"img":case"image":case"link":Bt("error",c),Bt("load",c),C=x;break;case"details":Bt("toggle",c),C=x;break;case"input":mt(c,x),C=it(c,x),Bt("invalid",c);break;case"option":C=x;break;case"select":c._wrapperState={wasMultiple:!!x.multiple},C=ee({},x,{value:void 0}),Bt("invalid",c);break;case"textarea":Yr(c,x),C=El(c,x),Bt("invalid",c);break;default:C=x}pm(b,C),G=C;for(R in G)if(G.hasOwnProperty(R)){var J=G[R];R==="style"?yb(c,J):R==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&th(c,J)):R==="children"?typeof J=="string"?(b!=="textarea"||J!=="")&&_s(c,J):typeof J=="number"&&_s(c,""+J):R!=="suppressContentEditableWarning"&&R!=="suppressHydrationWarning"&&R!=="autoFocus"&&(a.hasOwnProperty(R)?J!=null&&R==="onScroll"&&Bt("scroll",c):J!=null&&S(c,R,J,O))}switch(b){case"input":fe(c),on(c,x,!1);break;case"textarea":fe(c),Ms(c);break;case"option":x.value!=null&&c.setAttribute("value",""+te(x.value));break;case"select":c.multiple=!!x.multiple,R=x.value,R!=null?Gr(c,!!x.multiple,R,!1):x.defaultValue!=null&&Gr(c,!!x.multiple,x.defaultValue,!0);break;default:typeof C.onClick=="function"&&(c.onclick=Sh)}switch(b){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(h.flags|=4)}h.ref!==null&&(h.flags|=512,h.flags|=2097152)}return Qn(h),null;case 6:if(c&&h.stateNode!=null)A3(c,h,c.memoizedProps,x);else{if(typeof x!="string"&&h.stateNode===null)throw Error(n(166));if(b=Ps(Hd.current),Ps(ei.current),Ah(h)){if(x=h.stateNode,b=h.memoizedProps,x[Ja]=h,(R=x.nodeValue!==b)&&(c=Pr,c!==null))switch(c.tag){case 3:Eh(x.nodeValue,b,(c.mode&1)!==0);break;case 5:c.memoizedProps.suppressHydrationWarning!==!0&&Eh(x.nodeValue,b,(c.mode&1)!==0)}R&&(h.flags|=4)}else x=(b.nodeType===9?b:b.ownerDocument).createTextNode(x),x[Ja]=h,h.stateNode=x}return Qn(h),null;case 13:if(Ht(Jt),x=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(Vt&&Nr!==null&&(h.mode&1)!==0&&(h.flags&128)===0)L7(),Jo(),h.flags|=98560,R=!1;else if(R=Ah(h),x!==null&&x.dehydrated!==null){if(c===null){if(!R)throw Error(n(318));if(R=h.memoizedState,R=R!==null?R.dehydrated:null,!R)throw Error(n(317));R[Ja]=h}else Jo(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Qn(h),R=!1}else xa!==null&&(XU(xa),xa=null),R=!0;if(!R)return h.flags&65536?h:null}return(h.flags&128)!==0?(h.lanes=b,h):(x=x!==null,x!==(c!==null&&c.memoizedState!==null)&&x&&(h.child.flags|=8192,(h.mode&1)!==0&&(c===null||(Jt.current&1)!==0?Cn===0&&(Cn=3):YU())),h.updateQueue!==null&&(h.flags|=4),Qn(h),null);case 4:return rc(),LU(c,h),c===null&&Pd(h.stateNode.containerInfo),Qn(h),null;case 10:return oU(h.type._context),Qn(h),null;case 17:return br(h.type)&&Ch(),Qn(h),null;case 19:if(Ht(Jt),R=h.memoizedState,R===null)return Qn(h),null;if(x=(h.flags&128)!==0,O=R.rendering,O===null)if(x)Yd(R,!1);else{if(Cn!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(O=Nh(c),O!==null){for(h.flags|=128,Yd(R,!1),x=O.updateQueue,x!==null&&(h.updateQueue=x,h.flags|=4),h.subtreeFlags=0,x=b,b=h.child;b!==null;)R=b,c=x,R.flags&=14680066,O=R.alternate,O===null?(R.childLanes=0,R.lanes=c,R.child=null,R.subtreeFlags=0,R.memoizedProps=null,R.memoizedState=null,R.updateQueue=null,R.dependencies=null,R.stateNode=null):(R.childLanes=O.childLanes,R.lanes=O.lanes,R.child=O.child,R.subtreeFlags=0,R.deletions=null,R.memoizedProps=O.memoizedProps,R.memoizedState=O.memoizedState,R.updateQueue=O.updateQueue,R.type=O.type,c=O.dependencies,R.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),b=b.sibling;return Ot(Jt,Jt.current&1|2),h.child}c=c.sibling}R.tail!==null&&pn()>sc&&(h.flags|=128,x=!0,Yd(R,!1),h.lanes=4194304)}else{if(!x)if(c=Nh(O),c!==null){if(h.flags|=128,x=!0,b=c.updateQueue,b!==null&&(h.updateQueue=b,h.flags|=4),Yd(R,!0),R.tail===null&&R.tailMode==="hidden"&&!O.alternate&&!Vt)return Qn(h),null}else 2*pn()-R.renderingStartTime>sc&&b!==1073741824&&(h.flags|=128,x=!0,Yd(R,!1),h.lanes=4194304);R.isBackwards?(O.sibling=h.child,h.child=O):(b=R.last,b!==null?b.sibling=O:h.child=O,R.last=O)}return R.tail!==null?(h=R.tail,R.rendering=h,R.tail=h.sibling,R.renderingStartTime=pn(),h.sibling=null,b=Jt.current,Ot(Jt,x?b&1|2:b&1),h):(Qn(h),null);case 22:case 23:return GU(),x=h.memoizedState!==null,c!==null&&c.memoizedState!==null!==x&&(h.flags|=8192),x&&(h.mode&1)!==0?(Or&1073741824)!==0&&(Qn(h),h.subtreeFlags&6&&(h.flags|=8192)):Qn(h),null;case 24:return null;case 25:return null}throw Error(n(156,h.tag))}function kR(c,h){switch(nU(h),h.tag){case 1:return br(h.type)&&Ch(),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return rc(),Ht(gr),Ht(Kn),mU(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 5:return hU(h),null;case 13:if(Ht(Jt),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(n(340));Jo()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return Ht(Jt),null;case 4:return rc(),null;case 10:return oU(h.type._context),null;case 22:case 23:return GU(),null;case 24:return null;default:return null}}var Vh=!1,Jn=!1,CR=typeof WeakSet=="function"?WeakSet:Set,Le=null;function ic(c,h){var b=c.ref;if(b!==null)if(typeof b=="function")try{b(null)}catch(x){cn(c,h,x)}else b.current=null}function DU(c,h,b){try{b()}catch(x){cn(c,h,x)}}var R3=!1;function MR(c,h){if(Gm=fh,c=d7(),$m(c)){if("selectionStart"in c)var b={start:c.selectionStart,end:c.selectionEnd};else e:{b=(b=c.ownerDocument)&&b.defaultView||window;var x=b.getSelection&&b.getSelection();if(x&&x.rangeCount!==0){b=x.anchorNode;var C=x.anchorOffset,R=x.focusNode;x=x.focusOffset;try{b.nodeType,R.nodeType}catch{b=null;break e}var O=0,G=-1,J=-1,ue=0,ve=0,ye=c,be=null;t:for(;;){for(var je;ye!==b||C!==0&&ye.nodeType!==3||(G=O+C),ye!==R||x!==0&&ye.nodeType!==3||(J=O+x),ye.nodeType===3&&(O+=ye.nodeValue.length),(je=ye.firstChild)!==null;)be=ye,ye=je;for(;;){if(ye===c)break t;if(be===b&&++ue===C&&(G=O),be===R&&++ve===x&&(J=O),(je=ye.nextSibling)!==null)break;ye=be,be=ye.parentNode}ye=je}b=G===-1||J===-1?null:{start:G,end:J}}else b=null}b=b||{start:0,end:0}}else b=null;for(Ym={focusedElem:c,selectionRange:b},fh=!1,Le=h;Le!==null;)if(h=Le,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,Le=c;else for(;Le!==null;){h=Le;try{var Ne=h.alternate;if((h.flags&1024)!==0)switch(h.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var $e=Ne.memoizedProps,mn=Ne.memoizedState,le=h.stateNode,ne=le.getSnapshotBeforeUpdate(h.elementType===h.type?$e:wa(h.type,$e),mn);le.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var oe=h.stateNode.containerInfo;oe.nodeType===1?oe.textContent="":oe.nodeType===9&&oe.documentElement&&oe.removeChild(oe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ee){cn(h,h.return,Ee)}if(c=h.sibling,c!==null){c.return=h.return,Le=c;break}Le=h.return}return Ne=R3,R3=!1,Ne}function Zd(c,h,b){var x=h.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var C=x=x.next;do{if((C.tag&c)===c){var R=C.destroy;C.destroy=void 0,R!==void 0&&DU(h,b,R)}C=C.next}while(C!==x)}}function Gh(c,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var b=h=h.next;do{if((b.tag&c)===c){var x=b.create;b.destroy=x()}b=b.next}while(b!==h)}}function PU(c){var h=c.ref;if(h!==null){var b=c.stateNode;switch(c.tag){case 5:c=b;break;default:c=b}typeof h=="function"?h(c):h.current=c}}function j3(c){var h=c.alternate;h!==null&&(c.alternate=null,j3(h)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(h=c.stateNode,h!==null&&(delete h[Ja],delete h[Od],delete h[Qm],delete h[cR],delete h[dR])),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function L3(c){return c.tag===5||c.tag===3||c.tag===4}function D3(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||L3(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function NU(c,h,b){var x=c.tag;if(x===5||x===6)c=c.stateNode,h?b.nodeType===8?b.parentNode.insertBefore(c,h):b.insertBefore(c,h):(b.nodeType===8?(h=b.parentNode,h.insertBefore(c,b)):(h=b,h.appendChild(c)),b=b._reactRootContainer,b!=null||h.onclick!==null||(h.onclick=Sh));else if(x!==4&&(c=c.child,c!==null))for(NU(c,h,b),c=c.sibling;c!==null;)NU(c,h,b),c=c.sibling}function OU(c,h,b){var x=c.tag;if(x===5||x===6)c=c.stateNode,h?b.insertBefore(c,h):b.appendChild(c);else if(x!==4&&(c=c.child,c!==null))for(OU(c,h,b),c=c.sibling;c!==null;)OU(c,h,b),c=c.sibling}var Wn=null,Ea=!1;function Ol(c,h,b){for(b=b.child;b!==null;)P3(c,h,b),b=b.sibling}function P3(c,h,b){if(Qa&&typeof Qa.onCommitFiberUnmount=="function")try{Qa.onCommitFiberUnmount(lh,b)}catch{}switch(b.tag){case 5:Jn||ic(b,h);case 6:var x=Wn,C=Ea;Wn=null,Ol(c,h,b),Wn=x,Ea=C,Wn!==null&&(Ea?(c=Wn,b=b.stateNode,c.nodeType===8?c.parentNode.removeChild(b):c.removeChild(b)):Wn.removeChild(b.stateNode));break;case 18:Wn!==null&&(Ea?(c=Wn,b=b.stateNode,c.nodeType===8?qm(c.parentNode,b):c.nodeType===1&&qm(c,b),Md(c)):qm(Wn,b.stateNode));break;case 4:x=Wn,C=Ea,Wn=b.stateNode.containerInfo,Ea=!0,Ol(c,h,b),Wn=x,Ea=C;break;case 0:case 11:case 14:case 15:if(!Jn&&(x=b.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){C=x=x.next;do{var R=C,O=R.destroy;R=R.tag,O!==void 0&&((R&2)!==0||(R&4)!==0)&&DU(b,h,O),C=C.next}while(C!==x)}Ol(c,h,b);break;case 1:if(!Jn&&(ic(b,h),x=b.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=b.memoizedProps,x.state=b.memoizedState,x.componentWillUnmount()}catch(G){cn(b,h,G)}Ol(c,h,b);break;case 21:Ol(c,h,b);break;case 22:b.mode&1?(Jn=(x=Jn)||b.memoizedState!==null,Ol(c,h,b),Jn=x):Ol(c,h,b);break;default:Ol(c,h,b)}}function N3(c){var h=c.updateQueue;if(h!==null){c.updateQueue=null;var b=c.stateNode;b===null&&(b=c.stateNode=new CR),h.forEach(function(x){var C=PR.bind(null,c,x);b.has(x)||(b.add(x),x.then(C,C))})}}function Sa(c,h){var b=h.deletions;if(b!==null)for(var x=0;x<b.length;x++){var C=b[x];try{var R=c,O=h,G=O;e:for(;G!==null;){switch(G.tag){case 5:Wn=G.stateNode,Ea=!1;break e;case 3:Wn=G.stateNode.containerInfo,Ea=!0;break e;case 4:Wn=G.stateNode.containerInfo,Ea=!0;break e}G=G.return}if(Wn===null)throw Error(n(160));P3(R,O,C),Wn=null,Ea=!1;var J=C.alternate;J!==null&&(J.return=null),C.return=null}catch(ue){cn(C,h,ue)}}if(h.subtreeFlags&12854)for(h=h.child;h!==null;)O3(h,c),h=h.sibling}function O3(c,h){var b=c.alternate,x=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(Sa(h,c),ni(c),x&4){try{Zd(3,c,c.return),Gh(3,c)}catch($e){cn(c,c.return,$e)}try{Zd(5,c,c.return)}catch($e){cn(c,c.return,$e)}}break;case 1:Sa(h,c),ni(c),x&512&&b!==null&&ic(b,b.return);break;case 5:if(Sa(h,c),ni(c),x&512&&b!==null&&ic(b,b.return),c.flags&32){var C=c.stateNode;try{_s(C,"")}catch($e){cn(c,c.return,$e)}}if(x&4&&(C=c.stateNode,C!=null)){var R=c.memoizedProps,O=b!==null?b.memoizedProps:R,G=c.type,J=c.updateQueue;if(c.updateQueue=null,J!==null)try{G==="input"&&R.type==="radio"&&R.name!=null&&Be(C,R),mm(G,O);var ue=mm(G,R);for(O=0;O<J.length;O+=2){var ve=J[O],ye=J[O+1];ve==="style"?yb(C,ye):ve==="dangerouslySetInnerHTML"?th(C,ye):ve==="children"?_s(C,ye):S(C,ve,ye,ue)}switch(G){case"input":Mt(C,R);break;case"textarea":Zr(C,R);break;case"select":var be=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!R.multiple;var je=R.value;je!=null?Gr(C,!!R.multiple,je,!1):be!==!!R.multiple&&(R.defaultValue!=null?Gr(C,!!R.multiple,R.defaultValue,!0):Gr(C,!!R.multiple,R.multiple?[]:"",!1))}C[Od]=R}catch($e){cn(c,c.return,$e)}}break;case 6:if(Sa(h,c),ni(c),x&4){if(c.stateNode===null)throw Error(n(162));C=c.stateNode,R=c.memoizedProps;try{C.nodeValue=R}catch($e){cn(c,c.return,$e)}}break;case 3:if(Sa(h,c),ni(c),x&4&&b!==null&&b.memoizedState.isDehydrated)try{Md(h.containerInfo)}catch($e){cn(c,c.return,$e)}break;case 4:Sa(h,c),ni(c);break;case 13:Sa(h,c),ni(c),C=c.child,C.flags&8192&&(R=C.memoizedState!==null,C.stateNode.isHidden=R,!R||C.alternate!==null&&C.alternate.memoizedState!==null||(FU=pn())),x&4&&N3(c);break;case 22:if(ve=b!==null&&b.memoizedState!==null,c.mode&1?(Jn=(ue=Jn)||ve,Sa(h,c),Jn=ue):Sa(h,c),ni(c),x&8192){if(ue=c.memoizedState!==null,(c.stateNode.isHidden=ue)&&!ve&&(c.mode&1)!==0)for(Le=c,ve=c.child;ve!==null;){for(ye=Le=ve;Le!==null;){switch(be=Le,je=be.child,be.tag){case 0:case 11:case 14:case 15:Zd(4,be,be.return);break;case 1:ic(be,be.return);var Ne=be.stateNode;if(typeof Ne.componentWillUnmount=="function"){x=be,b=be.return;try{h=x,Ne.props=h.memoizedProps,Ne.state=h.memoizedState,Ne.componentWillUnmount()}catch($e){cn(x,b,$e)}}break;case 5:ic(be,be.return);break;case 22:if(be.memoizedState!==null){F3(ye);continue}}je!==null?(je.return=be,Le=je):F3(ye)}ve=ve.sibling}e:for(ve=null,ye=c;;){if(ye.tag===5){if(ve===null){ve=ye;try{C=ye.stateNode,ue?(R=C.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none"):(G=ye.stateNode,J=ye.memoizedProps.style,O=J!=null&&J.hasOwnProperty("display")?J.display:null,G.style.display=vb("display",O))}catch($e){cn(c,c.return,$e)}}}else if(ye.tag===6){if(ve===null)try{ye.stateNode.nodeValue=ue?"":ye.memoizedProps}catch($e){cn(c,c.return,$e)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===c)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===c)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===c)break e;ve===ye&&(ve=null),ye=ye.return}ve===ye&&(ve=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:Sa(h,c),ni(c),x&4&&N3(c);break;case 21:break;default:Sa(h,c),ni(c)}}function ni(c){var h=c.flags;if(h&2){try{e:{for(var b=c.return;b!==null;){if(L3(b)){var x=b;break e}b=b.return}throw Error(n(160))}switch(x.tag){case 5:var C=x.stateNode;x.flags&32&&(_s(C,""),x.flags&=-33);var R=D3(c);OU(c,R,C);break;case 3:case 4:var O=x.stateNode.containerInfo,G=D3(c);NU(c,G,O);break;default:throw Error(n(161))}}catch(J){cn(c,c.return,J)}c.flags&=-3}h&4096&&(c.flags&=-4097)}function IR(c,h,b){Le=c,$3(c)}function $3(c,h,b){for(var x=(c.mode&1)!==0;Le!==null;){var C=Le,R=C.child;if(C.tag===22&&x){var O=C.memoizedState!==null||Vh;if(!O){var G=C.alternate,J=G!==null&&G.memoizedState!==null||Jn;G=Vh;var ue=Jn;if(Vh=O,(Jn=J)&&!ue)for(Le=C;Le!==null;)O=Le,J=O.child,O.tag===22&&O.memoizedState!==null?B3(C):J!==null?(J.return=O,Le=J):B3(C);for(;R!==null;)Le=R,$3(R),R=R.sibling;Le=C,Vh=G,Jn=ue}z3(c)}else(C.subtreeFlags&8772)!==0&&R!==null?(R.return=C,Le=R):z3(c)}}function z3(c){for(;Le!==null;){var h=Le;if((h.flags&8772)!==0){var b=h.alternate;try{if((h.flags&8772)!==0)switch(h.tag){case 0:case 11:case 15:Jn||Gh(5,h);break;case 1:var x=h.stateNode;if(h.flags&4&&!Jn)if(b===null)x.componentDidMount();else{var C=h.elementType===h.type?b.memoizedProps:wa(h.type,b.memoizedProps);x.componentDidUpdate(C,b.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var R=h.updateQueue;R!==null&&F7(h,R,x);break;case 3:var O=h.updateQueue;if(O!==null){if(b=null,h.child!==null)switch(h.child.tag){case 5:b=h.child.stateNode;break;case 1:b=h.child.stateNode}F7(h,O,b)}break;case 5:var G=h.stateNode;if(b===null&&h.flags&4){b=G;var J=h.memoizedProps;switch(h.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&b.focus();break;case"img":J.src&&(b.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(h.memoizedState===null){var ue=h.alternate;if(ue!==null){var ve=ue.memoizedState;if(ve!==null){var ye=ve.dehydrated;ye!==null&&Md(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Jn||h.flags&512&&PU(h)}catch(be){cn(h,h.return,be)}}if(h===c){Le=null;break}if(b=h.sibling,b!==null){b.return=h.return,Le=b;break}Le=h.return}}function F3(c){for(;Le!==null;){var h=Le;if(h===c){Le=null;break}var b=h.sibling;if(b!==null){b.return=h.return,Le=b;break}Le=h.return}}function B3(c){for(;Le!==null;){var h=Le;try{switch(h.tag){case 0:case 11:case 15:var b=h.return;try{Gh(4,h)}catch(J){cn(h,b,J)}break;case 1:var x=h.stateNode;if(typeof x.componentDidMount=="function"){var C=h.return;try{x.componentDidMount()}catch(J){cn(h,C,J)}}var R=h.return;try{PU(h)}catch(J){cn(h,R,J)}break;case 5:var O=h.return;try{PU(h)}catch(J){cn(h,O,J)}}}catch(J){cn(h,h.return,J)}if(h===c){Le=null;break}var G=h.sibling;if(G!==null){G.return=h.return,Le=G;break}Le=h.return}}var _R=Math.ceil,Yh=k.ReactCurrentDispatcher,$U=k.ReactCurrentOwner,ea=k.ReactCurrentBatchConfig,Ut=0,Ln=null,vn=null,Xn=0,Or=0,lc=jl(0),Cn=0,Kd=null,Os=0,Zh=0,zU=0,qd=null,yr=null,FU=0,sc=1/0,Bi=null,Kh=!1,BU=null,$l=null,qh=!1,zl=null,Qh=0,Qd=0,HU=null,Jh=-1,e1=0;function cr(){return(Ut&6)!==0?pn():Jh!==-1?Jh:Jh=pn()}function Fl(c){return(c.mode&1)===0?1:(Ut&2)!==0&&Xn!==0?Xn&-Xn:fR.transition!==null?(e1===0&&(e1=Db()),e1):(c=Tt,c!==0||(c=window.event,c=c===void 0?16:Wb(c.type)),c)}function ka(c,h,b,x){if(50<Qd)throw Qd=0,HU=null,Error(n(185));wd(c,b,x),((Ut&2)===0||c!==Ln)&&(c===Ln&&((Ut&2)===0&&(Zh|=b),Cn===4&&Bl(c,Xn)),xr(c,x),b===1&&Ut===0&&(h.mode&1)===0&&(sc=pn()+500,Ih&&Dl()))}function xr(c,h){var b=c.callbackNode;fA(c,h);var x=ch(c,c===Ln?Xn:0);if(x===0)b!==null&&Rb(b),c.callbackNode=null,c.callbackPriority=0;else if(h=x&-x,c.callbackPriority!==h){if(b!=null&&Rb(b),h===1)c.tag===0?uR(W3.bind(null,c)):_7(W3.bind(null,c)),sR(function(){(Ut&6)===0&&Dl()}),b=null;else{switch(Pb(x)){case 1:b=wm;break;case 4:b=jb;break;case 16:b=ih;break;case 536870912:b=Lb;break;default:b=ih}b=Q3(b,H3.bind(null,c))}c.callbackPriority=h,c.callbackNode=b}}function H3(c,h){if(Jh=-1,e1=0,(Ut&6)!==0)throw Error(n(327));var b=c.callbackNode;if(oc()&&c.callbackNode!==b)return null;var x=ch(c,c===Ln?Xn:0);if(x===0)return null;if((x&30)!==0||(x&c.expiredLanes)!==0||h)h=t1(c,x);else{h=x;var C=Ut;Ut|=2;var R=V3();(Ln!==c||Xn!==h)&&(Bi=null,sc=pn()+500,zs(c,h));do try{RR();break}catch(G){X3(c,G)}while(!0);sU(),Yh.current=R,Ut=C,vn!==null?h=0:(Ln=null,Xn=0,h=Cn)}if(h!==0){if(h===2&&(C=Em(c),C!==0&&(x=C,h=WU(c,C))),h===1)throw b=Kd,zs(c,0),Bl(c,x),xr(c,pn()),b;if(h===6)Bl(c,x);else{if(C=c.current.alternate,(x&30)===0&&!TR(C)&&(h=t1(c,x),h===2&&(R=Em(c),R!==0&&(x=R,h=WU(c,R))),h===1))throw b=Kd,zs(c,0),Bl(c,x),xr(c,pn()),b;switch(c.finishedWork=C,c.finishedLanes=x,h){case 0:case 1:throw Error(n(345));case 2:Fs(c,yr,Bi);break;case 3:if(Bl(c,x),(x&130023424)===x&&(h=FU+500-pn(),10<h)){if(ch(c,0)!==0)break;if(C=c.suspendedLanes,(C&x)!==x){cr(),c.pingedLanes|=c.suspendedLanes&C;break}c.timeoutHandle=Km(Fs.bind(null,c,yr,Bi),h);break}Fs(c,yr,Bi);break;case 4:if(Bl(c,x),(x&4194240)===x)break;for(h=c.eventTimes,C=-1;0<x;){var O=31-va(x);R=1<<O,O=h[O],O>C&&(C=O),x&=~R}if(x=C,x=pn()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*_R(x/1960))-x,10<x){c.timeoutHandle=Km(Fs.bind(null,c,yr,Bi),x);break}Fs(c,yr,Bi);break;case 5:Fs(c,yr,Bi);break;default:throw Error(n(329))}}}return xr(c,pn()),c.callbackNode===b?H3.bind(null,c):null}function WU(c,h){var b=qd;return c.current.memoizedState.isDehydrated&&(zs(c,h).flags|=256),c=t1(c,h),c!==2&&(h=yr,yr=b,h!==null&&XU(h)),c}function XU(c){yr===null?yr=c:yr.push.apply(yr,c)}function TR(c){for(var h=c;;){if(h.flags&16384){var b=h.updateQueue;if(b!==null&&(b=b.stores,b!==null))for(var x=0;x<b.length;x++){var C=b[x],R=C.getSnapshot;C=C.value;try{if(!ya(R(),C))return!1}catch{return!1}}}if(b=h.child,h.subtreeFlags&16384&&b!==null)b.return=h,h=b;else{if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function Bl(c,h){for(h&=~zU,h&=~Zh,c.suspendedLanes|=h,c.pingedLanes&=~h,c=c.expirationTimes;0<h;){var b=31-va(h),x=1<<b;c[b]=-1,h&=~x}}function W3(c){if((Ut&6)!==0)throw Error(n(327));oc();var h=ch(c,0);if((h&1)===0)return xr(c,pn()),null;var b=t1(c,h);if(c.tag!==0&&b===2){var x=Em(c);x!==0&&(h=x,b=WU(c,x))}if(b===1)throw b=Kd,zs(c,0),Bl(c,h),xr(c,pn()),b;if(b===6)throw Error(n(345));return c.finishedWork=c.current.alternate,c.finishedLanes=h,Fs(c,yr,Bi),xr(c,pn()),null}function VU(c,h){var b=Ut;Ut|=1;try{return c(h)}finally{Ut=b,Ut===0&&(sc=pn()+500,Ih&&Dl())}}function $s(c){zl!==null&&zl.tag===0&&(Ut&6)===0&&oc();var h=Ut;Ut|=1;var b=ea.transition,x=Tt;try{if(ea.transition=null,Tt=1,c)return c()}finally{Tt=x,ea.transition=b,Ut=h,(Ut&6)===0&&Dl()}}function GU(){Or=lc.current,Ht(lc)}function zs(c,h){c.finishedWork=null,c.finishedLanes=0;var b=c.timeoutHandle;if(b!==-1&&(c.timeoutHandle=-1,lR(b)),vn!==null)for(b=vn.return;b!==null;){var x=b;switch(nU(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&Ch();break;case 3:rc(),Ht(gr),Ht(Kn),mU();break;case 5:hU(x);break;case 4:rc();break;case 13:Ht(Jt);break;case 19:Ht(Jt);break;case 10:oU(x.type._context);break;case 22:case 23:GU()}b=b.return}if(Ln=c,vn=c=Hl(c.current,null),Xn=Or=h,Cn=0,Kd=null,zU=Zh=Os=0,yr=qd=null,Ds!==null){for(h=0;h<Ds.length;h++)if(b=Ds[h],x=b.interleaved,x!==null){b.interleaved=null;var C=x.next,R=b.pending;if(R!==null){var O=R.next;R.next=C,x.next=O}b.pending=x}Ds=null}return c}function X3(c,h){do{var b=vn;try{if(sU(),Oh.current=Bh,$h){for(var x=en.memoizedState;x!==null;){var C=x.queue;C!==null&&(C.pending=null),x=x.next}$h=!1}if(Ns=0,jn=kn=en=null,Wd=!1,Xd=0,$U.current=null,b===null||b.return===null){Cn=1,Kd=h,vn=null;break}e:{var R=c,O=b.return,G=b,J=h;if(h=Xn,G.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var ue=J,ve=G,ye=ve.tag;if((ve.mode&1)===0&&(ye===0||ye===11||ye===15)){var be=ve.alternate;be?(ve.updateQueue=be.updateQueue,ve.memoizedState=be.memoizedState,ve.lanes=be.lanes):(ve.updateQueue=null,ve.memoizedState=null)}var je=U3(O);if(je!==null){je.flags&=-257,g3(je,O,G,R,h),je.mode&1&&m3(R,ue,h),h=je,J=ue;var Ne=h.updateQueue;if(Ne===null){var $e=new Set;$e.add(J),h.updateQueue=$e}else Ne.add(J);break e}else{if((h&1)===0){m3(R,ue,h),YU();break e}J=Error(n(426))}}else if(Vt&&G.mode&1){var mn=U3(O);if(mn!==null){(mn.flags&65536)===0&&(mn.flags|=256),g3(mn,O,G,R,h),iU(ac(J,G));break e}}R=J=ac(J,G),Cn!==4&&(Cn=2),qd===null?qd=[R]:qd.push(R),R=O;do{switch(R.tag){case 3:R.flags|=65536,h&=-h,R.lanes|=h;var le=h3(R,J,h);z7(R,le);break e;case 1:G=J;var ne=R.type,oe=R.stateNode;if((R.flags&128)===0&&(typeof ne.getDerivedStateFromError=="function"||oe!==null&&typeof oe.componentDidCatch=="function"&&($l===null||!$l.has(oe)))){R.flags|=65536,h&=-h,R.lanes|=h;var Ee=p3(R,G,h);z7(R,Ee);break e}}R=R.return}while(R!==null)}Y3(b)}catch(Fe){h=Fe,vn===b&&b!==null&&(vn=b=b.return);continue}break}while(!0)}function V3(){var c=Yh.current;return Yh.current=Bh,c===null?Bh:c}function YU(){(Cn===0||Cn===3||Cn===2)&&(Cn=4),Ln===null||(Os&268435455)===0&&(Zh&268435455)===0||Bl(Ln,Xn)}function t1(c,h){var b=Ut;Ut|=2;var x=V3();(Ln!==c||Xn!==h)&&(Bi=null,zs(c,h));do try{AR();break}catch(C){X3(c,C)}while(!0);if(sU(),Ut=b,Yh.current=x,vn!==null)throw Error(n(261));return Ln=null,Xn=0,Cn}function AR(){for(;vn!==null;)G3(vn)}function RR(){for(;vn!==null&&!rA();)G3(vn)}function G3(c){var h=q3(c.alternate,c,Or);c.memoizedProps=c.pendingProps,h===null?Y3(c):vn=h,$U.current=null}function Y3(c){var h=c;do{var b=h.alternate;if(c=h.return,(h.flags&32768)===0){if(b=SR(b,h,Or),b!==null){vn=b;return}}else{if(b=kR(b,h),b!==null){b.flags&=32767,vn=b;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Cn=6,vn=null;return}}if(h=h.sibling,h!==null){vn=h;return}vn=h=c}while(h!==null);Cn===0&&(Cn=5)}function Fs(c,h,b){var x=Tt,C=ea.transition;try{ea.transition=null,Tt=1,jR(c,h,b,x)}finally{ea.transition=C,Tt=x}return null}function jR(c,h,b,x){do oc();while(zl!==null);if((Ut&6)!==0)throw Error(n(327));b=c.finishedWork;var C=c.finishedLanes;if(b===null)return null;if(c.finishedWork=null,c.finishedLanes=0,b===c.current)throw Error(n(177));c.callbackNode=null,c.callbackPriority=0;var R=b.lanes|b.childLanes;if(hA(c,R),c===Ln&&(vn=Ln=null,Xn=0),(b.subtreeFlags&2064)===0&&(b.flags&2064)===0||qh||(qh=!0,Q3(ih,function(){return oc(),null})),R=(b.flags&15990)!==0,(b.subtreeFlags&15990)!==0||R){R=ea.transition,ea.transition=null;var O=Tt;Tt=1;var G=Ut;Ut|=4,$U.current=null,MR(c,b),O3(b,c),JA(Ym),fh=!!Gm,Ym=Gm=null,c.current=b,IR(b),aA(),Ut=G,Tt=O,ea.transition=R}else c.current=b;if(qh&&(qh=!1,zl=c,Qh=C),R=c.pendingLanes,R===0&&($l=null),sA(b.stateNode),xr(c,pn()),h!==null)for(x=c.onRecoverableError,b=0;b<h.length;b++)C=h[b],x(C.value,{componentStack:C.stack,digest:C.digest});if(Kh)throw Kh=!1,c=BU,BU=null,c;return(Qh&1)!==0&&c.tag!==0&&oc(),R=c.pendingLanes,(R&1)!==0?c===HU?Qd++:(Qd=0,HU=c):Qd=0,Dl(),null}function oc(){if(zl!==null){var c=Pb(Qh),h=ea.transition,b=Tt;try{if(ea.transition=null,Tt=16>c?16:c,zl===null)var x=!1;else{if(c=zl,zl=null,Qh=0,(Ut&6)!==0)throw Error(n(331));var C=Ut;for(Ut|=4,Le=c.current;Le!==null;){var R=Le,O=R.child;if((Le.flags&16)!==0){var G=R.deletions;if(G!==null){for(var J=0;J<G.length;J++){var ue=G[J];for(Le=ue;Le!==null;){var ve=Le;switch(ve.tag){case 0:case 11:case 15:Zd(8,ve,R)}var ye=ve.child;if(ye!==null)ye.return=ve,Le=ye;else for(;Le!==null;){ve=Le;var be=ve.sibling,je=ve.return;if(j3(ve),ve===ue){Le=null;break}if(be!==null){be.return=je,Le=be;break}Le=je}}}var Ne=R.alternate;if(Ne!==null){var $e=Ne.child;if($e!==null){Ne.child=null;do{var mn=$e.sibling;$e.sibling=null,$e=mn}while($e!==null)}}Le=R}}if((R.subtreeFlags&2064)!==0&&O!==null)O.return=R,Le=O;else e:for(;Le!==null;){if(R=Le,(R.flags&2048)!==0)switch(R.tag){case 0:case 11:case 15:Zd(9,R,R.return)}var le=R.sibling;if(le!==null){le.return=R.return,Le=le;break e}Le=R.return}}var ne=c.current;for(Le=ne;Le!==null;){O=Le;var oe=O.child;if((O.subtreeFlags&2064)!==0&&oe!==null)oe.return=O,Le=oe;else e:for(O=ne;Le!==null;){if(G=Le,(G.flags&2048)!==0)try{switch(G.tag){case 0:case 11:case 15:Gh(9,G)}}catch(Fe){cn(G,G.return,Fe)}if(G===O){Le=null;break e}var Ee=G.sibling;if(Ee!==null){Ee.return=G.return,Le=Ee;break e}Le=G.return}}if(Ut=C,Dl(),Qa&&typeof Qa.onPostCommitFiberRoot=="function")try{Qa.onPostCommitFiberRoot(lh,c)}catch{}x=!0}return x}finally{Tt=b,ea.transition=h}}return!1}function Z3(c,h,b){h=ac(b,h),h=h3(c,h,1),c=Nl(c,h,1),h=cr(),c!==null&&(wd(c,1,h),xr(c,h))}function cn(c,h,b){if(c.tag===3)Z3(c,c,b);else for(;h!==null;){if(h.tag===3){Z3(h,c,b);break}else if(h.tag===1){var x=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&($l===null||!$l.has(x))){c=ac(b,c),c=p3(h,c,1),h=Nl(h,c,1),c=cr(),h!==null&&(wd(h,1,c),xr(h,c));break}}h=h.return}}function LR(c,h,b){var x=c.pingCache;x!==null&&x.delete(h),h=cr(),c.pingedLanes|=c.suspendedLanes&b,Ln===c&&(Xn&b)===b&&(Cn===4||Cn===3&&(Xn&130023424)===Xn&&500>pn()-FU?zs(c,0):zU|=b),xr(c,h)}function K3(c,h){h===0&&((c.mode&1)===0?h=1:(h=oh,oh<<=1,(oh&130023424)===0&&(oh=4194304)));var b=cr();c=$i(c,h),c!==null&&(wd(c,h,b),xr(c,b))}function DR(c){var h=c.memoizedState,b=0;h!==null&&(b=h.retryLane),K3(c,b)}function PR(c,h){var b=0;switch(c.tag){case 13:var x=c.stateNode,C=c.memoizedState;C!==null&&(b=C.retryLane);break;case 19:x=c.stateNode;break;default:throw Error(n(314))}x!==null&&x.delete(h),K3(c,b)}var q3;q3=function(c,h,b){if(c!==null)if(c.memoizedProps!==h.pendingProps||gr.current)vr=!0;else{if((c.lanes&b)===0&&(h.flags&128)===0)return vr=!1,ER(c,h,b);vr=(c.flags&131072)!==0}else vr=!1,Vt&&(h.flags&1048576)!==0&&T7(h,Th,h.index);switch(h.lanes=0,h.tag){case 2:var x=h.type;Xh(c,h),c=h.pendingProps;var C=Ko(h,Kn.current);nc(h,b),C=bU(null,h,x,c,C,b);var R=vU();return h.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,br(x)?(R=!0,Mh(h)):R=!1,h.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,uU(h),C.updater=Hh,h.stateNode=C,C._reactInternals=h,kU(h,x,c,b),h=_U(null,h,x,!0,R,b)):(h.tag=0,Vt&&R&&tU(h),or(null,h,C,b),h=h.child),h;case 16:x=h.elementType;e:{switch(Xh(c,h),c=h.pendingProps,C=x._init,x=C(x._payload),h.type=x,C=h.tag=OR(x),c=wa(x,c),C){case 0:h=IU(null,h,x,c,b);break e;case 1:h=E3(null,h,x,c,b);break e;case 11:h=b3(null,h,x,c,b);break e;case 14:h=v3(null,h,x,wa(x.type,c),b);break e}throw Error(n(306,x,""))}return h;case 0:return x=h.type,C=h.pendingProps,C=h.elementType===x?C:wa(x,C),IU(c,h,x,C,b);case 1:return x=h.type,C=h.pendingProps,C=h.elementType===x?C:wa(x,C),E3(c,h,x,C,b);case 3:e:{if(S3(h),c===null)throw Error(n(387));x=h.pendingProps,R=h.memoizedState,C=R.element,$7(c,h),Ph(h,x,null,b);var O=h.memoizedState;if(x=O.element,R.isDehydrated)if(R={element:x,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},h.updateQueue.baseState=R,h.memoizedState=R,h.flags&256){C=ac(Error(n(423)),h),h=k3(c,h,x,b,C);break e}else if(x!==C){C=ac(Error(n(424)),h),h=k3(c,h,x,b,C);break e}else for(Nr=Rl(h.stateNode.containerInfo.firstChild),Pr=h,Vt=!0,xa=null,b=N7(h,null,x,b),h.child=b;b;)b.flags=b.flags&-3|4096,b=b.sibling;else{if(Jo(),x===C){h=Fi(c,h,b);break e}or(c,h,x,b)}h=h.child}return h;case 5:return B7(h),c===null&&aU(h),x=h.type,C=h.pendingProps,R=c!==null?c.memoizedProps:null,O=C.children,Zm(x,C)?O=null:R!==null&&Zm(x,R)&&(h.flags|=32),w3(c,h),or(c,h,O,b),h.child;case 6:return c===null&&aU(h),null;case 13:return C3(c,h,b);case 4:return fU(h,h.stateNode.containerInfo),x=h.pendingProps,c===null?h.child=ec(h,null,x,b):or(c,h,x,b),h.child;case 11:return x=h.type,C=h.pendingProps,C=h.elementType===x?C:wa(x,C),b3(c,h,x,C,b);case 7:return or(c,h,h.pendingProps,b),h.child;case 8:return or(c,h,h.pendingProps.children,b),h.child;case 12:return or(c,h,h.pendingProps.children,b),h.child;case 10:e:{if(x=h.type._context,C=h.pendingProps,R=h.memoizedProps,O=C.value,Ot(jh,x._currentValue),x._currentValue=O,R!==null)if(ya(R.value,O)){if(R.children===C.children&&!gr.current){h=Fi(c,h,b);break e}}else for(R=h.child,R!==null&&(R.return=h);R!==null;){var G=R.dependencies;if(G!==null){O=R.child;for(var J=G.firstContext;J!==null;){if(J.context===x){if(R.tag===1){J=zi(-1,b&-b),J.tag=2;var ue=R.updateQueue;if(ue!==null){ue=ue.shared;var ve=ue.pending;ve===null?J.next=J:(J.next=ve.next,ve.next=J),ue.pending=J}}R.lanes|=b,J=R.alternate,J!==null&&(J.lanes|=b),cU(R.return,b,h),G.lanes|=b;break}J=J.next}}else if(R.tag===10)O=R.type===h.type?null:R.child;else if(R.tag===18){if(O=R.return,O===null)throw Error(n(341));O.lanes|=b,G=O.alternate,G!==null&&(G.lanes|=b),cU(O,b,h),O=R.sibling}else O=R.child;if(O!==null)O.return=R;else for(O=R;O!==null;){if(O===h){O=null;break}if(R=O.sibling,R!==null){R.return=O.return,O=R;break}O=O.return}R=O}or(c,h,C.children,b),h=h.child}return h;case 9:return C=h.type,x=h.pendingProps.children,nc(h,b),C=Qr(C),x=x(C),h.flags|=1,or(c,h,x,b),h.child;case 14:return x=h.type,C=wa(x,h.pendingProps),C=wa(x.type,C),v3(c,h,x,C,b);case 15:return y3(c,h,h.type,h.pendingProps,b);case 17:return x=h.type,C=h.pendingProps,C=h.elementType===x?C:wa(x,C),Xh(c,h),h.tag=1,br(x)?(c=!0,Mh(h)):c=!1,nc(h,b),u3(h,x,C),kU(h,x,C,b),_U(null,h,x,!0,c,b);case 19:return I3(c,h,b);case 22:return x3(c,h,b)}throw Error(n(156,h.tag))};function Q3(c,h){return Ab(c,h)}function NR(c,h,b,x){this.tag=c,this.key=b,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ta(c,h,b,x){return new NR(c,h,b,x)}function ZU(c){return c=c.prototype,!(!c||!c.isReactComponent)}function OR(c){if(typeof c=="function")return ZU(c)?1:0;if(c!=null){if(c=c.$$typeof,c===$)return 11;if(c===K)return 14}return 2}function Hl(c,h){var b=c.alternate;return b===null?(b=ta(c.tag,h,c.key,c.mode),b.elementType=c.elementType,b.type=c.type,b.stateNode=c.stateNode,b.alternate=c,c.alternate=b):(b.pendingProps=h,b.type=c.type,b.flags=0,b.subtreeFlags=0,b.deletions=null),b.flags=c.flags&14680064,b.childLanes=c.childLanes,b.lanes=c.lanes,b.child=c.child,b.memoizedProps=c.memoizedProps,b.memoizedState=c.memoizedState,b.updateQueue=c.updateQueue,h=c.dependencies,b.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},b.sibling=c.sibling,b.index=c.index,b.ref=c.ref,b}function n1(c,h,b,x,C,R){var O=2;if(x=c,typeof c=="function")ZU(c)&&(O=1);else if(typeof c=="string")O=5;else e:switch(c){case M:return Bs(b.children,C,R,h);case j:O=8,C|=8;break;case D:return c=ta(12,b,h,C|2),c.elementType=D,c.lanes=R,c;case z:return c=ta(13,b,h,C),c.elementType=z,c.lanes=R,c;case Z:return c=ta(19,b,h,C),c.elementType=Z,c.lanes=R,c;case W:return r1(b,C,R,h);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case P:O=10;break e;case N:O=9;break e;case $:O=11;break e;case K:O=14;break e;case Q:O=16,x=null;break e}throw Error(n(130,c==null?c:typeof c,""))}return h=ta(O,b,h,C),h.elementType=c,h.type=x,h.lanes=R,h}function Bs(c,h,b,x){return c=ta(7,c,x,h),c.lanes=b,c}function r1(c,h,b,x){return c=ta(22,c,x,h),c.elementType=W,c.lanes=b,c.stateNode={isHidden:!1},c}function KU(c,h,b){return c=ta(6,c,null,h),c.lanes=b,c}function qU(c,h,b){return h=ta(4,c.children!==null?c.children:[],c.key,h),h.lanes=b,h.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},h}function $R(c,h,b,x,C){this.tag=h,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sm(0),this.expirationTimes=Sm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sm(0),this.identifierPrefix=x,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function QU(c,h,b,x,C,R,O,G,J){return c=new $R(c,h,b,G,J),h===1?(h=1,R===!0&&(h|=8)):h=0,R=ta(3,null,null,h),c.current=R,R.stateNode=c,R.memoizedState={element:x,isDehydrated:b,cache:null,transitions:null,pendingSuspenseBoundaries:null},uU(R),c}function zR(c,h,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:x==null?null:""+x,children:c,containerInfo:h,implementation:b}}function J3(c){if(!c)return Ll;c=c._reactInternals;e:{if(Ts(c)!==c||c.tag!==1)throw Error(n(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(br(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(n(171))}if(c.tag===1){var b=c.type;if(br(b))return M7(c,b,h)}return h}function e4(c,h,b,x,C,R,O,G,J){return c=QU(b,x,!0,c,C,R,O,G,J),c.context=J3(null),b=c.current,x=cr(),C=Fl(b),R=zi(x,C),R.callback=h??null,Nl(b,R,C),c.current.lanes=C,wd(c,C,x),xr(c,x),c}function a1(c,h,b,x){var C=h.current,R=cr(),O=Fl(C);return b=J3(b),h.context===null?h.context=b:h.pendingContext=b,h=zi(R,O),h.payload={element:c},x=x===void 0?null:x,x!==null&&(h.callback=x),c=Nl(C,h,O),c!==null&&(ka(c,C,O,R),Dh(c,C,O)),O}function i1(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return c.child.stateNode;default:return c.child.stateNode}}function t4(c,h){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var b=c.retryLane;c.retryLane=b!==0&&b<h?b:h}}function JU(c,h){t4(c,h),(c=c.alternate)&&t4(c,h)}function FR(){return null}var n4=typeof reportError=="function"?reportError:function(c){console.error(c)};function e2(c){this._internalRoot=c}l1.prototype.render=e2.prototype.render=function(c){var h=this._internalRoot;if(h===null)throw Error(n(409));a1(c,h,null,null)},l1.prototype.unmount=e2.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var h=c.containerInfo;$s(function(){a1(null,c,null,null)}),h[Di]=null}};function l1(c){this._internalRoot=c}l1.prototype.unstable_scheduleHydration=function(c){if(c){var h=$b();c={blockedOn:null,target:c,priority:h};for(var b=0;b<_l.length&&h!==0&&h<_l[b].priority;b++);_l.splice(b,0,c),b===0&&Bb(c)}};function t2(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function s1(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11&&(c.nodeType!==8||c.nodeValue!==" react-mount-point-unstable "))}function r4(){}function BR(c,h,b,x,C){if(C){if(typeof x=="function"){var R=x;x=function(){var ue=i1(O);R.call(ue)}}var O=e4(h,x,c,0,null,!1,!1,"",r4);return c._reactRootContainer=O,c[Di]=O.current,Pd(c.nodeType===8?c.parentNode:c),$s(),O}for(;C=c.lastChild;)c.removeChild(C);if(typeof x=="function"){var G=x;x=function(){var ue=i1(J);G.call(ue)}}var J=QU(c,0,!1,null,null,!1,!1,"",r4);return c._reactRootContainer=J,c[Di]=J.current,Pd(c.nodeType===8?c.parentNode:c),$s(function(){a1(h,J,b,x)}),J}function o1(c,h,b,x,C){var R=b._reactRootContainer;if(R){var O=R;if(typeof C=="function"){var G=C;C=function(){var J=i1(O);G.call(J)}}a1(h,O,c,C)}else O=BR(b,h,c,C,x);return i1(O)}Nb=function(c){switch(c.tag){case 3:var h=c.stateNode;if(h.current.memoizedState.isDehydrated){var b=xd(h.pendingLanes);b!==0&&(km(h,b|1),xr(h,pn()),(Ut&6)===0&&(sc=pn()+500,Dl()))}break;case 13:$s(function(){var x=$i(c,1);if(x!==null){var C=cr();ka(x,c,1,C)}}),JU(c,1)}},Cm=function(c){if(c.tag===13){var h=$i(c,134217728);if(h!==null){var b=cr();ka(h,c,134217728,b)}JU(c,134217728)}},Ob=function(c){if(c.tag===13){var h=Fl(c),b=$i(c,h);if(b!==null){var x=cr();ka(b,c,h,x)}JU(c,h)}},$b=function(){return Tt},zb=function(c,h){var b=Tt;try{return Tt=c,h()}finally{Tt=b}},bm=function(c,h,b){switch(h){case"input":if(Mt(c,b),h=b.name,b.type==="radio"&&h!=null){for(b=c;b.parentNode;)b=b.parentNode;for(b=b.querySelectorAll("input[name="+JSON.stringify(""+h)+'][type="radio"]'),h=0;h<b.length;h++){var x=b[h];if(x!==c&&x.form===c.form){var C=kh(x);if(!C)throw Error(n(90));Ue(x),Mt(x,C)}}}break;case"textarea":Zr(c,b);break;case"select":h=b.value,h!=null&&Gr(c,!!b.multiple,h,!1)}},Sb=VU,kb=$s;var HR={usingClientEntryPoint:!1,Events:[$d,Yo,kh,wb,Eb,VU]},Jd={findFiberByHostInstance:As,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},WR={bundleType:Jd.bundleType,version:Jd.version,rendererPackageName:Jd.rendererPackageName,rendererConfig:Jd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(c){return c=_b(c),c===null?null:c.stateNode},findFiberByHostInstance:Jd.findFiberByHostInstance||FR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var c1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!c1.isDisabled&&c1.supportsFiber)try{lh=c1.inject(WR),Qa=c1}catch{}}return wr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=HR,wr.createPortal=function(c,h){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t2(h))throw Error(n(200));return zR(c,h,null,b)},wr.createRoot=function(c,h){if(!t2(c))throw Error(n(299));var b=!1,x="",C=n4;return h!=null&&(h.unstable_strictMode===!0&&(b=!0),h.identifierPrefix!==void 0&&(x=h.identifierPrefix),h.onRecoverableError!==void 0&&(C=h.onRecoverableError)),h=QU(c,1,!1,null,null,b,!1,x,C),c[Di]=h.current,Pd(c.nodeType===8?c.parentNode:c),new e2(h)},wr.findDOMNode=function(c){if(c==null)return null;if(c.nodeType===1)return c;var h=c._reactInternals;if(h===void 0)throw typeof c.render=="function"?Error(n(188)):(c=Object.keys(c).join(","),Error(n(268,c)));return c=_b(h),c=c===null?null:c.stateNode,c},wr.flushSync=function(c){return $s(c)},wr.hydrate=function(c,h,b){if(!s1(h))throw Error(n(200));return o1(null,c,h,!0,b)},wr.hydrateRoot=function(c,h,b){if(!t2(c))throw Error(n(405));var x=b!=null&&b.hydratedSources||null,C=!1,R="",O=n4;if(b!=null&&(b.unstable_strictMode===!0&&(C=!0),b.identifierPrefix!==void 0&&(R=b.identifierPrefix),b.onRecoverableError!==void 0&&(O=b.onRecoverableError)),h=e4(h,null,c,1,b??null,C,!1,R,O),c[Di]=h.current,Pd(c),x)for(c=0;c<x.length;c++)b=x[c],C=b._getVersion,C=C(b._source),h.mutableSourceEagerHydrationData==null?h.mutableSourceEagerHydrationData=[b,C]:h.mutableSourceEagerHydrationData.push(b,C);return new l1(h)},wr.render=function(c,h,b){if(!s1(h))throw Error(n(200));return o1(null,c,h,!1,b)},wr.unmountComponentAtNode=function(c){if(!s1(c))throw Error(n(40));return c._reactRootContainer?($s(function(){o1(null,null,c,!1,function(){c._reactRootContainer=null,c[Di]=null})}),!0):!1},wr.unstable_batchedUpdates=VU,wr.unstable_renderSubtreeIntoContainer=function(c,h,b,x){if(!s1(b))throw Error(n(200));if(c==null||c._reactInternals===void 0)throw Error(n(38));return o1(c,h,b,!1,x)},wr.version="18.3.1-next-f1338f8080-20240426",wr}var u4;function yw(){if(u4)return a2.exports;u4=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),a2.exports=QR(),a2.exports}var f4;function JR(){if(f4)return d1;f4=1;var e=yw();return d1.createRoot=e.createRoot,d1.hydrateRoot=e.hydrateRoot,d1}var ej=JR();const tj="modulepreload",nj=function(e){return"/"+e},h4={},Re=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(u){return Promise.all(u.map(o=>Promise.resolve(o).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),d=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));a=l(n.map(u=>{if(u=nj(u),u in h4)return;h4[u]=!0;const o=u.endsWith(".css"),f=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const m=document.createElement("link");if(m.rel=o?"stylesheet":tj,o||(m.as="script"),m.crossOrigin="",m.href=u,d&&m.setAttribute("nonce",d),document.head.appendChild(m),o)return new Promise((U,g)=>{m.addEventListener("load",U),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(l){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=l,window.dispatchEvent(s),!s.defaultPrevented)throw l}return a.then(l=>{for(const s of l||[])s.status==="rejected"&&i(s.reason);return t().catch(i)})};var et={VITE_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",VITE_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",VITE_APP_LIBRARY_URL:"https://libraries.excalidraw.com",VITE_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",VITE_APP_PLUS_LP:"https://plus.excalidraw.com",VITE_APP_PLUS_APP:"https://app.excalidraw.com",VITE_APP_AI_BACKEND:"https://oss-ai.excalidraw.com",VITE_APP_WS_SERVER_URL:"https://oss-collab.excalidraw.com",VITE_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',VITE_APP_ENABLE_TRACKING:"false",VITE_APP_PLUS_EXPORT_PUBLIC_KEY:`MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApQ0jM9Qz8TdFLzcuAZZX
|
|
42
|
+
/WvuKSOJxiw6AR/ZcE3eFQWM/mbFdhQgyK8eHGkKQifKzH1xUZjCxyXcxW6ZO02t
|
|
43
|
+
kPOPxhz+nxUrIoWCD/V4NGmUA1lxwHuO21HN1gzKrN3xHg5EGjyouR9vibT9VDGF
|
|
44
|
+
gq6+4Ic/kJX+AD2MM7Yre2+FsOdysrmuW2Fu3ahuC1uQE7pOe1j0k7auNP0y1q53
|
|
45
|
+
PrB8Ts2LUpepWC1l7zIXFm4ViDULuyWXTEpUcHSsEH8vpd1tckjypxCwkipfZsXx
|
|
46
|
+
iPszy0o0Dx2iArPfWMXlFAI9mvyFCyFC3+nSvfyAUb2C4uZgCwAuyFh/ydPF4DEE
|
|
47
|
+
PQIDAQAB`,VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX:"false",VITE_APP_COLLAPSE_OVERLAY:"false",VITE_APP_ENABLE_ESLINT:"false",PKG_NAME:"@excalidraw/excalidraw",PKG_VERSION:"0.18.0",PROD:!0},xw=Object.defineProperty,rj=(e,t,n)=>t in e?xw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kle=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),aj=e=>t=>{var n=e[t];if(n)return n();throw new Error("Module not found in bundle: "+t)},ww=(e,t)=>{for(var n in t)xw(e,n,{get:t[n],enumerable:!0})},F=(e,t,n)=>(rj(e,typeof t!="symbol"?t+"":t,n),n),s2={},p4;function Ew(){return p4||(p4=1,(function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="0.3.0";function n(){for(var u=0,o=new Array(256),f=0;f!=256;++f)u=f,u=u&1?-306674912^u>>>1:u>>>1,u=u&1?-306674912^u>>>1:u>>>1,u=u&1?-306674912^u>>>1:u>>>1,u=u&1?-306674912^u>>>1:u>>>1,u=u&1?-306674912^u>>>1:u>>>1,u=u&1?-306674912^u>>>1:u>>>1,u=u&1?-306674912^u>>>1:u>>>1,u=u&1?-306674912^u>>>1:u>>>1,o[f]=u;return typeof Int32Array<"u"?new Int32Array(o):o}var r=n(),a=typeof Buffer<"u";function i(u){if(u.length>32768&&a)return s(new Buffer(u));for(var o=-1,f=u.length-1,m=0;m<f;)o=r[(o^u.charCodeAt(m++))&255]^o>>>8,o=r[(o^u.charCodeAt(m++))&255]^o>>>8;return m===f&&(o=o>>>8^r[(o^u.charCodeAt(m))&255]),o^-1}function l(u){if(u.length>1e4)return s(u);for(var o=-1,f=0,m=u.length-3;f<m;)o=o>>>8^r[(o^u[f++])&255],o=o>>>8^r[(o^u[f++])&255],o=o>>>8^r[(o^u[f++])&255],o=o>>>8^r[(o^u[f++])&255];for(;f<m+3;)o=o>>>8^r[(o^u[f++])&255];return o^-1}function s(u){for(var o=-1,f=0,m=u.length-7;f<m;)o=o>>>8^r[(o^u[f++])&255],o=o>>>8^r[(o^u[f++])&255],o=o>>>8^r[(o^u[f++])&255],o=o>>>8^r[(o^u[f++])&255],o=o>>>8^r[(o^u[f++])&255],o=o>>>8^r[(o^u[f++])&255],o=o>>>8^r[(o^u[f++])&255],o=o>>>8^r[(o^u[f++])&255];for(;f<m+7;)o=o>>>8^r[(o^u[f++])&255];return o^-1}function d(u){for(var o=-1,f=0,m=u.length,U,g;f<m;)U=u.charCodeAt(f++),U<128?o=o>>>8^r[(o^U)&255]:U<2048?(o=o>>>8^r[(o^(192|U>>6&31))&255],o=o>>>8^r[(o^(128|U&63))&255]):U>=55296&&U<57344?(U=(U&1023)+64,g=u.charCodeAt(f++)&1023,o=o>>>8^r[(o^(240|U>>8&7))&255],o=o>>>8^r[(o^(128|U>>2&63))&255],o=o>>>8^r[(o^(128|g>>6&15|U&3))&255],o=o>>>8^r[(o^(128|g&63))&255]):(o=o>>>8^r[(o^(224|U>>12&15))&255],o=o>>>8^r[(o^(128|U>>6&63))&255],o=o>>>8^r[(o^(128|U&63))&255]);return o^-1}t.table=r,t.bstr=i,t.buf=l,t.str=d})})(s2)),s2}var o2,m4;function ij(){if(m4)return o2;m4=1;var e=Ew();o2=a;var t=new Uint8Array(4),n=new Int32Array(t.buffer),r=new Uint32Array(t.buffer);function a(i){if(i[0]!==137)throw new Error("Invalid .png file header");if(i[1]!==80)throw new Error("Invalid .png file header");if(i[2]!==78)throw new Error("Invalid .png file header");if(i[3]!==71)throw new Error("Invalid .png file header");if(i[4]!==13)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(i[5]!==10)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(i[6]!==26)throw new Error("Invalid .png file header");if(i[7]!==10)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");for(var l=!1,s=[],d=8;d<i.length;){t[3]=i[d++],t[2]=i[d++],t[1]=i[d++],t[0]=i[d++];var u=r[0]+4,o=new Uint8Array(u);o[0]=i[d++],o[1]=i[d++],o[2]=i[d++],o[3]=i[d++];var f=String.fromCharCode(o[0])+String.fromCharCode(o[1])+String.fromCharCode(o[2])+String.fromCharCode(o[3]);if(!s.length&&f!=="IHDR")throw new Error("IHDR header missing");if(f==="IEND"){l=!0,s.push({name:f,data:new Uint8Array(0)});break}for(var m=4;m<u;m++)o[m]=i[d++];t[3]=i[d++],t[2]=i[d++],t[1]=i[d++],t[0]=i[d++];var U=n[0],g=e.buf(o);if(g!==U)throw new Error("CRC values for "+f+" header do not match, PNG file is likely corrupted");var v=new Uint8Array(o.buffer.slice(4));s.push({name:f,data:v})}if(!l)throw new Error(".png file ended prematurely: no IEND header was found");return s}return o2}var lj=ij();const Sw=_i(lj);var u1={},c2,U4;function sj(){if(U4)return c2;U4=1,c2=e;function e(t,n){if(t=String(t),n=String(n),!/^[\x00-\xFF]+$/.test(t)||!/^[\x00-\xFF]+$/.test(n))throw new Error("Only Latin-1 characters are permitted in PNG tEXt chunks. You might want to consider base64 encoding and/or zEXt compression");if(t.length>=80)throw new Error('Keyword "'+t+'" is longer than the 79-character limit imposed by the PNG specification');for(var r=t.length+n.length+1,a=new Uint8Array(r),i=0,l,s=0;s<t.length;s++){if(!(l=t.charCodeAt(s)))throw new Error("0x00 character is not permitted in tEXt keywords");a[i++]=l}a[i++]=0;for(var d=0;d<n.length;d++){if(!(l=n.charCodeAt(d)))throw new Error("0x00 character is not permitted in tEXt content");a[i++]=l}return{name:"tEXt",data:a}}return c2}var d2,g4;function oj(){if(g4)return d2;g4=1,d2=e;function e(t){t.data&&t.name&&(t=t.data);for(var n=!0,r="",a="",i=0;i<t.length;i++){var l=t[i];if(n)l?a+=String.fromCharCode(l):n=!1;else if(l)r+=String.fromCharCode(l);else throw new Error("Invalid NULL character found. 0x00 character is not permitted in tEXt content")}return{keyword:a,text:r}}return d2}var b4;function cj(){return b4||(b4=1,u1.encode=sj(),u1.decode=oj()),u1}var dj=cj();const kw=_i(dj);var u2,v4;function uj(){return v4||(v4=1,u2=function(e,t,n){var r=[],a=e.length;if(a===0)return r;var i=t<0?Math.max(0,t+a):t||0;for(n!==void 0&&(a=n<0?n+a:n);a-- >i;)r[a-i]=e[a];return r}),u2}var f2,y4;function fj(){if(y4)return f2;y4=1;var e=uj(),t=Ew();f2=i;var n=new Uint8Array(4),r=new Int32Array(n.buffer),a=new Uint32Array(n.buffer);function i(l){var s=8,d=s,u;for(u=0;u<l.length;u++)s+=l[u].data.length,s+=12;var o=new Uint8Array(s);for(o[0]=137,o[1]=80,o[2]=78,o[3]=71,o[4]=13,o[5]=10,o[6]=26,o[7]=10,u=0;u<l.length;u++){var f=l[u],m=f.name,U=f.data,g=U.length,v=[m.charCodeAt(0),m.charCodeAt(1),m.charCodeAt(2),m.charCodeAt(3)];a[0]=g,o[d++]=n[3],o[d++]=n[2],o[d++]=n[1],o[d++]=n[0],o[d++]=v[0],o[d++]=v[1],o[d++]=v[2],o[d++]=v[3];for(var y=0;y<g;)o[d++]=U[y++];var w=v.concat(e(U)),E=t.buf(w);r[0]=E,o[d++]=n[3],o[d++]=n[2],o[d++]=n[1],o[d++]=n[0]}return o}return f2}var hj=fj();const pj=_i(hj);/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */const mj=4,x4=0,w4=1,Uj=2;function od(e){let t=e.length;for(;--t>=0;)e[t]=0}const gj=0,Cw=1,bj=2,vj=3,yj=258,a5=29,_f=256,Ku=_f+1+a5,Dc=30,i5=19,Mw=2*Ku+1,no=15,h2=16,xj=7,l5=256,Iw=16,_w=17,Tw=18,jg=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),H1=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),wj=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Aw=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ej=512,Zi=new Array((Ku+2)*2);od(Zi);const Lu=new Array(Dc*2);od(Lu);const qu=new Array(Ej);od(qu);const Qu=new Array(yj-vj+1);od(Qu);const s5=new Array(a5);od(s5);const xp=new Array(Dc);od(xp);function p2(e,t,n,r,a){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=a,this.has_stree=e&&e.length}let Rw,jw,Lw;function m2(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const Dw=e=>e<256?qu[e]:qu[256+(e>>>7)],Ju=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},_r=(e,t,n)=>{e.bi_valid>h2-n?(e.bi_buf|=t<<e.bi_valid&65535,Ju(e,e.bi_buf),e.bi_buf=t>>h2-e.bi_valid,e.bi_valid+=n-h2):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},hi=(e,t,n)=>{_r(e,n[t*2],n[t*2+1])},Pw=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},Sj=e=>{e.bi_valid===16?(Ju(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},kj=(e,t)=>{const n=t.dyn_tree,r=t.max_code,a=t.stat_desc.static_tree,i=t.stat_desc.has_stree,l=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,d=t.stat_desc.max_length;let u,o,f,m,U,g,v=0;for(m=0;m<=no;m++)e.bl_count[m]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<Mw;u++)o=e.heap[u],m=n[n[o*2+1]*2+1]+1,m>d&&(m=d,v++),n[o*2+1]=m,!(o>r)&&(e.bl_count[m]++,U=0,o>=s&&(U=l[o-s]),g=n[o*2],e.opt_len+=g*(m+U),i&&(e.static_len+=g*(a[o*2+1]+U)));if(v!==0){do{for(m=d-1;e.bl_count[m]===0;)m--;e.bl_count[m]--,e.bl_count[m+1]+=2,e.bl_count[d]--,v-=2}while(v>0);for(m=d;m!==0;m--)for(o=e.bl_count[m];o!==0;)f=e.heap[--u],!(f>r)&&(n[f*2+1]!==m&&(e.opt_len+=(m-n[f*2+1])*n[f*2],n[f*2+1]=m),o--)}},Nw=(e,t,n)=>{const r=new Array(no+1);let a=0,i,l;for(i=1;i<=no;i++)r[i]=a=a+n[i-1]<<1;for(l=0;l<=t;l++){let s=e[l*2+1];s!==0&&(e[l*2]=Pw(r[s]++,s))}},Cj=()=>{let e,t,n,r,a;const i=new Array(no+1);for(n=0,r=0;r<a5-1;r++)for(s5[r]=n,e=0;e<1<<jg[r];e++)Qu[n++]=r;for(Qu[n-1]=r,a=0,r=0;r<16;r++)for(xp[r]=a,e=0;e<1<<H1[r];e++)qu[a++]=r;for(a>>=7;r<Dc;r++)for(xp[r]=a<<7,e=0;e<1<<H1[r]-7;e++)qu[256+a++]=r;for(t=0;t<=no;t++)i[t]=0;for(e=0;e<=143;)Zi[e*2+1]=8,e++,i[8]++;for(;e<=255;)Zi[e*2+1]=9,e++,i[9]++;for(;e<=279;)Zi[e*2+1]=7,e++,i[7]++;for(;e<=287;)Zi[e*2+1]=8,e++,i[8]++;for(Nw(Zi,Ku+1,i),e=0;e<Dc;e++)Lu[e*2+1]=5,Lu[e*2]=Pw(e,5);Rw=new p2(Zi,jg,_f+1,Ku,no),jw=new p2(Lu,H1,0,Dc,no),Lw=new p2(new Array(0),wj,0,i5,xj)},Ow=e=>{let t;for(t=0;t<Ku;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Dc;t++)e.dyn_dtree[t*2]=0;for(t=0;t<i5;t++)e.bl_tree[t*2]=0;e.dyn_ltree[l5*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},$w=e=>{e.bi_valid>8?Ju(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Mj=(e,t,n,r)=>{$w(e),Ju(e,n),Ju(e,~n),e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},E4=(e,t,n,r)=>{const a=t*2,i=n*2;return e[a]<e[i]||e[a]===e[i]&&r[t]<=r[n]},U2=(e,t,n)=>{const r=e.heap[n];let a=n<<1;for(;a<=e.heap_len&&(a<e.heap_len&&E4(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!E4(t,r,e.heap[a],e.depth));)e.heap[n]=e.heap[a],n=a,a<<=1;e.heap[n]=r},S4=(e,t,n)=>{let r,a,i=0,l,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+i*2]<<8|e.pending_buf[e.d_buf+i*2+1],a=e.pending_buf[e.l_buf+i],i++,r===0?hi(e,a,t):(l=Qu[a],hi(e,l+_f+1,t),s=jg[l],s!==0&&(a-=s5[l],_r(e,a,s)),r--,l=Dw(r),hi(e,l,n),s=H1[l],s!==0&&(r-=xp[l],_r(e,r,s)));while(i<e.last_lit);hi(e,l5,t)},Lg=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,a=t.stat_desc.has_stree,i=t.stat_desc.elems;let l,s,d=-1,u;for(e.heap_len=0,e.heap_max=Mw,l=0;l<i;l++)n[l*2]!==0?(e.heap[++e.heap_len]=d=l,e.depth[l]=0):n[l*2+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=d<2?++d:0,n[u*2]=1,e.depth[u]=0,e.opt_len--,a&&(e.static_len-=r[u*2+1]);for(t.max_code=d,l=e.heap_len>>1;l>=1;l--)U2(e,n,l);u=i;do l=e.heap[1],e.heap[1]=e.heap[e.heap_len--],U2(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=l,e.heap[--e.heap_max]=s,n[u*2]=n[l*2]+n[s*2],e.depth[u]=(e.depth[l]>=e.depth[s]?e.depth[l]:e.depth[s])+1,n[l*2+1]=n[s*2+1]=u,e.heap[1]=u++,U2(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],kj(e,t),Nw(n,d,e.bl_count)},k4=(e,t,n)=>{let r,a=-1,i,l=t[1],s=0,d=7,u=4;for(l===0&&(d=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)i=l,l=t[(r+1)*2+1],!(++s<d&&i===l)&&(s<u?e.bl_tree[i*2]+=s:i!==0?(i!==a&&e.bl_tree[i*2]++,e.bl_tree[Iw*2]++):s<=10?e.bl_tree[_w*2]++:e.bl_tree[Tw*2]++,s=0,a=i,l===0?(d=138,u=3):i===l?(d=6,u=3):(d=7,u=4))},C4=(e,t,n)=>{let r,a=-1,i,l=t[1],s=0,d=7,u=4;for(l===0&&(d=138,u=3),r=0;r<=n;r++)if(i=l,l=t[(r+1)*2+1],!(++s<d&&i===l)){if(s<u)do hi(e,i,e.bl_tree);while(--s!==0);else i!==0?(i!==a&&(hi(e,i,e.bl_tree),s--),hi(e,Iw,e.bl_tree),_r(e,s-3,2)):s<=10?(hi(e,_w,e.bl_tree),_r(e,s-3,3)):(hi(e,Tw,e.bl_tree),_r(e,s-11,7));s=0,a=i,l===0?(d=138,u=3):i===l?(d=6,u=3):(d=7,u=4)}},Ij=e=>{let t;for(k4(e,e.dyn_ltree,e.l_desc.max_code),k4(e,e.dyn_dtree,e.d_desc.max_code),Lg(e,e.bl_desc),t=i5-1;t>=3&&e.bl_tree[Aw[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},_j=(e,t,n,r)=>{let a;for(_r(e,t-257,5),_r(e,n-1,5),_r(e,r-4,4),a=0;a<r;a++)_r(e,e.bl_tree[Aw[a]*2+1],3);C4(e,e.dyn_ltree,t-1),C4(e,e.dyn_dtree,n-1)},Tj=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return x4;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return w4;for(n=32;n<_f;n++)if(e.dyn_ltree[n*2]!==0)return w4;return x4};let M4=!1;const Aj=e=>{M4||(Cj(),M4=!0),e.l_desc=new m2(e.dyn_ltree,Rw),e.d_desc=new m2(e.dyn_dtree,jw),e.bl_desc=new m2(e.bl_tree,Lw),e.bi_buf=0,e.bi_valid=0,Ow(e)},zw=(e,t,n,r)=>{_r(e,(gj<<1)+(r?1:0),3),Mj(e,t,n)},Rj=e=>{_r(e,Cw<<1,3),hi(e,l5,Zi),Sj(e)},jj=(e,t,n,r)=>{let a,i,l=0;e.level>0?(e.strm.data_type===Uj&&(e.strm.data_type=Tj(e)),Lg(e,e.l_desc),Lg(e,e.d_desc),l=Ij(e),a=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=a&&(a=i)):a=i=n+5,n+4<=a&&t!==-1?zw(e,t,n,r):e.strategy===mj||i===a?(_r(e,(Cw<<1)+(r?1:0),3),S4(e,Zi,Lu)):(_r(e,(bj<<1)+(r?1:0),3),_j(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),S4(e,e.dyn_ltree,e.dyn_dtree)),Ow(e),r&&$w(e)},Lj=(e,t,n)=>(e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Qu[n]+_f+1)*2]++,e.dyn_dtree[Dw(t)*2]++),e.last_lit===e.lit_bufsize-1);var Dj=Aj,Pj=zw,Nj=jj,Oj=Lj,$j=Rj,zj={_tr_init:Dj,_tr_stored_block:Pj,_tr_flush_block:Nj,_tr_tally:Oj,_tr_align:$j};const Fj=(e,t,n,r)=>{let a=e&65535|0,i=e>>>16&65535|0,l=0;for(;n!==0;){l=n>2e3?2e3:n,n-=l;do a=a+t[r++]|0,i=i+a|0;while(--l);a%=65521,i%=65521}return a|i<<16|0};var ef=Fj;const Bj=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},Hj=new Uint32Array(Bj()),Wj=(e,t,n,r)=>{const a=Hj,i=r+n;e^=-1;for(let l=r;l<i;l++)e=e>>>8^a[(e^t[l])&255];return e^-1};var Nn=Wj,Uo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},m0={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Xj,_tr_stored_block:Vj,_tr_flush_block:Gj,_tr_tally:cs,_tr_align:Yj}=zj,{Z_NO_FLUSH:Lo,Z_PARTIAL_FLUSH:Zj,Z_FULL_FLUSH:Kj,Z_FINISH:ds,Z_BLOCK:I4,Z_OK:pi,Z_STREAM_END:_4,Z_STREAM_ERROR:da,Z_DATA_ERROR:qj,Z_BUF_ERROR:g2,Z_DEFAULT_COMPRESSION:Qj,Z_FILTERED:Jj,Z_HUFFMAN_ONLY:f1,Z_RLE:eL,Z_FIXED:tL,Z_DEFAULT_STRATEGY:nL,Z_UNKNOWN:rL,Z_DEFLATED:U0}=m0,aL=9,iL=15,lL=8,sL=29,oL=256,Dg=oL+1+sL,cL=30,dL=19,uL=2*Dg+1,fL=15,ut=3,as=258,za=as+ut+1,hL=32,g0=42,Pg=69,W1=73,X1=91,V1=103,ro=113,yu=666,Tn=1,Tf=2,go=3,cd=4,pL=3,is=(e,t)=>(e.msg=Uo[t],t),T4=e=>(e<<1)-(e>4?9:0),ns=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let mL=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,us=mL;const Zl=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Gn=(e,t)=>{Gj(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Zl(e.strm)},Et=(e,t)=>{e.pending_buf[e.pending++]=t},tu=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},UL=(e,t,n,r)=>{let a=e.avail_in;return a>r&&(a=r),a===0?0:(e.avail_in-=a,t.set(e.input.subarray(e.next_in,e.next_in+a),n),e.state.wrap===1?e.adler=ef(e.adler,t,a,n):e.state.wrap===2&&(e.adler=Nn(e.adler,t,a,n)),e.next_in+=a,e.total_in+=a,a)},Fw=(e,t)=>{let n=e.max_chain_length,r=e.strstart,a,i,l=e.prev_length,s=e.nice_match;const d=e.strstart>e.w_size-za?e.strstart-(e.w_size-za):0,u=e.window,o=e.w_mask,f=e.prev,m=e.strstart+as;let U=u[r+l-1],g=u[r+l];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(a=t,!(u[a+l]!==g||u[a+l-1]!==U||u[a]!==u[r]||u[++a]!==u[r+1])){r+=2,a++;do;while(u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&r<m);if(i=as-(m-r),r=m-as,i>l){if(e.match_start=t,l=i,i>=s)break;U=u[r+l-1],g=u[r+l]}}while((t=f[t&o])>d&&--n!==0);return l<=e.lookahead?l:e.lookahead},bo=e=>{const t=e.w_size;let n,r,a,i,l;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-za)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do a=e.head[--n],e.head[n]=a>=t?a-t:0;while(--r);r=t,n=r;do a=e.prev[--n],e.prev[n]=a>=t?a-t:0;while(--r);i+=t}if(e.strm.avail_in===0)break;if(r=UL(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=ut)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=us(e,e.ins_h,e.window[l+1]);e.insert&&(e.ins_h=us(e,e.ins_h,e.window[l+ut-1]),e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<ut)););}while(e.lookahead<za&&e.strm.avail_in!==0)},gL=(e,t)=>{let n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(bo(e),e.lookahead===0&&t===Lo)return Tn;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;const r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,Gn(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-za&&(Gn(e,!1),e.strm.avail_out===0))return Tn}return e.insert=0,t===ds?(Gn(e,!0),e.strm.avail_out===0?go:cd):(e.strstart>e.block_start&&(Gn(e,!1),e.strm.avail_out===0),Tn)},b2=(e,t)=>{let n,r;for(;;){if(e.lookahead<za){if(bo(e),e.lookahead<za&&t===Lo)return Tn;if(e.lookahead===0)break}if(n=0,e.lookahead>=ut&&(e.ins_h=us(e,e.ins_h,e.window[e.strstart+ut-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-za&&(e.match_length=Fw(e,n)),e.match_length>=ut)if(r=cs(e,e.strstart-e.match_start,e.match_length-ut),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=ut){e.match_length--;do e.strstart++,e.ins_h=us(e,e.ins_h,e.window[e.strstart+ut-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=us(e,e.ins_h,e.window[e.strstart+1]);else r=cs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Gn(e,!1),e.strm.avail_out===0))return Tn}return e.insert=e.strstart<ut-1?e.strstart:ut-1,t===ds?(Gn(e,!0),e.strm.avail_out===0?go:cd):e.last_lit&&(Gn(e,!1),e.strm.avail_out===0)?Tn:Tf},cc=(e,t)=>{let n,r,a;for(;;){if(e.lookahead<za){if(bo(e),e.lookahead<za&&t===Lo)return Tn;if(e.lookahead===0)break}if(n=0,e.lookahead>=ut&&(e.ins_h=us(e,e.ins_h,e.window[e.strstart+ut-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=ut-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-za&&(e.match_length=Fw(e,n),e.match_length<=5&&(e.strategy===Jj||e.match_length===ut&&e.strstart-e.match_start>4096)&&(e.match_length=ut-1)),e.prev_length>=ut&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-ut,r=cs(e,e.strstart-1-e.prev_match,e.prev_length-ut),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=us(e,e.ins_h,e.window[e.strstart+ut-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=ut-1,e.strstart++,r&&(Gn(e,!1),e.strm.avail_out===0))return Tn}else if(e.match_available){if(r=cs(e,0,e.window[e.strstart-1]),r&&Gn(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Tn}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=cs(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<ut-1?e.strstart:ut-1,t===ds?(Gn(e,!0),e.strm.avail_out===0?go:cd):e.last_lit&&(Gn(e,!1),e.strm.avail_out===0)?Tn:Tf},bL=(e,t)=>{let n,r,a,i;const l=e.window;for(;;){if(e.lookahead<=as){if(bo(e),e.lookahead<=as&&t===Lo)return Tn;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=ut&&e.strstart>0&&(a=e.strstart-1,r=l[a],r===l[++a]&&r===l[++a]&&r===l[++a])){i=e.strstart+as;do;while(r===l[++a]&&r===l[++a]&&r===l[++a]&&r===l[++a]&&r===l[++a]&&r===l[++a]&&r===l[++a]&&r===l[++a]&&a<i);e.match_length=as-(i-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=ut?(n=cs(e,1,e.match_length-ut),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=cs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Gn(e,!1),e.strm.avail_out===0))return Tn}return e.insert=0,t===ds?(Gn(e,!0),e.strm.avail_out===0?go:cd):e.last_lit&&(Gn(e,!1),e.strm.avail_out===0)?Tn:Tf},vL=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(bo(e),e.lookahead===0)){if(t===Lo)return Tn;break}if(e.match_length=0,n=cs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Gn(e,!1),e.strm.avail_out===0))return Tn}return e.insert=0,t===ds?(Gn(e,!0),e.strm.avail_out===0?go:cd):e.last_lit&&(Gn(e,!1),e.strm.avail_out===0)?Tn:Tf};function ri(e,t,n,r,a){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=a}const xu=[new ri(0,0,0,0,gL),new ri(4,4,8,4,b2),new ri(4,5,16,8,b2),new ri(4,6,32,32,b2),new ri(4,4,16,16,cc),new ri(8,16,32,32,cc),new ri(8,16,128,128,cc),new ri(8,32,128,256,cc),new ri(32,128,258,1024,cc),new ri(32,258,258,4096,cc)],yL=e=>{e.window_size=2*e.w_size,ns(e.head),e.max_lazy_match=xu[e.level].max_lazy,e.good_match=xu[e.level].good_length,e.nice_match=xu[e.level].nice_length,e.max_chain_length=xu[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=ut-1,e.match_available=0,e.ins_h=0};function xL(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=U0,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(uL*2),this.dyn_dtree=new Uint16Array((2*cL+1)*2),this.bl_tree=new Uint16Array((2*dL+1)*2),ns(this.dyn_ltree),ns(this.dyn_dtree),ns(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(fL+1),this.heap=new Uint16Array(2*Dg+1),ns(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Dg+1),ns(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Bw=e=>{if(!e||!e.state)return is(e,da);e.total_in=e.total_out=0,e.data_type=rL;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?g0:ro,e.adler=t.wrap===2?0:1,t.last_flush=Lo,Xj(t),pi},Hw=e=>{const t=Bw(e);return t===pi&&yL(e.state),t},wL=(e,t)=>!e||!e.state||e.state.wrap!==2?da:(e.state.gzhead=t,pi),Ww=(e,t,n,r,a,i)=>{if(!e)return da;let l=1;if(t===Qj&&(t=6),r<0?(l=0,r=-r):r>15&&(l=2,r-=16),a<1||a>aL||n!==U0||r<8||r>15||t<0||t>9||i<0||i>tL)return is(e,da);r===8&&(r=9);const s=new xL;return e.state=s,s.strm=e,s.wrap=l,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=a+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+ut-1)/ut),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<a+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=i,s.method=n,Hw(e)},EL=(e,t)=>Ww(e,t,U0,iL,lL,nL),SL=(e,t)=>{let n,r;if(!e||!e.state||t>I4||t<0)return e?is(e,da):da;const a=e.state;if(!e.output||!e.input&&e.avail_in!==0||a.status===yu&&t!==ds)return is(e,e.avail_out===0?g2:da);a.strm=e;const i=a.last_flush;if(a.last_flush=t,a.status===g0)if(a.wrap===2)e.adler=0,Et(a,31),Et(a,139),Et(a,8),a.gzhead?(Et(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),Et(a,a.gzhead.time&255),Et(a,a.gzhead.time>>8&255),Et(a,a.gzhead.time>>16&255),Et(a,a.gzhead.time>>24&255),Et(a,a.level===9?2:a.strategy>=f1||a.level<2?4:0),Et(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(Et(a,a.gzhead.extra.length&255),Et(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=Nn(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=Pg):(Et(a,0),Et(a,0),Et(a,0),Et(a,0),Et(a,0),Et(a,a.level===9?2:a.strategy>=f1||a.level<2?4:0),Et(a,pL),a.status=ro);else{let l=U0+(a.w_bits-8<<4)<<8,s=-1;a.strategy>=f1||a.level<2?s=0:a.level<6?s=1:a.level===6?s=2:s=3,l|=s<<6,a.strstart!==0&&(l|=hL),l+=31-l%31,a.status=ro,tu(a,l),a.strstart!==0&&(tu(a,e.adler>>>16),tu(a,e.adler&65535)),e.adler=1}if(a.status===Pg)if(a.gzhead.extra){for(n=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>n&&(e.adler=Nn(e.adler,a.pending_buf,a.pending-n,n)),Zl(e),n=a.pending,a.pending===a.pending_buf_size));)Et(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>n&&(e.adler=Nn(e.adler,a.pending_buf,a.pending-n,n)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=W1)}else a.status=W1;if(a.status===W1)if(a.gzhead.name){n=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>n&&(e.adler=Nn(e.adler,a.pending_buf,a.pending-n,n)),Zl(e),n=a.pending,a.pending===a.pending_buf_size)){r=1;break}a.gzindex<a.gzhead.name.length?r=a.gzhead.name.charCodeAt(a.gzindex++)&255:r=0,Et(a,r)}while(r!==0);a.gzhead.hcrc&&a.pending>n&&(e.adler=Nn(e.adler,a.pending_buf,a.pending-n,n)),r===0&&(a.gzindex=0,a.status=X1)}else a.status=X1;if(a.status===X1)if(a.gzhead.comment){n=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>n&&(e.adler=Nn(e.adler,a.pending_buf,a.pending-n,n)),Zl(e),n=a.pending,a.pending===a.pending_buf_size)){r=1;break}a.gzindex<a.gzhead.comment.length?r=a.gzhead.comment.charCodeAt(a.gzindex++)&255:r=0,Et(a,r)}while(r!==0);a.gzhead.hcrc&&a.pending>n&&(e.adler=Nn(e.adler,a.pending_buf,a.pending-n,n)),r===0&&(a.status=V1)}else a.status=V1;if(a.status===V1&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&Zl(e),a.pending+2<=a.pending_buf_size&&(Et(a,e.adler&255),Et(a,e.adler>>8&255),e.adler=0,a.status=ro)):a.status=ro),a.pending!==0){if(Zl(e),e.avail_out===0)return a.last_flush=-1,pi}else if(e.avail_in===0&&T4(t)<=T4(i)&&t!==ds)return is(e,g2);if(a.status===yu&&e.avail_in!==0)return is(e,g2);if(e.avail_in!==0||a.lookahead!==0||t!==Lo&&a.status!==yu){let l=a.strategy===f1?vL(a,t):a.strategy===eL?bL(a,t):xu[a.level].func(a,t);if((l===go||l===cd)&&(a.status=yu),l===Tn||l===go)return e.avail_out===0&&(a.last_flush=-1),pi;if(l===Tf&&(t===Zj?Yj(a):t!==I4&&(Vj(a,0,0,!1),t===Kj&&(ns(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),Zl(e),e.avail_out===0))return a.last_flush=-1,pi}return t!==ds?pi:a.wrap<=0?_4:(a.wrap===2?(Et(a,e.adler&255),Et(a,e.adler>>8&255),Et(a,e.adler>>16&255),Et(a,e.adler>>24&255),Et(a,e.total_in&255),Et(a,e.total_in>>8&255),Et(a,e.total_in>>16&255),Et(a,e.total_in>>24&255)):(tu(a,e.adler>>>16),tu(a,e.adler&65535)),Zl(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?pi:_4)},kL=e=>{if(!e||!e.state)return da;const t=e.state.status;return t!==g0&&t!==Pg&&t!==W1&&t!==X1&&t!==V1&&t!==ro&&t!==yu?is(e,da):(e.state=null,t===ro?is(e,qj):pi)},CL=(e,t)=>{let n=t.length;if(!e||!e.state)return da;const r=e.state,a=r.wrap;if(a===2||a===1&&r.status!==g0||r.lookahead)return da;if(a===1&&(e.adler=ef(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){a===0&&(ns(r.head),r.strstart=0,r.block_start=0,r.insert=0);let d=new Uint8Array(r.w_size);d.set(t.subarray(n-r.w_size,n),0),t=d,n=r.w_size}const i=e.avail_in,l=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,bo(r);r.lookahead>=ut;){let d=r.strstart,u=r.lookahead-(ut-1);do r.ins_h=us(r,r.ins_h,r.window[d+ut-1]),r.prev[d&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=d,d++;while(--u);r.strstart=d,r.lookahead=ut-1,bo(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=ut-1,r.match_available=0,e.next_in=l,e.input=s,e.avail_in=i,r.wrap=a,pi};var ML=EL,IL=Ww,_L=Hw,TL=Bw,AL=wL,RL=SL,jL=kL,LL=CL,DL="pako deflate (from Nodeca project)",Du={deflateInit:ML,deflateInit2:IL,deflateReset:_L,deflateResetKeep:TL,deflateSetHeader:AL,deflate:RL,deflateEnd:jL,deflateSetDictionary:LL,deflateInfo:DL};const PL=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var NL=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)PL(n,r)&&(e[r]=n[r])}}return e},OL=e=>{let t=0;for(let r=0,a=e.length;r<a;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,a=0,i=e.length;r<i;r++){let l=e[r];n.set(l,a),a+=l.length}return n},b0={assign:NL,flattenChunks:OL};let Xw=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Xw=!1}const tf=new Uint8Array(256);for(let e=0;e<256;e++)tf[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;tf[254]=tf[254]=1;var $L=e=>{let t,n,r,a,i,l=e.length,s=0;for(a=0;a<l;a++)n=e.charCodeAt(a),(n&64512)===55296&&a+1<l&&(r=e.charCodeAt(a+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),a++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),i=0,a=0;i<s;a++)n=e.charCodeAt(a),(n&64512)===55296&&a+1<l&&(r=e.charCodeAt(a+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),a++)),n<128?t[i++]=n:n<2048?(t[i++]=192|n>>>6,t[i++]=128|n&63):n<65536?(t[i++]=224|n>>>12,t[i++]=128|n>>>6&63,t[i++]=128|n&63):(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63,t[i++]=128|n>>>6&63,t[i++]=128|n&63);return t};const zL=(e,t)=>{if(t<65534&&e.subarray&&Xw)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var FL=(e,t)=>{let n,r;const a=t||e.length,i=new Array(a*2);for(r=0,n=0;n<a;){let l=e[n++];if(l<128){i[r++]=l;continue}let s=tf[l];if(s>4){i[r++]=65533,n+=s-1;continue}for(l&=s===2?31:s===3?15:7;s>1&&n<a;)l=l<<6|e[n++]&63,s--;if(s>1){i[r++]=65533;continue}l<65536?i[r++]=l:(l-=65536,i[r++]=55296|l>>10&1023,i[r++]=56320|l&1023)}return zL(i,r)},BL=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+tf[e[n]]>t?n:t},nf={string2buf:$L,buf2string:FL,utf8border:BL};function HL(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Vw=HL;const Gw=Object.prototype.toString,{Z_NO_FLUSH:WL,Z_SYNC_FLUSH:XL,Z_FULL_FLUSH:VL,Z_FINISH:GL,Z_OK:wp,Z_STREAM_END:YL,Z_DEFAULT_COMPRESSION:ZL,Z_DEFAULT_STRATEGY:KL,Z_DEFLATED:qL}=m0;function v0(e){this.options=b0.assign({level:ZL,method:qL,chunkSize:16384,windowBits:15,memLevel:8,strategy:KL},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Vw,this.strm.avail_out=0;let n=Du.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==wp)throw new Error(Uo[n]);if(t.header&&Du.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=nf.string2buf(t.dictionary):Gw.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Du.deflateSetDictionary(this.strm,r),n!==wp)throw new Error(Uo[n]);this._dict_set=!0}}v0.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let a,i;if(this.ended)return!1;for(t===~~t?i=t:i=t===!0?GL:WL,typeof e=="string"?n.input=nf.string2buf(e):Gw.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(i===XL||i===VL)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(a=Du.deflate(n,i),a===YL)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),a=Du.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===wp;if(n.avail_out===0){this.onData(n.output);continue}if(i>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};v0.prototype.onData=function(e){this.chunks.push(e)};v0.prototype.onEnd=function(e){e===wp&&(this.result=b0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function QL(e,t){const n=new v0(t);if(n.push(e,!0),n.err)throw n.msg||Uo[n.err];return n.result}var JL=QL,eD={deflate:JL};const h1=30,tD=12;var nD=function(t,n){let r,a,i,l,s,d,u,o,f,m,U,g,v,y,w,E,S,k,I,T,M,j,D,P;const N=t.state;r=t.next_in,D=t.input,a=r+(t.avail_in-5),i=t.next_out,P=t.output,l=i-(n-t.avail_out),s=i+(t.avail_out-257),d=N.dmax,u=N.wsize,o=N.whave,f=N.wnext,m=N.window,U=N.hold,g=N.bits,v=N.lencode,y=N.distcode,w=(1<<N.lenbits)-1,E=(1<<N.distbits)-1;e:do{g<15&&(U+=D[r++]<<g,g+=8,U+=D[r++]<<g,g+=8),S=v[U&w];t:for(;;){if(k=S>>>24,U>>>=k,g-=k,k=S>>>16&255,k===0)P[i++]=S&65535;else if(k&16){I=S&65535,k&=15,k&&(g<k&&(U+=D[r++]<<g,g+=8),I+=U&(1<<k)-1,U>>>=k,g-=k),g<15&&(U+=D[r++]<<g,g+=8,U+=D[r++]<<g,g+=8),S=y[U&E];n:for(;;){if(k=S>>>24,U>>>=k,g-=k,k=S>>>16&255,k&16){if(T=S&65535,k&=15,g<k&&(U+=D[r++]<<g,g+=8,g<k&&(U+=D[r++]<<g,g+=8)),T+=U&(1<<k)-1,T>d){t.msg="invalid distance too far back",N.mode=h1;break e}if(U>>>=k,g-=k,k=i-l,T>k){if(k=T-k,k>o&&N.sane){t.msg="invalid distance too far back",N.mode=h1;break e}if(M=0,j=m,f===0){if(M+=u-k,k<I){I-=k;do P[i++]=m[M++];while(--k);M=i-T,j=P}}else if(f<k){if(M+=u+f-k,k-=f,k<I){I-=k;do P[i++]=m[M++];while(--k);if(M=0,f<I){k=f,I-=k;do P[i++]=m[M++];while(--k);M=i-T,j=P}}}else if(M+=f-k,k<I){I-=k;do P[i++]=m[M++];while(--k);M=i-T,j=P}for(;I>2;)P[i++]=j[M++],P[i++]=j[M++],P[i++]=j[M++],I-=3;I&&(P[i++]=j[M++],I>1&&(P[i++]=j[M++]))}else{M=i-T;do P[i++]=P[M++],P[i++]=P[M++],P[i++]=P[M++],I-=3;while(I>2);I&&(P[i++]=P[M++],I>1&&(P[i++]=P[M++]))}}else if((k&64)===0){S=y[(S&65535)+(U&(1<<k)-1)];continue n}else{t.msg="invalid distance code",N.mode=h1;break e}break}}else if((k&64)===0){S=v[(S&65535)+(U&(1<<k)-1)];continue t}else if(k&32){N.mode=tD;break e}else{t.msg="invalid literal/length code",N.mode=h1;break e}break}}while(r<a&&i<s);I=g>>3,r-=I,g-=I<<3,U&=(1<<g)-1,t.next_in=r,t.next_out=i,t.avail_in=r<a?5+(a-r):5-(r-a),t.avail_out=i<s?257+(s-i):257-(i-s),N.hold=U,N.bits=g};const dc=15,A4=852,R4=592,j4=0,v2=1,L4=2,rD=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),aD=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),iD=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),lD=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),sD=(e,t,n,r,a,i,l,s)=>{const d=s.bits;let u=0,o=0,f=0,m=0,U=0,g=0,v=0,y=0,w=0,E=0,S,k,I,T,M,j=null,D=0,P;const N=new Uint16Array(dc+1),$=new Uint16Array(dc+1);let z=null,Z=0,K,Q,W;for(u=0;u<=dc;u++)N[u]=0;for(o=0;o<r;o++)N[t[n+o]]++;for(U=d,m=dc;m>=1&&N[m]===0;m--);if(U>m&&(U=m),m===0)return a[i++]=1<<24|64<<16|0,a[i++]=1<<24|64<<16|0,s.bits=1,0;for(f=1;f<m&&N[f]===0;f++);for(U<f&&(U=f),y=1,u=1;u<=dc;u++)if(y<<=1,y-=N[u],y<0)return-1;if(y>0&&(e===j4||m!==1))return-1;for($[1]=0,u=1;u<dc;u++)$[u+1]=$[u]+N[u];for(o=0;o<r;o++)t[n+o]!==0&&(l[$[t[n+o]]++]=o);if(e===j4?(j=z=l,P=19):e===v2?(j=rD,D-=257,z=aD,Z-=257,P=256):(j=iD,z=lD,P=-1),E=0,o=0,u=f,M=i,g=U,v=0,I=-1,w=1<<U,T=w-1,e===v2&&w>A4||e===L4&&w>R4)return 1;for(;;){K=u-v,l[o]<P?(Q=0,W=l[o]):l[o]>P?(Q=z[Z+l[o]],W=j[D+l[o]]):(Q=96,W=0),S=1<<u-v,k=1<<g,f=k;do k-=S,a[M+(E>>v)+k]=K<<24|Q<<16|W|0;while(k!==0);for(S=1<<u-1;E&S;)S>>=1;if(S!==0?(E&=S-1,E+=S):E=0,o++,--N[u]===0){if(u===m)break;u=t[n+l[o]]}if(u>U&&(E&T)!==I){for(v===0&&(v=U),M+=f,g=u-v,y=1<<g;g+v<m&&(y-=N[g+v],!(y<=0));)g++,y<<=1;if(w+=1<<g,e===v2&&w>A4||e===L4&&w>R4)return 1;I=E&T,a[I]=U<<24|g<<16|M-i|0}}return E!==0&&(a[M+E]=u-v<<24|64<<16|0),s.bits=U,0};var Pu=sD;const oD=0,Yw=1,Zw=2,{Z_FINISH:D4,Z_BLOCK:cD,Z_TREES:p1,Z_OK:vo,Z_STREAM_END:dD,Z_NEED_DICT:uD,Z_STREAM_ERROR:ha,Z_DATA_ERROR:Kw,Z_MEM_ERROR:qw,Z_BUF_ERROR:fD,Z_DEFLATED:P4}=m0,Qw=1,N4=2,O4=3,$4=4,z4=5,F4=6,B4=7,H4=8,W4=9,X4=10,Ep=11,Hi=12,y2=13,V4=14,x2=15,G4=16,Y4=17,Z4=18,K4=19,m1=20,U1=21,q4=22,Q4=23,J4=24,ev=25,tv=26,w2=27,nv=28,rv=29,Gt=30,Jw=31,hD=32,pD=852,mD=592,UD=15,gD=UD,av=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function bD(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const eE=e=>{if(!e||!e.state)return ha;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Qw,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(pD),t.distcode=t.distdyn=new Int32Array(mD),t.sane=1,t.back=-1,vo},tE=e=>{if(!e||!e.state)return ha;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,eE(e)},nE=(e,t)=>{let n;if(!e||!e.state)return ha;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?ha:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,tE(e))},rE=(e,t)=>{if(!e)return ha;const n=new bD;e.state=n,n.window=null;const r=nE(e,t);return r!==vo&&(e.state=null),r},vD=e=>rE(e,gD);let iv=!0,E2,S2;const yD=e=>{if(iv){E2=new Int32Array(512),S2=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Pu(Yw,e.lens,0,288,E2,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Pu(Zw,e.lens,0,32,S2,0,e.work,{bits:5}),iv=!1}e.lencode=E2,e.lenbits=9,e.distcode=S2,e.distbits=5},aE=(e,t,n,r)=>{let a;const i=e.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),r>=i.wsize?(i.window.set(t.subarray(n-i.wsize,n),0),i.wnext=0,i.whave=i.wsize):(a=i.wsize-i.wnext,a>r&&(a=r),i.window.set(t.subarray(n-r,n-r+a),i.wnext),r-=a,r?(i.window.set(t.subarray(n-r,n),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=a,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=a))),0},xD=(e,t)=>{let n,r,a,i,l,s,d,u,o,f,m,U,g,v,y=0,w,E,S,k,I,T,M,j;const D=new Uint8Array(4);let P,N;const $=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return ha;n=e.state,n.mode===Hi&&(n.mode=y2),l=e.next_out,a=e.output,d=e.avail_out,i=e.next_in,r=e.input,s=e.avail_in,u=n.hold,o=n.bits,f=s,m=d,j=vo;e:for(;;)switch(n.mode){case Qw:if(n.wrap===0){n.mode=y2;break}for(;o<16;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}if(n.wrap&2&&u===35615){n.check=0,D[0]=u&255,D[1]=u>>>8&255,n.check=Nn(n.check,D,2,0),u=0,o=0,n.mode=N4;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=Gt;break}if((u&15)!==P4){e.msg="unknown compression method",n.mode=Gt;break}if(u>>>=4,o-=4,M=(u&15)+8,n.wbits===0)n.wbits=M;else if(M>n.wbits){e.msg="invalid window size",n.mode=Gt;break}n.dmax=1<<n.wbits,e.adler=n.check=1,n.mode=u&512?X4:Hi,u=0,o=0;break;case N4:for(;o<16;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}if(n.flags=u,(n.flags&255)!==P4){e.msg="unknown compression method",n.mode=Gt;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Gt;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&(D[0]=u&255,D[1]=u>>>8&255,n.check=Nn(n.check,D,2,0)),u=0,o=0,n.mode=O4;case O4:for(;o<32;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}n.head&&(n.head.time=u),n.flags&512&&(D[0]=u&255,D[1]=u>>>8&255,D[2]=u>>>16&255,D[3]=u>>>24&255,n.check=Nn(n.check,D,4,0)),u=0,o=0,n.mode=$4;case $4:for(;o<16;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&(D[0]=u&255,D[1]=u>>>8&255,n.check=Nn(n.check,D,2,0)),u=0,o=0,n.mode=z4;case z4:if(n.flags&1024){for(;o<16;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&(D[0]=u&255,D[1]=u>>>8&255,n.check=Nn(n.check,D,2,0)),u=0,o=0}else n.head&&(n.head.extra=null);n.mode=F4;case F4:if(n.flags&1024&&(U=n.length,U>s&&(U=s),U&&(n.head&&(M=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(i,i+U),M)),n.flags&512&&(n.check=Nn(n.check,r,U,i)),s-=U,i+=U,n.length-=U),n.length))break e;n.length=0,n.mode=B4;case B4:if(n.flags&2048){if(s===0)break e;U=0;do M=r[i+U++],n.head&&M&&n.length<65536&&(n.head.name+=String.fromCharCode(M));while(M&&U<s);if(n.flags&512&&(n.check=Nn(n.check,r,U,i)),s-=U,i+=U,M)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=H4;case H4:if(n.flags&4096){if(s===0)break e;U=0;do M=r[i+U++],n.head&&M&&n.length<65536&&(n.head.comment+=String.fromCharCode(M));while(M&&U<s);if(n.flags&512&&(n.check=Nn(n.check,r,U,i)),s-=U,i+=U,M)break e}else n.head&&(n.head.comment=null);n.mode=W4;case W4:if(n.flags&512){for(;o<16;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}if(u!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Gt;break}u=0,o=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Hi;break;case X4:for(;o<32;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}e.adler=n.check=av(u),u=0,o=0,n.mode=Ep;case Ep:if(n.havedict===0)return e.next_out=l,e.avail_out=d,e.next_in=i,e.avail_in=s,n.hold=u,n.bits=o,uD;e.adler=n.check=1,n.mode=Hi;case Hi:if(t===cD||t===p1)break e;case y2:if(n.last){u>>>=o&7,o-=o&7,n.mode=w2;break}for(;o<3;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}switch(n.last=u&1,u>>>=1,o-=1,u&3){case 0:n.mode=V4;break;case 1:if(yD(n),n.mode=m1,t===p1){u>>>=2,o-=2;break e}break;case 2:n.mode=Y4;break;case 3:e.msg="invalid block type",n.mode=Gt}u>>>=2,o-=2;break;case V4:for(u>>>=o&7,o-=o&7;o<32;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Gt;break}if(n.length=u&65535,u=0,o=0,n.mode=x2,t===p1)break e;case x2:n.mode=G4;case G4:if(U=n.length,U){if(U>s&&(U=s),U>d&&(U=d),U===0)break e;a.set(r.subarray(i,i+U),l),s-=U,i+=U,d-=U,l+=U,n.length-=U;break}n.mode=Hi;break;case Y4:for(;o<14;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}if(n.nlen=(u&31)+257,u>>>=5,o-=5,n.ndist=(u&31)+1,u>>>=5,o-=5,n.ncode=(u&15)+4,u>>>=4,o-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Gt;break}n.have=0,n.mode=Z4;case Z4:for(;n.have<n.ncode;){for(;o<3;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}n.lens[$[n.have++]]=u&7,u>>>=3,o-=3}for(;n.have<19;)n.lens[$[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,P={bits:n.lenbits},j=Pu(oD,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,j){e.msg="invalid code lengths set",n.mode=Gt;break}n.have=0,n.mode=K4;case K4:for(;n.have<n.nlen+n.ndist;){for(;y=n.lencode[u&(1<<n.lenbits)-1],w=y>>>24,E=y>>>16&255,S=y&65535,!(w<=o);){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}if(S<16)u>>>=w,o-=w,n.lens[n.have++]=S;else{if(S===16){for(N=w+2;o<N;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}if(u>>>=w,o-=w,n.have===0){e.msg="invalid bit length repeat",n.mode=Gt;break}M=n.lens[n.have-1],U=3+(u&3),u>>>=2,o-=2}else if(S===17){for(N=w+3;o<N;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}u>>>=w,o-=w,M=0,U=3+(u&7),u>>>=3,o-=3}else{for(N=w+7;o<N;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}u>>>=w,o-=w,M=0,U=11+(u&127),u>>>=7,o-=7}if(n.have+U>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Gt;break}for(;U--;)n.lens[n.have++]=M}}if(n.mode===Gt)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Gt;break}if(n.lenbits=9,P={bits:n.lenbits},j=Pu(Yw,n.lens,0,n.nlen,n.lencode,0,n.work,P),n.lenbits=P.bits,j){e.msg="invalid literal/lengths set",n.mode=Gt;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},j=Pu(Zw,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,P),n.distbits=P.bits,j){e.msg="invalid distances set",n.mode=Gt;break}if(n.mode=m1,t===p1)break e;case m1:n.mode=U1;case U1:if(s>=6&&d>=258){e.next_out=l,e.avail_out=d,e.next_in=i,e.avail_in=s,n.hold=u,n.bits=o,nD(e,m),l=e.next_out,a=e.output,d=e.avail_out,i=e.next_in,r=e.input,s=e.avail_in,u=n.hold,o=n.bits,n.mode===Hi&&(n.back=-1);break}for(n.back=0;y=n.lencode[u&(1<<n.lenbits)-1],w=y>>>24,E=y>>>16&255,S=y&65535,!(w<=o);){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}if(E&&(E&240)===0){for(k=w,I=E,T=S;y=n.lencode[T+((u&(1<<k+I)-1)>>k)],w=y>>>24,E=y>>>16&255,S=y&65535,!(k+w<=o);){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}u>>>=k,o-=k,n.back+=k}if(u>>>=w,o-=w,n.back+=w,n.length=S,E===0){n.mode=tv;break}if(E&32){n.back=-1,n.mode=Hi;break}if(E&64){e.msg="invalid literal/length code",n.mode=Gt;break}n.extra=E&15,n.mode=q4;case q4:if(n.extra){for(N=n.extra;o<N;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,o-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Q4;case Q4:for(;y=n.distcode[u&(1<<n.distbits)-1],w=y>>>24,E=y>>>16&255,S=y&65535,!(w<=o);){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}if((E&240)===0){for(k=w,I=E,T=S;y=n.distcode[T+((u&(1<<k+I)-1)>>k)],w=y>>>24,E=y>>>16&255,S=y&65535,!(k+w<=o);){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}u>>>=k,o-=k,n.back+=k}if(u>>>=w,o-=w,n.back+=w,E&64){e.msg="invalid distance code",n.mode=Gt;break}n.offset=S,n.extra=E&15,n.mode=J4;case J4:if(n.extra){for(N=n.extra;o<N;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,o-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Gt;break}n.mode=ev;case ev:if(d===0)break e;if(U=m-d,n.offset>U){if(U=n.offset-U,U>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Gt;break}U>n.wnext?(U-=n.wnext,g=n.wsize-U):g=n.wnext-U,U>n.length&&(U=n.length),v=n.window}else v=a,g=l-n.offset,U=n.length;U>d&&(U=d),d-=U,n.length-=U;do a[l++]=v[g++];while(--U);n.length===0&&(n.mode=U1);break;case tv:if(d===0)break e;a[l++]=n.length,d--,n.mode=U1;break;case w2:if(n.wrap){for(;o<32;){if(s===0)break e;s--,u|=r[i++]<<o,o+=8}if(m-=d,e.total_out+=m,n.total+=m,m&&(e.adler=n.check=n.flags?Nn(n.check,a,m,l-m):ef(n.check,a,m,l-m)),m=d,(n.flags?u:av(u))!==n.check){e.msg="incorrect data check",n.mode=Gt;break}u=0,o=0}n.mode=nv;case nv:if(n.wrap&&n.flags){for(;o<32;){if(s===0)break e;s--,u+=r[i++]<<o,o+=8}if(u!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Gt;break}u=0,o=0}n.mode=rv;case rv:j=dD;break e;case Gt:j=Kw;break e;case Jw:return qw;case hD:default:return ha}return e.next_out=l,e.avail_out=d,e.next_in=i,e.avail_in=s,n.hold=u,n.bits=o,(n.wsize||m!==e.avail_out&&n.mode<Gt&&(n.mode<w2||t!==D4))&&aE(e,e.output,e.next_out,m-e.avail_out),f-=e.avail_in,m-=e.avail_out,e.total_in+=f,e.total_out+=m,n.total+=m,n.wrap&&m&&(e.adler=n.check=n.flags?Nn(n.check,a,m,e.next_out-m):ef(n.check,a,m,e.next_out-m)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Hi?128:0)+(n.mode===m1||n.mode===x2?256:0),(f===0&&m===0||t===D4)&&j===vo&&(j=fD),j},wD=e=>{if(!e||!e.state)return ha;let t=e.state;return t.window&&(t.window=null),e.state=null,vo},ED=(e,t)=>{if(!e||!e.state)return ha;const n=e.state;return(n.wrap&2)===0?ha:(n.head=t,t.done=!1,vo)},SD=(e,t)=>{const n=t.length;let r,a,i;return!e||!e.state||(r=e.state,r.wrap!==0&&r.mode!==Ep)?ha:r.mode===Ep&&(a=1,a=ef(a,t,n,0),a!==r.check)?Kw:(i=aE(e,t,n,n),i?(r.mode=Jw,qw):(r.havedict=1,vo))};var kD=tE,CD=nE,MD=eE,ID=vD,_D=rE,TD=xD,AD=wD,RD=ED,jD=SD,LD="pako inflate (from Nodeca project)",Ki={inflateReset:kD,inflateReset2:CD,inflateResetKeep:MD,inflateInit:ID,inflateInit2:_D,inflate:TD,inflateEnd:AD,inflateGetHeader:RD,inflateSetDictionary:jD,inflateInfo:LD};function DD(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var PD=DD;const iE=Object.prototype.toString,{Z_NO_FLUSH:ND,Z_FINISH:OD,Z_OK:rf,Z_STREAM_END:k2,Z_NEED_DICT:C2,Z_STREAM_ERROR:$D,Z_DATA_ERROR:lv,Z_MEM_ERROR:zD}=m0;function y0(e){this.options=b0.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Vw,this.strm.avail_out=0;let n=Ki.inflateInit2(this.strm,t.windowBits);if(n!==rf)throw new Error(Uo[n]);if(this.header=new PD,Ki.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=nf.string2buf(t.dictionary):iE.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Ki.inflateSetDictionary(this.strm,t.dictionary),n!==rf)))throw new Error(Uo[n])}y0.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,a=this.options.dictionary;let i,l,s;if(this.ended)return!1;for(t===~~t?l=t:l=t===!0?OD:ND,iE.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=Ki.inflate(n,l),i===C2&&a&&(i=Ki.inflateSetDictionary(n,a),i===rf?i=Ki.inflate(n,l):i===lv&&(i=C2));n.avail_in>0&&i===k2&&n.state.wrap>0&&e[n.next_in]!==0;)Ki.inflateReset(n),i=Ki.inflate(n,l);switch(i){case $D:case lv:case C2:case zD:return this.onEnd(i),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||i===k2))if(this.options.to==="string"){let d=nf.utf8border(n.output,n.next_out),u=n.next_out-d,o=nf.buf2string(n.output,d);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(d,d+u),0),this.onData(o)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(i===rf&&s===0)){if(i===k2)return i=Ki.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};y0.prototype.onData=function(e){this.chunks.push(e)};y0.prototype.onEnd=function(e){e===rf&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=b0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function FD(e,t){const n=new y0(t);if(n.push(e),n.err)throw n.msg||Uo[n.err];return n.result}var BD=FD,HD={inflate:BD};const{deflate:WD}=eD,{inflate:XD}=HD;var VD=WD,GD=XD;const YD="#ffffff",ZD="#000000",KD=["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],qD=["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],QD=["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],JD=["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],eP=["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],tP=["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],nP=["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],rP=["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],aP=["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],iP=["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lP=["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],sP=["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],oP=["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"],Fn={white:YD,black:ZD,gray:KD,red:qD,pink:QD,grape:JD,violet:eP,indigo:tP,blue:nP,cyan:rP,teal:aP,green:iP,lime:lP,yellow:sP,orange:oP};let o5=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");var M2,sv;function cP(){if(sv)return M2;sv=1;var e="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt,d=typeof rs=="object"&&rs&&rs.Object===Object&&rs,u=typeof self=="object"&&self&&self.Object===Object&&self,o=d||u||Function("return this")(),f=Object.prototype,m=f.toString,U=Math.max,g=Math.min,v=function(){return o.Date.now()};function y(T,M,j){var D,P,N,$,z,Z,K=0,Q=!1,W=!1,q=!0;if(typeof T!="function")throw new TypeError(e);M=I(M)||0,E(j)&&(Q=!!j.leading,W="maxWait"in j,N=W?U(I(j.maxWait)||0,M):N,q="trailing"in j?!!j.trailing:q);function V(te){var de=D,me=P;return D=P=void 0,K=te,$=T.apply(me,de),$}function ee(te){return K=te,z=setTimeout(ge,M),Q?V(te):$}function X(te){var de=te-Z,me=te-K,fe=M-de;return W?g(fe,N-me):fe}function se(te){var de=te-Z,me=te-K;return Z===void 0||de>=M||de<0||W&&me>=N}function ge(){var te=v();if(se(te))return _e(te);z=setTimeout(ge,X(te))}function _e(te){return z=void 0,q&&D?V(te):(D=P=void 0,$)}function Y(){z!==void 0&&clearTimeout(z),K=0,D=Z=P=z=void 0}function H(){return z===void 0?$:_e(v())}function re(){var te=v(),de=se(te);if(D=arguments,P=this,Z=te,de){if(z===void 0)return ee(Z);if(W)return z=setTimeout(ge,M),V(Z)}return z===void 0&&(z=setTimeout(ge,M)),$}return re.cancel=Y,re.flush=H,re}function w(T,M,j){var D=!0,P=!0;if(typeof T!="function")throw new TypeError(e);return E(j)&&(D="leading"in j?!!j.leading:D,P="trailing"in j?!!j.trailing:P),y(T,M,{leading:D,maxWait:M,trailing:P})}function E(T){var M=typeof T;return!!T&&(M=="object"||M=="function")}function S(T){return!!T&&typeof T=="object"}function k(T){return typeof T=="symbol"||S(T)&&m.call(T)==n}function I(T){if(typeof T=="number")return T;if(k(T))return t;if(E(T)){var M=typeof T.valueOf=="function"?T.valueOf():T;T=E(M)?M+"":M}if(typeof T!="string")return T===0?T:+T;T=T.replace(r,"");var j=i.test(T);return j||l.test(T)?s(T.slice(2),j?2:8):a.test(T)?t:+T}return M2=w,M2}var dP=cP();const Af=_i(dP);var G1={exports:{}},uP=G1.exports,ov;function fP(){return ov||(ov=1,(function(e,t){(function(n,r){e.exports=r()})(uP,function(){var n=function(){this._listeners={}};n.prototype.addEventListener=function(u,o){this._listeners[u]=this._listeners[u]||[],this._listeners[u].indexOf(o)<0&&this._listeners[u].push(o)},n.prototype.removeEventListener=function(u,o){if(this._listeners[u]){var f=this._listeners[u].indexOf(o);f>=0&&this._listeners[u].splice(f,1)}},n.prototype.dispatchEvent=function(u){if(this._listeners[u.type]&&this._listeners[u.type].length)for(var o=this._listeners[u.type].slice(),f=0,m=o.length;f<m;++f)o[f].call(this,u)};var r=function(u){return typeof u.constructor=="function"&&u.constructor.name==="GeneratorFunction"},a=function(u){return{next:function(){var o=u();return o?{value:o}:{done:!0}}}},i=function(u){var o=!1;return{next:function(){return o?{done:!0}:(o=!0,{value:u})}}},l=function(u,o){var f=typeof u;if(f==="object"){if(typeof u.next=="function")return u;if(typeof u.then=="function")return i(u)}return f==="function"?r(u)?u():a(u):i(o.resolve(u))},s=function(u,o,f){this.target=u,this.type=o,this.data=f},d=function(u,o,f){if(n.call(this),typeof o!="number"||Math.floor(o)!==o||o<1)throw new Error("Invalid concurrency");this._concurrency=o,this._options=f||{},this._options.promise=this._options.promise||Promise,this._iterator=l(u,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return d.prototype=new n,d.prototype.constructor=d,d.prototype.concurrency=function(u){return typeof u<"u"&&(this._concurrency=u,this.active()&&this._proceed()),this._concurrency},d.prototype.size=function(){return this._size},d.prototype.active=function(){return!!this._promise},d.prototype.promise=function(){return this._promise},d.prototype.start=function(){var u=this,o=this._options.promise;return this._promise=new o(function(f,m){u._callbacks={reject:m,resolve:f},u._proceed()}),this._promise},d.prototype._fireEvent=function(u,o){this.dispatchEvent(new s(this,u,o))},d.prototype._settle=function(u){u?this._callbacks.reject(u):this._callbacks.resolve(),this._promise=null,this._callbacks=null},d.prototype._onPooledPromiseFulfilled=function(u,o){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:u,result:o}),this._proceed())},d.prototype._onPooledPromiseRejected=function(u,o){this._size--,this.active()&&(this._fireEvent("rejected",{promise:u,error:o}),this._settle(o||new Error("Unknown error")))},d.prototype._trackPromise=function(u){var o=this;u.then(function(f){o._onPooledPromiseFulfilled(u,f)},function(f){o._onPooledPromiseRejected(u,f)}).catch(function(f){o._settle(new Error("Promise processing failed: "+f))})},d.prototype._proceed=function(){if(!this._done){for(var u={done:!1};this._size<this._concurrency&&!(u=this._iterator.next()).done;)this._size++,this._trackPromise(u.value);this._done=u===null||!!u.done}this._done&&this._size===0&&this._settle()},d.PromisePoolEvent=s,d.PromisePool=d,d})})(G1)),G1.exports}var hP=fP();const pP=_i(hP);function Ng(e,t,n){if(e&&e.length){const[r,a]=t,i=Math.PI/180*n,l=Math.cos(i),s=Math.sin(i);for(const d of e){const[u,o]=d;d[0]=(u-r)*l-(o-a)*s+r,d[1]=(u-r)*s+(o-a)*l+a}}}function mP(e,t,n){const r=[];e.forEach(a=>r.push(...a)),Ng(r,t,n)}function UP(e,t){return e[0]===t[0]&&e[1]===t[1]}function gP(e,t,n,r=1){const a=n,i=Math.max(t,.1),l=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,s=[0,0];if(a)for(const u of l)Ng(u,s,a);const d=bP(l,i,r);if(a){for(const u of l)Ng(u,s,-a);mP(d,s,-a)}return d}function bP(e,t,n){const r=[];for(const u of e){const o=[...u];UP(o[0],o[o.length-1])||o.push([o[0][0],o[0][1]]),o.length>2&&r.push(o)}const a=[];t=Math.max(t,.1);const i=[];for(const u of r)for(let o=0;o<u.length-1;o++){const f=u[o],m=u[o+1];if(f[1]!==m[1]){const U=Math.min(f[1],m[1]);i.push({ymin:U,ymax:Math.max(f[1],m[1]),x:U===f[1]?f[0]:m[0],islope:(m[0]-f[0])/(m[1]-f[1])})}}if(i.sort((u,o)=>u.ymin<o.ymin?-1:u.ymin>o.ymin?1:u.x<o.x?-1:u.x>o.x?1:u.ymax===o.ymax?0:(u.ymax-o.ymax)/Math.abs(u.ymax-o.ymax)),!i.length)return a;let l=[],s=i[0].ymin,d=0;for(;l.length||i.length;){if(i.length){let u=-1;for(let f=0;f<i.length&&!(i[f].ymin>s);f++)u=f;i.splice(0,u+1).forEach(f=>{l.push({s,edge:f})})}if(l=l.filter(u=>!(u.edge.ymax<=s)),l.sort((u,o)=>u.edge.x===o.edge.x?0:(u.edge.x-o.edge.x)/Math.abs(u.edge.x-o.edge.x)),(n!==1||d%t===0)&&l.length>1)for(let u=0;u<l.length;u=u+2){const o=u+1;if(o>=l.length)break;const f=l[u].edge,m=l[o].edge;a.push([[Math.round(f.x),s],[Math.round(m.x),s]])}s+=n,l.forEach(u=>{u.edge.x=u.edge.x+n*u.edge.islope}),d++}return a}function Rf(e,t){var n;const r=t.hachureAngle+90;let a=t.hachureGap;a<0&&(a=t.strokeWidth*4),a=Math.max(a,.1);let i=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(i=a),gP(e,a,r,i||1)}class c5{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const r=Rf(t,n);return{type:"fillSketch",ops:this.renderLines(r,n)}}renderLines(t,n){const r=[];for(const a of t)r.push(...this.helper.doubleLineOps(a[0][0],a[0][1],a[1][0],a[1][1],n));return r}}function x0(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}class vP extends c5{fillPolygons(t,n){let r=n.hachureGap;r<0&&(r=n.strokeWidth*4),r=Math.max(r,.1);const a=Object.assign({},n,{hachureGap:r}),i=Rf(t,a),l=Math.PI/180*n.hachureAngle,s=[],d=r*.5*Math.cos(l),u=r*.5*Math.sin(l);for(const[f,m]of i)x0([f,m])&&s.push([[f[0]-d,f[1]+u],[...m]],[[f[0]+d,f[1]-u],[...m]]);return{type:"fillSketch",ops:this.renderLines(s,n)}}}class yP extends c5{fillPolygons(t,n){const r=this._fillPolygons(t,n),a=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),i=this._fillPolygons(t,a);return r.ops=r.ops.concat(i.ops),r}}class xP{constructor(t){this.helper=t}fillPolygons(t,n){n=Object.assign({},n,{hachureAngle:0});const r=Rf(t,n);return this.dotsOnLines(r,n)}dotsOnLines(t,n){const r=[];let a=n.hachureGap;a<0&&(a=n.strokeWidth*4),a=Math.max(a,.1);let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const l=a/4;for(const s of t){const d=x0(s),u=d/a,o=Math.ceil(u)-1,f=d-o*a,m=(s[0][0]+s[1][0])/2-a/4,U=Math.min(s[0][1],s[1][1]);for(let g=0;g<o;g++){const v=U+f+g*a,y=m-l+Math.random()*2*l,w=v-l+Math.random()*2*l,E=this.helper.ellipse(y,w,i,i,n);r.push(...E.ops)}}return{type:"fillSketch",ops:r}}}class wP{constructor(t){this.helper=t}fillPolygons(t,n){const r=Rf(t,n);return{type:"fillSketch",ops:this.dashedLine(r,n)}}dashedLine(t,n){const r=n.dashOffset<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashOffset,a=n.dashGap<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashGap,i=[];return t.forEach(l=>{const s=x0(l),d=Math.floor(s/(r+a)),u=(s+a-d*(r+a))/2;let o=l[0],f=l[1];o[0]>f[0]&&(o=l[1],f=l[0]);const m=Math.atan((f[1]-o[1])/(f[0]-o[0]));for(let U=0;U<d;U++){const g=U*(r+a),v=g+r,y=[o[0]+g*Math.cos(m)+u*Math.cos(m),o[1]+g*Math.sin(m)+u*Math.sin(m)],w=[o[0]+v*Math.cos(m)+u*Math.cos(m),o[1]+v*Math.sin(m)+u*Math.sin(m)];i.push(...this.helper.doubleLineOps(y[0],y[1],w[0],w[1],n))}}),i}}class EP{constructor(t){this.helper=t}fillPolygons(t,n){const r=n.hachureGap<0?n.strokeWidth*4:n.hachureGap,a=n.zigzagOffset<0?r:n.zigzagOffset;n=Object.assign({},n,{hachureGap:r+a});const i=Rf(t,n);return{type:"fillSketch",ops:this.zigzagLines(i,a,n)}}zigzagLines(t,n,r){const a=[];return t.forEach(i=>{const l=x0(i),s=Math.round(l/(2*n));let d=i[0],u=i[1];d[0]>u[0]&&(d=i[1],u=i[0]);const o=Math.atan((u[1]-d[1])/(u[0]-d[0]));for(let f=0;f<s;f++){const m=f*2*n,U=(f+1)*2*n,g=Math.sqrt(2*Math.pow(n,2)),v=[d[0]+m*Math.cos(o),d[1]+m*Math.sin(o)],y=[d[0]+U*Math.cos(o),d[1]+U*Math.sin(o)],w=[v[0]+g*Math.cos(o+Math.PI/4),v[1]+g*Math.sin(o+Math.PI/4)];a.push(...this.helper.doubleLineOps(v[0],v[1],w[0],w[1],r),...this.helper.doubleLineOps(w[0],w[1],y[0],y[1],r))}}),a}}const Er={};function SP(e,t){let n=e.fillStyle||"hachure";if(!Er[n])switch(n){case"zigzag":Er[n]||(Er[n]=new vP(t));break;case"cross-hatch":Er[n]||(Er[n]=new yP(t));break;case"dots":Er[n]||(Er[n]=new xP(t));break;case"dashed":Er[n]||(Er[n]=new wP(t));break;case"zigzag-line":Er[n]||(Er[n]=new EP(t));break;case"hachure":default:n="hachure",Er[n]||(Er[n]=new c5(t));break}return Er[n]}function kP(){return Math.floor(Math.random()*2**31)}class lE{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const CP=0,Og=1,sE=2,g1={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function MP(e){const t=new Array;for(;e!=="";)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:CP,text:RegExp.$1},e=e.substr(RegExp.$1.length);else if(e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))t[t.length]={type:Og,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length);else return[];return t[t.length]={type:sE,text:""},t}function I2(e,t){return e.type===t}function d5(e){const t=[],n=MP(e);let r="BOD",a=0,i=n[a];for(;!I2(i,sE);){let l=0;const s=[];if(r==="BOD")if(i.text==="M"||i.text==="m")a++,l=g1[i.text],r=i.text;else return d5("M0,0"+e);else I2(i,Og)?l=g1[r]:(a++,l=g1[i.text],r=i.text);if(a+l<n.length){for(let d=a;d<a+l;d++){const u=n[d];if(I2(u,Og))s[s.length]=+u.text;else throw new Error("Param not a number: "+r+","+u.text)}if(typeof g1[r]=="number"){const d={key:r,data:s};t.push(d),a+=l,i=n[a],r==="M"&&(r="L"),r==="m"&&(r="l")}else throw new Error("Bad segment: "+r)}else throw new Error("Path data ended short")}return t}function oE(e){let t=0,n=0,r=0,a=0;const i=[];for(const{key:l,data:s}of e)switch(l){case"M":i.push({key:"M",data:[...s]}),[t,n]=s,[r,a]=s;break;case"m":t+=s[0],n+=s[1],i.push({key:"M",data:[t,n]}),r=t,a=n;break;case"L":i.push({key:"L",data:[...s]}),[t,n]=s;break;case"l":t+=s[0],n+=s[1],i.push({key:"L",data:[t,n]});break;case"C":i.push({key:"C",data:[...s]}),t=s[4],n=s[5];break;case"c":{const d=s.map((u,o)=>o%2?u+n:u+t);i.push({key:"C",data:d}),t=d[4],n=d[5];break}case"Q":i.push({key:"Q",data:[...s]}),t=s[2],n=s[3];break;case"q":{const d=s.map((u,o)=>o%2?u+n:u+t);i.push({key:"Q",data:d}),t=d[2],n=d[3];break}case"A":i.push({key:"A",data:[...s]}),t=s[5],n=s[6];break;case"a":t+=s[5],n+=s[6],i.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case"H":i.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],i.push({key:"H",data:[t]});break;case"V":i.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],i.push({key:"V",data:[n]});break;case"S":i.push({key:"S",data:[...s]}),t=s[2],n=s[3];break;case"s":{const d=s.map((u,o)=>o%2?u+n:u+t);i.push({key:"S",data:d}),t=d[2],n=d[3];break}case"T":i.push({key:"T",data:[...s]}),t=s[0],n=s[1];break;case"t":t+=s[0],n+=s[1],i.push({key:"T",data:[t,n]});break;case"Z":case"z":i.push({key:"Z",data:[]}),t=r,n=a;break}return i}function cE(e){const t=[];let n="",r=0,a=0,i=0,l=0,s=0,d=0;for(const{key:u,data:o}of e){switch(u){case"M":t.push({key:"M",data:[...o]}),[r,a]=o,[i,l]=o;break;case"C":t.push({key:"C",data:[...o]}),r=o[4],a=o[5],s=o[2],d=o[3];break;case"L":t.push({key:"L",data:[...o]}),[r,a]=o;break;case"H":r=o[0],t.push({key:"L",data:[r,a]});break;case"V":a=o[0],t.push({key:"L",data:[r,a]});break;case"S":{let f=0,m=0;n==="C"||n==="S"?(f=r+(r-s),m=a+(a-d)):(f=r,m=a),t.push({key:"C",data:[f,m,...o]}),s=o[0],d=o[1],r=o[2],a=o[3];break}case"T":{const[f,m]=o;let U=0,g=0;n==="Q"||n==="T"?(U=r+(r-s),g=a+(a-d)):(U=r,g=a);const v=r+2*(U-r)/3,y=a+2*(g-a)/3,w=f+2*(U-f)/3,E=m+2*(g-m)/3;t.push({key:"C",data:[v,y,w,E,f,m]}),s=U,d=g,r=f,a=m;break}case"Q":{const[f,m,U,g]=o,v=r+2*(f-r)/3,y=a+2*(m-a)/3,w=U+2*(f-U)/3,E=g+2*(m-g)/3;t.push({key:"C",data:[v,y,w,E,U,g]}),s=f,d=m,r=U,a=g;break}case"A":{const f=Math.abs(o[0]),m=Math.abs(o[1]),U=o[2],g=o[3],v=o[4],y=o[5],w=o[6];f===0||m===0?(t.push({key:"C",data:[r,a,y,w,y,w]}),r=y,a=w):(r!==y||a!==w)&&(dE(r,a,y,w,f,m,U,g,v).forEach(function(S){t.push({key:"C",data:S})}),r=y,a=w);break}case"Z":t.push({key:"Z",data:[]}),r=i,a=l;break}n=u}return t}function IP(e){return Math.PI*e/180}function nu(e,t,n){const r=e*Math.cos(n)-t*Math.sin(n),a=e*Math.sin(n)+t*Math.cos(n);return[r,a]}function dE(e,t,n,r,a,i,l,s,d,u){const o=IP(l);let f=[],m=0,U=0,g=0,v=0;if(u)[m,U,g,v]=u;else{[e,t]=nu(e,t,-o),[n,r]=nu(n,r,-o);const $=(e-n)/2,z=(t-r)/2;let Z=$*$/(a*a)+z*z/(i*i);Z>1&&(Z=Math.sqrt(Z),a=Z*a,i=Z*i);const K=s===d?-1:1,Q=a*a,W=i*i,q=Q*W-Q*z*z-W*$*$,V=Q*z*z+W*$*$,ee=K*Math.sqrt(Math.abs(q/V));g=ee*a*z/i+(e+n)/2,v=ee*-i*$/a+(t+r)/2,m=Math.asin(parseFloat(((t-v)/i).toFixed(9))),U=Math.asin(parseFloat(((r-v)/i).toFixed(9))),e<g&&(m=Math.PI-m),n<g&&(U=Math.PI-U),m<0&&(m=Math.PI*2+m),U<0&&(U=Math.PI*2+U),d&&m>U&&(m=m-Math.PI*2),!d&&U>m&&(U=U-Math.PI*2)}let y=U-m;if(Math.abs(y)>Math.PI*120/180){const $=U,z=n,Z=r;d&&U>m?U=m+Math.PI*120/180*1:U=m+Math.PI*120/180*-1,n=g+a*Math.cos(U),r=v+i*Math.sin(U),f=dE(n,r,z,Z,a,i,l,0,d,[U,$,g,v])}y=U-m;const w=Math.cos(m),E=Math.sin(m),S=Math.cos(U),k=Math.sin(U),I=Math.tan(y/4),T=4/3*a*I,M=4/3*i*I,j=[e,t],D=[e+T*E,t-M*w],P=[n+T*k,r-M*S],N=[n,r];if(D[0]=2*j[0]-D[0],D[1]=2*j[1]-D[1],u)return[D,P,N].concat(f);{f=[D,P,N].concat(f);const $=[];for(let z=0;z<f.length;z+=3){const Z=nu(f[z][0],f[z][1],o),K=nu(f[z+1][0],f[z+1][1],o),Q=nu(f[z+2][0],f[z+2][1],o);$.push([Z[0],Z[1],K[0],K[1],Q[0],Q[1]])}return $}}const _P={randOffset:LP,randOffsetWithRange:DP,ellipse:RP,doubleLineOps:PP};function uE(e,t,n,r,a){return{type:"path",ops:il(e,t,n,r,a)}}function Y1(e,t,n){const r=(e||[]).length;if(r>2){const a=[];for(let i=0;i<r-1;i++)a.push(...il(e[i][0],e[i][1],e[i+1][0],e[i+1][1],n));return t&&a.push(...il(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:a}}else if(r===2)return uE(e[0][0],e[0][1],e[1][0],e[1][1],n);return{type:"path",ops:[]}}function TP(e,t){return Y1(e,!0,t)}function AP(e,t,n,r,a){const i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];return TP(i,a)}function cv(e,t){let n=hv(e,1*(1+t.roughness*.2),t);if(!t.disableMultiStroke){const r=hv(e,1.5*(1+t.roughness*.22),NP(t));n=n.concat(r)}return{type:"path",ops:n}}function RP(e,t,n,r,a){const i=fE(n,r,a);return $g(e,t,a,i).opset}function fE(e,t,n){const r=Math.sqrt(Math.PI*2*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),a=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),i=Math.PI*2/a;let l=Math.abs(e/2),s=Math.abs(t/2);const d=1-n.curveFitting;return l+=Ye(l*d,n),s+=Ye(s*d,n),{increment:i,rx:l,ry:s}}function $g(e,t,n,r){const[a,i]=pv(r.increment,e,t,r.rx,r.ry,1,r.increment*Sp(.1,Sp(.4,1,n),n),n);let l=kp(a,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[s]=pv(r.increment,e,t,r.rx,r.ry,1.5,0,n),d=kp(s,null,n);l=l.concat(d)}return{estimatedPoints:i,opset:{type:"path",ops:l}}}function dv(e,t,n,r,a,i,l,s,d){const u=e,o=t;let f=Math.abs(n/2),m=Math.abs(r/2);f+=Ye(f*.01,d),m+=Ye(m*.01,d);let U=a,g=i;for(;U<0;)U+=Math.PI*2,g+=Math.PI*2;g-U>Math.PI*2&&(U=0,g=Math.PI*2);const v=Math.PI*2/d.curveStepCount,y=Math.min(v/2,(g-U)/2),w=mv(y,u,o,f,m,U,g,1,d);if(!d.disableMultiStroke){const E=mv(y,u,o,f,m,U,g,1.5,d);w.push(...E)}return l&&(s?w.push(...il(u,o,u+f*Math.cos(U),o+m*Math.sin(U),d),...il(u,o,u+f*Math.cos(g),o+m*Math.sin(g),d)):w.push({op:"lineTo",data:[u,o]},{op:"lineTo",data:[u+f*Math.cos(U),o+m*Math.sin(U)]})),{type:"path",ops:w}}function uv(e,t){const n=cE(oE(d5(e))),r=[];let a=[0,0],i=[0,0];for(const{key:l,data:s}of n)switch(l){case"M":{i=[s[0],s[1]],a=[s[0],s[1]];break}case"L":r.push(...il(i[0],i[1],s[0],s[1],t)),i=[s[0],s[1]];break;case"C":{const[d,u,o,f,m,U]=s;r.push(...OP(d,u,o,f,m,U,i,t)),i=[m,U];break}case"Z":r.push(...il(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break}return{type:"path",ops:r}}function _2(e,t){const n=[];for(const r of e)if(r.length){const a=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+Ye(a,t),r[0][1]+Ye(a,t)]});for(let l=1;l<i;l++)n.push({op:"lineTo",data:[r[l][0]+Ye(a,t),r[l][1]+Ye(a,t)]})}}return{type:"fillPath",ops:n}}function wc(e,t){return SP(t,_P).fillPolygons(e,t)}function jP(e,t,n,r,a,i,l){const s=e,d=t;let u=Math.abs(n/2),o=Math.abs(r/2);u+=Ye(u*.01,l),o+=Ye(o*.01,l);let f=a,m=i;for(;f<0;)f+=Math.PI*2,m+=Math.PI*2;m-f>Math.PI*2&&(f=0,m=Math.PI*2);const U=(m-f)/l.curveStepCount,g=[];for(let v=f;v<=m;v=v+U)g.push([s+u*Math.cos(v),d+o*Math.sin(v)]);return g.push([s+u*Math.cos(m),d+o*Math.sin(m)]),g.push([s,d]),wc([g],l)}function LP(e,t){return Ye(e,t)}function DP(e,t,n){return Sp(e,t,n)}function PP(e,t,n,r,a){return il(e,t,n,r,a,!0)}function NP(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function hE(e){return e.randomizer||(e.randomizer=new lE(e.seed||0)),e.randomizer.next()}function Sp(e,t,n,r=1){return n.roughness*r*(hE(n)*(t-e)+e)}function Ye(e,t,n=1){return Sp(-e,e,t,n)}function il(e,t,n,r,a,i=!1){const l=i?a.disableMultiStrokeFill:a.disableMultiStroke,s=fv(e,t,n,r,a,!0,!1);if(l)return s;const d=fv(e,t,n,r,a,!0,!0);return s.concat(d)}function fv(e,t,n,r,a,i,l){const s=Math.pow(e-n,2)+Math.pow(t-r,2),d=Math.sqrt(s);let u=1;d<200?u=1:d>500?u=.4:u=-.0016668*d+1.233334;let o=a.maxRandomnessOffset||0;o*o*100>s&&(o=d/10);const f=o/2,m=.2+hE(a)*.2;let U=a.bowing*a.maxRandomnessOffset*(r-t)/200,g=a.bowing*a.maxRandomnessOffset*(e-n)/200;U=Ye(U,a,u),g=Ye(g,a,u);const v=[],y=()=>Ye(f,a,u),w=()=>Ye(o,a,u),E=a.preserveVertices;return l?v.push({op:"move",data:[e+(E?0:y()),t+(E?0:y())]}):v.push({op:"move",data:[e+(E?0:Ye(o,a,u)),t+(E?0:Ye(o,a,u))]}),l?v.push({op:"bcurveTo",data:[U+e+(n-e)*m+y(),g+t+(r-t)*m+y(),U+e+2*(n-e)*m+y(),g+t+2*(r-t)*m+y(),n+(E?0:y()),r+(E?0:y())]}):v.push({op:"bcurveTo",data:[U+e+(n-e)*m+w(),g+t+(r-t)*m+w(),U+e+2*(n-e)*m+w(),g+t+2*(r-t)*m+w(),n+(E?0:w()),r+(E?0:w())]}),v}function hv(e,t,n){const r=[];r.push([e[0][0]+Ye(t,n),e[0][1]+Ye(t,n)]),r.push([e[0][0]+Ye(t,n),e[0][1]+Ye(t,n)]);for(let a=1;a<e.length;a++)r.push([e[a][0]+Ye(t,n),e[a][1]+Ye(t,n)]),a===e.length-1&&r.push([e[a][0]+Ye(t,n),e[a][1]+Ye(t,n)]);return kp(r,null,n)}function kp(e,t,n){const r=e.length,a=[];if(r>3){const i=[],l=1-n.curveTightness;a.push({op:"move",data:[e[1][0],e[1][1]]});for(let s=1;s+2<r;s++){const d=e[s];i[0]=[d[0],d[1]],i[1]=[d[0]+(l*e[s+1][0]-l*e[s-1][0])/6,d[1]+(l*e[s+1][1]-l*e[s-1][1])/6],i[2]=[e[s+1][0]+(l*e[s][0]-l*e[s+2][0])/6,e[s+1][1]+(l*e[s][1]-l*e[s+2][1])/6],i[3]=[e[s+1][0],e[s+1][1]],a.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}}else r===3?(a.push({op:"move",data:[e[1][0],e[1][1]]}),a.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&a.push(...il(e[0][0],e[0][1],e[1][0],e[1][1],n));return a}function pv(e,t,n,r,a,i,l,s){const d=s.roughness===0,u=[],o=[];if(d){e=e/4,o.push([t+r*Math.cos(-e),n+a*Math.sin(-e)]);for(let f=0;f<=Math.PI*2;f=f+e){const m=[t+r*Math.cos(f),n+a*Math.sin(f)];u.push(m),o.push(m)}o.push([t+r*Math.cos(0),n+a*Math.sin(0)]),o.push([t+r*Math.cos(e),n+a*Math.sin(e)])}else{const f=Ye(.5,s)-Math.PI/2;o.push([Ye(i,s)+t+.9*r*Math.cos(f-e),Ye(i,s)+n+.9*a*Math.sin(f-e)]);const m=Math.PI*2+f-.01;for(let U=f;U<m;U=U+e){const g=[Ye(i,s)+t+r*Math.cos(U),Ye(i,s)+n+a*Math.sin(U)];u.push(g),o.push(g)}o.push([Ye(i,s)+t+r*Math.cos(f+Math.PI*2+l*.5),Ye(i,s)+n+a*Math.sin(f+Math.PI*2+l*.5)]),o.push([Ye(i,s)+t+.98*r*Math.cos(f+l),Ye(i,s)+n+.98*a*Math.sin(f+l)]),o.push([Ye(i,s)+t+.9*r*Math.cos(f+l*.5),Ye(i,s)+n+.9*a*Math.sin(f+l*.5)])}return[o,u]}function mv(e,t,n,r,a,i,l,s,d){const u=i+Ye(.1,d),o=[];o.push([Ye(s,d)+t+.9*r*Math.cos(u-e),Ye(s,d)+n+.9*a*Math.sin(u-e)]);for(let f=u;f<=l;f=f+e)o.push([Ye(s,d)+t+r*Math.cos(f),Ye(s,d)+n+a*Math.sin(f)]);return o.push([t+r*Math.cos(l),n+a*Math.sin(l)]),o.push([t+r*Math.cos(l),n+a*Math.sin(l)]),kp(o,null,d)}function OP(e,t,n,r,a,i,l,s){const d=[],u=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3];let o=[0,0];const f=s.disableMultiStroke?1:2,m=s.preserveVertices;for(let U=0;U<f;U++)U===0?d.push({op:"move",data:[l[0],l[1]]}):d.push({op:"move",data:[l[0]+(m?0:Ye(u[0],s)),l[1]+(m?0:Ye(u[0],s))]}),o=m?[a,i]:[a+Ye(u[U],s),i+Ye(u[U],s)],d.push({op:"bcurveTo",data:[e+Ye(u[U],s),t+Ye(u[U],s),n+Ye(u[U],s),r+Ye(u[U],s),o[0],o[1]]});return d}function ru(e){return[...e]}function $P(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(n===3)r.push(ru(e[0]),ru(e[1]),ru(e[2]),ru(e[2]));else{const a=[];a.push(e[0],e[0]);for(let s=1;s<e.length;s++)a.push(e[s]),s===e.length-1&&a.push(e[s]);const i=[],l=1-t;r.push(ru(a[0]));for(let s=1;s+2<a.length;s++){const d=a[s];i[0]=[d[0],d[1]],i[1]=[d[0]+(l*a[s+1][0]-l*a[s-1][0])/6,d[1]+(l*a[s+1][1]-l*a[s-1][1])/6],i[2]=[a[s+1][0]+(l*a[s][0]-l*a[s+2][0])/6,a[s+1][1]+(l*a[s][1]-l*a[s+2][1])/6],i[3]=[a[s+1][0],a[s+1][1]],r.push(i[1],i[2],i[3])}}return r}function zP(e,t){return Math.sqrt(Z1(e,t))}function Z1(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function FP(e,t,n){const r=Z1(t,n);if(r===0)return Z1(e,t);let a=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return a=Math.max(0,Math.min(1,a)),Z1(e,Gs(t,n,a))}function Gs(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function BP(e,t){const n=e[t+0],r=e[t+1],a=e[t+2],i=e[t+3];let l=3*r[0]-2*n[0]-i[0];l*=l;let s=3*r[1]-2*n[1]-i[1];s*=s;let d=3*a[0]-2*i[0]-n[0];d*=d;let u=3*a[1]-2*i[1]-n[1];return u*=u,l<d&&(l=d),s<u&&(s=u),l+s}function zg(e,t,n,r){const a=r||[];if(BP(e,t)<n){const i=e[t+0];a.length?zP(a[a.length-1],i)>1&&a.push(i):a.push(i),a.push(e[t+3])}else{const l=e[t+0],s=e[t+1],d=e[t+2],u=e[t+3],o=Gs(l,s,.5),f=Gs(s,d,.5),m=Gs(d,u,.5),U=Gs(o,f,.5),g=Gs(f,m,.5),v=Gs(U,g,.5);zg([l,o,U,v],0,n,a),zg([v,g,m,u],0,n,a)}return a}function Fg(e,t,n,r,a){const i=a||[],l=e[t],s=e[n-1];let d=0,u=1;for(let o=t+1;o<n-1;++o){const f=FP(e[o],l,s);f>d&&(d=f,u=o)}return Math.sqrt(d)>r?(Fg(e,t,u+1,r,i),Fg(e,u,n,r,i)):(i.length||i.push(l),i.push(s)),i}function HP(e,t=.15,n){const r=[],a=(e.length-1)/3;for(let i=0;i<a;i++){const l=i*3;zg(e,l,t,r)}return n&&n>0?Fg(r,0,r.length,n):r}function WP(e,t){return Math.sqrt(K1(e,t))}function K1(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function XP(e,t,n){const r=K1(t,n);if(r===0)return K1(e,t);let a=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return a=Math.max(0,Math.min(1,a)),K1(e,Ys(t,n,a))}function Ys(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function VP(e,t){const n=e[t+0],r=e[t+1],a=e[t+2],i=e[t+3];let l=3*r[0]-2*n[0]-i[0];l*=l;let s=3*r[1]-2*n[1]-i[1];s*=s;let d=3*a[0]-2*i[0]-n[0];d*=d;let u=3*a[1]-2*i[1]-n[1];return u*=u,l<d&&(l=d),s<u&&(s=u),l+s}function Bg(e,t,n,r){const a=r||[];if(VP(e,t)<n){const i=e[t+0];a.length?WP(a[a.length-1],i)>1&&a.push(i):a.push(i),a.push(e[t+3])}else{const l=e[t+0],s=e[t+1],d=e[t+2],u=e[t+3],o=Ys(l,s,.5),f=Ys(s,d,.5),m=Ys(d,u,.5),U=Ys(o,f,.5),g=Ys(f,m,.5),v=Ys(U,g,.5);Bg([l,o,U,v],0,n,a),Bg([v,g,m,u],0,n,a)}return a}function GP(e,t){return Hg(e,0,e.length,t)}function Hg(e,t,n,r,a){const i=a||[],l=e[t],s=e[n-1];let d=0,u=1;for(let o=t+1;o<n-1;++o){const f=XP(e[o],l,s);f>d&&(d=f,u=o)}return Math.sqrt(d)>r?(Hg(e,t,u+1,r,i),Hg(e,u,n,r,i)):(i.length||i.push(l),i.push(s)),i}function YP(e,t=.15,n){const r=[],a=(e.length-1)/3;for(let i=0;i<a;i++){const l=i*3;Bg(e,l,t,r)}return r}function ZP(e,t,n){const r=d5(e),a=cE(oE(r)),i=[];let l=[],s=[0,0],d=[];const u=()=>{d.length>=4&&l.push(...YP(d,t)),d=[]},o=()=>{u(),l.length&&(i.push(l),l=[])};for(const{key:m,data:U}of a)switch(m){case"M":o(),s=[U[0],U[1]],l.push(s);break;case"L":u(),l.push([U[0],U[1]]);break;case"C":if(!d.length){const g=l.length?l[l.length-1]:s;d.push([g[0],g[1]])}d.push([U[0],U[1]]),d.push([U[2],U[3]]),d.push([U[4],U[5]]);break;case"Z":u(),l.push([s[0],s[1]]);break}if(o(),!n)return i;const f=[];for(const m of i){const U=GP(m,n);U.length&&f.push(U)}return f}const $r="none";class af{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return kP()}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,r){return{shape:t,sets:n||[],options:r||this.defaultOptions}}line(t,n,r,a,i){const l=this._o(i);return this._d("line",[uE(t,n,r,a,l)],l)}rectangle(t,n,r,a,i){const l=this._o(i),s=[],d=AP(t,n,r,a,l);if(l.fill){const u=[[t,n],[t+r,n],[t+r,n+a],[t,n+a]];l.fillStyle==="solid"?s.push(_2([u],l)):s.push(wc([u],l))}return l.stroke!==$r&&s.push(d),this._d("rectangle",s,l)}ellipse(t,n,r,a,i){const l=this._o(i),s=[],d=fE(r,a,l),u=$g(t,n,l,d);if(l.fill)if(l.fillStyle==="solid"){const o=$g(t,n,l,d).opset;o.type="fillPath",s.push(o)}else s.push(wc([u.estimatedPoints],l));return l.stroke!==$r&&s.push(u.opset),this._d("ellipse",s,l)}circle(t,n,r,a){const i=this.ellipse(t,n,r,r,a);return i.shape="circle",i}linearPath(t,n){const r=this._o(n);return this._d("linearPath",[Y1(t,!1,r)],r)}arc(t,n,r,a,i,l,s=!1,d){const u=this._o(d),o=[],f=dv(t,n,r,a,i,l,s,!0,u);if(s&&u.fill)if(u.fillStyle==="solid"){const m=Object.assign({},u);m.disableMultiStroke=!0;const U=dv(t,n,r,a,i,l,!0,!1,m);U.type="fillPath",o.push(U)}else o.push(jP(t,n,r,a,i,l,u));return u.stroke!==$r&&o.push(f),this._d("arc",o,u)}curve(t,n){const r=this._o(n),a=[],i=cv(t,r);if(r.fill&&r.fill!==$r&&t.length>=3)if(r.fillStyle==="solid"){const l=cv(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));a.push({type:"fillPath",ops:this._mergedShape(l.ops)})}else{const l=$P(t),s=HP(l,10,(1+r.roughness)/2);a.push(wc([s],r))}return r.stroke!==$r&&a.push(i),this._d("curve",a,r)}polygon(t,n){const r=this._o(n),a=[],i=Y1(t,!0,r);return r.fill&&(r.fillStyle==="solid"?a.push(_2([t],r)):a.push(wc([t],r))),r.stroke!==$r&&a.push(i),this._d("polygon",a,r)}path(t,n){const r=this._o(n),a=[];if(!t)return this._d("path",a,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const i=r.fill&&r.fill!=="transparent"&&r.fill!==$r,l=r.stroke!==$r,s=!!(r.simplification&&r.simplification<1),d=s?4-4*(r.simplification||1):(1+r.roughness)/2,u=ZP(t,1,d),o=uv(t,r);if(i)if(r.fillStyle==="solid")if(u.length===1){const f=uv(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));a.push({type:"fillPath",ops:this._mergedShape(f.ops)})}else a.push(_2(u,r));else a.push(wc(u,r));return l&&(s?u.forEach(f=>{a.push(Y1(f,!1,r))}):a.push(o)),this._d("path",a,r)}opsToPath(t,n){let r="";for(const a of t.ops){const i=typeof n=="number"&&n>=0?a.data.map(l=>+l.toFixed(n)):a.data;switch(a.op){case"move":r+=`M${i[0]} ${i[1]} `;break;case"bcurveTo":r+=`C${i[0]} ${i[1]}, ${i[2]} ${i[3]}, ${i[4]} ${i[5]} `;break;case"lineTo":r+=`L${i[0]} ${i[1]} `;break}}return r.trim()}toPaths(t){const n=t.sets||[],r=t.options||this.defaultOptions,a=[];for(const i of n){let l=null;switch(i.type){case"path":l={d:this.opsToPath(i),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:$r};break;case"fillPath":l={d:this.opsToPath(i),stroke:$r,strokeWidth:0,fill:r.fill||$r};break;case"fillSketch":l=this.fillSketch(i,r);break}l&&a.push(l)}return a}fillSketch(t,n){let r=n.fillWeight;return r<0&&(r=n.strokeWidth/2),{d:this.opsToPath(t),stroke:n.fill||$r,strokeWidth:r,fill:$r}}_mergedShape(t){return t.filter((n,r)=>r===0?!0:n.op!=="move")}}class KP{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new af(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),a=this.ctx,i=t.options.fixedDecimalPlaceDigits;for(const l of n)switch(l.type){case"path":a.save(),a.strokeStyle=r.stroke==="none"?"transparent":r.stroke,a.lineWidth=r.strokeWidth,r.strokeLineDash&&a.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(a.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(a,l,i),a.restore();break;case"fillPath":{a.save(),a.fillStyle=r.fill||"";const s=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(a,l,i,s),a.restore();break}case"fillSketch":this.fillSketch(a,l,r);break}}fillSketch(t,n,r){let a=r.fillWeight;a<0&&(a=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=a,this._drawToContext(t,n,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,r,a="nonzero"){t.beginPath();for(const i of n.ops){const l=typeof r=="number"&&r>=0?i.data.map(s=>+s.toFixed(r)):i.data;switch(i.op){case"move":t.moveTo(l[0],l[1]);break;case"bcurveTo":t.bezierCurveTo(l[0],l[1],l[2],l[3],l[4],l[5]);break;case"lineTo":t.lineTo(l[0],l[1]);break}}n.type==="fillPath"?t.fill(a):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,r,a,i){const l=this.gen.line(t,n,r,a,i);return this.draw(l),l}rectangle(t,n,r,a,i){const l=this.gen.rectangle(t,n,r,a,i);return this.draw(l),l}ellipse(t,n,r,a,i){const l=this.gen.ellipse(t,n,r,a,i);return this.draw(l),l}circle(t,n,r,a){const i=this.gen.circle(t,n,r,a);return this.draw(i),i}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r),r}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r),r}arc(t,n,r,a,i,l,s=!1,d){const u=this.gen.arc(t,n,r,a,i,l,s,d);return this.draw(u),u}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r),r}path(t,n){const r=this.gen.path(t,n);return this.draw(r),r}}const b1="http://www.w3.org/2000/svg";class qP{constructor(t,n){this.svg=t,this.gen=new af(n)}draw(t){const n=t.sets||[],r=t.options||this.getDefaultOptions(),a=this.svg.ownerDocument||window.document,i=a.createElementNS(b1,"g"),l=t.options.fixedDecimalPlaceDigits;for(const s of n){let d=null;switch(s.type){case"path":{d=a.createElementNS(b1,"path"),d.setAttribute("d",this.opsToPath(s,l)),d.setAttribute("stroke",r.stroke),d.setAttribute("stroke-width",r.strokeWidth+""),d.setAttribute("fill","none"),r.strokeLineDash&&d.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&d.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break}case"fillPath":{d=a.createElementNS(b1,"path"),d.setAttribute("d",this.opsToPath(s,l)),d.setAttribute("stroke","none"),d.setAttribute("stroke-width","0"),d.setAttribute("fill",r.fill||""),(t.shape==="curve"||t.shape==="polygon")&&d.setAttribute("fill-rule","evenodd");break}case"fillSketch":{d=this.fillSketch(a,s,r);break}}d&&i.appendChild(d)}return i}fillSketch(t,n,r){let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const i=t.createElementNS(b1,"path");return i.setAttribute("d",this.opsToPath(n,r.fixedDecimalPlaceDigits)),i.setAttribute("stroke",r.fill||""),i.setAttribute("stroke-width",a+""),i.setAttribute("fill","none"),r.fillLineDash&&i.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,r,a,i){const l=this.gen.line(t,n,r,a,i);return this.draw(l)}rectangle(t,n,r,a,i){const l=this.gen.rectangle(t,n,r,a,i);return this.draw(l)}ellipse(t,n,r,a,i){const l=this.gen.ellipse(t,n,r,a,i);return this.draw(l)}circle(t,n,r,a){const i=this.gen.circle(t,n,r,a);return this.draw(i)}linearPath(t,n){const r=this.gen.linearPath(t,n);return this.draw(r)}polygon(t,n){const r=this.gen.polygon(t,n);return this.draw(r)}arc(t,n,r,a,i,l,s=!1,d){const u=this.gen.arc(t,n,r,a,i,l,s,d);return this.draw(u)}curve(t,n){const r=this.gen.curve(t,n);return this.draw(r)}path(t,n){const r=this.gen.path(t,n);return this.draw(r)}}const ws={canvas(e,t){return new KP(e,t)},svg(e,t){return new qP(e,t)},generator(e){return new af(e)},newSeed(){return af.newSeed()}};function Uv(e,t,n,r=a=>a){return e*r(.5-t*(.5-n))}function QP(e){return[-e[0],-e[1]]}function Ra(e,t){return[e[0]+t[0],e[1]+t[1]]}function aa(e,t){return[e[0]-t[0],e[1]-t[1]]}function _a(e,t){return[e[0]*t,e[1]*t]}function JP(e,t){return[e[0]/t,e[1]/t]}function au(e){return[e[1],-e[0]]}function gv(e,t){return e[0]*t[0]+e[1]*t[1]}function eN(e,t){return e[0]===t[0]&&e[1]===t[1]}function tN(e){return Math.hypot(e[0],e[1])}function nN(e){return e[0]*e[0]+e[1]*e[1]}function bv(e,t){return nN(aa(e,t))}function pE(e){return JP(e,tN(e))}function rN(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function iu(e,t,n){let r=Math.sin(n),a=Math.cos(n),i=e[0]-t[0],l=e[1]-t[1],s=i*a-l*r,d=i*r+l*a;return[s+t[0],d+t[1]]}function Wg(e,t,n){return Ra(e,_a(aa(t,e),n))}function vv(e,t,n){return Ra(e,_a(t,n))}var{min:uc,PI:aN}=Math,yv=.275,lu=aN+1e-4;function iN(e,t={}){let{size:n=16,smoothing:r=.5,thinning:a=.5,simulatePressure:i=!0,easing:l=W=>W,start:s={},end:d={},last:u=!1}=t,{cap:o=!0,easing:f=W=>W*(2-W)}=s,{cap:m=!0,easing:U=W=>--W*W*W+1}=d;if(e.length===0||n<=0)return[];let g=e[e.length-1].runningLength,v=s.taper===!1?0:s.taper===!0?Math.max(n,g):s.taper,y=d.taper===!1?0:d.taper===!0?Math.max(n,g):d.taper,w=Math.pow(n*r,2),E=[],S=[],k=e.slice(0,10).reduce((W,q)=>{let V=q.pressure;if(i){let ee=uc(1,q.distance/n),X=uc(1,1-ee);V=uc(1,W+(X-W)*(ee*yv))}return(W+V)/2},e[0].pressure),I=Uv(n,a,e[e.length-1].pressure,l),T,M=e[0].vector,j=e[0].point,D=j,P=j,N=D,$=!1;for(let W=0;W<e.length;W++){let{pressure:q}=e[W],{point:V,vector:ee,distance:X,runningLength:se}=e[W];if(W<e.length-1&&g-se<3)continue;if(a){if(i){let me=uc(1,X/n),fe=uc(1,1-me);q=uc(1,k+(fe-k)*(me*yv))}I=Uv(n,a,q,l)}else I=n/2;T===void 0&&(T=I);let ge=se<v?f(se/v):1,_e=g-se<y?U((g-se)/y):1;I=Math.max(.01,I*Math.min(ge,_e));let Y=(W<e.length-1?e[W+1]:e[W]).vector,H=W<e.length-1?gv(ee,Y):1,re=gv(ee,M)<0&&!$,te=H!==null&&H<0;if(re||te){let me=_a(au(M),I);for(let fe=1/13,Ue=0;Ue<=1;Ue+=fe)P=iu(aa(V,me),V,lu*Ue),E.push(P),N=iu(Ra(V,me),V,lu*-Ue),S.push(N);j=P,D=N,te&&($=!0);continue}if($=!1,W===e.length-1){let me=_a(au(ee),I);E.push(aa(V,me)),S.push(Ra(V,me));continue}let de=_a(au(Wg(Y,ee,H)),I);P=aa(V,de),(W<=1||bv(j,P)>w)&&(E.push(P),j=P),N=Ra(V,de),(W<=1||bv(D,N)>w)&&(S.push(N),D=N),k=q,M=ee}let z=e[0].point.slice(0,2),Z=e.length>1?e[e.length-1].point.slice(0,2):Ra(e[0].point,[1,1]),K=[],Q=[];if(e.length===1){if(!(v||y)||u){let W=vv(z,pE(au(aa(z,Z))),-(T||I)),q=[];for(let V=1/13,ee=V;ee<=1;ee+=V)q.push(iu(W,z,lu*2*ee));return q}}else{if(!(v||y&&e.length===1))if(o)for(let q=1/13,V=q;V<=1;V+=q){let ee=iu(S[0],z,lu*V);K.push(ee)}else{let q=aa(E[0],S[0]),V=_a(q,.5),ee=_a(q,.51);K.push(aa(z,V),aa(z,ee),Ra(z,ee),Ra(z,V))}let W=au(QP(e[e.length-1].vector));if(y||v&&e.length===1)Q.push(Z);else if(m){let q=vv(Z,W,I);for(let V=1/29,ee=V;ee<1;ee+=V)Q.push(iu(q,Z,lu*3*ee))}else Q.push(Ra(Z,_a(W,I)),Ra(Z,_a(W,I*.99)),aa(Z,_a(W,I*.99)),aa(Z,_a(W,I)))}return E.concat(Q,S.reverse(),K)}function lN(e,t={}){var n;let{streamline:r=.5,size:a=16,last:i=!1}=t;if(e.length===0)return[];let l=.15+(1-r)*.85,s=Array.isArray(e[0])?e:e.map(({x:U,y:g,pressure:v=.5})=>[U,g,v]);if(s.length===2){let U=s[1];s=s.slice(0,-1);for(let g=1;g<5;g++)s.push(Wg(s[0],U,g/4))}s.length===1&&(s=[...s,[...Ra(s[0],[1,1]),...s[0].slice(2)]]);let d=[{point:[s[0][0],s[0][1]],pressure:s[0][2]>=0?s[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],u=!1,o=0,f=d[0],m=s.length-1;for(let U=1;U<s.length;U++){let g=i&&U===m?s[U].slice(0,2):Wg(f.point,s[U],l);if(eN(f.point,g))continue;let v=rN(g,f.point);if(o+=v,U<m&&!u){if(o<a)continue;u=!0}f={point:g,pressure:s[U][2]>=0?s[U][2]:.5,vector:pE(aa(f.point,g)),distance:v,runningLength:o},d.push(f)}return d[0].vector=((n=d[1])==null?void 0:n.vector)||[0,0],d}function sN(e,t={}){return iN(lN(e,t),t)}function mE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=mE(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ae(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=mE(t))&&(r&&(r+=" "),r+=n);return r}function oN(e,t){return Math.sqrt(q1(e,t))}function q1(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function cN(e,t,n){const r=q1(t,n);if(r===0)return q1(e,t);let a=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return a=Math.max(0,Math.min(1,a)),q1(e,Zs(t,n,a))}function Zs(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function dN(e,t){const n=e[t+0],r=e[t+1],a=e[t+2],i=e[t+3];let l=3*r[0]-2*n[0]-i[0];l*=l;let s=3*r[1]-2*n[1]-i[1];s*=s;let d=3*a[0]-2*i[0]-n[0];d*=d;let u=3*a[1]-2*i[1]-n[1];return u*=u,l<d&&(l=d),s<u&&(s=u),l+s}function Xg(e,t,n,r){const a=r||[];if(dN(e,t)<n){const i=e[t+0];a.length?oN(a[a.length-1],i)>1&&a.push(i):a.push(i),a.push(e[t+3])}else{const l=e[t+0],s=e[t+1],d=e[t+2],u=e[t+3],o=Zs(l,s,.5),f=Zs(s,d,.5),m=Zs(d,u,.5),U=Zs(o,f,.5),g=Zs(f,m,.5),v=Zs(U,g,.5);Xg([l,o,U,v],0,n,a),Xg([v,g,m,u],0,n,a)}return a}function uN(e,t){return Cp(e,0,e.length,t)}function Cp(e,t,n,r,a){const i=a||[],l=e[t],s=e[n-1];let d=0,u=1;for(let o=t+1;o<n-1;++o){const f=cN(e[o],l,s);f>d&&(d=f,u=o)}return Math.sqrt(d)>r?(Cp(e,t,u+1,r,i),Cp(e,u,n,r,i)):(i.length||i.push(l),i.push(s)),i}function fN(e,t=.15,n){const r=[],a=(e.length-1)/3;for(let i=0;i<a;i++){const l=i*3;Xg(e,l,t,r)}return Cp(r,0,r.length,n)}var su={},xv;function hN(){if(xv)return su;xv=1,Object.defineProperty(su,"__esModule",{value:!0}),su.sanitizeUrl=void 0;var e=/^([^\w]*)(javascript|data|vbscript)/im,t=/&#(\w+)(^\w|;)?/g,n=/&(newline|tab);/gi,r=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|:)/gim,i=[".","/"];function l(u){return i.indexOf(u[0])>-1}function s(u){return u.replace(t,function(o,f){return String.fromCharCode(f)})}function d(u){var o=s(u||"").replace(n,"").replace(r,"").trim();if(!o)return"about:blank";if(l(o))return o;var f=o.match(a);if(!f)return o;var m=f[0];return e.test(m)?"about:blank":o}return su.sanitizeUrl=d,su}var pN=hN();const UE="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function kc(e,t,n){const r=n[0];if(t!=null&&e>=t)throw new Error(e+" >= "+t);if(e.slice(-1)===r||t&&t.slice(-1)===r)throw new Error("trailing zero");if(t){let l=0;for(;(e[l]||r)===t[l];)l++;if(l>0)return t.slice(0,l)+kc(e.slice(l),t.slice(l),n)}const a=e?n.indexOf(e[0]):0,i=t!=null?n.indexOf(t[0]):n.length;if(i-a>1){const l=Math.round(.5*(a+i));return n[l]}else return t&&t.length>1?t.slice(0,1):n[a]+kc(e.slice(1),null,n)}function gE(e){if(e.length!==bE(e[0]))throw new Error("invalid integer part of order key: "+e)}function bE(e){if(e>="a"&&e<="z")return e.charCodeAt(0)-97+2;if(e>="A"&&e<="Z")return 90-e.charCodeAt(0)+2;throw new Error("invalid order key head: "+e)}function wu(e){const t=bE(e[0]);if(t>e.length)throw new Error("invalid order key: "+e);return e.slice(0,t)}function wv(e,t){if(e==="A"+t[0].repeat(26))throw new Error("invalid order key: "+e);const n=wu(e);if(e.slice(n.length).slice(-1)===t[0])throw new Error("invalid order key: "+e)}function Ev(e,t){gE(e);const[n,...r]=e.split("");let a=!0;for(let i=r.length-1;a&&i>=0;i--){const l=t.indexOf(r[i])+1;l===t.length?r[i]=t[0]:(r[i]=t[l],a=!1)}if(a){if(n==="Z")return"a"+t[0];if(n==="z")return null;const i=String.fromCharCode(n.charCodeAt(0)+1);return i>"a"?r.push(t[0]):r.pop(),i+r.join("")}else return n+r.join("")}function mN(e,t){gE(e);const[n,...r]=e.split("");let a=!0;for(let i=r.length-1;a&&i>=0;i--){const l=t.indexOf(r[i])-1;l===-1?r[i]=t.slice(-1):(r[i]=t[l],a=!1)}if(a){if(n==="a")return"Z"+t.slice(-1);if(n==="A")return null;const i=String.fromCharCode(n.charCodeAt(0)-1);return i<"Z"?r.push(t.slice(-1)):r.pop(),i+r.join("")}else return n+r.join("")}function fc(e,t,n=UE){if(e!=null&&wv(e,n),t!=null&&wv(t,n),e!=null&&t!=null&&e>=t)throw new Error(e+" >= "+t);if(e==null){if(t==null)return"a"+n[0];const d=wu(t),u=t.slice(d.length);if(d==="A"+n[0].repeat(26))return d+kc("",u,n);if(d<t)return d;const o=mN(d,n);if(o==null)throw new Error("cannot decrement any more");return o}if(t==null){const d=wu(e),u=e.slice(d.length),o=Ev(d,n);return o??d+kc(u,null,n)}const r=wu(e),a=e.slice(r.length),i=wu(t),l=t.slice(i.length);if(r===i)return r+kc(a,l,n);const s=Ev(r,n);if(s==null)throw new Error("cannot increment any more");return s<t?s:r+kc(a,null,n)}function Vg(e,t,n,r=UE){if(n===0)return[];if(n===1)return[fc(e,t,r)];if(t==null){let l=fc(e,t,r);const s=[l];for(let d=0;d<n-1;d++)l=fc(l,t,r),s.push(l);return s}if(e==null){let l=fc(e,t,r);const s=[l];for(let d=0;d<n-1;d++)l=fc(e,l,r),s.push(l);return s.reverse(),s}const a=Math.floor(n/2),i=fc(e,t,r);return[...Vg(e,i,a,r),i,...Vg(i,t,n-a-1,r)]}const Do=(()=>{if(typeof self>"u")return!1;if(!("top"in self&&self!==top)){if("showOpenFilePicker"in self)return"showOpenFilePicker"}return!1})(),UN=Re(Do?()=>import("./file-open-002ab408-DIuFHtCF.js"):()=>import("./file-open-7c801643-684qeFg4.js"),[]);async function gN(...e){return(await UN).default(...e)}Re(Do?()=>import("./directory-open-4ed118d0-CunoC1EB.js"):()=>import("./directory-open-01563666-DWU9wJ6I.js"),[]);const bN=Re(Do?()=>import("./file-save-745eba88-Bb9F9Kg7.js"):()=>import("./file-save-3189631c-C1wFhQhH.js"),[]);async function vN(...e){return(await bN).default(...e)}var yN=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),xN=5,Ec=5,wN=4,Eu=4,Su=1,Ca=[0,2,4,6,8],Ma=(e,t)=>t.map(n=>Fn[e][n]),at={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:Ma("gray",Ca),red:Ma("red",Ca),pink:Ma("pink",Ca),grape:Ma("grape",Ca),violet:Ma("violet",Ca),blue:Ma("blue",Ca),cyan:Ma("cyan",Ca),teal:Ma("teal",Ca),green:Ma("green",Ca),yellow:Ma("yellow",Ca),orange:Ma("orange",Ca),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},vE=yN(at,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),yE=[at.black,at.red[Eu],at.green[Eu],at.blue[Eu],at.yellow[Eu]],xE=[at.transparent,at.red[Su],at.green[Su],at.blue[Su],at.yellow[Su]],wE=[at.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],EN={transparent:at.transparent,white:at.white,gray:at.gray,black:at.black,bronze:at.bronze,...vE},SN={transparent:at.transparent,white:at.white,gray:at.gray,black:at.black,bronze:at.bronze,...vE},kN=e=>[at.cyan[e],at.blue[e],at.violet[e],at.grape[e],at.pink[e],at.green[e],at.teal[e],at.yellow[e],at.orange[e],at.red[e]],CN=(e,t,n)=>`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`,xi=/Mac|iPod|iPhone|iPad/.test(navigator.platform),EE=/^Win/.test(navigator.platform),MN=/\b(android)\b/i.test(navigator.userAgent),lf="netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,IN=navigator.userAgent.indexOf("Chrome")!==-1,_N=!IN&&navigator.userAgent.indexOf("Safari")!==-1,SE=/iPad|iPhone/.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,TN=()=>{var e,t;return((t=(e=navigator.brave)==null?void 0:e.isBrave)==null?void 0:t.name)==="isBrave"},Gg=typeof window<"u"&&"ResizeObserver"in window,AN="Excalidraw",RN=36,Ks=10,Q1=8,jN=5,Sv=1,LN=30,ms=Math.PI/12,kE="red",kt={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},Kl={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},hc={enabled:"all",disabled:"none"},v1={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},Tr={TEST:"test"},Wc={SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper"},Cc="Xiaolai",sf="Segoe UI Emoji",Xt={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9},Mc={[Cc]:100,[sf]:1e3},CE=e=>{switch(e){case Xt.Excalifont:return[Cc,sf];default:return[sf]}},ot={LIGHT:"light",DARK:"dark"},Kt={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},u5=1,bl=20,Es=Xt.Excalifont,jf="left",Mp="top",yo=2,Ip=2*yo,DN=1e-5,PN=2*Ip-DN,y1="#ffffff",NN="#1e1e1e",ON="#a2f1a6",_p=20,ME=5,Xc={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},De={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json","excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...Xc},$N=[De.text,De.html,...Object.values(Xc)],T2={png:"png",svg:"svg",clipboard:"clipboard"},ua={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},f5=window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,zN=500,FN=300,BN=500,HN=100,w0=.1,h5=.1,p5=30,WN=300,m5="invert(93%) hue-rotate(180deg)",kv={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0}},XN=730,VN=1e3,GN=500,YN=1229,ou=2,U5=[1,2,3],dd=10,ZN=1440,Cv=4*1024*1024,pt="http://www.w3.org/2000/svg",E0={excalidraw:2,excalidrawLibrary:2},wn=5,KN=.7,qN=11,Br={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},of={LEFT:"left",CENTER:"center",RIGHT:"right"},QN=20,A2=.25,JN=32,bn={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},IE={artist:1,cartoonist:2},R2={thin:1,bold:2,extraBold:4},nn={strokeColor:at.black,backgroundColor:at.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:IE.artist,opacity:100,locked:!1},Tp="library",Pc="search",Fa={name:"default",defaultTab:Tp},_E=new Set(["iframe","embeddable","image"]),_n={selection:"selection",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",text:"text",image:"image",eraser:"eraser",frame:"frame",magicframe:"magicframe",laser:"laser"},Nu={MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},TE="Untitled",Ic={generalStats:1,elementProperties:2},ia=1,On={sharp:"sharp",round:"round",elbow:"elbow"},AE=.3,Ap="element",eO=Symbol.for("__test__originalId__"),RE=(e=>(e.ACTIVE="active",e.AWAY="away",e.IDLE="idle",e))(RE||{}),tO=U5.includes(devicePixelRatio)?devicePixelRatio:1,wi=()=>({showWelcomeScreen:!1,theme:ot.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:nn.backgroundColor,currentItemEndArrowhead:"arrow",currentItemFillStyle:nn.fillStyle,currentItemFontFamily:Es,currentItemFontSize:bl,currentItemOpacity:nn.opacity,currentItemRoughness:nn.roughness,currentItemStartArrowhead:null,currentItemStrokeColor:nn.strokeColor,currentItemRoundness:"round",currentItemArrowType:On.round,currentItemStrokeStyle:nn.strokeStyle,currentItemStrokeWidth:nn.strokeWidth,currentItemTextAlign:jf,currentHoveredFontFamily:null,cursorButton:"up",activeEmbeddable:null,newElement:null,editingTextElement:null,editingGroupId:null,editingLinearElement:null,activeTool:{type:"selection",customType:null,locked:nn.locked,lastActiveTool:null},penMode:!1,penDetected:!1,errorMessage:null,exportBackground:!0,exportScale:tO,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:_p,gridStep:ME,gridModeEnabled:!1,isBindingEnabled:!0,defaultSidebarDockedPreference:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:null,contextMenu:null,openMenu:null,openPopup:null,openSidebar:null,openDialog:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},hoveredElementIds:{},selectedGroupIds:{},selectedElementsAreBeingDragged:!1,selectionElement:null,shouldCacheIgnoreZoom:!1,stats:{open:!1,panels:Ic.generalStats|Ic.elementProperties},startBoundElement:null,suggestedBindings:[],frameRendering:{enabled:!0,clip:!0,name:!0,outline:!0},frameToHighlight:null,editingFrame:null,elementsToHighlight:null,toast:null,viewBackgroundColor:at.white,zenModeEnabled:!1,zoom:{value:1},viewModeEnabled:!1,pendingImageElementId:null,showHyperlinkPopup:!1,selectedLinearElement:null,snapLines:[],originSnapOffset:{x:0,y:0},objectsSnapModeEnabled:!1,userToFollow:null,followedBy:new Set,isCropping:!1,croppingElementId:null,searchMatches:[]}),nO=(e=>e)({showWelcomeScreen:{browser:!0,export:!1,server:!1},theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemRoundness:{browser:!0,export:!1,server:!1},currentItemArrowType:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},currentHoveredFontFamily:{browser:!1,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},activeEmbeddable:{browser:!1,export:!1,server:!1},newElement:{browser:!1,export:!1,server:!1},editingTextElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},activeTool:{browser:!0,export:!1,server:!1},penMode:{browser:!0,export:!1,server:!1},penDetected:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},gridStep:{browser:!0,export:!0,server:!0},gridModeEnabled:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},defaultSidebarDockedPreference:{browser:!0,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},contextMenu:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},openSidebar:{browser:!0,export:!1,server:!1},openDialog:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},hoveredElementIds:{browser:!1,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectedElementsAreBeingDragged:{browser:!1,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},stats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},frameRendering:{browser:!1,export:!1,server:!1},frameToHighlight:{browser:!1,export:!1,server:!1},editingFrame:{browser:!1,export:!1,server:!1},elementsToHighlight:{browser:!1,export:!1,server:!1},toast:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElementId:{browser:!1,export:!1,server:!1},showHyperlinkPopup:{browser:!1,export:!1,server:!1},selectedLinearElement:{browser:!0,export:!1,server:!1},snapLines:{browser:!1,export:!1,server:!1},originSnapOffset:{browser:!1,export:!1,server:!1},objectsSnapModeEnabled:{browser:!0,export:!1,server:!1},userToFollow:{browser:!1,export:!1,server:!1},followedBy:{browser:!1,export:!1,server:!1},isCropping:{browser:!1,export:!1,server:!1},croppingElementId:{browser:!1,export:!1,server:!1},searchMatches:{browser:!1,export:!1,server:!1}}),rO=(e,t)=>{var r;let n={};for(let a of Object.keys(e))if((r=nO[a])!=null&&r[t]){let i=e[a];n[a]=i}return n},jE=e=>rO(e,"export"),ci=({activeTool:e})=>e.type==="eraser",Vc=({activeTool:e})=>e.type==="hand",lt=(e,t,n)=>Math.min(Math.max(e,t),n),vi=(e,t,n="round")=>{let r=Math.pow(10,t);return Math[n]((e+Number.EPSILON)*r)/r},aO=(e,t,n="round")=>{let r=1/t;return Math[n](e*r)/r},x1=(e,t)=>(e+t)/2,Ou=e=>typeof e=="number"&&Number.isFinite(e),Mv=(e,t,n=1e-4)=>Math.abs(e-t)<n,Rp=e=>e<0?e+2*Math.PI:e>=2*Math.PI?e-2*Math.PI:e;function oo(e){return e*Math.PI/180}function Lf(e){return e*180/Math.PI}function iO(e){return Math.abs(Math.sin(2*e))<1e-4}function Vn(e,t,n=0,r=0){return[e-n,t-r]}function Pe(e,t=[0,0]){return Vn(e[0]-t[0],e[1]-t[1])}function In(e,t){return e[0]*t[1]-t[0]*e[1]}function Iv(e,t){return e[0]*t[0]+e[1]*t[1]}function ls(e,t){return[e[0]+t[0],e[1]+t[1]]}function jp(e,t){return[e[0]-t[0],e[1]-t[1]]}function an(e,t){return Vn(e[0]*t,e[1]*t)}function lO(e){return e[0]*e[0]+e[1]*e[1]}function sO(e){return Math.sqrt(lO(e))}var ar=e=>{let t=sO(e);return t===0?Vn(0,0):Vn(e[0]/t,e[1]/t)};function A(e,t){return[e,t]}function g5(e){return e.length===2?A(e[0],e[1]):void 0}function st(e,t=A(0,0)){return A(t[0]+e[0],t[1]+e[1])}function oO(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&!isNaN(e[0])&&typeof e[1]=="number"&&!isNaN(e[1])}function Xa(e,t){let n=Math.abs;return n(e[0]-t[0])<1e-4&&n(e[1]-t[1])<1e-4}function ce([e,t],[n,r],a){return A((e-n)*Math.cos(a)-(t-r)*Math.sin(a)+n,(e-n)*Math.sin(a)+(t-r)*Math.cos(a)+r)}function Lp(e,t=[0,0]){return A(e[0]+t[0],e[1]+t[1])}function Df(e,t){return A((e[0]+t[0])/2,(e[1]+t[1])/2)}function yt(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function cf(e,t){let n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}var Vi=(e,t,n)=>Lp(t,an(Pe(e,t),n)),LE=(e,t,n)=>t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1]);function Yg(e,t){return[e,t]}function cO(e,t){let n=e[1][1]-e[0][1],r=e[0][0]-e[1][0],a=t[1][1]-t[0][1],i=t[0][0]-t[1][0],l=n*i-a*r;if(l!==0){let s=n*e[0][0]+r*e[0][1],d=a*t[0][0]+i*t[0][1];return A((s*i-d*r)/l,(n*d-a*s)/l)}return null}function Oe(e,t){return[e,t]}var xo=(e,t,n=1e-4)=>{let r=b5(e,t);return r===0?!0:r<n},b5=(e,t)=>{let[n,r]=e,[[a,i],[l,s]]=t,d=n-a,u=r-i,o=l-a,f=s-i,m=d*o+u*f,U=o*o+f*f,g=-1;U!==0&&(g=m/U);let v,y;g<0?(v=a,y=i):g>1?(v=l,y=s):(v=a+g*o,y=i+g*f);let w=n-v,E=r-y;return Math.sqrt(w*w+E*E)};function df(e,t){let n=cO(Yg(e[0],e[1]),Yg(t[0],t[1]));return!n||!xo(n,t)||!xo(n,e)?null:n}function Zg(e,t){return[e,t]}function dO(e,t){return[Oe(e[0],A(e[1][0],e[0][1])),Oe(A(e[1][0],e[0][1]),e[1]),Oe(e[1],A(e[0][0],e[1][1])),Oe(A(e[0][0],e[1][1]),e[0])].map(n=>df(t,n)).filter(n=>!!n)}function el(e,t,n,r){return[e,t,n,r]}function _v(e,t,n,r=1e-6){return[(e(t+r,n)-e(t-r,n))/(2*r),(e(t,n+r)-e(t,n-r))/(2*r)]}function uO(e,t,n,r=.001,a=10){let i=1/0,l=0;for(;i>=r;){if(l>=a)return null;let s=e(t,n),d=[_v((v,y)=>e(v,y)[0],t,n),_v((v,y)=>e(v,y)[1],t,n)],u=[[-s[0]],[-s[1]]],o=d[0][0]*d[1][1]-d[0][1]*d[1][0];if(o===0)return null;let f=[[d[1][1]/o,-d[0][1]/o],[-d[1][0]/o,d[0][0]/o]],m=[[f[0][0]*u[0][0]+f[0][1]*u[1][0]],[f[1][0]*u[0][0]+f[1][1]*u[1][0]]];t=t+m[0][0],n=n+m[1][0];let[U,g]=e(t,n);i=Math.max(Math.abs(U),Math.abs(g)),l+=1}return[t,n]}var $u=(e,t)=>A((1-t)**3*e[0][0]+3*(1-t)**2*t*e[1][0]+3*(1-t)*t**2*e[2][0]+t**3*e[3][0],(1-t)**3*e[0][1]+3*(1-t)**2*t*e[1][1]+3*(1-t)*t**2*e[2][1]+t**3*e[3][1]);function DE(e,t){let n=hO(e);if(dO(Zg(A(n[0],n[1]),A(n[2],n[3])),t).length===0)return[];let r=s=>A(t[0][0]+s*(t[1][0]-t[0][0]),t[0][1]+s*(t[1][1]-t[0][1])),a=[[.5,0],[.2,0],[.8,0]],i=([s,d])=>{let u=uO((m,U)=>{let g=$u(e,m),v=r(U);return[g[0]-v[0],g[1]-v[1]]},s,d);if(!u)return null;let[o,f]=u;return o<0||o>1||f<0||f>1?null:$u(e,o)},l=i(a[0]);return l?[l]:(l=i(a[1]),l?[l]:(l=i(a[2]),l?[l]:[]))}function fO(e,t,n=.001){let r=(d,u,o,f=n)=>{let m=d,U=u,g;for(;U-m>f;)g=(U+m)/2,o(g-f)<o(g+f)?U=g:m=g;return g},a=0;for(let d=1/0,u=0;u<30;u++){let o=yt(t,$u(e,u/30));o<d&&(d=o,a=u)}let i=Math.max((a-1)/30,0),l=Math.min((a+1)/30,1),s=r(i,l,d=>yt(t,$u(e,d)));return s?$u(e,s):null}function PE(e,t){let n=fO(e,t);return n?yt(t,n):0}function hO(e){let[t,n,r,a]=e,i=[t[0],n[0],r[0],a[0]],l=[t[1],n[1],r[1],a[1]];return[Math.min(...i),Math.min(...l),Math.max(...i),Math.max(...l)]}function Tv(...e){return NE(e)}function Dp(e){return NE(e)}var Av=(e,t)=>{let n=e[0],r=e[1],a=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){let s=t[i][0],d=t[i][1],u=t[l][0],o=t[l][1];(d>r&&o<=r||d<=r&&o>r)&&n<(u-s)*(r-d)/(o-d)+s&&(a=!a)}return a},pO=(e,t,n=1e-4)=>{let r=!1;for(let a=0,i=t.length-1;a<i;a++)if(xo(e,Oe(t[a],t[a+1]),n)){r=!0;break}return r};function NE(e){return mO(e)?e:[...e,e[0]]}function mO(e){return Xa(e[0],e[e.length-1])}function tr(e,t){return pa([e,t])}var Pp=([e,t],[n,r])=>e<=n?t>=n:e>=n?r>=e:!1,Np=([e,t],[n,r])=>{let a=Math.max(e,n),i=Math.min(t,r);return a<=i?pa([a,i]):null},w1=(e,[t,n])=>e>=t&&e<=n;function pc([e,t,n],r){let a=(o,f,m)=>(o[0]-m[0])*(f[1]-m[1])-(f[0]-m[0])*(o[1]-m[1]),i=a(r,e,t),l=a(r,t,n),s=a(r,n,e),d=i<0||l<0||s<0,u=i>0||l>0||s>0;return!(d&&u)}var Rv=()=>{let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0"),a=`${e.getHours()}`.padStart(2,"0"),i=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${a}${i}`},zu=e=>e.charAt(0).toUpperCase()+e.slice(1),UO=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),Kg=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,gO=e=>Kg(e)||e instanceof Element&&!!e.closest("label, button"),Qs=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"),Gc=({fontFamily:e})=>{for(let[t,n]of Object.entries(Xt))if(n===e)return`${t}${CE(n).map(r=>`, ${r}`).join("")}`;return sf},_t=({fontSize:e,fontFamily:t})=>`${e}px ${Gc({fontFamily:t})}`,Yc=(e,t)=>{let n=0,r=null,a=(...i)=>{r=i,clearTimeout(n),n=window.setTimeout(()=>{r=null,e(...i)},t)};return a.flush=()=>{if(clearTimeout(n),r){let i=r;r=null,e(...i)}},a.cancel=()=>{r=null,clearTimeout(n)},a},S0=(e,t)=>{let n=null,r=null,a=null,i=s=>{n=window.requestAnimationFrame(()=>{n=null,e(...s),r=null,a&&(r=a,a=null,i(r))})},l=(...s)=>{if(et.MODE==="test"){e(...s);return}r=s,n===null?i(r):t!=null&&t.trailing&&(a=s)};return l.flush=()=>{n!==null&&(cancelAnimationFrame(n),n=null),r&&(e(...a||r),r=a=null)},l.cancel=()=>{r=a=null,n!==null&&(cancelAnimationFrame(n),n=null)},l},co=e=>1-Math.pow(1-e,4),jv=(e,t,n)=>(t-e)*co(n)+e,bO=({fromValues:e,toValues:t,onStep:n,duration:r=250,interpolateValue:a,onStart:i,onEnd:l,onCancel:s})=>{let d=!1,u=0,o;function f(m){if(d)return;o===void 0&&(o=m,i==null||i());let U=Math.min(m-o,r),g=co(U/r),v={};if(Object.keys(e).forEach(y=>{let w=y,E=(t[w]-e[w])*g+e[w];v[w]=E}),n(v),U<r){let y=U/r,w={};Object.keys(e).forEach(E=>{let S=E,k=e[S],I=t[S],T;T=a?a(k,I,y,S):jv(k,I,y),T==null&&(T=jv(k,I,y)),w[S]=T}),n(w),u=window.requestAnimationFrame(f)}else n(t),l==null||l()}return u=window.requestAnimationFrame(f),()=>{s==null||s(),d=!0,window.cancelAnimationFrame(u)}},vO=(e,t)=>{if(!e.length||t<1)return[];let n=0,r=0,a=Array(Math.ceil(e.length/t));for(;n<e.length;)a[r++]=e.slice(n,n+=t);return a},nr=(e,t)=>Math.abs(e-t),gn=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked},he=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter"),xi?e.replace(/\bCtrlOrCmd\b/gi,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/gi,"Ctrl")),jt=({clientX:e,clientY:t},{zoom:n,offsetLeft:r,offsetTop:a,scrollX:i,scrollY:l})=>{let s=(e-r)/n.value-i,d=(t-a)/n.value-l;return{x:s,y:d}},oa=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:r,offsetTop:a,scrollX:i,scrollY:l})=>{let s=(e+i)*n.value+r,d=(t+l)*n.value+a;return{x:s,y:d}},E1=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),yO="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--",xO="֑-߿יִ-﷽ﹰ-ﻼ",wO=new RegExp(`^[^${yO}]*[${xO}]`),OE=e=>wO.test(e),Pa=e=>{let[t,n]=e;return{x:t,y:n}},$E=e=>{if((e==null?void 0:e.name)==="AbortError"){console.warn(e);return}throw e},zE=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1},Js=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1},Na=e=>{let t=e.length===5&&e.substr(4,1)==="0",n=e.length===9&&e.substr(7,2)==="00";return t||n||e===at.transparent},j2=e=>e.fillStyle!=="solid"||Na(e.backgroundColor),EO=()=>{let e,t,n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n},SO=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},kO=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},CO=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),ud=()=>ll()?1:Date.now(),We=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),MO=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),Wi=(e,t)=>e.reduce((n,r)=>(n[t?t(r):String(r)]=r,n),{}),IO=e=>e.reduce((t,n,r)=>{let a={...n,prev:null,next:null};if(r!==0){let i=t[r-1];if(a.prev=i,i.next=a,r===e.length-1){let l=t[0];a.next=l,l.prev=a}}return t.push(a),t},[]),ll=()=>et.MODE==="test",FE=()=>et.MODE==="development",_O=()=>typeof process<"u"&&!0,BE=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),J1=(e,t)=>{let n=!1;for(let r in t){let a=t[r];if(typeof a<"u"){if(e[r]===a&&(typeof a!="object"||a===null))continue;n=!0}}return n?{...e,...t}:e},TO=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},Pf=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,qg=e=>{let t=e==null?void 0:e.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},Lv=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,Yn=(e,t,n,r=!1)=>{let a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return r&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let l of n)if(!(e[l]===t[l]||Lv(e[l],t[l])))return r&&console.warn(`%cisShallowEqual: ${l} not equal ->`,"color: #8B4000",e[l],t[l]),!1;return!0}return a.every(l=>{let s=n==null?void 0:n[l],d=s?s(e[l],t[l]):e[l]===t[l]||Lv(e[l],t[l]);return!d&&r&&console.warn(`%cisShallowEqual: ${l} not equal ->`,"color: #8B4000",e[l],t[l]),d})},k0=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(r){if(e==null||e(r),!n||!(r!=null&&r.defaultPrevented))return t==null?void 0:t(r)},wo=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function lr(e,t){if(!e)throw new Error(t)}var AO=e=>{let t,n,r=function(a){let i=Object.entries(a);if(t){let s=!0;for(let[d,u]of i)if(t.get(d)!==u){s=!1;break}if(s)return n}let l=e(a);return t=new Map(i),n=l,l};return r.clear=()=>{t=void 0,n=void 0},r},HE=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),rl=e=>JSON.parse(JSON.stringify(e)),cu=(e,t)=>Yn(e,t)?e:t;function Yt(e,t,n,r){var a;return e?((a=e==null?void 0:e.addEventListener)==null||a.call(e,t,n,r),()=>{var i;(i=e==null?void 0:e.removeEventListener)==null||i.call(e,t,n,r)}):()=>{}}function RO(e,t=!0){let n=e.length;if(n<4)return"";let r=e[0],a=e[1],i=e[2],l=`M${r[0].toFixed(2)},${r[1].toFixed(2)} Q${a[0].toFixed(2)},${a[1].toFixed(2)} ${x1(a[0],i[0]).toFixed(2)},${x1(a[1],i[1]).toFixed(2)} T`;for(let s=2,d=n-1;s<d;s++)r=e[s],a=e[s+1],l+=`${x1(r[0],a[0]).toFixed(2)},${x1(r[1],a[1]).toFixed(2)} `;return t&&(l+="Z"),l}var WE=e=>e.replace(/\r?\n|\r/g,`
|
|
48
|
+
`),pa=e=>e,Zc=async(e,...t)=>new Promise(n=>{n(e(...t))}),jO=(...e)=>Math.max(...e.map(t=>t?1:0))>0,Dv=class{constructor(e,t){F(this,"pool"),F(this,"entries",{}),this.pool=new pP(e,t)}all(){let e=t=>{if(t.data.result){let[n,r]=t.data.result;this.entries[n]=r}};return this.pool.addEventListener("fulfilled",e),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",e)}),Object.values(this.entries)))}},ep=e=>e.replace(/"/g,"""),Pv=e=>Array.isArray(e)?e:[e],la=e=>!!e&&e.type==="image"&&!!e.fileId,vt=e=>!!e&&e.type==="image",Cr=e=>!!e&&e.type==="embeddable",es=e=>!!e&&e.type==="iframe",sa=e=>!!e&&(e.type==="iframe"||e.type==="embeddable"),ke=e=>e!=null&&e.type==="text",XE=e=>e!=null&&e.type==="frame",tp=e=>e!=null&&e.type==="magicframe",He=e=>e!=null&&(e.type==="frame"||e.type==="magicframe"),ma=e=>e!=null&&LO(e.type),LO=e=>e==="freedraw",Ge=e=>e!=null&&v5(e.type),nt=e=>e!=null&&e.type==="arrow",Me=e=>nt(e)&&e.elbowed,v5=e=>e==="arrow"||e==="line",mi=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&VE(e.type),VE=e=>e==="arrow",Va=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),DO=e=>e!=null&&(e.type==="rectangle"||e.type==="diamond"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),uo=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||nt(e)),GE=e=>{let t=e==null?void 0:e.type;if(!t)return!1;switch(t){case"text":case"diamond":case"rectangle":case"iframe":case"embeddable":case"ellipse":case"arrow":case"freedraw":case"line":case"frame":case"magicframe":case"image":case"selection":return!0;default:return wo(t,null),!1}},C0=e=>e.type==="rectangle"||e.type==="ellipse"||e.type==="diamond",Ua=e=>{var t;return uo(e)&&!!((t=e.boundElements)!=null&&t.some(({type:n})=>n==="text"))},Ft=e=>e!==null&&"containerId"in e&&e.containerId!==null&&ke(e),fd=e=>e==="rectangle"||e==="embeddable"||e==="iframe"||e==="image",YE=e=>e==="line"||e==="arrow"||e==="diamond",PO=(e,t)=>!!((e===bn.ADAPTIVE_RADIUS||e===bn.LEGACY)&&fd(t.type)||e===bn.PROPORTIONAL_RADIUS&&YE(t.type)),NO=e=>YE(e.type)?{type:bn.PROPORTIONAL_RADIUS}:fd(e.type)?{type:bn.ADAPTIVE_RADIUS}:null,Op=e=>Object.hasOwn(e,"fixedPoint")&&e.fixedPoint!=null,sr=(e,t,n)=>{let r=e.split(`
|
|
49
|
+
`).map(l=>l||" ").join(`
|
|
50
|
+
`),a=parseFloat(t),i=FO(r,a,n);return{width:w5(r,t),height:i}},ZE="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),KE=(e,t)=>{let n=BO(e);return n===0?sr(ZE.split("").join(`
|
|
51
|
+
`),e,t).width+wn*2:n+wn*2},y5=(e,t)=>sr("",e,t).width+wn*2,OO=()=>w5(ZE,_t({fontSize:bl,fontFamily:Es}))>0,Kc=e=>WE(e).replace(/\t/g," "),x5=e=>Kc(e).split(`
|
|
52
|
+
`),$O=e=>{let t=x5(e.text).length;return e.height/t/e.fontSize},Nf=(e,t)=>e*t,qE=(e,t)=>Nf(e,t)+wn*2,L2,zO=class{constructor(){F(this,"canvas"),this.canvas=document.createElement("canvas")}getLineWidth(e,t){let n=this.canvas.getContext("2d");n.font=t;let r=n.measureText(e).width;return ll()?r*10:r}},Eo=(e,t)=>(L2||(L2=new zO),L2.getLineWidth(e,t)),w5=(e,t)=>{let n=x5(e),r=0;return n.forEach(a=>{r=Math.max(r,Eo(a,t))}),r},FO=(e,t,n)=>{let r=x5(e).length;return Nf(t,n)*r},Of=(()=>{let e={};return{calculate:(t,n)=>{let r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){let a=Eo(t,n);e[n][r]=a}return e[n][r]},getCache:t=>e[t],clearCache:t=>{e[t]=[]}}})(),BO=e=>{let t=Of.getCache(e);if(!t)return 0;let n=t.filter(r=>r!==void 0);return Math.max(...n)},D2,S1,P2,HO=e=>(D2||(D2=St.class(...Object.values(Gi))),D2.test(e)),WO=()=>{if(!S1)try{S1=VO()}catch{S1=XO()}return S1},E5=()=>(P2||(P2=GO()),P2),na={WHITESPACE:/\s/u,HYPHEN:/-/u,OPENING:/<\(\[\{/u,CLOSING:/>\)\]\}.,:;!\?…\//u},Gi={CHAR:new RegExp("\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}`'^〃〰〆#&*+-ー/\=|¦〒¬ ̄","u"),OPENING:/([{〈《⦅「「『【〖〔〘〚<〝/u,CLOSING:/)]}〉》⦆」」』】〗〕〙〛>。.,、〟‥?!:;・〜〞/u,CURRENCY:/¥₩£¢$/u},Hs={FLAG:new RegExp("\\p{RI}\\p{RI}","u"),JOINER:new RegExp("(?:\\p{Emoji_Modifier}|\\uFE0F\\u20E3?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?","u"),ZWJ:/\u200D/u,ANY:/[\p{Emoji}]/u,MOST:/[\p{Extended_Pictographic}\p{Emoji_Presentation}]/u},XO=()=>St.or(E5(),hn.On(na.HYPHEN,na.WHITESPACE,Gi.CHAR)),VO=()=>St.or(E5(),hn.Before(na.WHITESPACE).Build(),hn.After(na.WHITESPACE,na.HYPHEN).Build(),hn.Before(Gi.CHAR,Gi.CURRENCY).NotPrecededBy(na.OPENING,Gi.OPENING).Build(),hn.After(Gi.CHAR).NotFollowedBy(na.HYPHEN,na.CLOSING,Gi.CLOSING).Build(),hn.BeforeMany(Gi.OPENING).NotPrecededBy(na.OPENING).Build(),hn.AfterMany(Gi.CLOSING).NotFollowedBy(na.CLOSING).Build(),hn.AfterMany(na.CLOSING).FollowedBy(na.OPENING).Build()),GO=()=>St.group(St.or(Hs.FLAG,St.and(Hs.MOST,Hs.JOINER,St.build(`(?:${Hs.ZWJ.source}(?:${Hs.FLAG.source}|${Hs.ANY.source}${Hs.JOINER.source}))*`)))),St={build:e=>new RegExp(e,"u"),join:(...e)=>e.map(t=>t.source).join(""),and:(...e)=>St.build(St.join(...e)),or:(...e)=>St.build(e.map(t=>t.source).join("|")),group:(...e)=>St.build(`(${St.join(...e)})`),class:(...e)=>St.build(`[${St.join(...e)}]`)},hn={On:(...e)=>{let t=St.join(...e);return St.build(`([${t}])`)},Before:(...e)=>{let t=St.join(...e),n=()=>St.build(`(?=[${t}])`);return hn.Chain(n)},After:(...e)=>{let t=St.join(...e),n=()=>St.build(`(?<=[${t}])`);return hn.Chain(n)},BeforeMany:(...e)=>{let t=St.join(...e),n=()=>St.build(`(?<![${t}])(?=[${t}])`);return hn.Chain(n)},AfterMany:(...e)=>{let t=St.join(...e),n=()=>St.build(`(?<=[${t}])(?![${t}])`);return hn.Chain(n)},NotBefore:(...e)=>{let t=St.join(...e),n=()=>St.build(`(?![${t}])`);return hn.Chain(n)},NotAfter:(...e)=>{let t=St.join(...e),n=()=>St.build(`(?<![${t}])`);return hn.Chain(n)},Chain:e=>({Build:e,PreceededBy:(...t)=>{let n=e(),r=hn.After(...t).Build(),a=()=>St.and(r,n);return hn.Chain(a)},FollowedBy:(...t)=>{let n=e(),r=hn.Before(...t).Build(),a=()=>St.and(n,r);return hn.Chain(a)},NotPrecededBy:(...t)=>{let n=e(),r=hn.NotAfter(...t).Build(),a=()=>St.and(r,n);return hn.Chain(a)},NotFollowedBy:(...t)=>{let n=e(),r=hn.NotBefore(...t).Build(),a=()=>St.and(n,r);return hn.Chain(a)}})},YO=e=>{let t=WO();return e.normalize("NFC").split(t).filter(Boolean)},Po=(e,t,n)=>{if(!Number.isFinite(n)||n<0)return e;let r=[],a=e.split(`
|
|
53
|
+
`);for(let i of a){if(Eo(i,t)<=n){r.push(i);continue}let l=ZO(i,t,n);r.push(...l)}return r.join(`
|
|
54
|
+
`)},ZO=(e,t,n)=>{let r=[],a=YO(e)[Symbol.iterator](),i="",l=0,s=a.next();for(;!s.done;){let d=s.value,u=i+d,o=QO(d)?l+Of.calculate(d,t):Eo(u,t);if(/\s/.test(d)||o<=n){i=u,l=o,s=a.next();continue}if(i)r.push(i.trimEnd()),i="",l=0;else{let f=KO(d,t,n),m=f[f.length-1]??"",U=f.slice(0,-1);r.push(...U),i=m,l=Eo(m,t),s=a.next()}}if(i){let d=qO(i,t,n);r.push(d)}return r},KO=(e,t,n)=>{if(E5().test(e))return[e];JO(e);let r=[],a=Array.from(e),i="",l=0;for(let s of a){let d=Of.calculate(s,t),u=l+d;if(u<=n){i=i+s,l=u;continue}i&&r.push(i),i=s,l=d}return i&&r.push(i),r},qO=(e,t,n)=>{if(!(Eo(e,t)>n))return e;let[,r,a]=e.match(/^(.+?)(\s+)$/)??[e,e.trimEnd(),""],i=Eo(r,t);for(let l of Array.from(a)){let s=Of.calculate(l,t),d=i+s;if(d>n)break;r=r+l,i=d}return r},QO=e=>e.codePointAt(0)!==void 0&&e.codePointAt(1)===void 0,JO=e=>{if((et.MODE===Tr.TEST||et.DEV)&&/\s/.test(e))throw new Error("Word should not contain any whitespaces!")},dr=class{};F(dr,"rg",new af),F(dr,"cache",new WeakMap),F(dr,"get",e=>dr.cache.get(e)),F(dr,"set",(e,t)=>dr.cache.set(e,t)),F(dr,"delete",e=>dr.cache.delete(e)),F(dr,"destroy",()=>{dr.cache=new WeakMap}),F(dr,"generateElementShape",(e,t)=>{let n=t!=null&&t.isExporting?void 0:dr.get(e);if(n!==void 0)return n;l6.delete(e);let r=lV(e,dr.rg,t||{isExporting:!1,canvasBackgroundColor:at.white,embedsValidationStatus:null});return dr.cache.set(e,r),r});var Qt=dr,Da=e=>"var(--icon-fill-color)",QE=e=>e===ot.LIGHT?Fn.white:"#1e1e1e",ae=(e,t=512)=>{let{width:n=512,height:r=n,mirror:a,style:i,...l}=typeof t=="number"?{width:t}:t;return p.jsx("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${n} ${r}`,className:Ae({"rtl-mirror":a}),style:i,...l,children:typeof e=="string"?p.jsx("path",{fill:"currentColor",d:e}):e})},Se={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},qe={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"};ae(p.jsxs("g",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("rect",{x:3,y:8,width:18,height:4,rx:1}),p.jsx("line",{x1:12,y1:8,x2:12,y2:21}),p.jsx("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),p.jsx("path",{d:"M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5"})]}),Se);var S5=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),p.jsx("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),p.jsx("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),p.jsx("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),p.jsx("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),Se),e$=ae(p.jsxs("svg",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),p.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),Se),t$=ae(p.jsxs("g",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("circle",{cx:"12",cy:"12",r:"1"}),p.jsx("circle",{cx:"12",cy:"19",r:"1"}),p.jsx("circle",{cx:"12",cy:"5",r:"1"})]}),Se),n$=ae(p.jsxs("svg",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),p.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),p.jsx("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),Se),M0=ae(p.jsxs("g",{children:[p.jsx("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z",stroke:"currentColor",strokeWidth:"1.25"}),p.jsx("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z",stroke:"currentColor",strokeWidth:"1.25"}),p.jsx("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:p.jsx("path",{stroke:"none",d:"M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481",fill:"#fff"})}),p.jsx("g",{mask:"url(#UnlockedIcon)",children:p.jsx("path",{stroke:"none",d:"M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z",fill:"currentColor"})})]}),qe),k5=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z"}),p.jsx("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),p.jsx("path",{d:"M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916"})]}),qe),r$=ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),p.jsx("path",{d:"M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:41,height:94,fill:"none"}),a$=ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),p.jsx("path",{d:"M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:85,height:71,fill:"none"}),i$=ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),p.jsx("path",{d:"M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:38,height:78,fill:"none"});ae(p.jsx("g",{fill:"currentColor",children:p.jsx("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),{width:40,height:40,fill:"none"});var l$=ae(p.jsxs("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z"}),p.jsx("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),s$=ae(p.jsxs("g",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),Se),o$=ae(p.jsxs("g",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z"})]}),Se),c$=ae(p.jsxs("g",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("circle",{cx:"12",cy:"12",r:"9"})]}),Se),d$=ae(p.jsxs("g",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),p.jsx("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),p.jsx("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),Se),u$=ae(p.jsx("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),qe),f$=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),p.jsx("path",{d:"M16 7h4"}),p.jsx("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),Se),uf=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{clipRule:"evenodd",d:"m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z"}),p.jsx("path",{d:"m11.25 5.417 3.333 3.333"})]}),qe),JE=ae(p.jsxs("g",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),p.jsx("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),p.jsx("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),p.jsx("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),p.jsx("polyline",{points:"5 20 11 4 13 4 20 20"})]}),Se),h$=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{d:"M12.5 6.667h.01"}),p.jsx("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z"}),p.jsx("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),p.jsx("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),qe),p$=ae(p.jsxs("g",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"}),p.jsx("path",{d:"M18 13.3l-6.3 -6.3"})]}),Se),Nv=ae(p.jsx("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),qe),Ov=ae(p.jsx("path",{d:"M5 10h10",strokeWidth:"1.25"}),qe),m$=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M21 21l-6 -6"}),p.jsx("path",{d:"M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403"}),p.jsx("path",{d:"M3 4v4h4"})]}),Se),So=ae(p.jsx("path",{strokeWidth:"1.25",d:"M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5"}),qe),U$=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("polyline",{points:"12 16 18 10 12 4"}),p.jsx("polyline",{points:"8 4 2 10 8 16"})]}),qe),Qg=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{d:"M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z"}),p.jsx("path",{clipRule:"evenodd",d:"M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z"})]}),qe),Jg=ae(p.jsx("path",{clipRule:"evenodd",d:"M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z",stroke:"currentColor"}),qe),e6=ae(p.jsx("g",{stroke:"currentColor",strokeLinejoin:"round",children:p.jsx("path",{d:"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667"})}),{...qe,strokeWidth:1.5}),eS=ae(p.jsxs("g",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),p.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),p.jsx("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),Se),I0=ae(p.jsx("path",{strokeWidth:"1.25",d:"M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10"}),qe),C5=ae(p.jsxs("g",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("circle",{cx:"12",cy:"12",r:"9"}),p.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),p.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),Se),g$=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("circle",{cx:"12",cy:"12",r:"9"}),p.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),p.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),Se),$v=ae(p.jsx("path",{strokeWidth:"1.25",d:"M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5"}),qe),tS=ae(p.jsx("path",{d:"M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5",strokeWidth:"1.25"}),qe),b$=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{d:"M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0"}),p.jsx("path",{d:"M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084"})]}),qe),v$=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),p.jsx("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),Se),y$=ae(p.jsx("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),t6=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{d:"M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416"}),p.jsx("path",{d:"M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416"})]}),qe),x$=ae("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}),w$=ae("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}),M5=ae(p.jsx("path",{d:"m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z",strokeWidth:"1.25"}),qe);ae("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});var E$=ae("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"),N2=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),p.jsx("path",{d:"M13.737 9.737c2.299 -2.3 3.23 -5.095 2.081 -6.245c-1.15 -1.15 -3.945 -.217 -6.244 2.082c-2.3 2.299 -3.231 5.095 -2.082 6.244c1.15 1.15 3.946 .218 6.245 -2.081z"}),p.jsx("path",{d:"M7.492 11.818c.362 .362 .768 .676 1.208 .934l6.895 4.047c1.078 .557 2.255 -.075 3.692 -1.512c1.437 -1.437 2.07 -2.614 1.512 -3.692c-.372 -.718 -1.72 -3.017 -4.047 -6.895a6.015 6.015 0 0 0 -.934 -1.208"})]}),Se),nS=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M15 8h.01"}),p.jsx("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),p.jsx("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),p.jsx("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),p.jsx("path",{d:"M19 16v6"}),p.jsx("path",{d:"M22 19l-3 3l-3 -3"})]}),Se),S$=ae("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});ae("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});ae("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});var k$=ae("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");ae("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");var zv=ae(p.jsx("path",{d:"M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5",strokeWidth:"1.25"}),qe),Fv=ae(p.jsx("path",{d:"M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5",strokeWidth:"1.25"}),qe),C$=ae("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});ae(p.jsx("path",{d:"M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834",strokeWidth:"1.5"}),qe);ae("M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z");ae("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});ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1"}),p.jsx("path",{d:"M12 14v-11"}),p.jsx("path",{d:"M9 6l3 -3l3 3"})]}),Se);ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{fill:"currentColor",d:"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"}),p.jsx("path",{stroke:"currentColor",fill:"currentColor",d:"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z"})]}),{width:64,height:64});ae(p.jsx("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024});var rS=p.jsxs("g",{strokeWidth:1.5,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M12 10l0 10"}),p.jsx("path",{d:"M12 10l4 4"}),p.jsx("path",{d:"M12 10l-4 4"}),p.jsx("path",{d:"M4 4l16 0"})]}),aS=p.jsxs("g",{strokeWidth:1.5,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M12 5l0 14"}),p.jsx("path",{d:"M16 9l-4 -4"}),p.jsx("path",{d:"M8 9l4 -4"})]}),Bv=ae(aS,Se),Hv=ae(aS,{...Se,style:{transform:"rotate(180deg)"}}),Wv=ae(rS,Se),Xv=ae(rS,{...Se,style:{transform:"rotate(180deg)"}}),Vv=ae(p.jsxs(p.Fragment,{children:[p.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[p.jsx("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),qe),Gv=ae(p.jsxs(p.Fragment,{children:[p.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[p.jsx("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),qe),Yv=ae(p.jsxs(p.Fragment,{children:[p.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[p.jsx("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),qe),Zv=ae(p.jsxs(p.Fragment,{children:[p.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[p.jsx("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),qe),M$=ae(p.jsxs(p.Fragment,{children:[p.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[p.jsx("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),qe),I$=ae(p.jsxs(p.Fragment,{children:[p.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[p.jsx("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),qe),Kv=ae(p.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",children:[p.jsx("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),p.jsx("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z"})]}),qe),qv=ae(p.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",children:[p.jsx("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),p.jsx("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z"})]}),qe),iS=ae(p.jsxs("g",{strokeWidth:"1.5",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("circle",{cx:"9",cy:"7",r:"4"}),p.jsx("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),p.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),p.jsx("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),Se);ae("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");ae("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");var hd=ae(p.jsxs(p.Fragment,{children:[p.jsx("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M15 5 5 15M5 5l10 10"})}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),qe);ae("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});ae("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});ae("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});var Qv=we.memo(({theme:e})=>ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M25 26H111V111H25",fill:Da()}),p.jsx("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:Da(),strokeWidth:"2"}),p.jsx("path",{d:"M100 100H160V160H100",fill:Da()}),p.jsx("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:Da(),strokeWidth:"2"}),p.jsxs("g",{fill:QE(e),stroke:Da(),strokeWidth:"6",children:[p.jsx("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),p.jsx("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),p.jsx("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),p.jsx("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),Jv=we.memo(({theme:e})=>ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M25 26H111V111H25",fill:Da()}),p.jsx("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:Da(),strokeWidth:"2"}),p.jsx("path",{d:"M100 100H160V160H100",fill:Da()}),p.jsx("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:Da(),strokeWidth:"2"}),p.jsxs("g",{fill:QE(e),stroke:Da(),strokeWidth:"6",children:[p.jsx("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),p.jsx("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),p.jsx("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),p.jsx("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),p.jsx("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),p.jsx("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),_$=ae(p.jsx("g",{strokeWidth:1.25,children:p.jsx("path",{d:"M5.879 2.625h8.242a3.27 3.27 0 0 1 3.254 3.254v8.242a3.27 3.27 0 0 1-3.254 3.254H5.88a3.27 3.27 0 0 1-3.254-3.254V5.88A3.27 3.27 0 0 1 5.88 2.626l-.001-.001ZM4.518 16.118l7.608-12.83m.198 13.934 5.051-9.897M2.778 9.675l9.348-6.387m-7.608 12.83 12.857-8.793"})}),qe),T$=ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),p.jsx("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:p.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.25"})}),p.jsx("g",{mask:"url(#FillHachureIcon)",children:p.jsx("path",{d:"M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})]}),qe),A$=ae(p.jsxs(p.Fragment,{children:[p.jsxs("g",{clipPath:"url(#a)",children:[p.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),p.jsx("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:p.jsx("path",{d:"M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),p.jsx("g",{mask:"url(#FillCrossHatchIcon)",children:p.jsx("path",{d:"M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z",fill:"currentColor"})})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),qe),R$=ae(p.jsxs(p.Fragment,{children:[p.jsx("g",{clipPath:"url(#a)",children:p.jsx("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z",stroke:"currentColor",strokeWidth:"1.25"})}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...qe,fill:"currentColor"}),lS=ae(p.jsx(p.Fragment,{children:p.jsx("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),qe),j$=ae(p.jsx("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),qe),L$=ae(p.jsx("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),qe);we.memo(({theme:e})=>ae(p.jsx("path",{d:"M6 10H34",stroke:Da(),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20}));var D$=ae(p.jsxs("g",{strokeWidth:"2",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M5 12h2"}),p.jsx("path",{d:"M17 12h2"}),p.jsx("path",{d:"M11 12h2"})]}),Se),P$=ae(p.jsxs("g",{strokeWidth:"2",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M4 12v.01"}),p.jsx("path",{d:"M8 12v.01"}),p.jsx("path",{d:"M12 12v.01"}),p.jsx("path",{d:"M16 12v.01"}),p.jsx("path",{d:"M20 12v.01"})]}),Se),N$=ae(p.jsx("path",{d:"M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814",strokeWidth:"1.25"}),qe),O$=ae(p.jsx("path",{d:"M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43",strokeWidth:"1.25"}),qe),$$=ae(p.jsx("path",{d:"M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42",strokeWidth:"1.25"}),qe),z$=ae(p.jsxs("svg",{strokeWidth:"1.5",children:[p.jsx("path",{d:"M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10"}),p.jsx("path",{d:"M13.3333 3.33331V3.34331"}),p.jsx("path",{d:"M16.6667 3.33331V3.34331"}),p.jsx("path",{d:"M16.6667 6.66669V6.67669"}),p.jsx("path",{d:"M16.6667 10V10.01"}),p.jsx("path",{d:"M3.33334 13.3333V13.3433"}),p.jsx("path",{d:"M16.6667 13.3333V13.3433"}),p.jsx("path",{d:"M3.33334 16.6667V16.6767"}),p.jsx("path",{d:"M6.66666 16.6667V16.6767"}),p.jsx("path",{d:"M10 16.6667V16.6767"}),p.jsx("path",{d:"M13.3333 16.6667V16.6767"}),p.jsx("path",{d:"M16.6667 16.6667V16.6767"})]}),qe),F$=ae(p.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),p.jsx("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),p.jsx("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),p.jsx("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),p.jsx("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),p.jsx("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),p.jsx("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),p.jsx("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),p.jsx("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),p.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),p.jsx("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),p.jsx("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),Se),B$=ae(p.jsxs("g",{stroke:"currentColor",opacity:.3,strokeWidth:2,children:[p.jsx("path",{d:"M12 12l9 0"}),p.jsx("path",{d:"M3 9l6 6"}),p.jsx("path",{d:"M3 15l6 -6"})]}),Se),H$=we.memo(({flip:e=!1})=>ae(p.jsxs("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",children:[p.jsx("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),p.jsx("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})),W$=we.memo(({flip:e=!1})=>ae(p.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[p.jsx("path",{d:"M32 10L6 10",strokeWidth:2}),p.jsx("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),X$=we.memo(({flip:e=!1})=>ae(p.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[p.jsx("path",{d:"M26 10L6 10"}),p.jsx("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),V$=we.memo(({flip:e=!1})=>ae(p.jsx("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",children:p.jsx("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"currentColor",strokeWidth:2,fill:"none"})}),{width:40,height:20})),G$=we.memo(({flip:e=!1})=>ae(p.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[p.jsx("path",{d:"M32 10L6 10",strokeWidth:2}),p.jsx("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})),Y$=we.memo(({flip:e=!1})=>ae(p.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",children:[p.jsx("path",{d:"M6,9.5H27"}),p.jsx("path",{d:"M27,5L34,10L27,14Z",fill:"none"})]}),{width:40,height:20})),Z$=we.memo(({flip:e=!1})=>ae(p.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[p.jsx("path",{d:"M6,9.5H20"}),p.jsx("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),K$=we.memo(({flip:e=!1})=>ae(p.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[p.jsx("path",{d:"M6,9.5H20"}),p.jsx("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),q$=we.memo(({flip:e=!1})=>ae(p.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:p.jsx("path",{d:"M34,10 H6 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),Q$=we.memo(({flip:e=!1})=>ae(p.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:p.jsx("path",{d:"M34,10 H6 M15,10 L15,15 L15,5"})}),{width:40,height:20})),J$=we.memo(({flip:e=!1})=>ae(p.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:p.jsx("path",{d:"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),ez=ae(p.jsxs(p.Fragment,{children:[p.jsx("g",{clipPath:"url(#a)",children:p.jsx("path",{d:"M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),qe),tz=ae(p.jsxs(p.Fragment,{children:[p.jsx("g",{clipPath:"url(#a)",children:p.jsx("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),qe),nz=ae(p.jsxs(p.Fragment,{children:[p.jsx("g",{clipPath:"url(#a)",children:p.jsx("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),qe),rz=ae(p.jsx(p.Fragment,{children:p.jsx("path",{d:"m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),qe),_0=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M3 7v-2h13v2"}),p.jsx("path",{d:"M10 5v14"}),p.jsx("path",{d:"M12 19h-4"}),p.jsx("path",{d:"M15 13v-1h6v1"}),p.jsx("path",{d:"M18 12v7"}),p.jsx("path",{d:"M17 19h2"})]}),Se),az=ae(p.jsx(p.Fragment,{children:p.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M7 12h10"}),p.jsx("path",{d:"M7 5v14"}),p.jsx("path",{d:"M17 5v14"}),p.jsx("path",{d:"M15 19h4"}),p.jsx("path",{d:"M15 5h4"}),p.jsx("path",{d:"M5 19h4"}),p.jsx("path",{d:"M5 5h4"})]})}),Se),$p=ae(p.jsx(p.Fragment,{children:p.jsx("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334"})})}),qe),n6=ae(p.jsxs(p.Fragment,{children:[p.jsx("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M5.833 6.667 2.5 10l3.333 3.333M14.167 6.667 17.5 10l-3.333 3.333M11.667 3.333 8.333 16.667"})}),p.jsx("defs",{children:p.jsx("clipPath",{id:"a",children:p.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),qe),iz=ae(p.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),p.jsx("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),p.jsx("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),Se),lz=ae(p.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),p.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),p.jsx("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),Se),sz=ae(p.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),p.jsx("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),p.jsx("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),Se),oz=we.memo(({theme:e})=>ae(p.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),p.jsx("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),Se)),cz=we.memo(({theme:e})=>ae(p.jsxs("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),p.jsx("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),Se)),dz=we.memo(({theme:e})=>ae(p.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),p.jsx("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),p.jsx("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),Se)),sS=ae(p.jsxs("g",{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M21 19h-18l9 -15"}),p.jsx("path",{d:"M20.615 15.171h.015"}),p.jsx("path",{d:"M19.515 11.771h.015"}),p.jsx("path",{d:"M17.715 8.671h.015"}),p.jsx("path",{d:"M15.415 5.971h.015"})]}),Se),uz=ae(p.jsx("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512});ae(p.jsx("path",{d:"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z"}));var oS=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),p.jsx("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),p.jsx("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),p.jsx("path",{d:"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47"})]}),Se),ey=ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),p.jsx("path",{d:"M7 11l5 5l5 -5"}),p.jsx("path",{d:"M12 4l0 12"})]}),Se),I5=ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"}),p.jsx("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),Se),fz=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),p.jsx("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),p.jsx("path",{d:"M9.15 14.85l8.85 -10.85"}),p.jsx("path",{d:"M6 4l8.85 10.85"})]}),Se),hz=ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),p.jsx("path",{d:"M12 17l0 .01"}),p.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),Se);ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M7 4v16l13 -8z"})]}),Se);ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z",strokeWidth:"0",fill:"currentColor"})]}),Se);var pz=ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M5 12l5 5l10 -10"})]}),Se),mz=ae(p.jsxs(p.Fragment,{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z"}),p.jsx("path",{d:"M12 9v4"}),p.jsx("path",{d:"M12 17h.01"})]}),Se),Uz=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M11 7l6 6"}),p.jsx("path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z"})]}),Se),gz=ae(p.jsxs("g",{strokeWidth:1.5,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M12 3l-4 7h8z"}),p.jsx("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),p.jsx("path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"})]}),Se),cS=ae(p.jsxs("g",{strokeWidth:1.5,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M4 7l16 0"}),p.jsx("path",{d:"M4 17l16 0"}),p.jsx("path",{d:"M7 4l0 16"}),p.jsx("path",{d:"M17 4l0 16"})]}),Se),dS=ae(p.jsx("path",{fill:"currentColor",d:"M407.48,111.18C335.587,108.103 269.573,152.338 245.08,220C220.587,152.338 154.573,108.103 82.68,111.18C80.285,168.229 107.577,222.632 154.74,254.82C178.908,271.419 193.35,298.951 193.27,328.27L193.27,379.13L296.9,379.13L296.9,328.27C296.816,298.953 311.255,271.42 335.42,254.82C382.596,222.644 409.892,168.233 407.48,111.18Z"})),np=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{d:"M4.16602 10H15.8327"}),p.jsx("path",{d:"M12.5 13.3333L15.8333 10"}),p.jsx("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),qe),uS=ae(p.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[p.jsx("path",{clipRule:"evenodd",d:"m9.644 13.69 7.774-7.773a2.357 2.357 0 0 0-3.334-3.334l-7.773 7.774L8 12l1.643 1.69Z"}),p.jsx("path",{d:"m13.25 3.417 3.333 3.333M10 10l2-2M5 15l3-3M2.156 17.894l1-1M5.453 19.029l-.144-1.407M2.377 11.887l.866 1.118M8.354 17.273l-1.194-.758M.953 14.652l1.408.13"})]}),20),fS=ae(p.jsxs("g",{stroke:"currentColor",fill:"none",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),p.jsx("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),p.jsx("path",{d:"M15 6l3 3"}),p.jsx("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),p.jsx("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),Se);ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),p.jsx("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),p.jsx("path",{d:"M15 6l3 3"}),p.jsx("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),p.jsx("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),Se);ae(p.jsxs("g",{stroke:"currentColor",fill:"none",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),p.jsx("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),p.jsx("path",{d:"M6 7.63c-1.391 -.236 -2.787 .395 -3.534 1.689a3.474 3.474 0 0 0 1.271 4.745l4.263 2.514l6 -3.348"}),p.jsx("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),p.jsx("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),p.jsx("path",{d:"M18 16.302c1.391 .236 2.787 -.395 3.534 -1.689a3.474 3.474 0 0 0 -1.271 -4.745l-4.308 -2.514l-5.955 3.42"})]}),Se);var bz=ae(p.jsxs("g",{stroke:"currentColor",fill:"none",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),p.jsx("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),p.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),p.jsx("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),Se),_5=ae(p.jsxs("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),p.jsx("path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"})]}),Se),vz=ae(p.jsxs("g",{stroke:"currentColor",fill:"none",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),p.jsx("path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"}),p.jsx("path",{d:"M3 3l18 18"})]}),Se);ae(p.jsxs("g",{stroke:"currentColor",fill:"none",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),p.jsx("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),p.jsx("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),p.jsx("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),p.jsx("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),p.jsx("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),Se);var yz=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),p.jsx("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),p.jsx("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),p.jsx("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),p.jsx("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),p.jsx("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),Se),ko=ae(p.jsxs("g",{strokeWidth:1.5,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),p.jsx("path",{d:"M21 21l-6 -6"})]}),Se),xz=ae(p.jsxs("g",{strokeWidth:1.5,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),p.jsx("path",{d:"M12 7v5l3 3"}),p.jsx("path",{d:"M19 16l-2 3h4l-2 3"})]}),Se),wz=ae(p.jsxs("g",{strokeWidth:1.5,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z"}),p.jsx("path",{d:"M5 10a7 7 0 0 0 14 0"}),p.jsx("path",{d:"M8 21l8 0"}),p.jsx("path",{d:"M12 17l0 4"})]}),Se),Ez=ae(p.jsxs("g",{strokeWidth:1.5,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M3 3l18 18"}),p.jsx("path",{d:"M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1"}),p.jsx("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),p.jsx("path",{d:"M8 21l8 0"}),p.jsx("path",{d:"M12 17l0 4"})]}),Se),hS=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),Se),Sz=ae(p.jsxs("g",{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M8 8m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z"}),p.jsx("path",{d:"M12 20v.01"}),p.jsx("path",{d:"M16 20v.01"}),p.jsx("path",{d:"M8 20v.01"}),p.jsx("path",{d:"M4 20v.01"}),p.jsx("path",{d:"M4 16v.01"}),p.jsx("path",{d:"M4 12v.01"}),p.jsx("path",{d:"M4 8v.01"}),p.jsx("path",{d:"M4 4v.01"}),p.jsx("path",{d:"M8 4v.01"}),p.jsx("path",{d:"M12 4v.01"}),p.jsx("path",{d:"M16 4v.01"}),p.jsx("path",{d:"M20 4v.01"}),p.jsx("path",{d:"M20 8v.01"}),p.jsx("path",{d:"M20 12v.01"}),p.jsx("path",{d:"M20 16v.01"}),p.jsx("path",{d:"M20 20v.01"})]}),Se),kz=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M5 3v18"}),p.jsx("path",{d:"M19 21v-18"}),p.jsx("path",{d:"M5 7h14"}),p.jsx("path",{d:"M5 15h14"}),p.jsx("path",{d:"M8 13v4"}),p.jsx("path",{d:"M11 13v4"}),p.jsx("path",{d:"M16 13v4"}),p.jsx("path",{d:"M14 5v4"}),p.jsx("path",{d:"M11 5v4"}),p.jsx("path",{d:"M8 5v4"}),p.jsx("path",{d:"M3 21h18"})]}),Se),Cz=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M3 12l18 0"}),p.jsx("path",{d:"M7 16l10 0l-10 5l0 -5"}),p.jsx("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),Se),Mz=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M12 3l0 18"}),p.jsx("path",{d:"M16 7l0 10l5 0l-5 -10"}),p.jsx("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),Se),pS=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M5 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"}),p.jsx("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),p.jsx("path",{d:"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"})]}),Se),T5=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),p.jsx("path",{d:"M22 22l-3 -3"}),p.jsx("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),p.jsx("path",{d:"M3 11v-1"}),p.jsx("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),p.jsx("path",{d:"M10 3h1"}),p.jsx("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),Se),Iz=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),p.jsx("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),p.jsx("path",{d:"M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"}),p.jsx("path",{d:"M10 15l2 6l2 -6"}),p.jsx("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),Se),_z=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),p.jsx("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),p.jsx("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),p.jsx("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),p.jsx("path",{d:"M11 21v-6l3 6v-6"})]}),Se),Tz=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0"}),p.jsx("path",{d:"M4 8l5 0"}),p.jsx("path",{d:"M15 8l4 0"})]}),Se),Az=ae(p.jsxs("g",{strokeWidth:1.25,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1"}),p.jsx("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),p.jsx("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),p.jsx("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),p.jsx("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),Se),Rz=ae(p.jsxs("g",{stroke:"currentColor",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4"})]}),{...Se,strokeWidth:1.5});ae(p.jsxs("g",{strokeWidth:1.5,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"}),p.jsx("path",{d:"M21 12h-13l3 -3"}),p.jsx("path",{d:"M11 15l-3 -3"})]}),Se);var jz=ae(p.jsxs("g",{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z"}),p.jsx("path",{d:"M10 9l5 3l-5 3z"})]}),Se),Lz=ae(p.jsxs("g",{strokeWidth:1.5,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M3 6h18"}),p.jsx("path",{d:"M3 12h18"}),p.jsx("path",{d:"M3 18h18"}),p.jsx("path",{d:"M6 3v18"}),p.jsx("path",{d:"M12 3v18"}),p.jsx("path",{d:"M18 3v18"})]}),Se),Dz=ae(p.jsxs("g",{strokeWidth:1.5,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),p.jsx("path",{d:"M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),p.jsx("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),Se),Pz=ae(p.jsxs("g",{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M6 18l12 -12"}),p.jsx("path",{d:"M18 10v-4h-4"})]}),Se),Nz=ae(p.jsxs("g",{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),p.jsx("path",{d:"M18 4l3 3l-3 3"})]}),Se),Oz=ae(p.jsxs("g",{children:[p.jsx("path",{d:"M16,12L20,9L16,6"}),p.jsx("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),Se),mS=ae(p.jsxs("g",{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M6 9l6 6l6 -6"})]}),Se),$z=ae(p.jsxs("g",{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M6 15l6 -6l6 6"})]}),Se),zz=ae(p.jsxs("g",{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M6 15l6 -6l6 6"})]}),Se),ty=ae(p.jsxs("g",{strokeWidth:"1.25",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),p.jsx("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),Se),US=ae(p.jsxs("g",{children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),p.jsx("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),p.jsx("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),p.jsx("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),p.jsx("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),p.jsx("path",{d:"M5 7l0 10"}),p.jsx("path",{d:"M7 5l10 0"}),p.jsx("path",{d:"M7 19l10 0"}),p.jsx("path",{d:"M19 7l0 10"})]}),Se),zp={[Xt.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:uf},[Xt.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.35},icon:$p},[Xt["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15},icon:az},[Xt["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25},icon:n6},[Xt.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:uf,deprecated:!0},[Xt.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},icon:$p,deprecated:!0,local:!0},[Xt.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},icon:n6,deprecated:!0},[Xt["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},serverSide:!0},[Mc.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.15},fallback:!0},[Mc["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},eo={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},A5="local:",Fz=class extends Error{constructor(e="Couldn't export canvas.",t="CANVAS_ERROR"){super(),this.name=t,this.message=e}},T0=class extends DOMException{constructor(e="Request Aborted"){super(e,"AbortError")}},ao=class extends Error{constructor(e="Image Scene Data Error",t="IMAGE_SCENE_DATA_ERROR"){super(e),F(this,"code"),this.name="EncodingError",this.code=t}},Bz=class extends Error{constructor(){super(...arguments),F(this,"code","ELEMENT_HAS_INVALID_INDEX")}},gS=class extends Error{constructor(e="Worker URL is not defined!",t="WORKER_URL_NOT_DEFINED"){super(e),F(this,"code"),this.name="WorkerUrlNotDefinedError",this.code=t}},bS=class extends Error{constructor(e="Worker has to be in a separate chunk!",t="WORKER_IN_THE_MAIN_CHUNK"){super(e),F(this,"code"),this.name="WorkerInTheMainChunkError",this.code=t}},ny=class extends Error{constructor(e){super(e),this.name="ExcalidrawError"}},Hz=class{constructor(e){F(this,"instance"),F(this,"debounceTerminate"),this.instance=new Worker(e,{type:"module"})}},Wz=class vS{constructor(t,n){F(this,"idleWorkers",new Set),F(this,"workerUrl"),F(this,"workerTTL"),this.workerUrl=t,this.workerTTL=n.ttl||1e3}static create(t,n={}){if(!t)throw new gS;if(!import.meta.url||t.toString()===import.meta.url)throw new bS;return new vS(t,n)}async postMessage(t,n){let r,a=Array.from(this.idleWorkers).shift();return a?(this.idleWorkers.delete(a),r=a):r=await this.createWorker(),new Promise((i,l)=>{r.instance.onmessage=this.onMessageHandler(r,i),r.instance.onerror=this.onErrorHandler(r,l),r.instance.postMessage(t,n),r.debounceTerminate(()=>l(new Error(`Active worker did not respond for ${this.workerTTL}ms!`)))})}async clear(){for(let t of this.idleWorkers)t.debounceTerminate.cancel(),t.instance.terminate();this.idleWorkers.clear()}async createWorker(){let t=new Hz(this.workerUrl);return t.debounceTerminate=Yc(n=>{t.instance.terminate(),this.idleWorkers.has(t)?(this.idleWorkers.delete(t),console.debug("Job finished! Idle worker has been released from the pool.")):n?n():console.error("Worker has been terminated!")},this.workerTTL),t}onMessageHandler(t,n){return r=>{t.debounceTerminate(),this.idleWorkers.add(t),n(r.data)}}onErrorHandler(t,n){return r=>{t.debounceTerminate(()=>n(r)),t.debounceTerminate.flush(),this.clear()}}},ry=typeof Worker<"u",Xz=async(e,t)=>{let{Commands:n,subsetToBase64:r,toBase64:a}=await Gz();return ry?Zc(async()=>{try{let i=await Yz(),l=e.slice(0),s=await i.postMessage({command:n.Subset,arrayBuffer:l,codePoints:t},{transfer:[l]});return a(s)}catch(i){return ry=!1,_O()&&(i instanceof gS||i instanceof bS)||console.error("Failed to use workers for subsetting, falling back to the main thread.",i),r(e,t)}}):r(e,t)},O2=null,$2=null,Vz=async()=>(O2||(O2=Re(()=>import("./subset-worker.chunk-CmgaOgn3.js"),__vite__mapDeps([0,1]))),O2),Gz=async()=>($2||($2=Re(()=>import("./subset-shared.chunk-B4F4dEPr.js"),[])),$2),z2=null,Yz=()=>(z2||(z2=Zc(async()=>{let{WorkerUrl:e}=await Vz();return Wz.create(e)})),z2),yS=class rp{constructor(t,n,r){F(this,"urls"),F(this,"fontFace"),this.urls=rp.createUrls(n);let a=this.urls.map(i=>`url(${i}) ${rp.getFormat(i)}`).join(", ");this.fontFace=new FontFace(t,a,{display:"swap",style:"normal",weight:"400",...r})}toCSS(t){if(!this.getUnicodeRangeRegex().test(t))return;let n=Array.from(t).map(r=>r.codePointAt(0));return this.getContent(n).then(r=>`@font-face { font-family: ${this.fontFace.family}; src: url(${r}); }`)}async getContent(t){let n=0,r=[];for(;n<this.urls.length;){let a=this.urls[n];try{let i=await this.fetchFont(a);return await Xz(i,t)}catch(i){r.push(`"${a.toString()}" returned error "${i}"`)}n++}return console.error(`Failed to fetch font family "${this.fontFace.family}"`,JSON.stringify(r,void 0,2)),this.urls.length?this.urls[this.urls.length-1].toString():""}fetchFont(t){return Zc(async()=>{let n=await fetch(t,{cache:"force-cache",headers:{Accept:"font/woff2"}});if(!n.ok){let r=t instanceof URL?t.toString():"dataurl";throw new Error(`Failed to fetch "${r}": ${n.statusText}`)}return await n.arrayBuffer()})}getUnicodeRangeRegex(){let t=this.fontFace.unicodeRange.split(/,\s*/).map(n=>{let[r,a]=n.replace("U+","").split("-");return a?`\\u{${r}}-\\u{${a}}`:`\\u{${r}}`}).join("");return new RegExp(`[${t}]`,"u")}static createUrls(t){if(t.startsWith("data"))return[t];if(t.startsWith(A5))return[];if(t.startsWith("http"))return[new URL(t)];let n=t.replace(/^\/+/,""),r=[];if(typeof window.EXCALIDRAW_ASSET_PATH=="string"){let a=this.normalizeBaseUrl(window.EXCALIDRAW_ASSET_PATH);r.push(new URL(n,a))}else Array.isArray(window.EXCALIDRAW_ASSET_PATH)&&window.EXCALIDRAW_ASSET_PATH.forEach(a=>{let i=this.normalizeBaseUrl(a);r.push(new URL(n,i))});return r.push(new URL(n,rp.ASSETS_FALLBACK_URL)),r}static getFormat(t){if(!(t instanceof URL))return"";try{let n=new URL(t).pathname.split(".");return n.length===1?"":`format('${n.pop()}')`}catch{return""}}static normalizeBaseUrl(t){var r;let n=t;return/^\.?\//.test(n)&&(n=new URL(n.replace(/^\.?\/+/,""),(r=window==null?void 0:window.location)==null?void 0:r.origin).toString()),n=`${n.replace(/\/+$/,"")}/`,n}};F(yS,"ASSETS_FALLBACK_URL",`https://esm.sh/${`${et.PKG_NAME}@${et.PKG_VERSION}`}/dist/prod/`);var Zz=yS,Kz="./fonts/Cascadia/CascadiaCode-Regular.woff2",qz=[{uri:Kz}],Qz="./fonts/ComicShanns/ComicShanns-Regular-279a7b317d12eb88de06167bd672b4b4.woff2",Jz="./fonts/ComicShanns/ComicShanns-Regular-fcb0fc02dcbee4c9846b3e2508668039.woff2",eF="./fonts/ComicShanns/ComicShanns-Regular-dc6a8806fa96795d7b3be5026f989a17.woff2",tF="./fonts/ComicShanns/ComicShanns-Regular-6e066e8de2ac57ea9283adb9c24d7f0c.woff2",nF=[{uri:Qz,descriptors:{unicodeRange:"U+20-7e,U+a1-a6,U+a8,U+ab-ac,U+af-b1,U+b4,U+b8,U+bb-bc,U+bf-cf,U+d1-d7,U+d9-de,U+e0-ef,U+f1-f7,U+f9-ff,U+131,U+152-153,U+2c6,U+2da,U+2dc,U+2013-2014,U+2018-201a,U+201c-201d,U+2020-2022,U+2026,U+2039-203a,U+2044,U+20ac,U+2191,U+2193,U+2212"}},{uri:Jz,descriptors:{unicodeRange:"U+100-10f,U+112-125,U+128-130,U+134-137,U+139-13c,U+141-148,U+14c-151,U+154-161,U+164-165,U+168-17f,U+1bf,U+1f7,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+a75b"}},{uri:eF,descriptors:{unicodeRange:"U+2c7,U+2d8-2d9,U+2db,U+2dd,U+315,U+2190,U+2192,U+2200,U+2203-2204,U+2264-2265,U+f6c3"}},{uri:tF,descriptors:{unicodeRange:"U+3bb"}}],rF=[{uri:A5}],aF="./fonts/Excalifont/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2",iF="./fonts/Excalifont/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2",lF="./fonts/Excalifont/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2",sF="./fonts/Excalifont/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2",oF="./fonts/Excalifont/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2",cF="./fonts/Excalifont/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2",dF="./fonts/Excalifont/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2",uF=[{uri:aF,descriptors:{unicodeRange:"U+20-7e,U+a0-a3,U+a5-a6,U+a8-ab,U+ad-b1,U+b4,U+b6-b8,U+ba-ff,U+131,U+152-153,U+2bc,U+2c6,U+2da,U+2dc,U+304,U+308,U+2013-2014,U+2018-201a,U+201c-201e,U+2020,U+2022,U+2024-2026,U+2030,U+2039-203a,U+20ac,U+2122,U+2212"}},{uri:iF,descriptors:{unicodeRange:"U+100-130,U+132-137,U+139-149,U+14c-151,U+154-17e,U+192,U+1fc-1ff,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+2113"}},{uri:lF,descriptors:{unicodeRange:"U+400-45f,U+490-491,U+2116"}},{uri:sF,descriptors:{unicodeRange:"U+37e,U+384-38a,U+38c,U+38e-393,U+395-3a1,U+3a3-3a8,U+3aa-3cf,U+3d7"}},{uri:oF,descriptors:{unicodeRange:"U+2c7,U+2d8-2d9,U+2db,U+2dd,U+302,U+306-307,U+30a-30c,U+326-328,U+212e,U+2211,U+fb01-fb02"}},{uri:cF,descriptors:{unicodeRange:"U+462-463,U+472-475,U+4d8-4d9,U+4e2-4e3,U+4e6-4e9,U+4ee-4ef"}},{uri:dF,descriptors:{unicodeRange:"U+300-301,U+303"}}],fF=[{uri:A5}],hF="./fonts/Liberation/LiberationSans-Regular.woff2",pF=[{uri:hF}],mF="./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2",UF="./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2",gF=[{uri:UF,descriptors:{unicodeRange:eo.LATIN_EXT}},{uri:mF,descriptors:{unicodeRange:eo.LATIN}}],bF="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2",vF="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2",yF="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2",xF="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2",wF="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2",EF=[{uri:xF,descriptors:{unicodeRange:eo.CYRILIC_EXT,weight:"500"}},{uri:yF,descriptors:{unicodeRange:eo.CYRILIC,weight:"500"}},{uri:wF,descriptors:{unicodeRange:eo.VIETNAMESE,weight:"500"}},{uri:vF,descriptors:{unicodeRange:eo.LATIN_EXT,weight:"500"}},{uri:bF,descriptors:{unicodeRange:eo.LATIN,weight:"500"}}],SF="./fonts/Virgil/Virgil-Regular.woff2",kF=[{uri:SF}],CF="./fonts/Xiaolai/Xiaolai-Regular-09850c4077f3fffe707905872e0e2460.woff2",MF="./fonts/Xiaolai/Xiaolai-Regular-7eb9fffd1aa890d07d0f88cc82e6cfe4.woff2",IF="./fonts/Xiaolai/Xiaolai-Regular-60a3089806700d379f11827ee9843b6b.woff2",_F="./fonts/Xiaolai/Xiaolai-Regular-6fe5c5973cc06f74b2387a631ea36b88.woff2",TF="./fonts/Xiaolai/Xiaolai-Regular-b96d9226ce77ec94ceca043d712182e6.woff2",AF="./fonts/Xiaolai/Xiaolai-Regular-6ae5b42180ad70b971c91e7eefb8eba2.woff2",RF="./fonts/Xiaolai/Xiaolai-Regular-a4c34be6d42152e64b0df90bc4607f64.woff2",jF="./fonts/Xiaolai/Xiaolai-Regular-c69f61a4ab18d0488c8d1fc12e7028e8.woff2",LF="./fonts/Xiaolai/Xiaolai-Regular-e3fcf5180fd466c8915c4e8069491054.woff2",DF="./fonts/Xiaolai/Xiaolai-Regular-c1f94158256bb1f3bf665b053d895af9.woff2",PF="./fonts/Xiaolai/Xiaolai-Regular-544fc28abe2c5c30e62383fd4dac255f.woff2",NF="./fonts/Xiaolai/Xiaolai-Regular-7197d6fda6cba7c3874c53d6381ca239.woff2",OF="./fonts/Xiaolai/Xiaolai-Regular-70c2eb8d64e71a42a834eb857ea9df51.woff2",$F="./fonts/Xiaolai/Xiaolai-Regular-069e77aac84590e2e991d0a0176d34f2.woff2",zF="./fonts/Xiaolai/Xiaolai-Regular-41521fade99856108931b4768b1b2648.woff2",FF="./fonts/Xiaolai/Xiaolai-Regular-a004ddfcb26e67bd6e678c8ed19e25ce.woff2",BF="./fonts/Xiaolai/Xiaolai-Regular-04b718e5623574919c8b0dea5f301444.woff2",HF="./fonts/Xiaolai/Xiaolai-Regular-7e4bde7e9c7f84cd34d8a845e384c746.woff2",WF="./fonts/Xiaolai/Xiaolai-Regular-23686f7f29da6e8008c36dd3a80c83d6.woff2",XF="./fonts/Xiaolai/Xiaolai-Regular-69c09cc5fa3e55c74fc4821f76909cc3.woff2",VF="./fonts/Xiaolai/Xiaolai-Regular-25b7f38e18f035f96cb5e547bd2bd08c.woff2",GF="./fonts/Xiaolai/Xiaolai-Regular-ba3de316d63c7e339987b16f41a0b879.woff2",YF="./fonts/Xiaolai/Xiaolai-Regular-12b52b58eb3df36804b9a654ec9ee194.woff2",ZF="./fonts/Xiaolai/Xiaolai-Regular-b1220a3c61f85cc0408deedb4c5f57a2.woff2",KF="./fonts/Xiaolai/Xiaolai-Regular-4535823663ad81405188a528d8f2b1a2.woff2",qF="./fonts/Xiaolai/Xiaolai-Regular-3eaa538115d76932653c21d8dc28f207.woff2",QF="./fonts/Xiaolai/Xiaolai-Regular-7e929f262f30c8ee78bf398150b1a7cd.woff2",JF="./fonts/Xiaolai/Xiaolai-Regular-73e309718fd16cea44b4d54a33581811.woff2",eB="./fonts/Xiaolai/Xiaolai-Regular-9eb5a99df4e76ac3363453ac9ca288b1.woff2",tB="./fonts/Xiaolai/Xiaolai-Regular-3e63ed8162808a9e425ed80a8bc79114.woff2",nB="./fonts/Xiaolai/Xiaolai-Regular-cb17fc3db95f6d139afc9d31a8e93293.woff2",rB="./fonts/Xiaolai/Xiaolai-Regular-c8b71798409ccc126ee264a00aadcf21.woff2",aB="./fonts/Xiaolai/Xiaolai-Regular-11c345711937f0ba4b8f7b6b919c8440.woff2",iB="./fonts/Xiaolai/Xiaolai-Regular-e480d9c614742d05f0e78f274f1e69e6.woff2",lB="./fonts/Xiaolai/Xiaolai-Regular-95429962233afd82db1c27df1500a28c.woff2",sB="./fonts/Xiaolai/Xiaolai-Regular-2cf96d082d35ea3d8106851223ad0d16.woff2",oB="./fonts/Xiaolai/Xiaolai-Regular-2d43040e86ff03ba677f6f9c04cd0805.woff2",cB="./fonts/Xiaolai/Xiaolai-Regular-2a26d20a23b00898ce82f09d2ee47c3f.woff2",dB="./fonts/Xiaolai/Xiaolai-Regular-a365e82ed54697a52f27adcea1315fe8.woff2",uB="./fonts/Xiaolai/Xiaolai-Regular-f5d079153c99a25b9be5b8583c4cc8a7.woff2",fB="./fonts/Xiaolai/Xiaolai-Regular-10a7ae9a371830a80c3d844acf1c02d7.woff2",hB="./fonts/Xiaolai/Xiaolai-Regular-e4bca6cfa53e499cae0a6be4894a90e9.woff2",pB="./fonts/Xiaolai/Xiaolai-Regular-60a41c7e1c68f22424e6d22df544bc82.woff2",mB="./fonts/Xiaolai/Xiaolai-Regular-7ab2bed91166a9dca83a5ebfbe2a7f38.woff2",UB="./fonts/Xiaolai/Xiaolai-Regular-670ba603758d94268e8606f240a42e12.woff2",gB="./fonts/Xiaolai/Xiaolai-Regular-e656f091b9dc4709722c9f4b84d3c797.woff2",bB="./fonts/Xiaolai/Xiaolai-Regular-15dc6d811c9cd078f9086a740d5a1038.woff2",vB="./fonts/Xiaolai/Xiaolai-Regular-f0f13b5c60e0af5553bd359f5513be1b.woff2",yB="./fonts/Xiaolai/Xiaolai-Regular-8c2f33cee3993174f7e87c28e4bf42ee.woff2",xB="./fonts/Xiaolai/Xiaolai-Regular-761d05e3cd968cf574166867998ef06a.woff2",wB="./fonts/Xiaolai/Xiaolai-Regular-642b26e2e5f5fb780b51b593dbc8c851.woff2",EB="./fonts/Xiaolai/Xiaolai-Regular-5572b3513ba8df57a3d5d7303ee6b11b.woff2",SB="./fonts/Xiaolai/Xiaolai-Regular-3c9de2ae0ea4bc91a510942dfa4be8d2.woff2",kB="./fonts/Xiaolai/Xiaolai-Regular-671a2c20b1eb9e4ef8a192833940e319.woff2",CB="./fonts/Xiaolai/Xiaolai-Regular-4dc6d5f188d5c96d44815cd1e81aa885.woff2",MB="./fonts/Xiaolai/Xiaolai-Regular-ce4884f96f11589608b76b726a755803.woff2",IB="./fonts/Xiaolai/Xiaolai-Regular-8f476c4c99813d57cbe6eca4727388ad.woff2",_B="./fonts/Xiaolai/Xiaolai-Regular-5935a5775af3d5c6307ac667bd9ae74e.woff2",TB="./fonts/Xiaolai/Xiaolai-Regular-79f007c1c6d07557120982951ea67998.woff2",AB="./fonts/Xiaolai/Xiaolai-Regular-bafff7a14c27403dcc6cf1432e8ea836.woff2",RB="./fonts/Xiaolai/Xiaolai-Regular-543fa46ace099a7099dad69123399400.woff2",jB="./fonts/Xiaolai/Xiaolai-Regular-4ddc14ed3eb0c3e46364317dfc0144a3.woff2",LB="./fonts/Xiaolai/Xiaolai-Regular-0fa55a080fcd0f9dc2e0b0058b793df8.woff2",DB="./fonts/Xiaolai/Xiaolai-Regular-66493ba5a8367f2928812f446f47b56a.woff2",PB="./fonts/Xiaolai/Xiaolai-Regular-57862b464a55b18c7bf234ce22907d73.woff2",NB="./fonts/Xiaolai/Xiaolai-Regular-8d3bcabb847b56243b16afe62adaaf21.woff2",OB="./fonts/Xiaolai/Xiaolai-Regular-2b77e8ebfb2367ab2662396a60e7d320.woff2",$B="./fonts/Xiaolai/Xiaolai-Regular-0b5d723fdc4e249c140f0909e87d03b4.woff2",zB="./fonts/Xiaolai/Xiaolai-Regular-cdbce89e82cc1ab53a2decbf5819278f.woff2",FB="./fonts/Xiaolai/Xiaolai-Regular-739bc1a567439c7cffcd1614644593d2.woff2",BB="./fonts/Xiaolai/Xiaolai-Regular-72252d73220fa3cd856677888cee1635.woff2",HB="./fonts/Xiaolai/Xiaolai-Regular-08e0dc436ad0ad61ba5558db0674d762.woff2",WB="./fonts/Xiaolai/Xiaolai-Regular-cf6ff4e0f491ca0cf3038187a997b9b4.woff2",XB="./fonts/Xiaolai/Xiaolai-Regular-9cfb2a77a4e45025105ad29a1748b90d.woff2",VB="./fonts/Xiaolai/Xiaolai-Regular-450da755d5bcb70906e1295e559b9602.woff2",GB="./fonts/Xiaolai/Xiaolai-Regular-0986d134c05864f5025962eef9f994a0.woff2",YB="./fonts/Xiaolai/Xiaolai-Regular-1ee544f0f1dac422545c505baa788992.woff2",ZB="./fonts/Xiaolai/Xiaolai-Regular-4806e761d750087c2d734fc64596eaff.woff2",KB="./fonts/Xiaolai/Xiaolai-Regular-33432927cd87d40cfe393c7482bf221f.woff2",qB="./fonts/Xiaolai/Xiaolai-Regular-be549ab72f0719d606a5c01e2c0219b6.woff2",QB="./fonts/Xiaolai/Xiaolai-Regular-019d66dcad46dc156b162d267f981c20.woff2",JB="./fonts/Xiaolai/Xiaolai-Regular-b5c1596551c256e0e9cf02028595b092.woff2",eH="./fonts/Xiaolai/Xiaolai-Regular-e5f453bb04da18eed01675eeebd88bf8.woff2",tH="./fonts/Xiaolai/Xiaolai-Regular-cf2cc71752631e579e35b0e423bf2638.woff2",nH="./fonts/Xiaolai/Xiaolai-Regular-6f3256af8454371776bc46670d33cc65.woff2",rH="./fonts/Xiaolai/Xiaolai-Regular-23f228f3999c01983860012330e4be08.woff2",aH="./fonts/Xiaolai/Xiaolai-Regular-21430ee05a1248901da8d0de08744d47.woff2",iH="./fonts/Xiaolai/Xiaolai-Regular-5330a2119a716e4e7224ed108b085dac.woff2",lH="./fonts/Xiaolai/Xiaolai-Regular-cd145ce4a0ea18469358df53c207bc1b.woff2",sH="./fonts/Xiaolai/Xiaolai-Regular-36925dfe329a45086cbb7fc5c20d45ac.woff2",oH="./fonts/Xiaolai/Xiaolai-Regular-4bfaa8ffa64c5ee560aa2daba7c9cbd3.woff2",cH="./fonts/Xiaolai/Xiaolai-Regular-112c051027b2d766c19a519f6ee1f4f7.woff2",dH="./fonts/Xiaolai/Xiaolai-Regular-5b0ed6971aaab9c8ad563230bd5471a7.woff2",uH="./fonts/Xiaolai/Xiaolai-Regular-98f2ad84457de7f3740d9920b8fa8667.woff2",fH="./fonts/Xiaolai/Xiaolai-Regular-733171b4ffcd17ea1fe1c0ba627173bf.woff2",hH="./fonts/Xiaolai/Xiaolai-Regular-684d65f1793cac449dde5d59cb3c47fb.woff2",pH="./fonts/Xiaolai/Xiaolai-Regular-cbaaefaaf326668277aa24dfa93c4d28.woff2",mH="./fonts/Xiaolai/Xiaolai-Regular-58fd02350d0bc52cf1ca3bb32ce9766e.woff2",UH="./fonts/Xiaolai/Xiaolai-Regular-7ccce86603f80a099ddb0cb21d4ae3e3.woff2",gH="./fonts/Xiaolai/Xiaolai-Regular-3717077e38f98d89eae729b6c14e56dc.woff2",bH="./fonts/Xiaolai/Xiaolai-Regular-dbea1af6dcd9860be40c3d18254338f5.woff2",vH="./fonts/Xiaolai/Xiaolai-Regular-4a0fdb40036e87b40aa08dd30584cb85.woff2",yH="./fonts/Xiaolai/Xiaolai-Regular-0f626226ba1272e832aea87bafd9720e.woff2",xH="./fonts/Xiaolai/Xiaolai-Regular-938d90c10ff8c20386af7f242c05d6b0.woff2",wH="./fonts/Xiaolai/Xiaolai-Regular-b6d128682ee29e471486354d486a1b90.woff2",EH="./fonts/Xiaolai/Xiaolai-Regular-e51ef413167c6e14e0c0fdcc585f2fc9.woff2",SH="./fonts/Xiaolai/Xiaolai-Regular-9d81066dd2b337c938df6e90380a00dc.woff2",kH="./fonts/Xiaolai/Xiaolai-Regular-20e7bf72fa05de9adf7dbcc7bf51dde6.woff2",CH="./fonts/Xiaolai/Xiaolai-Regular-4095eb84ef3874e2600247bee0b04026.woff2",MH="./fonts/Xiaolai/Xiaolai-Regular-4ee10ae43505e2e0bc62656ced49c0fa.woff2",IH="./fonts/Xiaolai/Xiaolai-Regular-7494dc504ae00ee9cd0505f990f88c5d.woff2",_H="./fonts/Xiaolai/Xiaolai-Regular-8de5b863cb50dfefdd07cb11c774d579.woff2",TH="./fonts/Xiaolai/Xiaolai-Regular-3e1f8f654357353bf0e04ba5c34b5f7f.woff2",AH="./fonts/Xiaolai/Xiaolai-Regular-2e33e8dc771ef5e1d9127d60a6b73679.woff2",RH="./fonts/Xiaolai/Xiaolai-Regular-173945821411c09f70c95f98d590e697.woff2",jH="./fonts/Xiaolai/Xiaolai-Regular-b358f7a51ece39a3247942b1feabdb29.woff2",LH="./fonts/Xiaolai/Xiaolai-Regular-23ad2d71b280f00b1363b95b7bea94eb.woff2",DH="./fonts/Xiaolai/Xiaolai-Regular-5882ffa04f32584d26109137e2da4352.woff2",PH="./fonts/Xiaolai/Xiaolai-Regular-a203b91dad570bf05a58c3c3ddb529bf.woff2",NH="./fonts/Xiaolai/Xiaolai-Regular-bd77e3c7f9e0b072d96af37f73d1aa32.woff2",OH="./fonts/Xiaolai/Xiaolai-Regular-5a45d991244d4c7140217e1e5f5ca4f4.woff2",$H="./fonts/Xiaolai/Xiaolai-Regular-f56414bf9bced67990def8660e306759.woff2",zH="./fonts/Xiaolai/Xiaolai-Regular-583d166e56ba0de4b77eabb47ef67839.woff2",FH="./fonts/Xiaolai/Xiaolai-Regular-7f855356ab893b0d2b9c1c83b8116f0e.woff2",BH="./fonts/Xiaolai/Xiaolai-Regular-b57aaedfd8ebdf3931f25119dc6a5eb2.woff2",HH="./fonts/Xiaolai/Xiaolai-Regular-b6fd38ca30869792244804b04bc058da.woff2",WH="./fonts/Xiaolai/Xiaolai-Regular-452225341522a7942f0f6aab1a5c91a3.woff2",XH="./fonts/Xiaolai/Xiaolai-Regular-866fa7613df6b3fd272bcfd4530c0bb9.woff2",VH="./fonts/Xiaolai/Xiaolai-Regular-52a84a22fd1369bffeaf21da2d6158dc.woff2",GH="./fonts/Xiaolai/Xiaolai-Regular-829615148e6357d826b9242eb7fbbd1e.woff2",YH="./fonts/Xiaolai/Xiaolai-Regular-c99eda15fc26a2941579560f76c3a5cf.woff2",ZH="./fonts/Xiaolai/Xiaolai-Regular-395c35dd584b56b0789f58a0559beaf1.woff2",KH="./fonts/Xiaolai/Xiaolai-Regular-203b0e569e3b14aac86a003dc3fa523e.woff2",qH="./fonts/Xiaolai/Xiaolai-Regular-51a0e808bbc8361236ac521a119758a3.woff2",QH="./fonts/Xiaolai/Xiaolai-Regular-6e092f71c1e634059ada0e52abadce67.woff2",JH="./fonts/Xiaolai/Xiaolai-Regular-0f7fb1e0d5015bb1371343153ecf7ce3.woff2",eW="./fonts/Xiaolai/Xiaolai-Regular-d0cf73942fea1c74edbdf0b3011f4656.woff2",tW="./fonts/Xiaolai/Xiaolai-Regular-968cffdc8ee679da094e77ebf50f58ef.woff2",nW="./fonts/Xiaolai/Xiaolai-Regular-7a07ddc0f0c0f5f4a9bad6ee3dda66b5.woff2",rW="./fonts/Xiaolai/Xiaolai-Regular-ec181b795ac1fb5a50d700b6e996d745.woff2",aW="./fonts/Xiaolai/Xiaolai-Regular-cfb211578629b7e8153b37240de6a9d5.woff2",iW="./fonts/Xiaolai/Xiaolai-Regular-59e9ff77b0efaf684bc09274fb6908c9.woff2",lW="./fonts/Xiaolai/Xiaolai-Regular-2adbc89c11e65905393d3dfc468b9d5b.woff2",sW="./fonts/Xiaolai/Xiaolai-Regular-70e811fd7994e61f408c923de6ddd078.woff2",oW="./fonts/Xiaolai/Xiaolai-Regular-c4a687ac4f0c2766eefc9f77ed99cddf.woff2",cW="./fonts/Xiaolai/Xiaolai-Regular-51502f1206be09c565f1547c406e9558.woff2",dW="./fonts/Xiaolai/Xiaolai-Regular-1fdc0c67ed57263a80fd108c1f6ccf24.woff2",uW="./fonts/Xiaolai/Xiaolai-Regular-e11567fd2accf9957cd0d3c2be937d87.woff2",fW="./fonts/Xiaolai/Xiaolai-Regular-20cc1bbf50e7efb442756cb605672c1f.woff2",hW="./fonts/Xiaolai/Xiaolai-Regular-5d2898fbc097a7e24c6f38d80587621e.woff2",pW="./fonts/Xiaolai/Xiaolai-Regular-ac9ceb44437becc3e9c4dbfebab7fc2d.woff2",mW="./fonts/Xiaolai/Xiaolai-Regular-c16ed9740b85badf16e86ea782a3062f.woff2",UW="./fonts/Xiaolai/Xiaolai-Regular-aa0d470430e6391eca720c7cfa44446f.woff2",gW="./fonts/Xiaolai/Xiaolai-Regular-f2b54d4e7be0eaefe1c2c56836fa5368.woff2",bW="./fonts/Xiaolai/Xiaolai-Regular-99a16ef6a64934d5781933dbd9c46b2e.woff2",vW="./fonts/Xiaolai/Xiaolai-Regular-c40533fdf4cc57177b12803598af7e59.woff2",yW="./fonts/Xiaolai/Xiaolai-Regular-91ddb2969bf2d31ba02ad82998d1314c.woff2",xW="./fonts/Xiaolai/Xiaolai-Regular-774d4f764a1299da5d28ec2f2ffe0d69.woff2",wW="./fonts/Xiaolai/Xiaolai-Regular-7718fe60986d8b42b1be9c5ace5ccf25.woff2",EW="./fonts/Xiaolai/Xiaolai-Regular-aa5c9ca6cf4fba00433b7aa3fa10671a.woff2",SW="./fonts/Xiaolai/Xiaolai-Regular-4f50e5136e136527280bc902c5817561.woff2",kW="./fonts/Xiaolai/Xiaolai-Regular-093b9ef39a46ceae95a1df18a0a3a326.woff2",CW="./fonts/Xiaolai/Xiaolai-Regular-a0ca5df4258213d7fc9fce80f65ce760.woff2",MW="./fonts/Xiaolai/Xiaolai-Regular-d2666cbed13462c5dc36fa2f15c202ca.woff2",IW="./fonts/Xiaolai/Xiaolai-Regular-1e6fd68f1f3902ce48ce8c69df385622.woff2",_W="./fonts/Xiaolai/Xiaolai-Regular-87599f94b6cc129d505b375798d0d751.woff2",TW="./fonts/Xiaolai/Xiaolai-Regular-06c77b8c66e51ed6c63ccb502dd8b8af.woff2",AW="./fonts/Xiaolai/Xiaolai-Regular-13ae07ed2e272d26d59bc0691cd7117a.woff2",RW="./fonts/Xiaolai/Xiaolai-Regular-353f33792a8f60dc69323ddf635a269e.woff2",jW="./fonts/Xiaolai/Xiaolai-Regular-0facdf1ea213ba40261022f5d5ed4493.woff2",LW="./fonts/Xiaolai/Xiaolai-Regular-f8ee5d36068a42b51d0e4a1116cfcec1.woff2",DW="./fonts/Xiaolai/Xiaolai-Regular-79d494361ae093b69e74ee9dbe65bfd4.woff2",PW="./fonts/Xiaolai/Xiaolai-Regular-74e2263a91439c25b91d5132ce9f4d62.woff2",NW="./fonts/Xiaolai/Xiaolai-Regular-ee8bae97908d5147b423f77ad0d3c1bb.woff2",OW="./fonts/Xiaolai/Xiaolai-Regular-56467a5c8840c4d23a60b2f935114848.woff2",$W="./fonts/Xiaolai/Xiaolai-Regular-145aa02cdd91946e67dc934e1acffe75.woff2",zW="./fonts/Xiaolai/Xiaolai-Regular-54acdfc2166ad7fcbd074f75fd4a56ba.woff2",FW="./fonts/Xiaolai/Xiaolai-Regular-29cec36cd205b211da97acabaa62f055.woff2",BW="./fonts/Xiaolai/Xiaolai-Regular-3756e81d3e149cf6099163ee79944fec.woff2",HW="./fonts/Xiaolai/Xiaolai-Regular-8e9f97f01034820170065b2921b4fb5e.woff2",WW="./fonts/Xiaolai/Xiaolai-Regular-13d2887ec8ee73c43acdabc52a05af7b.woff2",XW="./fonts/Xiaolai/Xiaolai-Regular-72536a3d71b694a0d53dd90ddceae41e.woff2",VW="./fonts/Xiaolai/Xiaolai-Regular-603aefd23e350ba7eb124273e3c9bcf1.woff2",GW="./fonts/Xiaolai/Xiaolai-Regular-095c169f3314805276f603a362766abd.woff2",YW="./fonts/Xiaolai/Xiaolai-Regular-9544732d2e62d1a429674f8ee41b5d3a.woff2",ZW="./fonts/Xiaolai/Xiaolai-Regular-d3716376641d615e2995605b29bca7b6.woff2",KW="./fonts/Xiaolai/Xiaolai-Regular-5a1ce3117cfe90c48e8fb4a9a00f694d.woff2",qW="./fonts/Xiaolai/Xiaolai-Regular-b7d203b051eff504ff59ddca7576b6a9.woff2",QW="./fonts/Xiaolai/Xiaolai-Regular-4a38cc3e9cf104e69ba246d37f8cf135.woff2",JW="./fonts/Xiaolai/Xiaolai-Regular-982b630266d87db93d2539affb1275c6.woff2",eX="./fonts/Xiaolai/Xiaolai-Regular-9592bfc861f07bcb8d75c196b370e548.woff2",tX="./fonts/Xiaolai/Xiaolai-Regular-a7accba310e821da5505f71c03b76bdb.woff2",nX="./fonts/Xiaolai/Xiaolai-Regular-dac48066b5883d8b4551fc584f0c2a3e.woff2",rX="./fonts/Xiaolai/Xiaolai-Regular-a1f916d6039285c4ffb900cd654e418f.woff2",aX="./fonts/Xiaolai/Xiaolai-Regular-95bfd249da4902577b4b7d76ebdd0b44.woff2",iX="./fonts/Xiaolai/Xiaolai-Regular-93fc8f28a33234bcadf1527cafabd502.woff2",lX="./fonts/Xiaolai/Xiaolai-Regular-903bb6865f3452e2fda42e3a25547bc5.woff2",sX="./fonts/Xiaolai/Xiaolai-Regular-4aca6a43e59aceee2166b0c7e4e85ef1.woff2",oX="./fonts/Xiaolai/Xiaolai-Regular-24476a126f129212beb33f66853ea151.woff2",cX="./fonts/Xiaolai/Xiaolai-Regular-1b611157cd46bb184d4fa4dae2d6a2b8.woff2",dX="./fonts/Xiaolai/Xiaolai-Regular-56a32a7689abd0326e57c10c6c069bb4.woff2",uX="./fonts/Xiaolai/Xiaolai-Regular-3cc70dbb64df5b21f1326cc24dee2195.woff2",fX="./fonts/Xiaolai/Xiaolai-Regular-f6032fc06eb20480f096199713f70885.woff2",hX="./fonts/Xiaolai/Xiaolai-Regular-e2ead7ea7da0437f085f42ffc05f8d13.woff2",pX="./fonts/Xiaolai/Xiaolai-Regular-97f7f48ce90c9429bf32ae51469db74d.woff2",mX="./fonts/Xiaolai/Xiaolai-Regular-24a21c1e4449222e8d1898d69ff3a404.woff2",UX="./fonts/Xiaolai/Xiaolai-Regular-726303e0774b4e678bff8c2deb6ca603.woff2",gX="./fonts/Xiaolai/Xiaolai-Regular-5a7fac4b8b23a6e4e5ba0c9bf1756c91.woff2",bX="./fonts/Xiaolai/Xiaolai-Regular-2b7441d46298788ac94e610ffcc709b6.woff2",vX=[{uri:CF,descriptors:{unicodeRange:"U+f9b8-fa6d,U+fe32,U+fe45-fe4f,U+ff02-ff0b,U+ff0d-ff1e,U+ff20-ff2a"}},{uri:MF,descriptors:{unicodeRange:"U+20dd-20de,U+25ef,U+ff2b-ffbe,U+ffc2-ffc7,U+ffca-ffcf,U+ffd2-ffd7,U+ffda-ffdc,U+ffe0-ffe6,U+ffe8-ffee"}},{uri:IF,descriptors:{unicodeRange:"U+d7eb-d7fb,U+f900-f9b7"}},{uri:_F,descriptors:{unicodeRange:"U+d6f2-d7a3,U+d7b0-d7c6,U+d7cb-d7ea"}},{uri:TF,descriptors:{unicodeRange:"U+d609-d6f1"}},{uri:AF,descriptors:{unicodeRange:"U+d520-d608"}},{uri:RF,descriptors:{unicodeRange:"U+d437-d51f"}},{uri:jF,descriptors:{unicodeRange:"U+d34e-d436"}},{uri:LF,descriptors:{unicodeRange:"U+d265-d34d"}},{uri:DF,descriptors:{unicodeRange:"U+d17c-d264"}},{uri:PF,descriptors:{unicodeRange:"U+d093-d17b"}},{uri:NF,descriptors:{unicodeRange:"U+cfaa-d092"}},{uri:OF,descriptors:{unicodeRange:"U+cec1-cfa9"}},{uri:$F,descriptors:{unicodeRange:"U+cdd8-cec0"}},{uri:zF,descriptors:{unicodeRange:"U+ccf1-cdd7"}},{uri:FF,descriptors:{unicodeRange:"U+cc08-ccf0"}},{uri:BF,descriptors:{unicodeRange:"U+cb43-cc07"}},{uri:HF,descriptors:{unicodeRange:"U+ca83-cb42"}},{uri:WF,descriptors:{unicodeRange:"U+c9a1-ca82"}},{uri:XF,descriptors:{unicodeRange:"U+c8b8-c9a0"}},{uri:VF,descriptors:{unicodeRange:"U+c7cf-c8b7"}},{uri:GF,descriptors:{unicodeRange:"U+c6e6-c7ce"}},{uri:YF,descriptors:{unicodeRange:"U+c5fd-c6e5"}},{uri:ZF,descriptors:{unicodeRange:"U+c514-c5fc"}},{uri:KF,descriptors:{unicodeRange:"U+c42b-c513"}},{uri:qF,descriptors:{unicodeRange:"U+c341-c34e,U+c350-c42a"}},{uri:QF,descriptors:{unicodeRange:"U+c258-c340"}},{uri:JF,descriptors:{unicodeRange:"U+c16f-c257"}},{uri:eB,descriptors:{unicodeRange:"U+c086-c16e"}},{uri:tB,descriptors:{unicodeRange:"U+bf9d-c085"}},{uri:nB,descriptors:{unicodeRange:"U+beb4-bf9c"}},{uri:rB,descriptors:{unicodeRange:"U+bdcb-beb3"}},{uri:aB,descriptors:{unicodeRange:"U+bce2-bdca"}},{uri:iB,descriptors:{unicodeRange:"U+bbf9-bce1"}},{uri:lB,descriptors:{unicodeRange:"U+bb10-bbf8"}},{uri:sB,descriptors:{unicodeRange:"U+ba27-bb0f"}},{uri:oB,descriptors:{unicodeRange:"U+b93e-ba26"}},{uri:cB,descriptors:{unicodeRange:"U+b855-b93d"}},{uri:dB,descriptors:{unicodeRange:"U+b76c-b854"}},{uri:uB,descriptors:{unicodeRange:"U+b683-b76b"}},{uri:fB,descriptors:{unicodeRange:"U+b59a-b682"}},{uri:hB,descriptors:{unicodeRange:"U+b4b1-b599"}},{uri:pB,descriptors:{unicodeRange:"U+11fb-11ff,U+b3cd-b4b0"}},{uri:mB,descriptors:{unicodeRange:"U+11e6-11fa,U+b2f9-b3cc"}},{uri:UB,descriptors:{unicodeRange:"U+11d1-11e5,U+b225-b2f8"}},{uri:gB,descriptors:{unicodeRange:"U+11bc-11d0,U+b151-b224"}},{uri:bB,descriptors:{unicodeRange:"U+11a7-11bb,U+b07d-b150"}},{uri:vB,descriptors:{unicodeRange:"U+1191-11a6,U+afaa-b07c"}},{uri:yB,descriptors:{unicodeRange:"U+117c-1190,U+aed6-afa9"}},{uri:xB,descriptors:{unicodeRange:"U+1167-117b,U+ae02-aed5"}},{uri:wB,descriptors:{unicodeRange:"U+1152-115e,U+1160-1166,U+ad2d-ae01"}},{uri:EB,descriptors:{unicodeRange:"U+113d-1151,U+ac59-ad2c"}},{uri:SB,descriptors:{unicodeRange:"U+1100-113c,U+9f95-9f98,U+9f9c-9f9e,U+9fa1-9fce,U+9fd0,U+a960-a97c,U+ac00-ac58"}},{uri:kB,descriptors:{unicodeRange:"U+9771-9772,U+9775,U+9777-977b,U+977d-9784,U+9786-978a,U+978c,U+978e-9790,U+9793,U+9795-9797,U+9799-979f,U+97a1-97a2,U+97a4-97aa,U+97ac,U+97ae,U+97b0-97b1,U+97b3,U+97b5-97e5,U+97e8,U+97ee-97f2,U+97f4,U+97f7-982d"}},{uri:CB,descriptors:{unicodeRange:"U+9491,U+9496,U+9498,U+94c7,U+94cf,U+94d3-94d4,U+94da,U+94e6,U+94fb,U+951c,U+9520,U+9527,U+9533,U+953d,U+9543,U+9548,U+954b,U+9555,U+955a,U+9560,U+956e,U+9574-9575,U+9577-957e,U+9580-95e7,U+95ec,U+95ff,U+9607,U+9613,U+9618,U+961b,U+961e,U+9620,U+9623-9629,U+962b-962d,U+962f-9630,U+9637-963a,U+963e,U+9641,U+9643,U+964a,U+964e-964f,U+9651-9653,U+9656-965a,U+965c-965e,U+9660,U+9663,U+9665-9666,U+966b,U+966d-9671,U+9673,U+9678-9684,U+9687,U+9689-968a,U+968c,U+968e,U+9691-9693"}},{uri:MB,descriptors:{unicodeRange:"U+923c-9273,U+9275-928d,U+928f-92ad,U+92af-92c7,U+92c9-92ee"}},{uri:IB,descriptors:{unicodeRange:"U+9159,U+915b-915c,U+915f-9160,U+9166-9168,U+916b,U+916d,U+9173,U+917a-917c,U+9180-9184,U+9186,U+9188,U+918a,U+918e-918f,U+9193-9199,U+919c-91a1,U+91a4-91a9,U+91ab-91ac,U+91b0-91b3,U+91b6-91b9,U+91bb-91c6,U+91c8,U+91cb,U+91d0,U+91d2-91db,U+91dd-923b"}},{uri:_B,descriptors:{unicodeRange:"U+902b-902c,U+9030-9034,U+9037,U+9039-903a,U+903d,U+903f-9040,U+9043,U+9045-9046,U+9048-904c,U+904e,U+9054-9056,U+9059-905a,U+905c-9061,U+9064,U+9066-9067,U+9069-906c,U+906f-9073,U+9076-907c,U+907e,U+9081,U+9084-9087,U+9089-908a,U+908c-9090,U+9092,U+9094,U+9096,U+9098,U+909a,U+909c,U+909e-90a0,U+90a4-90a5,U+90a7-90a9,U+90ab,U+90ad,U+90b2,U+90b7,U+90bc-90bd,U+90bf-90c0,U+90c2-90c3,U+90c6,U+90c8-90c9,U+90cb-90cd,U+90d2,U+90d4-90d6,U+90d8-90da,U+90de-90e0,U+90e3-90e5,U+90e9-90ea,U+90ec,U+90ee,U+90f0-90f3,U+90f5-90f7,U+90f9-90fc,U+90ff-9101,U+9103,U+9105-9118,U+911a-911d,U+911f-9121,U+9124-912e,U+9130,U+9132-9138,U+913a-9142,U+9144-9145,U+9147-9148,U+9151,U+9153-9156,U+9158"}},{uri:TB,descriptors:{unicodeRange:"U+8f03-8f65,U+8f6a,U+8f80,U+8f8c,U+8f92,U+8f9d,U+8fa0-8fa2,U+8fa4-8fa7,U+8faa,U+8fac-8faf,U+8fb2-8fb5,U+8fb7-8fb8,U+8fba-8fbc,U+8fbf-8fc0,U+8fc3,U+8fc6,U+8fc9-8fcd,U+8fcf,U+8fd2,U+8fd6-8fd7,U+8fda,U+8fe0-8fe1,U+8fe3,U+8fe7,U+8fec,U+8fef,U+8ff1-8ff2,U+8ff4-8ff6,U+8ffa-8ffc,U+8ffe-8fff,U+9007-9008,U+900c,U+900e,U+9013,U+9015,U+9018-9019,U+901c,U+9023-9025,U+9027-902a"}},{uri:AB,descriptors:{unicodeRange:"U+8d03-8d1c,U+8d20,U+8d51-8d52,U+8d57,U+8d5f,U+8d65,U+8d68-8d6a,U+8d6c,U+8d6e-8d6f,U+8d71-8d72,U+8d78-8d80,U+8d82-8d83,U+8d86-8d89,U+8d8c-8d90,U+8d92-8d93,U+8d95-8d9e,U+8da0-8da2,U+8da4-8db0,U+8db2,U+8db6-8db7,U+8db9,U+8dbb,U+8dbd,U+8dc0-8dc2,U+8dc5,U+8dc7-8dca,U+8dcd,U+8dd0,U+8dd2-8dd5,U+8dd8-8dd9,U+8ddc,U+8de0-8de2,U+8de5-8de7,U+8de9,U+8ded-8dee,U+8df0-8df2,U+8df4,U+8df6,U+8dfc,U+8dfe-8e04,U+8e06-8e08,U+8e0b,U+8e0d-8e0e,U+8e10-8e13,U+8e15-8e1c,U+8e20-8e21,U+8e24-8e28,U+8e2b,U+8e2d,U+8e30,U+8e32-8e34,U+8e36-8e38,U+8e3b-8e3c,U+8e3e-8e3f,U+8e43,U+8e45-8e46"}},{uri:RB,descriptors:{unicodeRange:"U+8bea,U+8c09,U+8c1e,U+8c38-8c40,U+8c42-8c45,U+8c48,U+8c4a-8c4b,U+8c4d-8c54,U+8c56-8c59,U+8c5b-8c60,U+8c63-8c69,U+8c6c-8c72,U+8c74-8c77,U+8c7b-8c81,U+8c83-8c84,U+8c86-8c88,U+8c8b,U+8c8d-8c93,U+8c95-8c97,U+8c99-8d02"}},{uri:jB,descriptors:{unicodeRange:"U+8a64-8a78,U+8a7a-8a88,U+8a8b-8a92,U+8a94-8b06,U+8b08-8b1b"}},{uri:LB,descriptors:{unicodeRange:"U+8987-89c0,U+89c3,U+89cd,U+89d3-89d5,U+89d7-89d9,U+89db,U+89dd,U+89df-89e2,U+89e4,U+89e7-89ea,U+89ec-89ee,U+89f0-89f2,U+89f4-89ff,U+8a01-8a06,U+8a08-8a3d,U+8a3f-8a47,U+8a49-8a63"}},{uri:DB,descriptors:{unicodeRange:"U+87e3-87e4,U+87e6-87e9,U+87eb-87ed,U+87ef-87f8,U+87fa-87fd,U+87ff-8802,U+8804-8809,U+880b-8812,U+8814,U+8817-881a,U+881c-8820,U+8823-8831,U+8833-8838,U+883a-883b,U+883d-883f,U+8841-8843,U+8846-884b,U+884e-8853,U+8855-8856,U+8858,U+885a-8860,U+8866-8867,U+886a,U+886d,U+886f,U+8871,U+8873-8876,U+8878-887c,U+8880,U+8883,U+8886-8887,U+8889-888a,U+888c,U+888e-8891,U+8893-8895,U+8897-889b,U+889d-88a1,U+88a3,U+88a5-88aa,U+88ac,U+88ae-88b0,U+88b2-88b6,U+88b8-88bb"}},{uri:PB,descriptors:{unicodeRange:"U+86e7-86e8,U+86ea-86ec,U+86ef,U+86f5-86f7,U+86fa-86fd,U+86ff,U+8701,U+8704-8706,U+870b-870c,U+870e-8711,U+8714,U+8716,U+8719,U+871b,U+871d,U+871f-8720,U+8724,U+8726-8728,U+872a-872d,U+872f-8730,U+8732-8733,U+8735-8736,U+8738-873a,U+873c-873d,U+8740-8746,U+874a-874b,U+874d,U+874f-8752,U+8754-8756,U+8758,U+875a-875f,U+8761-8762,U+8766-876d,U+876f,U+8771-8773,U+8775,U+8777-877a,U+877f-8781,U+8784,U+8786-8787,U+8789-878a,U+878c,U+878e-8792,U+8794-8796,U+8798-879e,U+87a0-87a7,U+87a9-87aa,U+87ae,U+87b0-87b2,U+87b4,U+87b6-87b9,U+87bb-87bc,U+87be-87bf,U+87c1-87c5,U+87c7-87c9,U+87cc-87d0,U+87d4-87da,U+87dc-87df,U+87e1-87e2"}},{uri:NB,descriptors:{unicodeRange:"U+8604,U+8606-8610,U+8612-8615,U+8617-8626,U+8628,U+862a-8637,U+8639-863b,U+863d-864c,U+8652-8653,U+8655-8659,U+865b-865d,U+865f-8661,U+8663-866a,U+866d,U+866f-8670,U+8672-8678,U+8683-8689,U+868e-8692,U+8694,U+8696-869b,U+869e-86a2,U+86a5-86a6,U+86ab,U+86ad-86ae,U+86b2-86b3,U+86b7-86b9,U+86bb-86bf,U+86c1-86c3,U+86c5,U+86c8,U+86cc-86cd,U+86d2-86d3,U+86d5-86d7,U+86da,U+86dc-86dd,U+86e0-86e3,U+86e5-86e6"}},{uri:OB,descriptors:{unicodeRange:"U+8456,U+8458,U+845d-8460,U+8462,U+8464-8468,U+846a,U+846e-8470,U+8472,U+8474,U+8477,U+8479,U+847b-8481,U+8483-8486,U+848a,U+848d,U+848f-8496,U+8498,U+849a-849b,U+849d-84a0,U+84a2-84ae,U+84b0-84b1,U+84b3,U+84b5-84b7,U+84bb-84bc,U+84be,U+84c0,U+84c2-84c3,U+84c5-84c8,U+84cb-84cc,U+84ce-84cf,U+84d2,U+84d4-84d5,U+84d7-84dc,U+84de,U+84e1-84e2,U+84e4,U+84e7-84eb,U+84ed-84ef,U+84f1-84fb,U+84fd-84fe,U+8500-850b,U+850d-8510,U+8512,U+8514-8516,U+8518-8519,U+851b-851e,U+8520,U+8522-852a,U+852d-8536,U+853e-8542,U+8544-8547,U+854b-854f"}},{uri:$B,descriptors:{unicodeRange:"U+82c2-82c3,U+82c5-82c6,U+82c9,U+82d0,U+82d6,U+82d9-82da,U+82dd,U+82e2,U+82e7-82ea,U+82ec-82ee,U+82f0,U+82f2-82f3,U+82f5-82f6,U+82f8,U+82fa,U+82fc-8300,U+830a-830b,U+830d,U+8310,U+8312-8313,U+8316,U+8318-8319,U+831d-8326,U+8329-832a,U+832e,U+8330,U+8332,U+8337,U+833b,U+833d-833f,U+8341-8342,U+8344-8345,U+8348,U+834a-834e,U+8353,U+8355-8359,U+835d,U+8362,U+8370-8376,U+8379-837a,U+837e-8384,U+8387-8388,U+838a-838d,U+838f-8391,U+8394-8397,U+8399-839a,U+839d,U+839f,U+83a1-83a7,U+83ac-83af,U+83b5,U+83bb,U+83be-83bf,U+83c2-83c4,U+83c6,U+83c8-83c9,U+83cb,U+83cd-83ce,U+83d0-83d3,U+83d5,U+83d7,U+83d9-83db,U+83de,U+83e2-83e4,U+83e6-83e8,U+83eb-83ef,U+83f3-83f7,U+83fa-83fc,U+83fe-8400,U+8402,U+8405,U+8407-840a,U+8410,U+8412-8417,U+8419-841b,U+841e-8423,U+8429-8430,U+8432-8437,U+8439-843b,U+843e-8445,U+8447-8450,U+8452-8455"}},{uri:zB,descriptors:{unicodeRange:"U+81a4-81a5,U+81a7,U+81a9,U+81ab-81b2,U+81b4-81b9,U+81bc-81bf,U+81c4-81c5,U+81c7-81c9,U+81cb,U+81cd-81e2,U+81e4-81e6,U+81e8-81e9,U+81eb,U+81ee-81f2,U+81f5-81fa,U+81fd,U+81ff,U+8203,U+8207-820b,U+820e-820f,U+8211,U+8213,U+8215-821a,U+821d,U+8220,U+8224-8227,U+8229,U+822e,U+8232,U+823a,U+823c-823d,U+823f-8243,U+8245-8246,U+8248,U+824a,U+824c-824e,U+8250-8257,U+8259,U+825b-825e,U+8260-8267,U+8269-826d,U+8271,U+8275-8278,U+827b-827c,U+8280-8281,U+8283,U+8285-8287,U+8289,U+828c,U+8290,U+8293-8296,U+829a-829b,U+829e,U+82a0,U+82a2-82a3,U+82a7,U+82b2,U+82b5-82b6,U+82ba-82bc,U+82bf-82c0"}},{uri:FB,descriptors:{unicodeRange:"U+8059,U+805b-8068,U+806b-8070,U+8072-807e,U+8081-8082,U+8085,U+8088,U+808a,U+808d-8092,U+8094-8095,U+8097,U+8099,U+809e,U+80a3,U+80a6-80a8,U+80ac,U+80b0,U+80b3,U+80b5-80b6,U+80b8-80b9,U+80bb,U+80c5,U+80c7-80cb,U+80cf-80d5,U+80d8,U+80df-80e0,U+80e2-80e3,U+80e6,U+80ee,U+80f5,U+80f7,U+80f9,U+80fb,U+80fe-8101,U+8103-8105,U+8107-8108,U+810b-810c,U+8115,U+8117,U+8119,U+811b-811d,U+811f-812b,U+812d-812e,U+8130,U+8133-8135,U+8137,U+8139-813d,U+813f-8145,U+8147,U+8149,U+814d-814f,U+8152,U+8156-8158,U+815b-815f,U+8161-8164,U+8166,U+8168,U+816a-816c,U+816f,U+8172-8173,U+8175-8178,U+8181,U+8183-8187,U+8189,U+818b-818e,U+8190,U+8192-8197,U+8199-819a,U+819e-81a2"}},{uri:BB,descriptors:{unicodeRange:"U+7f3c-7f41,U+7f43,U+7f46-7f4f,U+7f52-7f53,U+7f56,U+7f59,U+7f5b-7f5e,U+7f60,U+7f63-7f67,U+7f6b-7f6d,U+7f6f-7f70,U+7f73,U+7f75-7f78,U+7f7a-7f7d,U+7f7f-7f80,U+7f82-7f89,U+7f8b,U+7f8d,U+7f8f-7f93,U+7f95-7f99,U+7f9b-7f9c,U+7fa0,U+7fa2-7fa3,U+7fa5-7fa6,U+7fa8-7fae,U+7fb1,U+7fb3-7fb7,U+7fba-7fbb,U+7fbe,U+7fc0,U+7fc2-7fc4,U+7fc6-7fc9,U+7fcb,U+7fcd,U+7fcf-7fd3,U+7fd6-7fd7,U+7fd9-7fde,U+7fe2-7fe4,U+7fe7-7fe8,U+7fea-7fed,U+7fef,U+7ff2,U+7ff4-7ffa,U+7ffd-7fff,U+8002,U+8007-800a,U+800e-800f,U+8011,U+8013,U+801a-801b,U+801d-801f,U+8021,U+8023-8024,U+802b-8030,U+8032,U+8034,U+8039-803a,U+803c,U+803e,U+8040-8041,U+8044-8045,U+8047-8049,U+804e-8051,U+8053,U+8055-8057"}},{uri:HB,descriptors:{unicodeRange:"U+7cd8,U+7cda-7cdb,U+7cdd-7cde,U+7ce1-7ce7,U+7ce9-7cee,U+7cf0-7cf7,U+7cf9-7cfa,U+7cfc-7d09,U+7d0b-7d1f,U+7d21,U+7d23-7d26,U+7d28-7d2a,U+7d2c-7d2e,U+7d30-7d6d,U+7d6f-7d76,U+7d78-7d94"}},{uri:WB,descriptors:{unicodeRange:"U+7afe,U+7b00-7b02,U+7b05,U+7b07,U+7b09,U+7b0c-7b0e,U+7b10,U+7b12-7b13,U+7b16-7b18,U+7b1a,U+7b1c-7b1d,U+7b1f,U+7b21-7b23,U+7b27,U+7b29,U+7b2d,U+7b2f-7b30,U+7b32,U+7b34-7b37,U+7b39,U+7b3b,U+7b3d,U+7b3f-7b44,U+7b46,U+7b48,U+7b4a,U+7b4d-7b4e,U+7b53,U+7b55,U+7b57,U+7b59,U+7b5c,U+7b5e-7b5f,U+7b61,U+7b63-7b6d,U+7b6f-7b70,U+7b73-7b74,U+7b76,U+7b78,U+7b7a,U+7b7c-7b7d,U+7b7f,U+7b81-7b84,U+7b86-7b8c,U+7b8e-7b8f,U+7b91-7b93,U+7b96,U+7b98-7b9b,U+7b9e-7ba0,U+7ba3-7ba5,U+7bae-7bb0,U+7bb2-7bb3,U+7bb5-7bb7,U+7bb9-7bc0,U+7bc2-7bc5,U+7bc8-7bcb,U+7bcd-7bd0,U+7bd2,U+7bd4-7bd8,U+7bdb-7bdc,U+7bde-7be0,U+7be2-7be4,U+7be7-7be9,U+7beb-7bed,U+7bef-7bf0,U+7bf2-7bf6,U+7bf8-7bfb,U+7bfd,U+7bff-7c06,U+7c08-7c0a,U+7c0d-7c0e,U+7c10-7c13"}},{uri:XB,descriptors:{unicodeRange:"U+7a10-7a13,U+7a15-7a16,U+7a18-7a19,U+7a1b-7a1d,U+7a1f,U+7a21-7a22,U+7a24-7a32,U+7a34-7a36,U+7a38,U+7a3a,U+7a3e,U+7a40-7a45,U+7a47-7a50,U+7a52-7a56,U+7a58-7a6f,U+7a71-7a73,U+7a75,U+7a7b-7a7e,U+7a82,U+7a85,U+7a87,U+7a89-7a8c,U+7a8e-7a90,U+7a93-7a94,U+7a99-7a9b,U+7a9e,U+7aa1-7aa4,U+7aa7,U+7aa9-7aab,U+7aae-7ab2,U+7ab4-7abe,U+7ac0-7aca,U+7acc-7ad5,U+7ad7-7ad8,U+7ada-7add,U+7ae1-7ae2,U+7ae4,U+7ae7-7aec,U+7aee,U+7af0-7af8,U+7afb-7afc"}},{uri:VB,descriptors:{unicodeRange:"U+790d-7912,U+7914-791d,U+791f-7923,U+7925-7933,U+7935-7939,U+793d,U+793f,U+7942-7945,U+7947,U+794a-7952,U+7954-7955,U+7958-7959,U+7961,U+7963-7964,U+7966,U+7969-796c,U+796e,U+7970-7976,U+7979,U+797b-797f,U+7982-7983,U+7986-7989,U+798b-798e,U+7990-7999,U+799b-79a6,U+79a8-79b2,U+79b4-79b8,U+79bc,U+79bf,U+79c2,U+79c4-79c5,U+79c7-79c8,U+79ca,U+79cc,U+79ce-79d0,U+79d3-79d4,U+79d6-79d7,U+79d9-79de,U+79e0-79e2,U+79e5,U+79e8,U+79ea,U+79ec,U+79ee,U+79f1-79f7,U+79f9-79fa,U+79fc,U+79fe-79ff,U+7a01,U+7a04-7a05,U+7a07-7a0a,U+7a0c,U+7a0f"}},{uri:GB,descriptors:{unicodeRange:"U+77d8-77da,U+77dd-77e1,U+77e4,U+77e6,U+77e8,U+77ea,U+77ef-77f2,U+77f4-77f5,U+77f7,U+77f9-77fc,U+7803-7808,U+780a-780b,U+780e-7810,U+7813,U+7815,U+7819,U+781b,U+781e,U+7820-7822,U+7824,U+7828,U+782a-782b,U+782e-782f,U+7831-7833,U+7835-7836,U+783d,U+783f,U+7841-7844,U+7846,U+7848-784b,U+784d,U+784f,U+7851,U+7853-7854,U+7858-785c,U+785e-7869,U+786f-7876,U+7878-787b,U+787d-7886,U+7888,U+788a-788b,U+788f-7890,U+7892,U+7894-7896,U+7899,U+789d-789e,U+78a0,U+78a2,U+78a4,U+78a6,U+78a8-78af,U+78b5-78b8,U+78ba-78bd,U+78bf-78c0,U+78c2-78c4,U+78c6-78c8,U+78cc-78cf,U+78d1-78d3,U+78d6-78d8,U+78da-78e7,U+78e9-78eb,U+78ed-78f1,U+78f3,U+78f5-78f6,U+78f8-78f9,U+78fb-7900,U+7902-7904,U+7906-790c"}},{uri:YB,descriptors:{unicodeRange:"U+76af-76b0,U+76b3,U+76b5-76be,U+76c0-76c1,U+76c3-76c4,U+76c7,U+76c9,U+76cb-76cc,U+76d3,U+76d5,U+76d9-76da,U+76dc-76de,U+76e0-76e4,U+76e6-76ed,U+76f0,U+76f3,U+76f5-76f7,U+76fa-76fb,U+76fd,U+76ff-7703,U+7705-7706,U+770a,U+770c,U+770e-7718,U+771b-771e,U+7721,U+7723-7725,U+7727,U+772a-772c,U+772e,U+7730-7734,U+7739,U+773b,U+773d-773f,U+7742,U+7744-7746,U+7748-774f,U+7752-7759,U+775c-7760,U+7764,U+7767,U+7769-776a,U+776d-7778,U+777a-777c,U+7781-7783,U+7786-778b,U+778f-7790,U+7793-779e,U+77a1,U+77a3-77a4,U+77a6,U+77a8,U+77ab,U+77ad-77af,U+77b1-77b2,U+77b4,U+77b6-77ba,U+77bc,U+77be,U+77c0-77cc,U+77ce-77d6"}},{uri:ZB,descriptors:{unicodeRange:"U+7589-758a,U+758c-758e,U+7590,U+7593,U+7595,U+7598,U+759b-759c,U+759e,U+75a2,U+75a6-75aa,U+75ad,U+75b6-75b7,U+75ba-75bb,U+75bf-75c1,U+75c6,U+75cb-75cc,U+75ce-75d1,U+75d3,U+75d7,U+75d9-75da,U+75dc-75dd,U+75df-75e1,U+75e5,U+75e9,U+75ec-75ef,U+75f2-75f3,U+75f5-75f8,U+75fa-75fb,U+75fd-75fe,U+7602,U+7604,U+7606-7609,U+760b,U+760d-760f,U+7611-7614,U+7616,U+761a,U+761c-761e,U+7621,U+7623,U+7627-7628,U+762c,U+762e-762f,U+7631-7632,U+7636-7637,U+7639-763b,U+763d,U+7641-7642,U+7644-764b,U+764e-7653,U+7655,U+7657-765b,U+765d,U+765f-7662,U+7664-766a,U+766c-766e,U+7670-7677,U+7679-767a,U+767c,U+767f-7681,U+7683,U+7685,U+7689-768a,U+768c-768d,U+768f-7690,U+7692,U+7694-7695,U+7697-7698,U+769a-76a3,U+76a5-76ad"}},{uri:KB,descriptors:{unicodeRange:"U+7492-749b,U+749d,U+749f-74a6,U+74aa-74b9,U+74bb-74d1,U+74d3-74db,U+74dd,U+74df,U+74e1,U+74e5,U+74e7-74ed,U+74f0-74f3,U+74f5,U+74f8-74fe,U+7500-7503,U+7505-750c,U+750e,U+7510,U+7512,U+7514-7517,U+751b,U+751d-751e,U+7520-7524,U+7526-7527,U+752a,U+752e,U+7534,U+7536,U+7539,U+753c-753d,U+753f,U+7541-7544,U+7546-7547,U+7549-754a,U+754d,U+7550-7553,U+7555-7558,U+755d-7564,U+7567-7569,U+756b-7571,U+7573,U+7575-7577,U+757a-757e,U+7580-7582,U+7584-7585,U+7587-7588"}},{uri:qB,descriptors:{unicodeRange:"U+7372-737d,U+737f-7383,U+7385-7386,U+7388,U+738a,U+738c-738d,U+738f-7390,U+7392-7395,U+7397-739a,U+739c-739e,U+73a0-73a1,U+73a3-73a8,U+73aa,U+73ac-73ad,U+73b1,U+73b4-73b6,U+73b8-73b9,U+73bc-73bf,U+73c1,U+73c3-73c7,U+73cb-73cc,U+73ce,U+73d2-73d8,U+73da-73dd,U+73df,U+73e1-73e4,U+73e6,U+73e8,U+73ea-73ec,U+73ee-73f1,U+73f3-7402,U+7404,U+7407-7408,U+740b-740e,U+7411-7419,U+741c-7421,U+7423-7424,U+7427,U+7429,U+742b,U+742d,U+742f,U+7431-7432,U+7437-743b,U+743d-7440,U+7442-7454,U+7456,U+7458,U+745d,U+7460-746c,U+746e-746f,U+7471-7475,U+7478-747d,U+747f,U+7482,U+7484-7486,U+7488-748a,U+748c-748d,U+748f,U+7491"}},{uri:QB,descriptors:{unicodeRange:"U+7054-705d,U+705f-706a,U+706e,U+7071-7074,U+7077,U+7079-707b,U+707d,U+7081-7084,U+7086-7088,U+708b-708d,U+708f-7091,U+7093,U+7097-7098,U+709a-709b,U+709e-70aa,U+70b0,U+70b2,U+70b4-70b6,U+70ba,U+70be-70bf,U+70c4-70c7,U+70c9,U+70cb-70d7,U+70da,U+70dc-70de,U+70e0-70e3,U+70e5,U+70ea,U+70ee,U+70f0-70f6,U+70f8,U+70fa-70fc,U+70fe-7108,U+710b-710f,U+7111-7112,U+7114,U+7117,U+711b-7125,U+7127-712e,U+7132-7135,U+7137-7144,U+7146-7149,U+714b,U+714d,U+714f-715b,U+715d,U+715f-7163,U+7165,U+7169-716d,U+716f-7171,U+7174-7177"}},{uri:JB,descriptors:{unicodeRange:"U+722e-722f,U+7232-7234,U+723a,U+723c,U+723e,U+7240-7246,U+7249-724b,U+724e-7251,U+7253-7255,U+7257-7258,U+725a,U+725c,U+725e,U+7260,U+7263-7265,U+7268,U+726a-726d,U+7270-7271,U+7273-7274,U+7276-7278,U+727b-727d,U+7282-7283,U+7285-7289,U+728c,U+728e,U+7290-7291,U+7293-729e,U+72a0-72ab,U+72ae,U+72b1-72b3,U+72b5,U+72ba-72c0,U+72c5-72c7,U+72c9-72cc,U+72cf,U+72d1,U+72d3-72d6,U+72d8,U+72da-72dd,U+72df,U+72e2-72e7,U+72ea-72eb,U+72f5-72f6,U+72f9,U+72fd-7300,U+7302,U+7304-7309,U+730b-730d,U+730f-7312,U+7314,U+7318-731a,U+731f-7320,U+7323-7324,U+7326-7328,U+732d,U+732f-7330,U+7332-7333,U+7335-7336,U+733a-733d,U+7340-734c,U+734e-734f,U+7351,U+7353-7356,U+7358-735f,U+7361-736b,U+736e,U+7370-7371"}},{uri:eH,descriptors:{unicodeRange:"U+6ec5-6ec6,U+6ec8-6eca,U+6ecc-6ece,U+6ed0,U+6ed2,U+6ed6,U+6ed8-6ed9,U+6edb-6edd,U+6ee3,U+6ee7,U+6eea-6ef3,U+6ef5-6ef8,U+6efa-6f01,U+6f03-6f05,U+6f07-6f08,U+6f0a-6f0e,U+6f10-6f12,U+6f16-6f1f,U+6f21-6f23,U+6f25-6f28,U+6f2c,U+6f2e,U+6f30,U+6f32,U+6f34-6f35,U+6f37-6f3d,U+6f3f-6f45,U+6f48-6f4a,U+6f4c,U+6f4e-6f57,U+6f59-6f5b,U+6f5d,U+6f5f-6f61,U+6f63-6f65,U+6f67-6f6c,U+6f6f-6f71,U+6f73,U+6f75-6f77,U+6f79,U+6f7b,U+6f7d-6f83,U+6f85-6f87,U+6f8a-6f8b,U+6f8f-6f9b,U+6f9d-6fa0,U+6fa2-6fa6,U+6fa8-6fb1"}},{uri:tH,descriptors:{unicodeRange:"U+6d73,U+6d75-6d76,U+6d79-6d7b,U+6d7d-6d81,U+6d83-6d84,U+6d86-6d87,U+6d8a-6d8b,U+6d8d,U+6d8f-6d90,U+6d92,U+6d96-6d9a,U+6d9c,U+6da2,U+6da5,U+6dac-6dad,U+6db0-6db1,U+6db3-6db4,U+6db6-6db7,U+6db9-6dbe,U+6dc1-6dc3,U+6dc8-6dca,U+6dcd-6dd0,U+6dd2-6dd5,U+6dd7,U+6dda-6ddc,U+6ddf,U+6de2-6de3,U+6de5,U+6de7-6dea,U+6ded,U+6def-6df0,U+6df2,U+6df4-6df6,U+6df8,U+6dfa,U+6dfd-6e04,U+6e06-6e09,U+6e0b,U+6e0f,U+6e12-6e13,U+6e15,U+6e18-6e19,U+6e1b-6e1c,U+6e1e-6e1f,U+6e22,U+6e26-6e28,U+6e2a,U+6e2c,U+6e2e,U+6e30-6e31,U+6e33,U+6e35-6e37,U+6e39,U+6e3b-6e42,U+6e45-6e4c,U+6e4f-6e52,U+6e55,U+6e57,U+6e59-6e5a,U+6e5c-6e5e,U+6e60-6e6a,U+6e6c-6e6d,U+6e6f-6e7d,U+6e80-6e82,U+6e84,U+6e87-6e88,U+6e8a-6e8e,U+6e91-6e97,U+6e99-6e9b,U+6e9d-6e9e,U+6ea0-6ea1,U+6ea3-6ea4,U+6ea6,U+6ea8-6ea9,U+6eab-6eae,U+6eb0,U+6eb3,U+6eb5,U+6eb8-6eb9,U+6ebc,U+6ebe-6ec0,U+6ec3-6ec4"}},{uri:nH,descriptors:{unicodeRange:"U+6bbb-6bbe,U+6bc0,U+6bc3-6bc4,U+6bc6-6bca,U+6bcc,U+6bce,U+6bd0-6bd1,U+6bd8,U+6bda,U+6bdc-6be0,U+6be2-6be9,U+6bec-6bee,U+6bf0-6bf2,U+6bf4,U+6bf6-6bf8,U+6bfa-6bfc,U+6bfe-6c04,U+6c08-6c0c,U+6c0e,U+6c12,U+6c17,U+6c1c-6c1e,U+6c20,U+6c23,U+6c25,U+6c2b-6c2d,U+6c31,U+6c33,U+6c36-6c37,U+6c39-6c3c,U+6c3e-6c3f,U+6c43-6c45,U+6c48,U+6c4b-6c4f,U+6c51-6c53,U+6c56,U+6c58-6c5a,U+6c62-6c63,U+6c65-6c67,U+6c6b-6c6f,U+6c71,U+6c73,U+6c75,U+6c77-6c78,U+6c7a-6c7c,U+6c7f-6c80,U+6c84,U+6c87,U+6c8a-6c8b,U+6c8d-6c8e,U+6c91-6c92,U+6c95-6c98,U+6c9a,U+6c9c-6c9e,U+6ca0,U+6ca2,U+6ca8,U+6cac,U+6caf-6cb0,U+6cb4-6cb7,U+6cba,U+6cc0-6cc3,U+6cc6-6cc8,U+6ccb,U+6ccd-6ccf,U+6cd1-6cd2,U+6cd8-6cda,U+6cdc-6cdd,U+6cdf,U+6ce4,U+6ce6-6ce7,U+6ce9,U+6cec-6ced,U+6cf2,U+6cf4,U+6cf9,U+6cff-6d00,U+6d02-6d03,U+6d05-6d06,U+6d08-6d0a,U+6d0d,U+6d0f-6d11,U+6d13-6d16,U+6d18,U+6d1c-6d1d,U+6d1f-6d24,U+6d26,U+6d28-6d29,U+6d2c-6d2d,U+6d2f-6d30,U+6d34,U+6d36-6d38,U+6d3a,U+6d3f-6d40,U+6d42,U+6d44,U+6d49,U+6d4c,U+6d50,U+6d55-6d58,U+6d5b,U+6d5d,U+6d5f,U+6d61-6d62,U+6d64-6d65,U+6d67-6d68,U+6d6b-6d6d,U+6d70-6d72"}},{uri:rH,descriptors:{unicodeRange:"U+6967-696a,U+696c-696d,U+696f-6970,U+6972-6976,U+697a-697b,U+697d-697f,U+6981,U+6983,U+6985,U+698a-698c,U+698e-6993,U+6996-6997,U+6999-699a,U+699d-69a6,U+69a9-69aa,U+69ac,U+69ae-69b0,U+69b2-69b3,U+69b5-69b6,U+69b8-69ba,U+69bc-69c0,U+69c2-69c9,U+69cb,U+69cd,U+69cf,U+69d1-69d3,U+69d5-69da,U+69dc-69de,U+69e1-69ec,U+69ee-69f1,U+69f3-69fc,U+69fe,U+6a00-6a09,U+6a0b-6a16,U+6a19-6a1e,U+6a20,U+6a22-6a27,U+6a29,U+6a2b-6a2e,U+6a30,U+6a32-6a34,U+6a36-6a3c,U+6a3f-6a43,U+6a45-6a46,U+6a48-6a4a"}},{uri:aH,descriptors:{unicodeRange:"U+6830-6831,U+6834-6836,U+683a-683b,U+683f,U+6847,U+684b,U+684d,U+684f,U+6852,U+6856-685f,U+686a,U+686c-6873,U+6875,U+6878-6880,U+6882,U+6884,U+6887-688e,U+6890-6892,U+6894-6896,U+6898-68a1,U+68a3-68a5,U+68a9-68ac,U+68ae,U+68b1-68b2,U+68b4,U+68b6-68bf,U+68c1,U+68c3-68c8,U+68ca,U+68cc,U+68ce-68d1,U+68d3-68d4,U+68d6-68d7,U+68d9,U+68db-68df,U+68e1-68e2,U+68e4-68ed,U+68ef,U+68f2-68f4,U+68f6-68f8,U+68fb,U+68fd-6900,U+6902-6904,U+6906-690a,U+690c,U+690f,U+6911,U+6913-691e,U+6921-6923,U+6925-692c,U+692e-692f,U+6931-6933,U+6935-6938,U+693a-693c,U+693e,U+6940-6941,U+6943-6953,U+6955-6956,U+6958-6959,U+695b-695c,U+695f,U+6961-6962,U+6964-6965"}},{uri:iH,descriptors:{unicodeRange:"U+66b8,U+66ba-66bd,U+66bf-66d8,U+66da,U+66de-66e5,U+66e7-66e8,U+66ea-66ef,U+66f1,U+66f5-66f6,U+66f8,U+66fa-66fb,U+66fd,U+6701-6707,U+670c,U+670e-670f,U+6711-6713,U+6716,U+6718-671a,U+671c,U+671e,U+6720-6725,U+6727,U+6729,U+672e,U+6730,U+6732-6733,U+6736-6739,U+673b-673c,U+673e-673f,U+6741,U+6744-6745,U+6747,U+674a-674b,U+674d,U+6752,U+6754-6755,U+6757-675b,U+675d,U+6762-6764,U+6766-6767,U+676b-676c,U+676e,U+6771,U+6774,U+6776,U+6778-677b,U+677d,U+6780,U+6782-6783,U+6785-6786,U+6788,U+678a,U+678c-678f,U+6791-6794,U+6796,U+6799,U+679b,U+679f-67a1,U+67a4,U+67a6,U+67a9,U+67ac,U+67ae,U+67b1-67b2,U+67b4,U+67b9-67c0,U+67c2,U+67c5-67ce,U+67d5-67d7,U+67db,U+67df,U+67e1,U+67e3-67e4,U+67e6-67e8,U+67ea-67eb,U+67ed-67ee,U+67f2,U+67f5-67fc,U+67fe,U+6801-6804,U+6806,U+680d,U+6810,U+6812,U+6814-6815,U+6818-681c,U+681e-6820,U+6822-6828,U+682b-682f"}},{uri:lH,descriptors:{unicodeRange:"U+6569-656a,U+656d-656f,U+6571,U+6573,U+6575-6576,U+6578-6586,U+6588-658a,U+658d-658f,U+6592,U+6594-6596,U+6598,U+659a,U+659d-659e,U+65a0,U+65a2-65a3,U+65a6,U+65a8,U+65aa,U+65ac,U+65ae,U+65b1-65b8,U+65ba-65bb,U+65be-65c0,U+65c2,U+65c7-65ca,U+65cd,U+65d0-65d1,U+65d3-65d5,U+65d8-65df,U+65e1,U+65e3-65e4,U+65ea-65eb,U+65f2-65f5,U+65f8-65f9,U+65fb-65ff,U+6601,U+6604-6605,U+6607-6609,U+660b,U+660d,U+6610-6612,U+6616-6618,U+661a-661c,U+661e,U+6621-6624,U+6626,U+6629-662c,U+662e,U+6630,U+6632-6633,U+6637-663b,U+663d,U+663f-6640,U+6642,U+6644-664a,U+664d-664e,U+6650-6651,U+6658-6659,U+665b-665e,U+6660,U+6662-6663,U+6665,U+6667,U+6669-666d,U+6671-6673,U+6675,U+6678-6679,U+667b-667d,U+667f-6681,U+6683,U+6685-6686,U+6688-668b,U+668d-6690,U+6692-6695,U+6698-669c,U+669e-66a6,U+66a9-66ad,U+66af-66b3,U+66b5-66b7"}},{uri:sH,descriptors:{unicodeRange:"U+5f30,U+5f32-5f38,U+5f3b,U+5f3d-5f3f,U+5f41-5f4f,U+5f51,U+5f54,U+5f59-5f5c,U+5f5e-5f60,U+5f63,U+5f65,U+5f67-5f68,U+5f6b,U+5f6e-5f6f,U+5f72,U+5f74-5f76,U+5f78,U+5f7a,U+5f7d-5f7f,U+5f83,U+5f86,U+5f8d-5f8f,U+5f91,U+5f93-5f94,U+5f96,U+5f9a-5f9b,U+5f9d-5fa0,U+5fa2-5fa7,U+5fa9,U+5fab-5fac,U+5faf-5fb4,U+5fb6,U+5fb8-5fbb,U+5fbe-5fc2,U+5fc7-5fc8,U+5fca-5fcb,U+5fce,U+5fd3-5fd5,U+5fda-5fdc,U+5fde-5fdf,U+5fe2-5fe3,U+5fe5-5fe6,U+5fe8-5fe9,U+5fec,U+5fef-5ff0,U+5ff2-5ff4,U+5ff6-5ff7,U+5ff9-5ffa,U+5ffc,U+6007-6009,U+600b-600c,U+6010-6011,U+6013,U+6017-6018,U+601a,U+601e-601f,U+6022-6024,U+602c-602e,U+6030-6034,U+6036-603a,U+603d-603e,U+6040,U+6044-604a,U+604c,U+604e-604f,U+6051,U+6053-6054,U+6056-6058,U+605b-605c,U+605e-6061,U+6065-6066,U+606e,U+6071-6072,U+6074-6075,U+6077,U+607e,U+6080-6082,U+6085-6088,U+608a-608b,U+608e-6091,U+6093,U+6095,U+6097-6099,U+609c,U+609e,U+60a1-60a2,U+60a4-60a5,U+60a7,U+60a9-60aa,U+60ae,U+60b0,U+60b3,U+60b5-60b7,U+60b9-60ba,U+60bd-60c4,U+60c7-60c9,U+60cc"}},{uri:oH,descriptors:{unicodeRange:"U+635a-635d,U+6360,U+6364-6366,U+6368,U+636a-636c,U+636f-6370,U+6372-6375,U+6378-6379,U+637c-637f,U+6381,U+6383-6386,U+638b,U+638d,U+6391,U+6393-6395,U+6397,U+6399-639f,U+63a1,U+63a4,U+63a6,U+63ab,U+63af,U+63b1-63b2,U+63b5-63b6,U+63b9,U+63bb,U+63bd,U+63bf-63c3,U+63c5,U+63c7-63c8,U+63ca-63cc,U+63d1,U+63d3-63d5,U+63d7-63dd,U+63df,U+63e2,U+63e4-63e8,U+63eb-63ec,U+63ee-63f1,U+63f3,U+63f5,U+63f7,U+63f9-63fc,U+63fe,U+6403-6404,U+6406-640a,U+640d-640e,U+6411-6412,U+6415-641a,U+641d,U+641f,U+6422-6425,U+6427-6429,U+642b,U+642e-6433,U+6435-6439,U+643b-643c,U+643e,U+6440,U+6442-6443,U+6449,U+644b-6451,U+6453,U+6455-6457,U+6459-645d,U+645f-6466,U+6468,U+646a-646c,U+646e-6477,U+647b-6481,U+6483,U+6486,U+6488-648f"}},{uri:cH,descriptors:{unicodeRange:"U+61c5-61c7,U+61c9,U+61cc-61d0,U+61d3,U+61d5-61e5,U+61e7-61f4,U+61f6-61fe,U+6200-6205,U+6207,U+6209,U+6213-6214,U+6219,U+621c-621e,U+6220,U+6223,U+6226-6229,U+622b,U+622d,U+622f-6232,U+6235-6236,U+6238-623c,U+6242,U+6244-6246,U+624a,U+624f-6250,U+6255-6257,U+6259-625a,U+625c-6262,U+6264-6265,U+6268,U+6271-6272,U+6274-6275,U+6277-6278,U+627a-627b,U+627d,U+6281-6283,U+6285-6288,U+628b-6290,U+6294,U+6299,U+629c-629e,U+62a3,U+62a6-62a7,U+62a9-62aa,U+62ad-62b0,U+62b2-62b4,U+62b6-62b8,U+62ba,U+62be,U+62c0-62c1,U+62c3,U+62cb,U+62cf,U+62d1,U+62d5,U+62dd-62de,U+62e0-62e1,U+62e4,U+62ea-62eb,U+62f0,U+62f2,U+62f5,U+62f8-62fb,U+6300,U+6303-6306,U+630a-630d,U+630f-6310,U+6312-6315,U+6317-6319,U+631c,U+6326-6327,U+6329,U+632c-632e,U+6330-6331,U+6333-6338,U+633b-633c,U+633e-6341,U+6344,U+6347-6348,U+634a,U+6351-6354,U+6356-6359"}},{uri:dH,descriptors:{unicodeRange:"U+5dd0-5dda,U+5ddc,U+5ddf-5de0,U+5de3-5de4,U+5dea,U+5dec-5ded,U+5df0,U+5df5-5df6,U+5df8-5dfc,U+5dff-5e00,U+5e04,U+5e07,U+5e09-5e0b,U+5e0d-5e0e,U+5e12-5e13,U+5e17,U+5e1e-5e25,U+5e28-5e2c,U+5e2f-5e30,U+5e32-5e36,U+5e39-5e3a,U+5e3e-5e41,U+5e43,U+5e46-5e4b,U+5e4d-5e53,U+5e56-5e5a,U+5e5c-5e5d,U+5e5f-5e60,U+5e63-5e71,U+5e75,U+5e77,U+5e79,U+5e7e,U+5e81-5e83,U+5e85,U+5e88-5e89,U+5e8c-5e8e,U+5e92,U+5e98,U+5e9b,U+5e9d,U+5ea1-5ea4,U+5ea8-5eac,U+5eae-5eb2,U+5eb4,U+5eba-5ebd,U+5ebf-5ec8,U+5ecb-5ed0,U+5ed4-5ed5,U+5ed7-5eda,U+5edc-5ee7,U+5ee9,U+5eeb-5ef3,U+5ef5,U+5ef8-5ef9,U+5efb-5efd,U+5f05-5f07,U+5f09,U+5f0c-5f0e,U+5f10,U+5f12,U+5f14,U+5f16,U+5f19-5f1a,U+5f1c-5f1e,U+5f21-5f24,U+5f28,U+5f2b-5f2c,U+5f2e"}},{uri:uH,descriptors:{unicodeRange:"U+60cd-60d0,U+60d2-60d4,U+60d6-60d7,U+60d9,U+60db,U+60de,U+60e1-60e5,U+60ea,U+60f1-60f2,U+60f5,U+60f7-60f8,U+60fb-60ff,U+6102-6105,U+6107,U+610a-610c,U+6110-6114,U+6116-6119,U+611b-611e,U+6121-6122,U+6125,U+6128-612a,U+612c-613e,U+6140-6147,U+6149,U+614b,U+614d,U+614f-6150,U+6152-6154,U+6156-615c,U+615e-6161,U+6163-6166,U+6169-616f,U+6171-6174,U+6176,U+6178-618a,U+618c-618d,U+618f-6193,U+6195-619c,U+619e-61a6,U+61aa-61ab,U+61ad-61b6,U+61b8-61bd,U+61bf-61c1,U+61c3-61c4"}},{uri:fH,descriptors:{unicodeRange:"U+5cf4-5cfa,U+5cfc-5d01,U+5d04-5d05,U+5d08-5d0d,U+5d0f-5d13,U+5d15,U+5d17-5d1a,U+5d1c-5d1d,U+5d1f-5d23,U+5d25,U+5d28,U+5d2a-5d2c,U+5d2f-5d33,U+5d35-5d3c,U+5d3f-5d46,U+5d48-5d49,U+5d4d-5d57,U+5d59-5d5a,U+5d5c,U+5d5e-5d68,U+5d6a,U+5d6d-5d6e,U+5d70-5d73,U+5d75-5d81,U+5d83-5d98,U+5d9a-5d9c,U+5d9e-5db6,U+5db8-5dc4,U+5dc6-5dcc,U+5dce-5dcf"}},{uri:hH,descriptors:{unicodeRange:"U+5b52,U+5b56,U+5b5e,U+5b60-5b61,U+5b67-5b68,U+5b6b,U+5b6d-5b6f,U+5b72,U+5b74,U+5b76-5b79,U+5b7b-5b7c,U+5b7e-5b7f,U+5b82,U+5b86,U+5b8a,U+5b8d-5b8e,U+5b90-5b92,U+5b94,U+5b96,U+5b9f,U+5ba7-5ba9,U+5bac-5baf,U+5bb1-5bb2,U+5bb7,U+5bba-5bbc,U+5bc0-5bc1,U+5bc3,U+5bc8-5bcb,U+5bcd-5bcf,U+5bd1,U+5bd4-5bdc,U+5be0,U+5be2-5be3,U+5be6-5be7,U+5be9-5bed,U+5bef,U+5bf1-5bf7,U+5bfd-5bfe,U+5c00,U+5c02-5c03,U+5c05,U+5c07-5c08,U+5c0b-5c0e,U+5c10,U+5c12-5c13,U+5c17,U+5c19,U+5c1b,U+5c1e-5c21,U+5c23,U+5c26,U+5c28-5c2b,U+5c2d-5c30,U+5c32-5c33,U+5c35-5c37,U+5c43-5c44,U+5c46-5c47,U+5c4c-5c4d,U+5c52-5c54,U+5c56-5c58,U+5c5a-5c5d,U+5c5f,U+5c62,U+5c64,U+5c67-5c6d,U+5c70,U+5c72-5c78,U+5c7b-5c7e,U+5c80,U+5c83-5c87,U+5c89-5c8b,U+5c8e-5c8f,U+5c92-5c93,U+5c95,U+5c9d-5ca1,U+5ca4-5ca8,U+5caa,U+5cae-5cb0,U+5cb2,U+5cb4,U+5cb6,U+5cb9-5cbc,U+5cbe,U+5cc0,U+5cc2-5cc3,U+5cc5-5cca,U+5ccc-5cd1,U+5cd3-5cd8,U+5cda-5ce0,U+5ce2-5ce3,U+5ce7,U+5ce9,U+5ceb-5cec,U+5cee-5cef,U+5cf1-5cf3"}},{uri:pH,descriptors:{unicodeRange:"U+593b,U+593d-5940,U+5943,U+5945-5946,U+594a,U+594c-594d,U+5950,U+5952-5953,U+5959,U+595b-595f,U+5961,U+5963-5964,U+5966-5972,U+5975,U+5977,U+597a-597c,U+597e-5980,U+5985,U+5989,U+598b-598c,U+598e-5991,U+5994-5995,U+5998,U+599a-599d,U+599f-59a2,U+59a6-59a7,U+59ac-59ad,U+59b0-59b1,U+59b3-59b8,U+59ba,U+59bc-59bd,U+59bf-59c5,U+59c7-59c9,U+59cc-59cf,U+59d5-59d6,U+59d9,U+59db,U+59de-59e2,U+59e4,U+59e6-59e7,U+59e9-59eb,U+59ed-59f8,U+59fa,U+59fc-59fe,U+5a00,U+5a02,U+5a0a-5a0b,U+5a0d-5a10,U+5a12,U+5a14-5a17,U+5a19-5a1b,U+5a1d-5a1e,U+5a21-5a22,U+5a24,U+5a26-5a28,U+5a2a-5a30,U+5a33,U+5a35,U+5a37-5a3b,U+5a3d-5a3f,U+5a41-5a45,U+5a47-5a48,U+5a4b-5a54,U+5a56-5a59,U+5a5b-5a61,U+5a63-5a66,U+5a68-5a69,U+5a6b-5a73,U+5a78-5a79,U+5a7b-5a7e,U+5a80-5a90"}},{uri:mH,descriptors:{unicodeRange:"U+5a91,U+5a93-5a99,U+5a9c-5aa9,U+5aab-5ab1,U+5ab4,U+5ab6-5ab7,U+5ab9-5abd,U+5abf-5ac0,U+5ac3-5ac8,U+5aca-5acb,U+5acd-5ad1,U+5ad3,U+5ad5,U+5ad7,U+5ad9-5adb,U+5add-5adf,U+5ae2,U+5ae4-5ae5,U+5ae7-5ae8,U+5aea,U+5aec-5af0,U+5af2-5b08,U+5b0a-5b15,U+5b18-5b31,U+5b33,U+5b35-5b36,U+5b38-5b3f,U+5b41-5b4f"}},{uri:UH,descriptors:{unicodeRange:"U+5843,U+5845-584b,U+584e-5850,U+5852-5853,U+5855-5857,U+5859-585d,U+585f-5864,U+5866-586a,U+586d-587d,U+587f,U+5882,U+5884,U+5886-5888,U+588a-5891,U+5894-5898,U+589b-589d,U+58a0-58a7,U+58aa-58bb,U+58bd-58c0,U+58c2-58c4,U+58c6-58d0,U+58d2-58d4,U+58d6-58e3,U+58e5-58ea,U+58ed,U+58ef,U+58f1-58f2,U+58f4-58f5,U+58f7-58f8,U+58fa-5901,U+5903,U+5905-5906,U+5908-590c,U+590e,U+5910-5913,U+5917-5918,U+591b,U+591d-591e,U+5920-5923,U+5926,U+5928,U+592c,U+5930,U+5932-5933,U+5935-5936"}},{uri:gH,descriptors:{unicodeRange:"U+56d0-56d3,U+56d5-56d6,U+56d8-56d9,U+56dc,U+56e3,U+56e5-56ea,U+56ec,U+56ee-56ef,U+56f2-56f3,U+56f6-56f8,U+56fb-56fc,U+5700-5702,U+5705,U+5707,U+570b-571b,U+571d-571e,U+5720-5722,U+5724-5727,U+572b,U+5731-5732,U+5734-5738,U+573c-573d,U+573f,U+5741,U+5743-5746,U+5748-5749,U+574b,U+5752-5756,U+5758-5759,U+5762-5763,U+5765,U+5767,U+576c,U+576e,U+5770-5772,U+5774-5775,U+5778-577a,U+577d-5781,U+5787-578a,U+578d-5791,U+5794-579a,U+579c-579f,U+57a5,U+57a8,U+57aa,U+57ac,U+57af-57b1,U+57b3,U+57b5-57b7,U+57b9-57c1,U+57c4-57ca,U+57cc-57cd,U+57d0-57d1,U+57d3,U+57d6-57d7,U+57db-57dc,U+57de,U+57e1-57e3,U+57e5-57ec,U+57ee,U+57f0-57f3,U+57f5-57f7,U+57fb-57fc,U+57fe-57ff,U+5801,U+5803-5805,U+5808-580a,U+580c,U+580e-5810,U+5812-5814,U+5816-5818,U+581a-581d,U+581f,U+5822-5823,U+5825-5829,U+582b-582f,U+5831-5834,U+5836-5842"}},{uri:bH,descriptors:{unicodeRange:"U+55f9-55fc,U+55ff,U+5602-5607,U+560a-560b,U+560d,U+5610-5617,U+5619-561a,U+561c-561d,U+5620-5622,U+5625-5626,U+5628-562b,U+562e-5630,U+5633,U+5635,U+5637-5638,U+563a,U+563c-563e,U+5640-564b,U+564f-5653,U+5655-5656,U+565a-565b,U+565d-5661,U+5663,U+5665-5667,U+566d-5670,U+5672-5675,U+5677-567a,U+567d-5684,U+5687-568d,U+5690-5692,U+5694-56a2,U+56a4-56ae,U+56b0-56b6,U+56b8-56bb,U+56bd-56c9,U+56cb-56cf"}},{uri:vH,descriptors:{unicodeRange:"U+5286-5287,U+5289-528f,U+5291-5292,U+5294-529a,U+529c,U+52a4-52a7,U+52ae-52b0,U+52b4-52bd,U+52c0-52c2,U+52c4-52c6,U+52c8,U+52ca,U+52cc-52cf,U+52d1,U+52d3-52d5,U+52d7,U+52d9-52de,U+52e0-52e3,U+52e5-52ef,U+52f1-52f8,U+52fb-52fd,U+5301-5304,U+5307,U+5309-530c,U+530e,U+5311-5314,U+5318,U+531b-531c,U+531e-531f,U+5322,U+5324-5325,U+5327-5329,U+532b-532d,U+532f-5338,U+533c-533d,U+5340,U+5342,U+5344,U+5346,U+534b-534d,U+5350,U+5354,U+5358-5359,U+535b,U+535d,U+5365,U+5368,U+536a,U+536c-536d,U+5372,U+5376,U+5379,U+537b-537e,U+5380-5381,U+5383,U+5387-5388,U+538a,U+538e-5394,U+5396-5397,U+5399,U+539b-539c,U+539e,U+53a0-53a1,U+53a4,U+53a7,U+53aa-53ad,U+53af-53b5,U+53b7-53ba,U+53bc-53be,U+53c0,U+53c3-53c7,U+53ce-53d0,U+53d2-53d3,U+53d5,U+53da,U+53dc-53de,U+53e1-53e2,U+53e7,U+53f4,U+53fa,U+53fe-5400,U+5402,U+5405,U+5407,U+540b,U+5414,U+5418-541a,U+541c,U+5422,U+5424-5425,U+542a,U+5430,U+5433,U+5436-5437,U+543a"}},{uri:yH,descriptors:{unicodeRange:"U+5101-5105,U+5108-510a,U+510c-5111,U+5113-5120,U+5122-513e,U+5142,U+5147,U+514a,U+514c,U+514e-5150,U+5152-5153,U+5157-5159,U+515b,U+515d-5161,U+5163-5164,U+5166-5167,U+5169-516a,U+516f,U+5172,U+517a,U+517e-517f,U+5183-5184,U+5186-5187,U+518a-518b,U+518e-5191,U+5193-5194,U+5198,U+519a,U+519d-519f,U+51a1,U+51a3,U+51a6-51aa,U+51ad-51ae,U+51b4,U+51b8-51ba,U+51be-51bf,U+51c1-51c3,U+51c5,U+51c8,U+51ca,U+51cd-51ce,U+51d0,U+51d2-51da,U+51dc,U+51de-51df,U+51e2-51e3,U+51e5-51ea,U+51ec,U+51ee,U+51f1-51f2,U+51f4,U+51f7,U+51fe,U+5204-5205,U+5209,U+520b-520c,U+520f-5210,U+5213-5215,U+521c,U+521e-521f,U+5221-5223,U+5225-5227,U+522a,U+522c,U+522f,U+5231-5232,U+5234-5235,U+523c,U+523e,U+5244-5249,U+524b,U+524e-524f,U+5252-5253,U+5255,U+5257-525b,U+525d,U+525f-5260,U+5262-5264,U+5266,U+5268,U+526b-526e,U+5270-5271,U+5273-527c,U+527e,U+5280,U+5283-5285"}},{uri:xH,descriptors:{unicodeRange:"U+543d,U+543f,U+5441-5442,U+5444-5445,U+5447,U+5449,U+544c-544f,U+5451,U+545a,U+545d-5461,U+5463,U+5465,U+5467,U+5469-5470,U+5474,U+5479-547a,U+547e-547f,U+5481,U+5483,U+5485,U+5487-548a,U+548d,U+5491,U+5493,U+5497-5498,U+549c,U+549e-54a2,U+54a5,U+54ae,U+54b0,U+54b2,U+54b5-54b7,U+54b9-54ba,U+54bc,U+54be,U+54c3,U+54c5,U+54ca-54cb,U+54d6,U+54d8,U+54db,U+54e0-54e4,U+54eb-54ec,U+54ef-54f1,U+54f4-54f9,U+54fb,U+54fe,U+5500,U+5502-5505,U+5508,U+550a-550e,U+5512-5513,U+5515-551a,U+551c-551f,U+5521,U+5525-5526,U+5528-5529,U+552b,U+552d,U+5532,U+5534-5536,U+5538-553b,U+553d,U+5540,U+5542,U+5545,U+5547-5548,U+554b-554f,U+5551-5554,U+5557-555b,U+555d-5560,U+5562-5563,U+5568-5569,U+556b,U+556f-5574,U+5579-557a,U+557d,U+557f,U+5585-5586,U+558c-558e,U+5590,U+5592-5593,U+5595-5597,U+559a-559b,U+559e,U+55a0-55a6,U+55a8-55b0,U+55b2,U+55b4,U+55b6,U+55b8,U+55ba,U+55bc,U+55bf-55c3,U+55c6-55c8,U+55ca-55cb,U+55ce-55d0,U+55d5,U+55d7-55db,U+55de,U+55e0,U+55e2,U+55e7,U+55e9,U+55ed-55ee,U+55f0-55f1,U+55f4,U+55f6,U+55f8"}},{uri:wH,descriptors:{unicodeRange:"U+4fe0,U+4fe2,U+4fe4-4fe5,U+4fe7,U+4feb-4fec,U+4ff0,U+4ff2,U+4ff4-4ff7,U+4ff9,U+4ffb-4ffd,U+4fff-500b,U+500e,U+5010-5011,U+5013,U+5015-5017,U+501b,U+501d-501e,U+5020,U+5022-5024,U+5027,U+502b,U+502f-5039,U+503b,U+503d,U+503f-5042,U+5044-5046,U+5049-504b,U+504d,U+5050-5054,U+5056-5059,U+505b,U+505d-5064,U+5066-506b,U+506d-5075,U+5078-507a,U+507c-507d,U+5081-5084,U+5086-5087,U+5089-508c,U+508e-50a2,U+50a4,U+50a6,U+50aa-50ab,U+50ad-50b1,U+50b3-50b9,U+50bc-50ce,U+50d0-50d5,U+50d7-50d9,U+50db-50e5,U+50e8-50eb,U+50ef-50f2,U+50f4,U+50f6-50fa,U+50fc-5100"}},{uri:EH,descriptors:{unicodeRange:"U+49d5-4a77"}},{uri:SH,descriptors:{unicodeRange:"U+4dac-4dad,U+4daf-4db5,U+4e02,U+4e04-4e06,U+4e0f,U+4e12,U+4e17,U+4e1f-4e21,U+4e23,U+4e26,U+4e29,U+4e2e-4e2f,U+4e31,U+4e33,U+4e35,U+4e37,U+4e3c,U+4e40-4e42,U+4e44,U+4e46,U+4e4a,U+4e51,U+4e55,U+4e57,U+4e5a-4e5b,U+4e62-4e65,U+4e67-4e68,U+4e6a-4e6f,U+4e72,U+4e74-4e7d,U+4e7f-4e85,U+4e87,U+4e8a,U+4e90,U+4e96-4e97,U+4e99,U+4e9c-4e9e,U+4ea3,U+4eaa,U+4eaf-4eb1,U+4eb4,U+4eb6-4eb9,U+4ebc-4ebe,U+4ec8,U+4ecc,U+4ecf-4ed0,U+4ed2,U+4eda-4edc,U+4ee0,U+4ee2,U+4ee6-4ee7,U+4ee9,U+4eed-4eef,U+4ef1,U+4ef4,U+4ef8-4efa,U+4efc,U+4efe,U+4f00,U+4f02-4f08,U+4f0b-4f0c,U+4f12-4f16,U+4f1c-4f1d,U+4f21,U+4f23,U+4f28-4f29,U+4f2c-4f2e,U+4f31,U+4f33,U+4f35,U+4f37,U+4f39,U+4f3b,U+4f3e-4f42,U+4f44-4f45,U+4f47-4f4c,U+4f52,U+4f54,U+4f56,U+4f61-4f62,U+4f66,U+4f68,U+4f6a-4f6b,U+4f6d-4f6e,U+4f71-4f72,U+4f75,U+4f77-4f7a,U+4f7d,U+4f80-4f82,U+4f85-4f87,U+4f8a,U+4f8c,U+4f8e,U+4f90,U+4f92-4f93,U+4f95-4f96,U+4f98-4f9a,U+4f9c,U+4f9e-4f9f,U+4fa1-4fa2,U+4fa4,U+4fab,U+4fad,U+4fb0-4fb4,U+4fb6-4fbe,U+4fc0-4fc2,U+4fc6-4fc9,U+4fcb-4fcd,U+4fd2-4fd6,U+4fd9,U+4fdb"}},{uri:kH,descriptors:{unicodeRange:"U+4933-49d4"}},{uri:CH,descriptors:{unicodeRange:"U+487a-4932"}},{uri:MH,descriptors:{unicodeRange:"U+47d2-4879,U+2ce7c,U+2ce88,U+2ce93"}},{uri:IH,descriptors:{unicodeRange:"U+4756-47d1,U+2ca02,U+2ca0e,U+2ca7d,U+2caa9,U+2cb29,U+2cb2e,U+2cb31,U+2cb38-2cb39,U+2cb3f,U+2cb41,U+2cb4e,U+2cb5a,U+2cb64,U+2cb69,U+2cb6c,U+2cb6f,U+2cb76,U+2cb78,U+2cb7c,U+2cbb1,U+2cbbf-2cbc0,U+2cbce,U+2cc5f,U+2ccf5-2ccf6,U+2ccfd,U+2ccff,U+2cd02-2cd03,U+2cd0a,U+2cd8b,U+2cd8d,U+2cd8f-2cd90,U+2cd9f-2cda0,U+2cda8,U+2cdad-2cdae,U+2cdd5,U+2ce18,U+2ce1a,U+2ce23,U+2ce26,U+2ce2a"}},{uri:_H,descriptors:{unicodeRange:"U+46c3-4755,U+2c488,U+2c494,U+2c497,U+2c542,U+2c613,U+2c618,U+2c621,U+2c629,U+2c62b-2c62d,U+2c62f,U+2c642,U+2c64a-2c64b,U+2c72c,U+2c72f,U+2c79f,U+2c7c1,U+2c7fd,U+2c8d9,U+2c8de,U+2c8e1,U+2c8f3,U+2c907,U+2c90a,U+2c91d"}},{uri:TH,descriptors:{unicodeRange:"U+4629-46c2,U+2bdf7,U+2be29,U+2c029-2c02a,U+2c0a9,U+2c0ca,U+2c1d5,U+2c1d9,U+2c1f9,U+2c27c,U+2c288,U+2c2a4,U+2c317,U+2c35b,U+2c361,U+2c364"}},{uri:AH,descriptors:{unicodeRange:"U+458e-4628,U+2b7a9,U+2b7c5,U+2b7e6,U+2b7f9,U+2b806,U+2b80a,U+2b81c,U+2b8b8,U+2bac7,U+2bb5f,U+2bb62,U+2bb7c,U+2bb83,U+2bc1b,U+2bd77,U+2bd87"}},{uri:RH,descriptors:{unicodeRange:"U+4449-4511,U+2afa2,U+2b127-2b128,U+2b137-2b138,U+2b1ed"}},{uri:jH,descriptors:{unicodeRange:"U+439b-4448,U+2a437,U+2a5f1,U+2a602,U+2a61a,U+2a6b2,U+2a7dd,U+2a8fb,U+2a917,U+2aa30,U+2aa36,U+2aa58"}},{uri:LH,descriptors:{unicodeRange:"U+4275-430d,U+298c6,U+29a72,U+29d98,U+29ddb,U+29e15,U+29e3d,U+29e49"}},{uri:DH,descriptors:{unicodeRange:"U+4132-41de,U+28bef,U+28c47,U+28c4f,U+28c51,U+28c54,U+28d10,U+28d71,U+28dfb,U+28e1f,U+28e36,U+28e89,U+28e99,U+28eeb,U+28f32,U+28ff8,U+292a0"}},{uri:PH,descriptors:{unicodeRange:"U+41df-4274,U+292b1,U+29490,U+295cf,U+2967f,U+296f0,U+29719,U+29750"}},{uri:NH,descriptors:{unicodeRange:"U+408e-4131,U+285c8-285c9,U+28678,U+28695,U+286d7,U+286fa,U+287e0,U+28946,U+28949,U+2896b,U+28987-28988,U+289ba-289bb,U+28a1e,U+28a29,U+28a43,U+28a71,U+28a99,U+28acd,U+28add,U+28ae4,U+28b49,U+28bc1"}},{uri:OH,descriptors:{unicodeRange:"U+3e83-3f2f,U+27139,U+273da-273db,U+273fe,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770e,U+27723,U+27752"}},{uri:$H,descriptors:{unicodeRange:"U+3f30-3fdb,U+27985,U+27a84,U+27bb3,U+27bbe,U+27bc7,U+27cb8,U+27da0,U+27e10"}},{uri:zH,descriptors:{unicodeRange:"U+3fdc-408d,U+27fb7,U+27ff9,U+2808a,U+280bb,U+2815d,U+28277,U+28282,U+282e2,U+282f3,U+283cd,U+28408,U+2840c,U+28455,U+28468,U+2856b"}},{uri:FH,descriptors:{unicodeRange:"U+3dd2-3e82,U+26a58,U+26a8c,U+26ab7,U+26aff,U+26b5c,U+26c21,U+26c29,U+26c73,U+26cdd,U+26e40,U+26e65,U+26f94,U+26ff6-26ff8,U+270f4,U+2710d"}},{uri:BH,descriptors:{unicodeRange:"U+3d34-3dd1,U+2648d,U+26676,U+2667e,U+266b0,U+2671d,U+2677c,U+267cc,U+268dd,U+268ea,U+26951,U+2696f,U+269dd,U+269fa,U+26a1e"}},{uri:HH,descriptors:{unicodeRange:"U+3c76-3d33,U+25d0a,U+25da1,U+25e2e,U+25e56,U+25e62,U+25e65,U+25ec2,U+25ed7-25ed8,U+25ee8,U+25f23,U+25f5c,U+25fd4,U+25fe0,U+25ffb,U+2600c,U+26017,U+26060,U+260ed,U+26221,U+26270,U+26286,U+2634c,U+26402"}},{uri:WH,descriptors:{unicodeRange:"U+3bda-3c75,U+25771,U+257a9,U+257b4,U+259c4,U+259d4,U+25ae3-25ae4,U+25af1,U+25bb2,U+25c14,U+25c4b,U+25c64"}},{uri:XH,descriptors:{unicodeRange:"U+3b25-3bd9,U+2504a,U+25055,U+25122,U+2512b,U+251a9,U+251cd,U+251e5,U+2521e,U+2524c,U+2542e,U+2548e,U+254d9,U+2550e,U+25532,U+25562,U+255a7-255a8"}},{uri:VH,descriptors:{unicodeRange:"U+3a6b-3b24,U+24896,U+249db,U+24a4d,U+24a7d,U+24ac9,U+24b56,U+24b6f,U+24c16,U+24d14,U+24dea,U+24e0e,U+24e37,U+24e6a,U+24e8b,U+24eaa"}},{uri:GH,descriptors:{unicodeRange:"U+39a9-3a6a,U+24096,U+24103,U+241ac,U+241c6,U+241fe,U+243bc,U+243f8,U+244d3,U+24629,U+246a5,U+247f1"}},{uri:YH,descriptors:{unicodeRange:"U+38e3-39a8,U+23a98,U+23c7f,U+23c97-23c98,U+23cfe,U+23d00,U+23d0e,U+23d40,U+23dd3,U+23df9-23dfa,U+23e23,U+23f7e"}},{uri:ZH,descriptors:{unicodeRange:"U+3760-382a,U+22ab8,U+22b43,U+22b46,U+22b4f-22b50,U+22ba6,U+22bca,U+22c1d,U+22c24,U+22c55,U+22d4c,U+22de1"}},{uri:KH,descriptors:{unicodeRange:"U+382b-38e2,U+231b6,U+231c3-231c4,U+231f5,U+23350,U+23372,U+233d0,U+233d2-233d3,U+233d5,U+233da,U+233df,U+233e4,U+2344a-2344b,U+23451,U+23465,U+234e4,U+2355a,U+23594,U+235c4,U+235cb,U+23638-2363a,U+23647,U+2370c,U+2371c,U+2373f,U+23763-23764,U+237e7,U+237ff,U+23824,U+2383d"}},{uri:qH,descriptors:{unicodeRange:"U+3698-375f,U+22218,U+2231e,U+223ad,U+224dc,U+226f3,U+2285b,U+228ab,U+2298f"}},{uri:QH,descriptors:{unicodeRange:"U+35e6-3697,U+21c56,U+21cde,U+21d2d,U+21d45,U+21d62,U+21d78,U+21d92,U+21d9c,U+21da1,U+21db7,U+21de0,U+21e33-21e34,U+21f1e,U+21f76,U+21ffa,U+2217b"}},{uri:JH,descriptors:{unicodeRange:"U+3444-350e,U+20ad3,U+20b1d,U+20b9f,U+20c41,U+20cbf,U+20cd0,U+20d45,U+20de1,U+20e64,U+20e6d,U+20e95,U+20e9d,U+20ea2,U+20f5f,U+210c1,U+21201,U+2123d,U+21255,U+21274,U+2127b"}},{uri:eW,descriptors:{unicodeRange:"U+350f-35e5,U+212d7,U+212e4,U+212fd,U+2131b,U+21336,U+21344,U+2139a,U+213c4,U+21413,U+2146d-2146e,U+215d7,U+21647,U+216b4,U+21706,U+21742,U+218bd,U+219c3"}},{uri:tW,descriptors:{unicodeRange:"U+336d-3443,U+2032b,U+20371,U+20381,U+203f9,U+2044a,U+20509,U+20547,U+205d6,U+20628,U+20676,U+2074f,U+20779,U+20807,U+2083a,U+20895,U+208b9,U+2097c,U+2099d"}},{uri:nW,descriptors:{unicodeRange:"U+328b-336c,U+2000b,U+20089,U+200a2,U+200a4,U+20164,U+201a2,U+20213"}},{uri:rW,descriptors:{unicodeRange:"U+3192-31ba,U+31c0-31e3,U+31f0-321e,U+3220-328a,U+1f250-1f251"}},{uri:aW,descriptors:{unicodeRange:"U+2f74-2fd5,U+3000,U+3003-3007,U+3012-3013,U+3018-301c,U+3020-3029,U+302f-303f,U+3041-3096,U+3099-30a1"}},{uri:iW,descriptors:{unicodeRange:"U+30a2-30ff,U+3105-312f,U+3131-318e,U+3190-3191"}},{uri:lW,descriptors:{unicodeRange:"U+4e36,U+4ea0,U+4f74,U+4f91,U+4f94,U+4fc5,U+507e,U+50ed,U+5182,U+51f5,U+525e,U+5282,U+52f9,U+5326,U+537a,U+53a3,U+5423,U+5459,U+54b4,U+54d9,U+55c9,U+57f4,U+580b,U+5902,U+5925,U+5a08,U+5ab5,U+5b84,U+5be4,U+5c22,U+5cb5,U+5cbd,U+5d3e,U+5e31,U+5e5e,U+5e80,U+5ee8,U+5f82,U+5fc9,U+5fed,U+600a,U+605d,U+609b,U+609d,U+60dd,U+6243,U+6322,U+63ce,U+640c,U+643f,U+6445,U+64d7,U+6534,U+6549,U+656b,U+6603,U+674c,U+680a,U+6864,U+69d4,U+6a65,U+6c2a,U+6c46,U+6c5c,U+6d0e,U+6d48,U+6e2b,U+6eb2,U+6eb7,U+6f89,U+706c,U+70b1,U+7113,U+71d4,U+727f,U+72f3,U+7303,U+7321,U+736c,U+736f,U+74a9,U+74de,U+750d,U+7513,U+7592,U+75c4,U+7605,U+760a,U+761b,U+7625,U+762d,U+7643,U+7707,U+7747,U+77b5,U+7839,U+784e,U+78a5,U+7924,U+793b,U+798a,U+7a03,U+7a06,U+7a78,U+7a80,U+7aad,U+7ba8,U+7be5,U+7cc8,U+7ec1,U+7f0b,U+7f0f,U+7f12,U+7f68,U+7f9d,U+8025,U+809c,U+80ad,U+80b7,U+80e8,U+811e,U+8204,U+8223,U+822d,U+823b,U+824b,U+825a,U+827d,U+827f,U+828f,U+82c8,U+8307,U+831b,U+8347,U+837d,U+839b,U+83a9,U+83f9,U+84b9,U+8579,U+864d,U+867f,U+86b0,U+86d1,U+86d8,U+86f2,U+8764,U+8770,U+8788,U+8797,U+87ac-87ad,U+87b5,U+881b,U+8844,U+88bc,U+88fc,U+8930,U+89cf,U+89d6,U+8ba0,U+8bd4,U+8c02,U+8c2b,U+8c85,U+8e23,U+8f81-8f82,U+8fd5,U+90b6,U+90db,U+914e,U+9164,U+91ad,U+943e,U+94b7-94b8,U+94eb,U+950d,U+9514,U+9516,U+9518,U+9529,U+9538,U+953f,U+954e,U+955f,U+95fc,U+9667,U+96b3,U+9792,U+97b2,U+98a1,U+9969,U+9987,U+9998,U+9a80,U+9a92,U+9a96,U+9adf,U+9cb4,U+9cbd,U+9cd0,U+9cd4,U+9e31,U+9e3a,U+9e71,U+9ee5,U+9eea,U+9ef9,U+9fa0"}},{uri:sW,descriptors:{unicodeRange:"U+4e0c,U+4e28,U+4e3f,U+4ec2,U+502e,U+50ba,U+5155,U+5181,U+522d,U+5281,U+5290,U+5369,U+53b6,U+54d5,U+54dc,U+54ff,U+552a,U+553c,U+5588,U+55b5,U+5686,U+570a,U+5776,U+5786,U+57a4,U+5820,U+5865,U+58bc,U+5b32,U+5b65,U+5c1c,U+5c66,U+5c6e,U+5c8d,U+5ddb,U+5f2a,U+5f50,U+5f61,U+6067,U+614a,U+615d,U+619d,U+61d4,U+620b,U+6224-6225,U+6343,U+63ad,U+63f2,U+640b,U+6420,U+6434,U+6496,U+64d0,U+6509,U+652e,U+67a8,U+6833,U+6844,U+684a,U+6920,U+6957,U+6971,U+6a8e,U+6a91,U+6aa0,U+6b43,U+6bea,U+6bf5,U+6c15,U+6cd0,U+6ee0,U+6f24,U+6f2d,U+70c0,U+721d,U+728b,U+72c3,U+72e8,U+730a,U+7338-7339,U+734d,U+746d,U+752f,U+754e,U+770d,U+7735,U+778d,U+77a2,U+77e7,U+7857,U+786d,U+78c9,U+78f2,U+791e,U+7953,U+7b58,U+7b9d,U+7bda,U+7cd7,U+7f32-7f33,U+8022,U+8028-8029,U+8035,U+804d,U+8080,U+80c2,U+80e9,U+80ec,U+80f2,U+810e,U+8221,U+8274,U+82b0,U+82e0,U+83b0,U+8487-8488,U+848e,U+84cd,U+84d0,U+8539,U+857a,U+85a8,U+85b7,U+867c,U+871e,U+8723,U+877e,U+878b,U+8793,U+8803,U+88d2,U+8966,U+89cc,U+89eb,U+8b26,U+8c8a,U+8c98,U+8d33,U+8d47,U+8d55,U+8dbc,U+8e40,U+8e94,U+8f77,U+8f79,U+9058,U+91a2,U+91b5,U+928e,U+9494,U+94b6,U+94de,U+94f4,U+94f9,U+950a,U+950e,U+951e,U+952b,U+953c,U+953e,U+9544,U+9561,U+9564,U+9569,U+95f6,U+9603,U+960d,U+963d,U+9674,U+9794,U+97ab,U+98a5,U+9a9f,U+9ab1,U+9ad1,U+9b0f,U+9b2f,U+9c92,U+9c95,U+9cba,U+9cbc,U+9cc6,U+9ccb,U+9cd8,U+9e32,U+9e38,U+9e5b,U+9e7e,U+9eb4,U+9efb-9efc,U+9f3d"}},{uri:oW,descriptors:{unicodeRange:"U+2e3b,U+2e80-2e99,U+2e9b-2ef3,U+2f00-2f73,U+ffffd"}},{uri:cW,descriptors:{unicodeRange:"U+4e69,U+4f1b,U+4f67,U+4f7e,U+4fdc,U+50e6,U+5196,U+5202,U+5233,U+523f,U+52a2,U+536e,U+5476,U+54ad,U+54cf,U+5537,U+561e,U+56dd,U+56df,U+5709,U+572c,U+57cf,U+57f8,U+580d,U+5881,U+589a,U+5941,U+59b2,U+5c25,U+5d24,U+5d74,U+5e42,U+5e8b,U+5eb3,U+5ed2,U+5fad,U+6003,U+603c,U+6083,U+6100,U+6126,U+6206,U+62ca,U+638e,U+63b4,U+6426,U+646d,U+6535,U+65c4,U+66db,U+6715,U+6769,U+6798,U+67c3,U+6861,U+698d,U+69ca,U+69ed,U+69f2,U+69ff,U+6a18,U+6b39,U+6bb3,U+6c0d,U+6cb2,U+6cd6,U+6cf7,U+6cfa,U+6d33,U+6e16,U+6e53-6e54,U+6ebb,U+6fb6,U+709d,U+72ad,U+72f7,U+72fb,U+7313,U+739f,U+74ba,U+754b,U+755b,U+758b,U+75ac,U+75d6,U+7617,U+7635,U+7640,U+76a4,U+76b2,U+775a,U+77bd,U+781f,U+79b3,U+7b2b,U+7b31,U+7b3e,U+7b6e,U+7b9c,U+7c0b,U+7c9e,U+7cc1,U+7ce8,U+7ea5,U+7f21,U+7f27,U+7f74,U+7fb0,U+8031,U+8071,U+80ea,U+8114,U+8160,U+81a6,U+81c1,U+829f,U+82a4,U+82fb,U+831a,U+8333,U+836c,U+83b6,U+83f8,U+8411,U+841c,U+8489,U+848c,U+85a4,U+8627,U+8629,U+866e,U+86b5,U+872e,U+8731,U+877b,U+877d,U+87ea,U+8813,U+8816,U+8864,U+88ce,U+88e5,U+897b,U+89cb,U+89f3,U+8bfc,U+8c35,U+8d46,U+8d4d,U+8dba,U+8e3a,U+8f75,U+8f7e,U+8fd3,U+9161,U+9179,U+917e,U+91a3,U+94ac,U+94d7,U+94e5,U+952a,U+952c,U+9545,U+9565,U+9568,U+956a,U+961d,U+96e0,U+972a,U+9730,U+989f,U+98e7,U+990d,U+9967,U+9993,U+9aa3,U+9ac0,U+9ae1,U+9aeb,U+9af9,U+9c86,U+9c8b,U+9ca0-9ca1,U+9ca3,U+9ce2,U+9e48,U+9e6a,U+9e87,U+9ee2,U+9ee9,U+9f17,U+9f19,U+9f2c,U+9f80"}},{uri:dW,descriptors:{unicodeRange:"U+4ef3,U+50d6,U+50ec,U+51ab,U+51b1,U+52d6,U+54a9,U+54da,U+55be,U+55cd,U+564d,U+572f,U+574c,U+576b,U+57d8,U+57fd,U+5844,U+59d2,U+5ae0,U+5b16,U+5b37,U+5b5b,U+5b80,U+5d1e,U+5d6b,U+5efe,U+5f11,U+5f56,U+5f58,U+5f73,U+5f8c,U+5fc4,U+5fe4,U+602b,U+6106,U+610d,U+63de,U+63f8,U+641b,U+64e4,U+6634,U+676a,U+67b5,U+681d,U+6883,U+69b1,U+69e0,U+6b37,U+6b9b,U+6d7c,U+6ed7,U+6f36,U+6f72,U+6f8c,U+7035,U+7039,U+7173,U+7178,U+7228,U+728f,U+72b4,U+72ef,U+72f4,U+7331,U+7481,U+74e0,U+7540,U+75c3,U+75e6,U+763c,U+764d,U+76cd,U+7704,U+7743,U+7780,U+7847,U+786a,U+78b9,U+7962,U+7a02,U+7aac,U+7ab3,U+7b0a,U+7b4c,U+7b7b,U+7bfc,U+7c0f,U+7c16,U+7c40,U+7ca2,U+7cc7,U+7cf8,U+7d77,U+7e3b,U+7ea1,U+7ea9,U+7ef2,U+7f02,U+7f07,U+7f0c,U+7f23,U+7f2f,U+7fbc,U+8016,U+8020,U+812c,U+8136,U+8182,U+822f,U+8233,U+825f,U+8268,U+8284,U+8288,U+8291,U+8308,U+8311,U+835b,U+836d,U+83dd,U+8406,U+840f,U+845c,U+84b4,U+84e3,U+850c,U+855e,U+863c,U+86ba,U+86c4,U+86de,U+86f1,U+873e,U+87bd,U+87db,U+880a,U+883c,U+887f,U+88f0,U+890a,U+892b,U+895e,U+89ef,U+8a48,U+8bdc,U+8c18,U+8c33,U+8c94,U+8db1,U+8dcf,U+8dd6,U+8de3,U+8e6f,U+8e90,U+8f7a,U+8fb6,U+902d,U+90be,U+91af,U+936a,U+948b,U+94d8,U+9513,U+953a,U+956c,U+963c,U+9654,U+966c,U+9688,U+97b4,U+996b,U+9a75,U+9a7a,U+9aba,U+9aed,U+9b08,U+9b43,U+9c8e,U+9c94,U+9c9a,U+9e2b,U+9e36,U+9e4b,U+9e4e,U+9e55,U+9e63,U+9e68-9e69,U+9ebd,U+9ec9,U+9f0d,U+9f37,U+9f51"}},{uri:uW,descriptors:{unicodeRange:"U+50a7,U+5240,U+5261,U+52ac,U+531a,U+5363,U+5432,U+5452,U+5456,U+5472,U+5478,U+553f,U+5575,U+5581,U+55cc,U+55fe,U+5601,U+572e,U+57d2,U+57ef,U+581e,U+5924,U+5981,U+5997,U+59a3,U+5aaa,U+5ab8,U+5b34,U+5d5d,U+5def,U+5e11,U+5e91,U+5ed1,U+5ef4,U+5f40,U+600d,U+6019,U+601b,U+605a,U+6092,U+60ab,U+6217,U+623d,U+6369,U+65d2,U+6661,U+670a,U+6753,U+67a7,U+6855,U+68f9,U+6939,U+696e,U+6980,U+6a7c,U+6aab,U+6b82,U+6bf3,U+6bf9,U+6c05,U+6c19-6c1a,U+6ca9,U+6cf6,U+6d1a,U+6dab,U+6f74,U+7085,U+7198,U+71b5,U+7256,U+725d,U+727e,U+72fa,U+7322,U+738e,U+73e5,U+750f,U+755a,U+7594,U+75b3,U+760c,U+7615,U+7630,U+763f,U+77ec,U+7817,U+78a1,U+78d9,U+7905,U+7b2a,U+7b2e,U+7b62,U+7b85,U+7bcc,U+7bea,U+7c26,U+7c74,U+7c9c-7c9d,U+7e47,U+7e9b,U+7e9f,U+7ee0,U+7ee8,U+7ef1,U+7f01,U+7f11,U+7f17,U+7f36,U+7f7e,U+7fee,U+802a,U+80cd,U+8112,U+8169,U+8234,U+8279,U+8298,U+82ca,U+82d8,U+82e1,U+83c0,U+83d4,U+83df,U+8401,U+8451,U+845a,U+8476,U+8478,U+84ba,U+84bd,U+84e0,U+851f,U+8548,U+8556,U+8585,U+868d,U+86e9,U+86f4,U+86f8,U+8765,U+8785,U+87ab,U+87ee,U+8832,U+8872,U+88b7,U+88e2-88e3,U+89da,U+8bce,U+8bd3,U+8bd6,U+8bf9,U+8c16,U+8c73,U+8d5c,U+8dde,U+8f6d,U+8f94,U+8fe8,U+9011,U+915e,U+9185,U+918c,U+94ab,U+94d1,U+94f3,U+9515,U+951d,U+9558,U+9567,U+96ce,U+96e9,U+9785,U+9878,U+987c,U+9883,U+98d1,U+9954,U+9963,U+9a93,U+9ac1,U+9acc,U+9b1f,U+9b49,U+9b4d,U+9b51,U+9ca7,U+9cae,U+9cce,U+9cd3,U+9e37,U+9e39,U+9e41,U+9e46,U+9f22,U+9f2f,U+9f39,U+9f85"}},{uri:fW,descriptors:{unicodeRange:"U+4e5c,U+4edf,U+4f25,U+4f32,U+4f5e,U+4f76,U+4faa,U+4fe6,U+5028,U+5048,U+5250,U+535f,U+538d,U+53c1,U+5412,U+5443,U+54d4,U+54dd,U+5541,U+5550,U+5577,U+55dd,U+55f3,U+560f,U+562c,U+5657-5658,U+5664,U+56af,U+575c,U+577c,U+57b2,U+57da,U+5800,U+5a62,U+5aeb,U+5c3b,U+5ca3,U+5d26,U+5d9d,U+5f01,U+5fb5,U+5fdd,U+5ff8,U+6029,U+6041,U+6079,U+60b1,U+6222,U+629f,U+6332,U+63bc,U+63e0,U+6485,U+65ab,U+65c3,U+65c6,U+668c,U+669d,U+66be,U+67fd,U+6800,U+68fc,U+690b,U+6924,U+6978,U+69a7,U+6a3e,U+6a50,U+6a5b,U+6a97,U+6b24,U+6b8d,U+6baa,U+6c10,U+6c54,U+6ceb,U+6d04,U+6d4d,U+6eb1,U+6ebd,U+7110,U+71b3,U+71f9,U+7230,U+728d,U+7292,U+72b8,U+72d2,U+7360,U+73a2,U+7511,U+75a0,U+75c8,U+779f,U+7826,U+7877,U+7a39,U+7aa8,U+7ae6,U+7b04,U+7b0f,U+7baa,U+7bac,U+7c1f,U+7ccd,U+7ecb,U+7ed4,U+7ed7,U+7efb,U+7f0d,U+7f5f,U+7faf,U+7fd5,U+7fe5,U+8027,U+80bc,U+80dd,U+80fc,U+8132,U+815a,U+8167,U+816d,U+81ca,U+8228,U+82a1,U+82a9,U+82ab,U+82cc,U+8351,U+8368,U+83b8,U+83d8,U+83ea,U+83f0,U+8497,U+84c1,U+858f,U+85ff,U+867b,U+86a8-86a9,U+870a,U+8722,U+876e,U+877c,U+87e5,U+8888,U+88df,U+8919,U+8bcc,U+8bdf,U+8be8,U+8bee,U+8c20,U+8c2f,U+8d36,U+8df8,U+8e05,U+8e2f,U+8f9a,U+9021,U+908b,U+90b4,U+90ba,U+90d0,U+90eb,U+90fe,U+91aa,U+933e,U+9486-9487,U+948d,U+9490,U+94ad,U+94bd,U+94d6,U+94d9,U+9507,U+9546,U+955e,U+956b,U+95e9,U+9604,U+960b,U+9612,U+9615,U+9617,U+96b9,U+989a-989b,U+989e,U+9a78,U+9a7d,U+9aa0,U+9aa2,U+9ac2,U+9b23,U+9b3b,U+9c82,U+9cca,U+9cd9,U+9e28,U+9e5a,U+9e5e,U+9e6c,U+9efe,U+9f0b"}},{uri:hW,descriptors:{unicodeRange:"U+4e47,U+4e8d,U+4f65,U+4f89,U+50ee,U+520e,U+5416,U+5454,U+54bb,U+54c2,U+54d3,U+54de,U+5591,U+55e5,U+560c,U+566b,U+5769,U+578c,U+5793,U+57e4,U+5889,U+593c,U+59ab,U+5ad4,U+5ad8,U+5af1,U+5b53,U+5ba5,U+5c59,U+5c63,U+5d5b,U+5e0f,U+5e14,U+5edb,U+5fbc,U+6004,U+60ad,U+610e,U+61b7,U+624c,U+634c,U+647a,U+64ba,U+65f0,U+6600,U+66f7,U+67e2,U+67f0,U+680c,U+686b,U+6874,U+691f,U+6989,U+6a17,U+6b81,U+6b84,U+6c06-6c07,U+6c3d,U+6d07,U+6d27,U+6d2b,U+6d91,U+6e6b,U+6e8f,U+6fde,U+70bb,U+723b,U+726e,U+72b0,U+72ce,U+72f2,U+7301,U+731e,U+737e,U+7477,U+748e,U+74ff,U+7633,U+7654,U+771a,U+7726,U+7765,U+7768,U+781c,U+7829,U+78d4,U+7913,U+7957,U+79d5,U+79eb,U+7a70,U+7a86,U+7b25,U+7b38,U+7b47,U+7b72,U+7ba6-7ba7,U+7dae,U+7ee1,U+7efe,U+7f26,U+7f31,U+7f35,U+801c,U+8043,U+809f,U+80ab,U+80d7,U+8118,U+8188,U+81cc,U+823e,U+8244,U+824f,U+82b4,U+82c1,U+82e4,U+82f4,U+8306,U+833a,U+835c,U+839c,U+83b3,U+83bc,U+846d,U+867a,U+868b,U+8734,U+87ca,U+886e,U+887e,U+88a2,U+88c9,U+8921,U+8bb5,U+8bf3,U+8c04,U+8c17,U+8c1d,U+8c25,U+8c36,U+8c55,U+8c78,U+8d3d,U+8d40,U+8d59,U+8d67,U+8d91,U+8dbf,U+8deb-8dec,U+8dfd,U+8e14,U+8e41,U+8f8e,U+900b,U+9044,U+9062,U+90cf,U+9123,U+9146,U+9162,U+9172,U+918d,U+9190,U+92c8,U+93ca,U+948c,U+94aa,U+94b2,U+94c8,U+94ca,U+94d5,U+94df,U+94e9-94ea,U+94f7,U+94fc-94fd,U+951b,U+954f,U+9554,U+9559,U+9566,U+9571-9572,U+95f1,U+9608,U+960f,U+97af,U+988f,U+98d5,U+992e,U+9955,U+9ab0,U+9b32,U+9c90,U+9c9e,U+9ca5,U+9ca9,U+9cad,U+9cb1,U+9cc3,U+9e47,U+9ee7,U+9f87"}},{uri:pW,descriptors:{unicodeRange:"U+4e93,U+4ec4,U+4ef5,U+4f27,U+4f7b,U+4fe3,U+5080,U+5121,U+51eb,U+5208,U+52f0,U+53f5,U+5453,U+5466,U+54a6,U+54bf,U+54d0,U+5533,U+5549,U+5556,U+556d,U+558f,U+55f2,U+55f5,U+5627,U+567b,U+56d4,U+571c,U+5739,U+57b4,U+5807,U+58c5,U+59a4,U+59af,U+59d8,U+5a09,U+5a0c,U+5a4a,U+5ad2,U+5b6c,U+5ca2,U+5cac,U+5d03,U+5d6c,U+5db7,U+5ebe,U+5f2d,U+5fea,U+6042,U+6120,U+6175,U+6221,U+623e,U+6339,U+638a,U+643d,U+64b8,U+64e2,U+66e9,U+67b3,U+67c1,U+67d2,U+6832,U+6877,U+68f0,U+6934,U+6966,U+6987,U+6998,U+69c1,U+69ce,U+6a3d,U+6a84,U+6aa9,U+6b87,U+6bd6,U+6c16,U+6c18,U+6cd4,U+6cee,U+6de0,U+6e0c,U+6ecf,U+6f4b,U+70b7,U+7168,U+72d9,U+7352,U+73b3,U+73d0,U+7441,U+74d2,U+75a5,U+75e7-75e8,U+7610,U+7619,U+765e,U+772d,U+7812,U+782c,U+784c,U+7850,U+7856,U+789b,U+78f4,U+7a51,U+7b15,U+7b1e,U+7b24,U+7b5a,U+7bb8,U+7bc1,U+7bd9,U+7ed0,U+7ee6,U+7efa,U+7f1b,U+7f1f,U+7f22,U+7f45,U+7f71,U+7fa7,U+7fbf,U+7ff3,U+8052,U+80b1,U+80db,U+80f4,U+81bb,U+81ec,U+8202,U+8210,U+8249,U+828a,U+828e,U+82e3,U+8315,U+8369,U+8378,U+83a8,U+83aa,U+83b4,U+83e1,U+84fc,U+8538,U+853b,U+859c,U+85ae,U+86b4,U+86c9,U+86cf,U+8725,U+879f,U+87b3,U+887d,U+88fe,U+8a8a,U+8ba7,U+8c07,U+8c14,U+8c30,U+8c47,U+8db5,U+8dd7,U+8e1f,U+8e69,U+8e70,U+8e85,U+8f78,U+8f87,U+8f8b,U+8f8f,U+90c4,U+9143,U+917d,U+948f,U+94cd,U+94d2,U+94ef,U+954a,U+9609-960a,U+96d2,U+9708,U+9765,U+97ea,U+9880,U+98a7,U+996c,U+9980,U+9991,U+9a88,U+9ab6,U+9afb,U+9b47,U+9c87,U+9c9b,U+9cb5,U+9cc7,U+9e2c,U+9e42,U+9e58,U+9ecd,U+9ecf,U+9f8a,U+9f8c"}},{uri:mW,descriptors:{unicodeRange:"U+4ebb,U+4edd,U+4fa9,U+502c,U+50a5,U+51c7,U+51fc,U+523d,U+5241,U+530f,U+5464,U+549d,U+54a3,U+5514,U+5527,U+555c,U+556e,U+5576,U+55b1,U+55b9,U+55eb,U+5624,U+564c,U+5671,U+5685,U+568f,U+56d7,U+56e1,U+57a1,U+57d9,U+5942,U+5a67,U+5c50,U+5c7a,U+5c98,U+5d06,U+5d27,U+5d6f,U+5df3,U+5dfd,U+5e19,U+5ea0,U+5eb9,U+5eea,U+5ffe,U+600f,U+606b,U+6215,U+622c,U+6266,U+62bb,U+62bf,U+6308,U+6387,U+63b8,U+63c4,U+63c6,U+63f6,U+6441,U+6555,U+659b,U+6677,U+66a7,U+6775,U+678b,U+679e,U+6840,U+6849,U+6860,U+68c2,U+6910,U+6a28,U+6a2f,U+6a79,U+6b92-6b93,U+6bc2,U+6bfd,U+6c29,U+6c32,U+6c86,U+6cc5,U+6d0c,U+6d60,U+6da0,U+6ddd,U+6e86,U+6ed3,U+6edf,U+6fb9,U+6fd1,U+6fef,U+7023,U+7080,U+70ca,U+712f,U+7145,U+7284,U+732c,U+73c8,U+73d9,U+740a,U+7457,U+7596,U+759d,U+75a3,U+75d8,U+75e3-75e4,U+75ff,U+7622,U+7688,U+76b4,U+76e5,U+7818,U+7887,U+789a,U+78b2,U+7b08,U+7b33,U+7c2a,U+7ccc,U+7ea8,U+7ec0,U+7fe6,U+8012,U+8084,U+8093,U+80e4,U+80ef,U+8297,U+82a8,U+82be,U+8331,U+8366,U+83c5,U+83fd,U+8473,U+84a1,U+84ca,U+84d1,U+857b,U+85c1,U+85d3,U+8605,U+8662,U+86aa,U+86b1,U+86d4,U+86ed,U+86f3,U+8709,U+8748,U+874c,U+8763,U+89c7,U+89de,U+89e5,U+8a3e,U+8ba6,U+8c00,U+8c21,U+8c49,U+8c7a,U+8d30,U+8df9,U+8e51,U+8e59,U+8f6b,U+8f73,U+8ff3,U+9016,U+9026,U+902f,U+9099,U+909b,U+90c7,U+914a,U+91ae,U+91ba,U+9495,U+94a3,U+94af,U+94ba,U+94bf,U+94cc,U+94e1,U+94f0,U+9531,U+955d,U+95f3,U+9697,U+96bc,U+975b,U+977c,U+98a2,U+998a,U+9994-9995,U+9a9b,U+9ab7,U+9ac5,U+9c91,U+9ccf,U+9cd5,U+9e29,U+9edc,U+9edf,U+9f83,U+9f88-9f89"}},{uri:UW,descriptors:{unicodeRange:"U+4ee8,U+4f22,U+4f43,U+4f57,U+4f5d,U+4f6f,U+4ff8,U+502d,U+507b,U+5345,U+53df,U+53fb,U+544b,U+5482,U+54a7,U+54cc,U+550f,U+5544,U+5555,U+5594,U+55e8,U+55ec,U+55ef,U+564e,U+56f9,U+5704,U+576d,U+5785,U+57ad,U+5914,U+5958,U+599e,U+59aa,U+59be,U+5a06,U+5abe,U+5ae1,U+5b40,U+5bee,U+5cbf,U+5cc4,U+5ccb,U+5d47,U+603f,U+6078,U+607d,U+607f,U+608c,U+609a,U+60fa,U+61ff,U+621b,U+622e,U+626a,U+6371,U+63ae,U+63cd,U+63d6,U+6410,U+6414,U+6421,U+6448,U+64d8,U+6710,U+6748,U+6772,U+680e,U+6954,U+69ab,U+6c68,U+6c8f,U+6ca4,U+6d2e,U+6e4e,U+6e98,U+6fe0,U+7094,U+70e9,U+7116,U+7119,U+723f,U+73c9,U+74e4,U+753e,U+7548,U+75bd,U+75cd,U+7618,U+7634,U+76c5,U+76f1,U+7708,U+7719,U+777e,U+7791,U+77b3,U+7823,U+7827,U+7830,U+7889,U+7893,U+7949,U+795c,U+79e3,U+7a14,U+7a88,U+7a95,U+7aa0,U+7afd,U+7b90,U+7bd1,U+7bfe,U+7da6,U+7ec2,U+7eef,U+7f03-7f04,U+7f08,U+7f58,U+7f61,U+7f9f,U+8174,U+8200,U+828d,U+82c4,U+82d5,U+82dc,U+82f7,U+832d,U+835a,U+840b,U+8438,U+852b,U+869d,U+86ac,U+86d0,U+86f0,U+8782,U+87a8,U+87d1-87d2,U+87e0,U+8839,U+8913,U+891b,U+8934,U+8941,U+89ca,U+89ce,U+8a07,U+8ba3,U+8bc5,U+8bcb,U+8bdb,U+8c11,U+8c15,U+8c29,U+8c32,U+8dc4,U+8dce,U+8ddb,U+8dfa,U+8e09,U+8e1d,U+8e39,U+8e42,U+8e49,U+8e4b,U+8e8f,U+8f71-8f72,U+9004,U+9036,U+9097,U+90dc,U+90e2,U+90e6,U+90ef,U+9104,U+919a,U+91b4,U+938f,U+9497,U+950f,U+9557,U+9562-9563,U+9573,U+9606,U+9649,U+972d,U+973e,U+97a3,U+97eb,U+988c,U+9894,U+98a6,U+9974,U+9977,U+997d,U+9a90,U+9a9d,U+9aef,U+9ca2,U+9ccd,U+9cdf,U+9e20,U+9e4c,U+9e6b,U+9f3e"}},{uri:gW,descriptors:{unicodeRange:"U+4ede,U+4ee1,U+4eeb,U+4fda,U+4ffe,U+5025,U+506c,U+50f3,U+5106,U+520d,U+525c,U+52ad,U+530d,U+5310,U+539d,U+53a9,U+53fc,U+5421,U+5477,U+54e7,U+551b,U+5530,U+557e,U+5599,U+55c4,U+55d1,U+55d4,U+55df,U+55e4,U+55ea,U+5623,U+562d,U+5654,U+56eb,U+56f5,U+57a7,U+57d5,U+57dd,U+584d,U+5880,U+58ec,U+59dd,U+5a32,U+5a55,U+5a75,U+5b51,U+5b71,U+5b73,U+5cd2,U+5ce4,U+5e5b,U+5e96,U+5fd2,U+607b,U+61d1,U+634b,U+636d,U+63b3,U+63ff,U+64c0,U+661d,U+6657,U+66dc,U+67a5,U+6841,U+6867,U+6901,U+699b,U+6a47,U+6b46,U+6c21,U+6c24,U+6c35,U+6c4a,U+6c94,U+6ca3,U+6d39,U+6d63,U+6d6f,U+6d94,U+705e,U+71e7,U+726f,U+72cd,U+72de,U+72f0,U+7325,U+7350,U+7391,U+741a,U+757f,U+7583,U+75b1,U+75b4,U+75b8,U+75c2,U+75f1,U+766f,U+7699,U+7751,U+789c,U+7a17,U+7be6,U+7cb2,U+7ea3,U+7eb0,U+7ebe,U+7eeb,U+7f25,U+7f2c,U+7fb8,U+8026,U+8037,U+8153,U+8171,U+8191,U+8214,U+821b,U+8222,U+826e,U+82eb,U+830c,U+8314,U+8334,U+83d6,U+8418,U+843c,U+84ff,U+8564,U+8572,U+8616,U+866c,U+8693,U+86a3,U+86a7,U+86af,U+86b6,U+86c6,U+86ca,U+8708,U+870d,U+8759,U+8760,U+87af,U+87c6,U+8869,U+88c6,U+89d0,U+8b07,U+8baa-8bab,U+8bc2,U+8be4,U+8bf0,U+8c2a,U+8c62,U+8c89,U+8d49,U+8d6d,U+8d84,U+8d94,U+8db8,U+8dc6,U+8e2e,U+8e3d,U+8e47,U+8e7f,U+9005,U+9051,U+907d,U+9082,U+9088,U+90b0,U+90d3,U+9150,U+949c,U+94a4,U+94b9,U+94cb,U+94e0,U+9509,U+9512,U+951f,U+9534,U+9552-9553,U+965f,U+96b0,U+9791,U+9889,U+9990,U+9a9c,U+9aa7,U+9c88,U+9cb2-9cb3,U+9cb6-9cb7,U+9cc5,U+9cdc,U+9e22,U+9e2a,U+9e57,U+9e67,U+9e73,U+9e82,U+9eb8,U+9ee0,U+9f9b"}},{uri:bW,descriptors:{unicodeRange:"U+4eb5,U+4f09,U+4f5a,U+4f8f,U+4fce,U+4fdf,U+4fea,U+4ff3,U+500c,U+500f,U+504e,U+5088,U+52be,U+5420,U+5457,U+5499,U+549b,U+54c6,U+54d2,U+558b,U+559f,U+55bd,U+55d6,U+565c,U+567c,U+568e,U+5768,U+577b,U+57a9,U+57ed,U+59f9,U+5a11,U+5a40,U+5ae6,U+5b6a,U+5b93,U+5bb8,U+5c15,U+5c99,U+5c9c,U+5cc1,U+5d2e,U+5d4b,U+5d99,U+5e54,U+5e61,U+5fcf-5fd1,U+6002,U+6006,U+6014,U+60af,U+60c6,U+60da,U+60f4,U+621f,U+62c8,U+631b,U+631e,U+63e9,U+64b5,U+655d,U+6619,U+6635,U+6641,U+67ad,U+67b0,U+67b7,U+67e9,U+684e,U+688f,U+695d,U+696b,U+69b7,U+6a58,U+6c26,U+6d35,U+6d43,U+6d9e,U+6dd9,U+6dec,U+6e11,U+6e6e,U+6e9f,U+6ec2,U+6ee2,U+6ef9,U+6f09,U+6f66,U+6f8d,U+6fc2,U+6fc9,U+729f,U+72c8,U+73de,U+7430,U+7566,U+7579,U+75c9,U+75e2,U+75fc,U+762a,U+7638,U+7678,U+76c2,U+76f9,U+778c,U+77cd,U+77dc,U+7800,U+781d,U+782d,U+783b-783c,U+78a3,U+78ec,U+7980,U+7a23,U+7b95,U+7bdd,U+7c0c,U+7c41,U+7c91,U+7cb3,U+7cc5,U+7ecc,U+7f19,U+7fca,U+8006,U+8069,U+807f,U+80bd,U+80ed,U+814b,U+8198,U+82cb,U+82d2,U+834f,U+8360,U+847a,U+84d6,U+84e5,U+8537,U+85d0,U+8671,U+86a4,U+86ce,U+86f9,U+8703,U+8707,U+8737,U+873b,U+8815,U+8936,U+8bc3,U+8bcf,U+8bd2,U+8bd8,U+8be9,U+8c0c,U+8c0f,U+8c4c,U+8d45,U+8d5d,U+8d73,U+8e31,U+8e6d,U+8e76,U+8fe4,U+9041,U+90d7,U+9169,U+92ae,U+94a1,U+94c4,U+94c9,U+94db,U+94e7,U+9503,U+9506,U+9517,U+9528,U+9537,U+9542,U+9549,U+95fe,U+9616,U+961a,U+96c9,U+96f3,U+9701,U+970e,U+9739,U+9753,U+9798,U+98d2-98d3,U+98d9-98da,U+9968,U+996f,U+9984,U+9997,U+9acb,U+9b03,U+9c85,U+9ca8,U+9cab,U+9e49,U+9e51,U+9e66,U+9f10"}},{uri:vW,descriptors:{unicodeRange:"U+4e15,U+4e1e,U+4e2b,U+4eb3,U+4ec9,U+4f0e,U+4f64,U+501c,U+50a9,U+510b,U+51a2,U+51bc,U+527d,U+52d0,U+53fd,U+5429,U+542e,U+5486,U+54af,U+5506,U+5511,U+5522,U+552c,U+556c,U+55b3,U+55d2,U+55e6,U+55fd,U+561f,U+5639,U+5659,U+5662,U+5693,U+572a,U+5892,U+598a,U+5992,U+59a9,U+5a20,U+5ae3,U+5b17,U+5b7d,U+5d34,U+5d3d,U+5d4a,U+5d82,U+5e1a-5e1b,U+5ea5,U+5f0b,U+5f77,U+5fd6,U+5fff,U+6026,U+6035,U+6063,U+60b4,U+60bb,U+60ee,U+612b,U+6194,U+61ca,U+61e6,U+61f5,U+620a,U+6248,U+62a1,U+62d7,U+6376,U+637b,U+652b,U+65bc,U+65cc,U+65ce,U+65d6,U+664c,U+665f,U+6666,U+6684,U+66b9,U+6773,U+6777,U+6787,U+67de,U+6845,U+693d,U+6994,U+6a35,U+6d54,U+6d5c,U+6d8e,U+6dd6,U+6eb4,U+6f2a,U+6f78,U+704f,U+70ec,U+7118,U+714a,U+7172,U+71b9,U+724d,U+728a,U+7337,U+733e,U+7396,U+73b7,U+73cf,U+7428,U+742c,U+742e,U+74ee,U+74f4,U+7525,U+753a,U+7572,U+75d4,U+765c,U+768e,U+7762,U+777d,U+77fd,U+7825,U+7837,U+78b4,U+795f,U+79ed,U+7a1e,U+7b06,U+7b20,U+7ba9,U+7bab,U+7c7c,U+7cbd,U+7cdc,U+7ec9,U+7ef6,U+7f30,U+7f42,U+7f44,U+7f54,U+7f94,U+8004,U+800b,U+8019,U+809b,U+80ae,U+80c4,U+80f1,U+8146,U+816e,U+817c,U+81c0,U+81fc,U+81fe,U+822b,U+830f,U+832f,U+8340,U+8365,U+8385,U+8392,U+83a0,U+8424,U+84af,U+869c,U+8713,U+8717-8718,U+87c0,U+87cb,U+87fe,U+8821,U+8902,U+89d1,U+8bb9,U+8c12,U+8d32,U+8d53,U+8df7,U+8e7c,U+8f7c,U+8f95,U+8fab,U+9052,U+905b,U+9095,U+909d,U+90c5,U+911e,U+9122,U+916a,U+919b,U+948e,U+9492,U+949a,U+94b5,U+94bc,U+94c6,U+94f1,U+9502,U+9511,U+9536,U+956f-9570,U+9602,U+9621,U+9631,U+998b,U+99a5,U+9a81,U+9a9e,U+9ebe,U+9f8b"}},{uri:yW,descriptors:{unicodeRange:"U+4f2b,U+4f3d,U+4fac,U+5043,U+5055,U+5140,U+5156,U+51cb,U+5243,U+531d,U+536f,U+53a5,U+53ae,U+53f1,U+541d,U+5431,U+547b,U+5492,U+5494,U+54a4,U+54aa,U+54ce,U+54fd,U+5509,U+5520,U+553e,U+557b,U+55c5,U+55e1,U+55f7,U+5608,U+5636,U+563b,U+5773,U+57a0,U+5811,U+587e,U+58d5,U+59e3,U+5a29,U+5a6a,U+5a76,U+5a7a,U+5ac9,U+5b62,U+5b95,U+5c49,U+5c8c,U+5cab,U+5cb7,U+5d02,U+5d58,U+5e44,U+5e7a,U+5eff,U+5f29,U+5f89,U+5f9c,U+5fa8,U+6005,U+6043,U+60b8,U+60d8,U+60ec,U+60f0,U+6115,U+618e,U+630e,U+637a,U+6390,U+63ac,U+63b0,U+64de,U+6525,U+6538,U+65ee-65ef,U+6631,U+6636,U+6654,U+677c,U+67b8,U+67d8,U+683e,U+6886,U+68b5,U+692d,U+6963,U+6979,U+6988,U+6b59,U+6b9a,U+6c69,U+6c74,U+6cae,U+6ce0,U+6cef,U+6d95,U+6dc5,U+6dde,U+6de6,U+6dfc,U+6ea7,U+6f15,U+6f29,U+7096,U+70c3,U+7131,U+715c,U+7166,U+7266,U+7317,U+731d,U+7329,U+73e9,U+7425,U+7455,U+7490,U+74ef,U+7519,U+75b5,U+75b9,U+75de,U+7656,U+7663,U+7691,U+7729,U+77fe,U+783e,U+787c,U+795a,U+7a79,U+7abf,U+7b3a,U+7b4f,U+7b60,U+7b75,U+7b8d,U+7bb4,U+7bd3,U+7be1,U+7cbc,U+7edb,U+7f1c,U+7f8c,U+7fb2,U+7fb9,U+7fce,U+7ff1,U+810d,U+81c6,U+82a5,U+82aa,U+82de,U+8317,U+8343,U+835e,U+8364,U+836a,U+853a,U+8543,U+854a,U+8559,U+8568,U+85b0,U+85b9,U+864f,U+86e4,U+8715,U+8845,U+8884,U+88e8,U+88f1,U+8983,U+8be1,U+8c1f,U+8c27,U+8c5a,U+8c82,U+8d58,U+8dbe,U+8f98,U+9035,U+9074,U+90a1,U+9149,U+9157,U+93d6,U+949d,U+94c2,U+94e3-94e4,U+95eb,U+95f0,U+9611,U+9619,U+9642,U+968d,U+9706,U+970f,U+97ed,U+988a,U+9893,U+98e8,U+9a77,U+9a87,U+9aa1,U+9abc,U+9cdd,U+9e2f,U+9e33,U+9e44,U+9e5c,U+9e9d,U+9edd"}},{uri:xW,descriptors:{unicodeRange:"U+4f58,U+4f6c,U+4f70,U+4fd0,U+5014,U+51bd,U+524c,U+5315,U+5323,U+535e,U+540f,U+542d,U+545b,U+548e,U+549a,U+54ab,U+54fc,U+5567,U+556a,U+5600,U+5618,U+563f,U+5669,U+56f1,U+56ff,U+573b,U+574d,U+579b,U+57b8,U+57c2,U+586c,U+58f9,U+595a,U+598d,U+5993,U+5996,U+59d7,U+5b7a,U+5ba6,U+5c4e,U+5c96,U+5ce5,U+5eb6,U+5f08,U+5f99,U+602f,U+6059,U+606c,U+607a,U+60ed,U+61a9,U+620c,U+6249,U+62a8,U+62c4,U+62ed,U+62fd,U+6342,U+6345,U+6396,U+63a3,U+6402,U+6413,U+642a,U+6487,U+64a9,U+64ac,U+64ae,U+64b7,U+659f,U+65a1,U+667e,U+66f3,U+67e0,U+69db,U+69df,U+6aac,U+6b86,U+6c50,U+6c5e,U+6c76,U+6c85,U+6c8c,U+6cde,U+6d19,U+6d52,U+6da7,U+6db8,U+6e1a,U+6e25,U+6e4d,U+6e5f,U+6ec1,U+6f31,U+6f7a,U+6fa7,U+6fe1,U+701b,U+70ab,U+70f7,U+717d,U+71a8,U+7252,U+72c4,U+72e1,U+7315,U+736d,U+73ae,U+73c0,U+73c2,U+740f,U+75a4,U+7600-7601,U+768b,U+76bf,U+76d4,U+7728,U+772f,U+776c,U+77a0,U+77b0,U+77f8,U+783a,U+78d0,U+78fa,U+7977,U+7a37,U+7a92,U+7afa,U+7b71,U+7b94,U+7cef,U+7f28,U+7fe1,U+808b,U+80e5,U+80eb,U+8110,U+8113,U+812f,U+814c,U+81c3,U+8235,U+82d4,U+8309,U+83c1,U+8431,U+8469,U+84bf,U+84d3,U+84df,U+84e6,U+8511,U+8638,U+86c0,U+86db,U+86fe,U+8757,U+8822,U+8882,U+8885,U+8892,U+88f3,U+892a,U+8ba5,U+8bd9,U+8be0,U+8be7,U+8bfd,U+8c1a,U+8d4a,U+8d4e,U+8d66,U+8dda,U+8e0c,U+8e52,U+8e74,U+8e87,U+8f76,U+8fc2,U+8fe6,U+900d,U+9068,U+90ac,U+90b3,U+90b8,U+90e7,U+9119,U+9131,U+915a,U+916e,U+94b4,U+94d0,U+94e2,U+94ec,U+94ff,U+9522,U+9535,U+9556,U+965b,U+96f9,U+9774,U+9981,U+998d,U+998f,U+9a6e,U+9a7f,U+9a8a,U+9b13,U+9c9f,U+9e3e,U+9e43,U+9e6d,U+9e8b,U+9e92,U+9edb,U+9eef"}},{uri:wW,descriptors:{unicodeRange:"U+4e10,U+4e56,U+4e98,U+4ec3,U+4f3a,U+4f5f,U+4f88,U+4f97,U+4fa5,U+4fe8,U+504c,U+5197,U+52fa,U+5364,U+53e8,U+5406,U+543c,U+545c,U+5471,U+5480,U+5495,U+54b3,U+54df,U+54e6,U+54ee,U+557c,U+5583,U+55dc,U+55e3,U+566c,U+592f,U+5944,U+5983,U+59ca,U+59e5,U+5a13,U+5a7f,U+5b09,U+5bd0,U+5e4c,U+5eb5,U+5f1b,U+5f3c,U+608d,U+60cb,U+61a7,U+61ac,U+61cb,U+6233,U+62a0,U+62e7,U+62ee,U+62f4,U+62f7,U+634e,U+6382,U+63c9,U+63ea,U+6400,U+645e,U+6482,U+6556,U+6593,U+6615,U+664f,U+66e6,U+672d,U+675e,U+67da,U+6805,U+6808,U+6868,U+68a2,U+695e,U+69ad,U+6a80,U+6a90,U+6b83,U+6be1,U+6c30,U+6cad,U+6cb1,U+6cf1,U+6d31,U+6d93,U+6dae,U+6dbf,U+6dc6-6dc7,U+6e0d,U+6e32,U+6e3a,U+6e85,U+6eba,U+6f3e,U+6f5e,U+6f7c,U+6fee,U+71ee,U+722a,U+72b7,U+72e9,U+73ba,U+73d1,U+7409,U+7435-7436,U+7459-745a,U+747e,U+7487,U+74e2,U+7504,U+752c-752d,U+7599,U+759f,U+75a1,U+75ca,U+75f0,U+761f,U+7629,U+777f,U+7785,U+77a5,U+77bf,U+78d5,U+7934,U+7940,U+79a7,U+7b19,U+7c38,U+7c95,U+7cb1,U+7ce0,U+7eca,U+7ef7,U+7f2b,U+7f81,U+7fcc,U+8046,U+8148,U+8165,U+819b,U+81ba,U+828b,U+82ae,U+82b7,U+82d3,U+8301,U+830e,U+831c,U+8338,U+837c,U+8393,U+8398,U+83ba,U+83e0,U+83e9,U+853c,U+8654,U+86df,U+8712,U+873f,U+874e,U+8783,U+8859,U+88a4,U+8925,U+8bb7,U+8bff,U+8c19,U+8c1b,U+8c24,U+8c2c,U+8d61,U+8db4,U+8e6c,U+8f8a,U+8fe5,U+8ff8,U+901e,U+90f4,U+912f,U+9163,U+9170,U+91dc,U+949b,U+94a8,U+94b3,U+94c0,U+94e8,U+9525,U+9530,U+9539,U+954c-954d,U+9550,U+955b,U+962a,U+9685,U+96cc,U+9776,U+988d,U+9975,U+9985,U+9a6f,U+9aa5,U+9ab8,U+9c7f,U+9ca4,U+9cb8,U+9e25,U+9e35,U+9e4a"}},{uri:EW,descriptors:{unicodeRange:"U+4ea2,U+4ea5,U+4f36,U+4f84,U+4f8d,U+501a,U+5029,U+516e,U+51a5,U+51c4,U+51f8,U+5201,U+527f,U+5321,U+5352,U+5366,U+53e9,U+54c7,U+5632,U+5676,U+56b7,U+56bc,U+56da,U+56e4,U+5703,U+5729,U+5742,U+57a2-57a3,U+5815,U+58d1,U+5919,U+592d,U+5955,U+5a05,U+5a25,U+5a34,U+5b70,U+5b75,U+5bdd,U+5bf0,U+5c41,U+5c79,U+5c91,U+5c94,U+5ce6,U+5ced,U+5d69,U+5dc5,U+5e16,U+5e27,U+5f27,U+5f95,U+5ffb,U+6020,U+604d,U+6055,U+60e6,U+60eb,U+6123,U+618b,U+61a8,U+620d,U+62c7,U+62ce,U+62d9,U+631f,U+634d,U+6452,U+6479,U+64ce,U+64d2,U+655b,U+660a,U+6726,U+67c4,U+6809,U+6853,U+68e3,U+68f1,U+68fa,U+693f,U+6942,U+6995,U+69a8,U+69b4,U+6a71,U+6b89,U+6bcb,U+6bd3,U+6bd9,U+6c40,U+6cf8,U+6cfe,U+6d85,U+6da3,U+6daa,U+6e0e,U+6e43-6e44,U+6f88,U+7078,U+7099,U+70bd,U+70d9,U+70fd,U+7109,U+7184,U+7239,U+733f,U+73f2,U+748b,U+749c,U+749e,U+759a,U+75d2,U+75eb,U+7620,U+766b,U+7693,U+76cf,U+7738,U+773a,U+776b,U+778e,U+77aa,U+7852,U+78be,U+7948,U+795b,U+7960,U+796f,U+79ba,U+7a20,U+7a96,U+7aa5,U+7b03,U+7b28,U+7b50,U+7b77,U+7bc6,U+7bf1,U+7c27,U+7d0a,U+7ead,U+7ec5,U+7ee2,U+7ef0,U+7efd,U+7f0e,U+7f2e,U+7f79,U+7f9a,U+8098,U+80da,U+80e7,U+80f0,U+80f3,U+80fa,U+818a,U+81e7,U+8237-8238,U+8299,U+82b8,U+82ce,U+837b,U+83bd,U+83cf,U+8426,U+8475,U+85c9,U+85d5,U+85dc,U+85e9,U+871a,U+8747,U+8749,U+888d,U+8910,U+891a,U+8bb4,U+8be3,U+8bec,U+8bf2,U+8c06,U+8c0d,U+8d31,U+8d48,U+8de4,U+8e1e,U+8e4a,U+8e66,U+8f84,U+8f97,U+9083,U+90e1,U+9165,U+91c9,U+94b0,U+94f5,U+9504,U+9532,U+956d,U+95f5,U+95fa,U+9668,U+9698,U+96bd,U+9704,U+9773,U+9890,U+996a,U+997a,U+9a74,U+9a8b,U+9cc4,U+9ccc"}},{uri:SW,descriptors:{unicodeRange:"U+4ea8,U+4f1e,U+4f51,U+4f63,U+4f7c,U+4f83,U+4fa0,U+4fd1,U+4ffa,U+5018,U+5026,U+508d,U+50bb,U+50f5,U+50fb,U+5162,U+5319,U+5320,U+538c,U+5413,U+541f,U+5475,U+54bd,U+54d1,U+5589,U+5598,U+575f,U+57ae,U+57e0,U+5937,U+5974,U+5978,U+59ae,U+5a1f,U+5a49,U+5ab3,U+5b99,U+5b9b,U+5ba0,U+5be1,U+5be5,U+5c09,U+5c27,U+5de2,U+5e9a,U+5f26,U+5f8a,U+5f98,U+6021,U+606d,U+60bc,U+60d5,U+60e7,U+611a,U+614c,U+6254,U+626f,U+6292,U+6296,U+62b9,U+62e2,U+631a,U+631d,U+6320,U+6346,U+63ba,U+6467,U+64bc,U+658b,U+663c,U+6643,U+6652,U+6656,U+6687,U+66d9,U+66dd,U+66f0,U+673d,U+67ab,U+6816-6817,U+68a7,U+68ad,U+68cd,U+68e0,U+6986,U+69fd,U+6b47,U+6bd7,U+6c1f,U+6c2e-6c2f,U+6cbe,U+6de4,U+6e1d,U+6e83,U+6e9c,U+6ed4-6ed5,U+6f4d,U+70f9,U+7130,U+716e,U+718f,U+71ac,U+71e5,U+72fc,U+731c,U+7334,U+73ca,U+7422,U+7426,U+745f,U+7470,U+75af,U+75f4,U+762b,U+763e,U+7696,U+7737,U+7741,U+77a7,U+77bb,U+77ee,U+785d,U+788c,U+78ca,U+7901,U+796d,U+7985,U+79fd,U+7a3c,U+7a57,U+7a74,U+7b5b,U+7caa,U+7cb9,U+7cd5,U+7eac,U+7eb6,U+7ed1,U+7ee5,U+7f20,U+7f2a,U+7f38,U+7f69,U+7fa1,U+8018,U+8038,U+803f,U+804b,U+80a2,U+80be,U+80d6,U+817a,U+81fb,U+820c,U+82ad,U+82af,U+82bd,U+8327,U+8354,U+835f,U+8367,U+836b,U+840c,U+841d,U+8471,U+849c,U+84b2,U+84c9,U+8517,U+851a,U+8549,U+8681,U+8721,U+8776,U+88d9,U+88f9,U+89c5,U+8c1c,U+8c34,U+8d81,U+8d9f,U+8e0a,U+8e72,U+8eb2,U+8fed,U+901b,U+902e,U+906e,U+9091,U+90aa,U+90af,U+915d,U+9171,U+946b,U+9489,U+9499,U+94a5,U+9508,U+9524,U+952d,U+9551,U+9576,U+95f7,U+9600,U+96b6,U+96c0,U+9756,U+97f6,U+98a0,U+98a4,U+997f,U+9a73,U+9a86,U+9ad3,U+9e3d,U+9ed4"}},{uri:kW,descriptors:{unicodeRange:"U+4e4d,U+4e5e,U+4ec7,U+4ed5,U+50da,U+50e7,U+515c,U+51a4,U+51ff,U+5203,U+5254,U+5300,U+533e,U+5375,U+53ee,U+5435,U+543b,U+5455,U+548b,U+548f,U+54d7,U+54fa,U+5578,U+5587,U+55a7,U+560e,U+5760,U+576f,U+5777,U+5830,U+58a9,U+5962,U+59e8,U+5a07,U+5a23,U+5a3c,U+5b5a,U+5bb5,U+5bc5,U+5bde,U+5c7f,U+5cb1,U+5ce8,U+5cea,U+5d29,U+5d4c,U+5e18,U+5f57,U+5f5d,U+5f87,U+5ff1,U+6016,U+601c,U+6064,U+6177,U+61d2,U+625b,U+62e3,U+62f1,U+634f,U+63a0,U+6401,U+6405,U+6495,U+64c2,U+6512,U+6577,U+6590,U+65a7,U+65a9,U+65f7,U+6627,U+6655,U+6714,U+6795,U+67d1,U+67ff,U+68b3,U+68d5,U+68d8,U+6930,U+6960,U+6977,U+69bb,U+69d0,U+6a31,U+6b7c,U+6bb4,U+6c22,U+6c72,U+6c79,U+6c7e,U+6c81,U+6c93,U+6ca5,U+6cbc,U+6ce3,U+6cfb,U+6d3c,U+6da9,U+6df3,U+6e2d,U+6eaf,U+6ec7,U+6f13,U+6f33,U+6f62,U+6fa1,U+7011,U+707c,U+708a,U+70c1,U+70d8,U+70eb,U+711a,U+7194,U+7281,U+7316,U+7357,U+7384,U+7405,U+742a,U+745b,U+7574,U+7578,U+75ea,U+7682,U+7792,U+77d7,U+77e9,U+77eb,U+77f6,U+780c,U+78c5,U+7941,U+79e4,U+7a1a,U+7a9c,U+7ad6,U+7b5d,U+7bf7,U+7c07,U+7c3f,U+7c9f,U+7ca5,U+7cdf,U+7e82,U+7eab,U+7ece,U+7eda,U+7f09,U+7f15,U+7f9e,U+7fdf,U+7fe9,U+803b,U+803d,U+80aa,U+80b4,U+813e,U+8155,U+817b,U+819d,U+821c,U+82b9,U+82df,U+82ef,U+8304,U+83b9,U+8446,U+853d,U+85af,U+85fb,U+8650,U+865e,U+86d9,U+86ee,U+8700,U+8862,U+889c,U+88d4,U+88f8,U+895f,U+8a79,U+8bb3,U+8bb6,U+8bc0,U+8beb,U+8bf5,U+8c23,U+8c79,U+8d1e,U+8dcb,U+8e29,U+8e44,U+8e81,U+8eac,U+8eaf,U+8f8d,U+9050,U+90f8,U+914b,U+948a,U+94be,U+94ee,U+950c,U+9540,U+962e,U+9647,U+9661,U+9699,U+96cf,U+9716,U+9761,U+97a0,U+97e7,U+9a7c,U+9a8f,U+9ae6,U+9cd6,U+9e26"}},{uri:CW,descriptors:{unicodeRange:"U+4fa3,U+4fae,U+4fd8,U+4fef,U+50a3,U+5189,U+5195,U+51db,U+51f3,U+51f9,U+5220,U+5228,U+5288,U+52ff,U+532e,U+533f,U+5351,U+53db,U+53ed,U+5450,U+5484,U+5490,U+54c9,U+54e9,U+5501,U+5507,U+5543,U+55d3,U+56a3,U+575e,U+589f,U+5984,U+59ec,U+5a04,U+5a36,U+5a77,U+5a9a-5a9b,U+5ab2,U+5ac2,U+5ad6,U+5bc7,U+5c2c,U+5c34,U+5c51,U+5cd9,U+5d0e,U+5deb,U+5e3c,U+5e87,U+5ed3,U+5f13,U+5f64,U+5fe1,U+606a,U+6096,U+60df,U+60f6,U+60f9,U+6151,U+620e,U+6241,U+6252,U+6273,U+627c,U+6289,U+62c2,U+62cc,U+62ef,U+6361,U+6363,U+63b7,U+63e3,U+6518,U+66ae,U+6756,U+6789,U+6813,U+6829,U+6862,U+6866,U+6893,U+6897,U+690e,U+6984,U+69cc,U+6a1f,U+6a44,U+6a59,U+6ba1,U+6c13,U+6c90,U+6ca6,U+6cbd,U+6ccc,U+6cd3,U+6cd7,U+6d4a,U+6d4f,U+6d5a,U+6d9f,U+6da1,U+6dcc,U+6ea5,U+6ee4,U+6ee6,U+6f2f,U+6f8e,U+701a,U+7095,U+709c,U+70af,U+70db,U+70e8,U+714e,U+715e,U+71a0,U+71ce,U+7235,U+7280,U+72d0,U+72f8,U+73ab,U+7410,U+745c,U+7480,U+74a7-74a8,U+74e3,U+75ae,U+75f9,U+76b1,U+76ce,U+7736,U+77e2-77e3,U+781a,U+789f,U+797a,U+79be,U+79c3,U+79c6,U+79f8,U+7a8d,U+7a98,U+7aa6,U+7aff,U+7b1b,U+7cd9,U+7d6e,U+7ede,U+7eee,U+7f00,U+7f24,U+7f2d,U+7fd8,U+800d,U+8116,U+8151,U+81b3,U+8205,U+82c7,U+82db,U+832c,U+8335,U+8339,U+8386,U+846b,U+8587,U+8611,U+8682,U+868a,U+868c,U+8774,U+88d8,U+88f4,U+8912,U+8b6c,U+8bbd,U+8c0e,U+8c41,U+8d26,U+8d3b-8d3c,U+8d50,U+8dea,U+8e35,U+8f99,U+8fe2,U+8fe9,U+9017,U+914c,U+916f,U+9175-9176,U+918b,U+94a0,U+94ae,U+94ce,U+94f2,U+951a,U+952f,U+9541,U+9640,U+9672,U+968b,U+96cd,U+96ef,U+9713,U+97ec,U+9885,U+9992,U+9a6d,U+9a79,U+9a85,U+9cbb,U+9cd7,U+9cde,U+9e93,U+9f9f"}},{uri:MW,descriptors:{unicodeRange:"U+4e11,U+4ed7,U+4fcf,U+4fe9,U+4fed,U+50ac,U+50b2,U+5112,U+5180,U+5188,U+51f6,U+522e,U+5265,U+52cb,U+52df,U+5349,U+5367,U+5378,U+537f,U+5395,U+5398,U+53d4,U+543e,U+5440,U+5446,U+54b8,U+5565-5566,U+5580,U+55bb,U+56ca,U+572d,U+573e,U+574e,U+5782-5784,U+58f3,U+5938-5939,U+5948,U+594e,U+5a1c,U+5a74,U+5ae9,U+5b55,U+5b5c,U+5bb0,U+5bd3,U+5bf8,U+5c3f,U+5d14,U+5d2d,U+5df7,U+5dfe,U+5e05-5e06,U+5e1c,U+5e62,U+5e7b,U+5e7d,U+5ed6,U+5f2f,U+5f66,U+5f6c,U+5fa1,U+604b,U+609f,U+60a6,U+60e8,U+6101,U+6124,U+6127,U+6148,U+61be,U+6247,U+62d8,U+62da,U+633d,U+635e,U+6367,U+6380,U+638f,U+63a9,U+63fd,U+641c,U+64e6,U+655e,U+6572,U+6591,U+65a5,U+6691,U+6735,U+67a2-67a3,U+67ef,U+680b,U+6876,U+6905,U+6a0a,U+6a61,U+6b79,U+6bb7,U+6bbf,U+6c41,U+6c55,U+6c83,U+6c9b,U+6ca7,U+6cfc,U+6d46,U+6d51,U+6d74,U+6d9d,U+6daf,U+6dc0,U+6deb,U+6e17,U+6e24,U+6e89,U+6ea2,U+6ef4,U+6f6d,U+707f,U+70b3,U+70e4,U+70ef,U+710a,U+722c,U+725f,U+7261,U+72ee,U+72f1,U+730e,U+732b,U+7433,U+7538,U+75bc,U+7624,U+7709,U+7750,U+7779,U+7802,U+7898,U+78a7,U+78b1,U+78cb,U+78f7,U+7984,U+7a83,U+7aed,U+7b3c,U+7b4b,U+7c92,U+7c98,U+7ca4,U+7eb9,U+7ee3,U+7ef3,U+7ef5,U+7f05,U+7f55,U+7f62,U+7fc1,U+7fd4,U+7fe0,U+8042,U+806a,U+80a0,U+80a4,U+80c3,U+8102,U+8106,U+814a,U+8154,U+8247,U+8258,U+82cd,U+8328,U+832b,U+8389,U+83ca,U+845b,U+846c,U+84b8,U+8574,U+859b,U+8680,U+8695,U+86c7,U+8702,U+886c,U+8896,U+88b1,U+88e4,U+8bc8,U+8c10,U+8c26,U+8c28,U+8c2d,U+8d4c,U+8d63,U+8f67,U+8f74,U+8fc4,U+9006,U+9063,U+90a2,U+90b1,U+90c1,U+9177,U+9189,U+9493,U+949e,U+94fe,U+9610,U+961c,U+96a7,U+96fe,U+978d,U+97f5,U+9888,U+997c,U+9a84,U+9b3c,U+9b44-9b45,U+9b54,U+9e64,U+9f0e,U+9f9a"}},{uri:IW,descriptors:{unicodeRange:"U+4e19,U+4e38,U+4e53,U+4e7e,U+4e9f,U+4ec6,U+4f50,U+4fde,U+502a,U+5154,U+517d,U+51d1,U+51f0,U+5239,U+5256,U+52c9,U+52fe,U+5308,U+532a,U+535c,U+5384,U+53a2,U+53a8,U+53c9,U+53e0,U+5496,U+54ac,U+54c0,U+54c4,U+54e8,U+5561,U+5582,U+561b,U+5631,U+566a,U+5764,U+576a,U+5792,U+57ab,U+584c,U+5885,U+58f6,U+59a8,U+5acc,U+5bc2,U+5c38-5c39,U+5c60,U+5c6f,U+5c82,U+5c90,U+5d16,U+5dcd,U+5e37,U+5e90,U+5eb8,U+5f6a,U+5fcc,U+6012,U+6068,U+6073,U+607c,U+6094,U+6109,U+621a,U+626e,U+6284,U+62d0,U+62e6,U+62fe,U+6321,U+6328,U+632b,U+6349,U+6454,U+65ed,U+660f,U+6674,U+66a8,U+6749,U+674f,U+6760,U+67af,U+6850,U+6854,U+6869,U+68a8,U+68d2,U+68f5,U+6912,U+6b49,U+6b6a,U+6bef,U+6c28,U+6c5d,U+6c82,U+6cab,U+6cb8,U+6cc4,U+6cf5,U+6d47,U+6d78,U+6da4,U+6dc4,U+6dcb,U+6df9,U+6e0a,U+6e23,U+6e5b,U+6eb6,U+6f06,U+6f47,U+6f84,U+6f9c,U+6fd2,U+7076,U+70ac,U+7199,U+723d,U+72ac,U+72ed,U+7476,U+7529,U+752b,U+754f,U+7554,U+75d5,U+7626,U+76ef,U+7720,U+7766,U+7784,U+77ac,U+780d,U+7838,U+7845,U+786b,U+78b3,U+7978,U+79b9,U+79c9,U+79e7,U+7a3d,U+7a84,U+7a9f,U+7b0b,U+7b52,U+7c7d,U+7f1a,U+7fc5,U+7ff0,U+804a,U+8086-8087,U+808c,U+809a,U+80ba,U+810a,U+8180,U+818f,U+81c2,U+81ed,U+8231,U+8292,U+829c,U+82a6,U+82d1,U+8346,U+838e,U+839e,U+83c7,U+83f1,U+8403,U+840e,U+8513,U+857e,U+85e4,U+867e,U+871c,U+87ba,U+87f9,U+884d,U+8944,U+8a93,U+8c05,U+8d2c,U+8d2e,U+8d42-8d43,U+8dfb,U+8e22,U+8eba,U+8f69,U+8f9c,U+8fa3,U+8fa8,U+8fb1,U+900a,U+9038,U+903b,U+9042,U+904f,U+90b5,U+90dd,U+9102,U+9187,U+94a7,U+94c5,U+9523,U+95f8,U+95fd,U+960e,U+964b-964c,U+96c1,U+9709,U+971c,U+97ad,U+9882,U+9965,U+9976,U+9988,U+99a8,U+9a82,U+9a9a,U+9b41,U+9c8d,U+9e45,U+9e70,U+9e9f,U+9f3b,U+9f7f"}},{uri:_W,descriptors:{unicodeRange:"U+4e08,U+4e18,U+4e1b,U+4e22,U+4e27,U+4e32,U+4e52,U+4e73,U+4ead,U+4ed4,U+4ed9,U+4ef0,U+4fa6,U+5076,U+5179,U+51bb,U+51c9,U+51ef,U+51fd,U+524a,U+526a,U+529d,U+52ab,U+5306,U+5339,U+53d9,U+540a,U+5410,U+541e,U+5439,U+54b1,U+54ed,U+5564,U+558a,U+55b7,U+5634,U+574a,U+5751,U+57a6,U+57cb,U+57d4,U+5824,U+582a,U+5835,U+5858,U+5893,U+58e4,U+5951,U+5986,U+59da,U+59fb,U+59ff,U+5a03,U+5a46,U+5ac1,U+5b5d,U+5bfa,U+5c18,U+5c3a,U+5c48,U+5c4f,U+5c61,U+5cb3,U+5d1b,U+5e15,U+5e3d,U+5e99,U+5e9e,U+5eca,U+5f0a,U+5f17-5f18,U+5f25,U+5f7c,U+5fcd,U+6028,U+60a0,U+60ac,U+60d1,U+614e,U+6155,U+6168,U+61c8,U+6208,U+6212,U+6251,U+629a-629b,U+62ab-62ac,U+62fc,U+6323,U+632a,U+63d2,U+643a,U+6491-6492,U+649e,U+64b0,U+64c5,U+659c,U+6614,U+662d,U+6664,U+6670,U+6676,U+6746,U+67cf,U+67d4,U+682a,U+6843,U+6846,U+68da,U+6b3a,U+6b67,U+6c27,U+6c5b,U+6c64,U+6c70,U+6caa,U+6cca,U+6ce1,U+6d12,U+6d45,U+6dd1,U+6dd8,U+6e34,U+6e7f,U+6ee5,U+6f02,U+7092,U+70c2,U+70e6,U+7115,U+7237,U+7272,U+727a,U+72c2,U+739b,U+73b2,U+743c,U+751c,U+758f,U+75b2,U+7686,U+76c6,U+76d2,U+76fc,U+775b,U+77a9,U+7816,U+788e,U+7897,U+78b0,U+79bd,U+7a0d,U+7a91,U+7a9d,U+7ae3,U+7bad,U+7cca,U+7d2b,U+7eb1,U+7f06,U+7f14,U+7f1d,U+7f50,U+7ffc,U+8036,U+80bf,U+80c1,U+80ce,U+80f8,U+8109,U+810f,U+8170,U+8179,U+819c,U+821f,U+8230,U+8236,U+8273,U+829d,U+82f9,U+8305,U+8350,U+83b2,U+83cc,U+8404,U+840d,U+8427,U+8482,U+8679,U+8854,U+886b,U+8bbc,U+8be6,U+8c31,U+8c6b,U+8d4b,U+8dcc,U+8e2a,U+8e48,U+8f90,U+8fb0,U+9022,U+903c,U+903e,U+9065,U+916c,U+917f,U+94a9,U+94c3,U+94dd,U+94ed,U+9510,U+953b,U+96c7,U+970d,U+9738,U+9877,U+987d,U+989c,U+98d8,U+9a70,U+9a91,U+9aa4,U+9b42,U+9b4f,U+9e2d,U+9e3f,U+9e7f,U+9f20"}},{uri:TW,descriptors:{unicodeRange:"U+4e59,U+4ed3,U+4f0f,U+4f38,U+4f69,U+4fa7,U+4faf,U+4ff1,U+5077,U+5085,U+5144,U+5151,U+51af,U+51b6,U+51cc,U+523a,U+5251,U+5269,U+5272,U+52d8,U+5353,U+5389,U+53f9,U+5401,U+5415,U+541b,U+54f2,U+5524,U+554a,U+559d,U+5609,U+5740,U+575d,U+5806,U+5821,U+586b,U+5915,U+594f,U+5960,U+5999,U+59a5,U+59b9,U+59c6,U+59d1,U+59dc,U+5b5f,U+5b64,U+5b87,U+5bb4,U+5bbf,U+5c16,U+5c1d,U+5c3e,U+5c9a,U+5ca9,U+5cad,U+5cfb,U+5de1,U+5de7,U+5de9,U+5ef7,U+5f04,U+5f70,U+5f79,U+5fc6,U+602a,U+6050,U+6052,U+6070,U+6084,U+60b2,U+60dc,U+60e9,U+6167,U+6170,U+61c2,U+6270,U+6291,U+62b1,U+62bc,U+62dc,U+62df,U+62f3,U+6324,U+633a,U+6377,U+6398,U+63cf,U+640f,U+642c-642d,U+6458,U+6478,U+6500,U+654c,U+6566,U+658c,U+65c1,U+65cb,U+65e8,U+65ec,U+6696-6697,U+6734,U+679a,U+679d,U+67dc,U+67f3-67f4,U+680f,U+683d,U+684c,U+68af,U+699c,U+6bc1,U+6c0f,U+6c1b,U+6c57,U+6c6a,U+6d3d,U+6d6e,U+6d82,U+6db5,U+6dee,U+6e58,U+6eaa,U+6ecb,U+6ede,U+6ee9,U+6f0f,U+6f20,U+6f58,U+704c,U+7070,U+70b8,U+718a,U+7238,U+7262,U+7275,U+72b9,U+72d7,U+72e0,U+741b,U+7434,U+7483,U+74f6-74f7,U+75ab,U+764c,U+7761,U+7855,U+7891,U+78c1,U+79d2,U+7a00,U+7a3b,U+7c97,U+7ea4,U+7eb2,U+7ed2,U+7eea,U+7ef8,U+7f18,U+7fbd,U+8000,U+8010,U+8096,U+809d,U+80a9,U+817f,U+81e3,U+8206,U+8212,U+82ac,U+8302,U+8361,U+8377,U+83f2,U+8461,U+848b,U+84ec,U+8521,U+85aa,U+8870,U+8877,U+8881,U+888b,U+88ad,U+88c2,U+8986,U+8bd1,U+8bf1,U+8d24,U+8d2a,U+8d3e-8d3f,U+8d41,U+8d56,U+8d64,U+8d6b,U+8e0f,U+8f70,U+8f85,U+8f88,U+8fa9,U+9003,U+901d,U+90b9,U+90ce,U+94a6,U+94f8,U+9505,U+95ea,U+95ef,U+95f2,U+95f9,U+9601,U+9605,U+9634,U+966a,U+9677,U+9690,U+9694,U+96d5,U+971e,U+9896-9897,U+9972,U+9a71,U+9a76,U+9a7e,U+9e1f,U+9e23"}},{uri:AW,descriptors:{unicodeRange:"U+4e01,U+4e43,U+4ea6,U+4ef2,U+4eff,U+4f26,U+4f2a,U+4f2f,U+4f5b,U+4fa8,U+4fca,U+4fd7,U+5021,U+504f,U+5141,U+51c0,U+51dd,U+51e4,U+51ed,U+5200,U+5237,U+5427,U+5448,U+54a8,U+5706,U+5708,U+5723,U+575b,U+57c3,U+5899,U+58a8,U+58c1,U+5976,U+5988,U+59bb,U+59d0,U+59d3,U+5a18,U+5a31,U+5a92,U+5b54,U+5b85,U+5baa-5bab,U+5bc4,U+5bd2,U+5be8,U+5bff,U+5c65,U+5d07,U+5e1d,U+5e78,U+5e7c,U+5f03,U+5f1f,U+5f39,U+5f6d,U+5f92,U+5faa,U+5fbd,U+5fe7,U+5ffd,U+60a8,U+60ef,U+6108,U+6162,U+622a,U+6234,U+626b,U+626d,U+62c6,U+62d2,U+62d4,U+62d6,U+62e8,U+6316,U+6355,U+63ed,U+6447,U+64a4,U+65f1,U+6606,U+6628,U+664b,U+6668,U+6682,U+66f9,U+66fc,U+66ff,U+6717,U+6740,U+676d,U+67aa,U+67ec,U+67f1,U+6842,U+6851,U+695a,U+6982,U+6a2a,U+6b20,U+6b23,U+6b32,U+6b96,U+6bc5,U+6beb,U+6c60,U+6c9f,U+6cea,U+6cf3,U+6d1e,U+6d53,U+6d66,U+6d69,U+6d8c,U+6d9b,U+6db2,U+6de1,U+6dfb,U+6e14,U+6ed1,U+6eda,U+6ee8,U+6f2b,U+706d,U+7089,U+708e,U+70ad-70ae,U+70e7,U+7126,U+714c,U+71c3,U+71d5,U+7206,U+7259,U+731b,U+73a9,U+73bb,U+74dc,U+7532,U+7545,U+755c,U+75c7,U+7687,U+76d7,U+76f2,U+788d,U+78e8,U+79e6,U+79e9,U+7a3f,U+7a46,U+7a97,U+7af9,U+7bee,U+7c4d,U+7c89,U+7cd6,U+7eb5,U+7ebd,U+7ed8,U+8017,U+8033,U+80c0,U+80de,U+80f6,U+8138,U+817e,U+81a8,U+820d,U+827e,U+82b3,U+82d7,U+83b1,U+84c4,U+84dd,U+8584,U+864e,U+865a,U+866b,U+86cb,U+88d5,U+89e6,U+8bca,U+8bde,U+8bfa,U+8c0a,U+8c37,U+8c46,U+8c6a,U+8c8c,U+8d1d,U+8d29,U+8d4f,U+8d54,U+8d5a,U+8d60,U+8d62,U+8f7f,U+8f96,U+8f9e-8f9f,U+8fc1,U+8fdf,U+8fea,U+8ff7,U+9012,U+906d,U+9075,U+90a6,U+90bb,U+90ca,U+9178,U+9192,U+91ca,U+94bb,U+94dc,U+94fa,U+9501,U+950b,U+9521,U+955c,U+963b,U+9655,U+9675-9676,U+9887,U+9891,U+9971,U+9a97,U+9ece,U+9ed8"}},{uri:RW,descriptors:{unicodeRange:"U+4e1d,U+4e39,U+4e4c,U+4e4f,U+4e54,U+4e58,U+4e95,U+4ea1,U+4eab,U+4eae,U+4ec1,U+4f10,U+4f19,U+4f30,U+4f34,U+4fb5,U+503e,U+518c,U+5192,U+51a0,U+51ac,U+51b0,U+51e1,U+5211,U+5242,U+52a3,U+52b2,U+52c3,U+52c7,U+52d2,U+52e4,U+5377,U+539a,U+53a6,U+53e5,U+5417,U+5510,U+552f,U+5531,U+574f-5750,U+5761,U+5851,U+5854,U+58ee,U+593a,U+5949,U+5954,U+5a5a,U+5b8b,U+5bbd,U+5c04,U+5c0a,U+5c4b,U+5ce1,U+5cf0,U+5e10,U+5e8a,U+5e9f,U+5ec9,U+5f31,U+5f84,U+5fd8-5fd9,U+5fe0,U+6015,U+6062,U+6069,U+6076,U+6089,U+60a3,U+60ca,U+620f,U+624e,U+6263,U+6298,U+62a2,U+62bd,U+6311,U+6350,U+6389,U+638c,U+63f4,U+6446,U+644a,U+6469,U+64cd,U+654f,U+6562,U+656c,U+65d7,U+65e6,U+65fa,U+660c,U+6653,U+66b4,U+670b,U+672b,U+676f-6770,U+6881,U+6885,U+68a6,U+68cb,U+68ee,U+6b8a,U+6c88-6c89,U+6cc9,U+6ce5,U+6d01,U+6d17,U+6d1b,U+6d59,U+6d6a,U+6da8,U+6df7,U+6e10,U+6e20-6e21,U+6f5c,U+706f,U+70bc,U+719f,U+7267,U+732a,U+73cd,U+7518,U+756a,U+7586,U+7591,U+75db,U+76c8,U+76d0,U+76d6,U+76d8,U+76df,U+76fe,U+77db,U+7801,U+786c,U+795d,U+7965,U+79cb,U+7a77,U+7a7f,U+7aef,U+7b11,U+7bb1,U+7bc7,U+7ea0,U+7eaf,U+7ed5,U+7edc,U+7f13,U+7f29,U+7f34,U+7f8a,U+7ffb,U+8015,U+8058,U+805a,U+8083,U+80af,U+80c6,U+80cc,U+811a,U+8150,U+82e5,U+8336,U+8352,U+83ab,U+8428,U+8463,U+852c,U+8861,U+89c8,U+8bcd,U+8bd7,U+8bda,U+8be2,U+8bef,U+8bf8,U+8c0b,U+8c13,U+8d34,U+8d3a,U+8d74,U+8d76,U+8da3,U+8dd1,U+8ddd,U+8ddf,U+8df3,U+8f68,U+8f6f,U+8f7d,U+8f91,U+8f9b,U+8fbd,U+8fc8,U+8fd4,U+8feb,U+8ff9,U+900f,U+9057,U+907f-9080,U+90d1,U+90ed,U+91ce,U+9519,U+9526,U+95ed,U+9614,U+9635,U+9644,U+9686,U+96c5,U+96ea,U+9707,U+9732,U+9759,U+978b,U+9876,U+9881,U+9910,U+996e,U+9970,U+9c81,U+9e21,U+9ebb,U+9f84"}},{uri:jW,descriptors:{unicodeRange:"U+4e3d,U+4e4e,U+4e71,U+4e8f,U+4ed8,U+4eea,U+4f0a,U+4f0d,U+4f11,U+4f1f,U+4f24,U+4f3c,U+4f73,U+4fc4,U+500d,U+5012,U+501f,U+503a,U+505c,U+507f,U+50a8,U+514d,U+5178,U+517c,U+51b2,U+51b7,U+520a,U+5238,U+523b,U+52b1,U+535a,U+5371,U+5385,U+53eb-53ec,U+53f3,U+53f6,U+5409,U+542b,U+542f,U+5434,U+5462,U+5473,U+547c,U+54c8,U+54ea,U+56fa,U+5733,U+5757,U+5766,U+5802,U+585e,U+590f,U+591c,U+591f,U+5947,U+594b,U+5987,U+5a01,U+5b59,U+5b63,U+5b88,U+5b97,U+5b9c,U+5bbe,U+5bfb,U+5c01,U+5c1a,U+5c24,U+5c3c,U+5c97,U+5c9b,U+5cb8,U+5de6,U+5e01,U+5e2e,U+5e45,U+5e55,U+5e84,U+5ef6,U+5f02,U+5f52,U+5f69,U+5f7b,U+5f90,U+5fae,U+6000,U+600e,U+6025,U+60e0,U+6276,U+6297,U+62b5,U+62cd,U+62d3,U+62e5,U+62e9,U+62ff,U+6302,U+632f,U+63e1,U+6444,U+64ad,U+653b,U+6551,U+6563,U+65a4,U+65e7,U+6620,U+667a,U+66f2,U+671d,U+6731,U+6742,U+675f,U+6768,U+677e-677f,U+6790,U+67b6,U+67d3,U+6863,U+68b0,U+68c9,U+690d,U+6b8b,U+6bcd,U+6bd2,U+6bd5,U+6c38,U+6c61,U+6cbf,U+6cdb,U+6cf0,U+6d2a,U+6d89,U+6da6,U+6f6e,U+6fb3,U+7075,U+707e,U+70df,U+7164,U+7236,U+725b,U+7389,U+73e0,U+745e,U+74e6,U+751a,U+7537,U+75be,U+76ae,U+76db,U+793c,U+7956,U+7981,U+79d8,U+79df,U+79fb,U+7adf,U+7ae5,U+7b14,U+7b26,U+7b54,U+7b79,U+7d2f,U+7eb8,U+7eba,U+7ec6,U+7ee9,U+7eff,U+7f5a,U+7f6a,U+7f72,U+8089,U+80a5,U+80e1,U+8111,U+8131,U+821e,U+822c,U+8270,U+8499,U+8651,U+867d,U+8840,U+8857,U+8863,U+88c1,U+89c9,U+89d2,U+8a89,U+8bed,U+8bfe,U+8c01,U+8c22,U+8d21,U+8d25,U+8d2f,U+8d5e,U+8d75,U+8d8b,U+8dc3,U+8de8,U+8df5,U+8f6e,U+8f86,U+8f89,U+8fc5,U+8ff0,U+8ffd,U+9014,U+904d,U+90ae,U+9274,U+949f,U+952e,U+969c,U+96c4,U+96e8,U+96f6-96f7,U+97e9,U+987f,U+996d,U+9a7b,U+9aa8,U+9c7c,U+9c9c,U+9e4f,U+9f13,U+9f50"}},{uri:LW,descriptors:{unicodeRange:"U+4e13,U+4e16,U+4e1c,U+4e24,U+4e3e,U+4e49,U+4e61,U+4e66,U+4e89,U+4e8c,U+4e94,U+4e9b,U+4ea4,U+4eac,U+4ebf,U+4eca,U+4ef6-4ef7,U+4efb,U+4f18,U+4f20,U+4f46,U+4f7f,U+4fe1,U+503c,U+505a,U+5146,U+5148,U+515a,U+5171,U+5177,U+519b,U+51b3,U+51c6,U+51e0,U+5212,U+521b,U+522b,U+529e,U+52bf,U+534e-534f,U+5355,U+5357,U+5382,U+539f,U+53bb,U+53bf,U+53c2,U+53c8,U+53ca,U+53d6-53d8,U+53e3,U+53ea,U+53f0,U+540d,U+5411,U+56db,U+56de,U+56e0,U+56e2,U+578b,U+57ce,U+57fa,U+589e,U+5904,U+5934,U+5982,U+5b89,U+5b8c,U+5bfc,U+5c06,U+5c11,U+5c40,U+5c71,U+5e38,U+5e72,U+5e76,U+5e7f,U+5e94,U+5e9c,U+5f0f,U+5f15,U+5f20,U+5f3a,U+5f62,U+5f88,U+5fc5,U+5fd7,U+5feb,U+601d,U+6027,U+60c5,U+60f3,U+610f,U+6216,U+6218,U+624b,U+624d,U+6279,U+628a,U+6295,U+6301,U+6307,U+636e,U+63a5,U+63a8,U+652f,U+6536,U+653e,U+6548,U+6559,U+6570,U+65bd,U+65e0,U+6602,U+660e,U+6613,U+66f4,U+6700,U+670d,U+671f,U+672f,U+6743,U+674e,U+6751,U+6761,U+6784,U+6797,U+679c,U+67e5,U+6807,U+6837,U+683c,U+6b21,U+6b63-6b65,U+6bcf,U+6bd4,U+6c42,U+6c5f,U+6ca1,U+6cbb,U+6d3b,U+6d41,U+6d88,U+6df1,U+70b9,U+7136,U+7269,U+7279,U+7531,U+754c,U+767e,U+76ca,U+76f8,U+770b,U+7740,U+7814,U+79ef,U+7a0b,U+7a0e,U+7a76,U+7b80,U+7cbe,U+7cfb,U+7e41,U+7ea7,U+7ec4,U+7ec7,U+7ed3,U+7ed9,U+7edf,U+7f8e,U+8001,U+804c,U+8054,U+80b2,U+81f3,U+8425,U+8868,U+88ab,U+897f,U+89c1-89c2,U+89c4,U+89c6,U+89e3,U+8ba1,U+8ba4,U+8bae,U+8bb0,U+8bba,U+8bc1,U+8c03,U+8d28,U+8d39,U+8def,U+8f66,U+8f6c,U+8fd0-8fd1,U+9020,U+9053,U+90a3,U+90fd,U+91cc,U+9500,U+9547,U+95e8,U+95f4,U+961f,U+9645,U+9662,U+96be,U+96c6,U+9700,U+9769,U+97e6,U+9875,U+9879,U+9886,U+9898,U+98ce,U+9996,U+2b5af,U+2cc56,U+2e9f5,U+30edd-30ede"}},{uri:DW,descriptors:{unicodeRange:"U+4e03,U+4e30,U+4e34,U+4e45,U+4e60,U+4e70,U+4e88,U+4e91-4e92,U+4ea9,U+4eb2,U+4ec0,U+4ecb,U+4ecd,U+4ee4,U+4fee,U+5019,U+5047,U+50cf,U+5145,U+516d,U+5170,U+5175,U+5199,U+51cf,U+51fb,U+521a,U+5224,U+5267,U+52aa,U+5347-5348,U+534a,U+5356,U+5361,U+536b,U+5370,U+538b,U+53e4,U+53e6,U+5403,U+5426,U+5428,U+542c,U+5438,U+5668,U+56ed,U+56f4,U+56fe,U+57df,U+592a,U+5957,U+5b69,U+5b81,U+5b8f,U+5b98,U+5b9d,U+5ba1,U+5ba4,U+5bb3,U+5bc6,U+5bdf,U+5c3d,U+5c5e,U+5c81,U+5ddd,U+5de8,U+5dee,U+5e0c,U+5e86,U+5e8f,U+5e93,U+5e95,U+5e97,U+5ea7,U+5ead,U+5eb7,U+5f55,U+5f81,U+5f85,U+5ff5,U+6001,U+613f,U+6258,U+6267,U+6269,U+626c,U+627e,U+62db,U+62ec,U+6325,U+635f,U+6362,U+6388,U+6392,U+63a2,U+63a7,U+63aa,U+641e,U+6545,U+6597,U+65e2,U+65e9,U+661f,U+665a,U+666e-666f,U+66fe,U+6728,U+67d0,U+6811,U+6838,U+6865,U+697c,U+6b22,U+6b27,U+6b4c,U+6b62,U+6b66,U+6b7b,U+6bdb,U+6c47,U+6c49,U+6c7d,U+6c99,U+6cfd,U+6d0b,U+6d25,U+6d32,U+6d3e,U+6d4b,U+6e29,U+6e56,U+6e7e,U+6f14,U+6fc0,U+706b,U+70c8,U+7247,U+72af,U+72b6,U+72ec,U+732e,U+73ed,U+7403,U+7533,U+753b,U+7559,U+7565,U+7597,U+767b,U+773c,U+7763,U+77ed,U+77ff,U+7968,U+798f,U+79bb,U+79c0-79c1,U+7ad9,U+7ae0,U+7b51,U+7b7e,U+7cae,U+7d22,U+7ea2,U+7eb3,U+7eb7,U+7ec3,U+7ec8,U+7ecd,U+7edd,U+7efc,U+7f16,U+7f3a,U+7f51,U+7f57,U+7f6e,U+80dc,U+822a,U+8239,U+826f,U+82cf,U+82e6,U+8349,U+8363,U+83dc,U+8457,U+85cf,U+878d,U+8865,U+8a00,U+8b66,U+8ba2,U+8ba8,U+8bad,U+8bb2,U+8bc9,U+8bd5,U+8bfb,U+8d2b,U+8d35,U+8d37,U+8f7b,U+8f93,U+8fce,U+8fdd,U+9000-9002,U+9010,U+9047,U+9093,U+9152,U+9488,U+94a2,U+9633,U+9636,U+963f,U+9646,U+9648,U+964d,U+9664,U+9669,U+9760,U+97f3,U+987a,U+987e,U+9884,U+98de,U+9986,U+9ed1"}},{uri:PW,descriptors:{unicodeRange:"U+4e14,U+4e25,U+4e48,U+4e50,U+4e5d,U+4e9a,U+4ec5,U+4efd,U+4f17,U+4f4e-4f4f,U+4f55,U+4f59,U+4f60,U+4f8b,U+4f9b,U+4f9d,U+4fbf,U+4fc3,U+5065,U+513f,U+5149,U+514b,U+516b,U+5174,U+517b,U+518d,U+51b5,U+5207,U+5217-5219,U+521d,U+526f,U+529f,U+52a9,U+52b3,U+5305,U+533b,U+5343,U+5360,U+5373-5374,U+5386,U+53cb-53cd,U+53f2,U+53f7,U+544a,U+5468,U+547d,U+54cd,U+552e,U+5584,U+56f0,U+571f,U+5747,U+575a,U+57f9,U+5883,U+58eb,U+58f0,U+5907,U+590d,U+592e,U+5931,U+5956,U+5965,U+5973,U+5979,U+59cb,U+5b57-5b58,U+5b83,U+5ba2-5ba3,U+5bb9,U+5bcc,U+5c42,U+5c45,U+5c4a,U+5dde,U+5df1,U+5df4,U+5e03,U+5e08,U+5e26,U+5e2d,U+5f71,U+5f80,U+5f8b,U+5fb7,U+606f,U+611f,U+6237,U+623f,U+6253,U+627f,U+6293,U+62a4,U+62c5,U+62c9,U+6309,U+6574,U+6599,U+65ad,U+65af,U+65c5,U+65cf,U+6625,U+663e,U+671b,U+672a,U+6750,U+6781,U+6821,U+6839,U+6848,U+68c0,U+6a21,U+6b3e,U+6bb5,U+6c14,U+6cb3,U+6cb9,U+6ce8,U+6e05,U+6e2f,U+6e38,U+6e90,U+6ee1,U+70ed,U+7167,U+7231,U+7248,U+724c,U+7387,U+738b,U+73af,U+7530,U+75c5,U+767d,U+76d1,U+76f4,U+771f,U+77e5,U+77f3,U+7834,U+7840,U+786e,U+793a,U+795e,U+79f0,U+7a33,U+7a7a,U+7a81,U+7ade,U+7b56,U+7b97,U+7c73,U+7c7b,U+7d20,U+7d27,U+7ea6,U+7eaa,U+7ebf,U+7ee7,U+7eed,U+7ef4,U+7fa4,U+8003,U+80a1,U+81f4,U+8272,U+827a,U+8282,U+82b1,U+82f1,U+8303,U+836f,U+83b7,U+843d,U+88c5,U+8ba9,U+8baf,U+8bb8,U+8bbf,U+8bc4,U+8bc6,U+8bdd,U+8be5,U+8bf7,U+8c08,U+8c61,U+8d1f,U+8d22-8d23,U+8d27,U+8d2d,U+8d38,U+8d5b,U+8d70,U+8d85,U+8d8a,U+8db3,U+8eab,U+8f83,U+8fb9,U+8fdc,U+8fde,U+9009,U+901f,U+914d,U+91c7,U+94b1,U+94c1,U+94f6,U+95fb,U+9632,U+9650,U+968f,U+9752,U+975e,U+987b,U+989d,U+98df,U+9999,U+9a6c,U+9a8c,U+9ec4,U+9feb-9fec"}},{uri:NW,descriptors:{unicodeRange:"U+98fb-990c,U+990e-990f,U+9911-992d,U+992f-9953,U+9956-9962,U+9964,U+9966,U+9973,U+9978-9979,U+997b,U+997e,U+9982-9983,U+9989,U+998c,U+998e,U+999a-99a4,U+99a6-99a7,U+99a9-99c8"}},{uri:OW,descriptors:{unicodeRange:"U+8e4c-8e50,U+8e53-8e58,U+8e5a-8e65,U+8e67-8e68,U+8e6a-8e6b,U+8e6e,U+8e71,U+8e73,U+8e75,U+8e77-8e7b,U+8e7d-8e7e,U+8e80,U+8e82-8e84,U+8e86,U+8e88-8e8e,U+8e91-8e93,U+8e95-8e9b,U+8e9d,U+8e9f-8eaa,U+8ead-8eae,U+8eb0-8eb1,U+8eb3-8eb9,U+8ebb-8ecd,U+8ecf-8f02"}},{uri:$W,descriptors:{unicodeRange:"U+2e3a,U+3001-3002,U+3008-3011,U+3014-3017,U+301d-301f,U+4dae,U+4e00,U+4e07,U+4e09-4e0b,U+4e0d-4e0e,U+4e1a,U+4e2a,U+4e2d,U+4e3a-4e3b,U+4e4b,U+4e5f,U+4e86,U+4e8b,U+4e8e,U+4ea7,U+4eba,U+4ece,U+4ed1,U+4ed6,U+4ee3,U+4ee5,U+4eec,U+4f01,U+4f1a,U+4f4d,U+4f53,U+4f5c,U+4fdd,U+5143,U+5165,U+5168,U+516c,U+5173,U+5176,U+5185,U+519c,U+51fa,U+5206,U+5229,U+5230,U+5236,U+524d,U+529b,U+52a0-52a1,U+52a8,U+5316-5317,U+533a,U+5341,U+5362,U+53d1,U+53ef,U+53f8,U+5404,U+5408,U+540c,U+540e,U+5458,U+548c,U+54c1,U+54e5,U+5546,U+559c,U+56fd,U+5728,U+5730,U+573a,U+5916,U+591a,U+5927,U+5929,U+592b,U+597d,U+59d4,U+5b50,U+5b66,U+5b9a,U+5b9e,U+5bb6,U+5bf9,U+5c0f,U+5c14,U+5c31,U+5c55,U+5de5,U+5df2,U+5e02,U+5e73-5e74,U+5ea6,U+5efa,U+5f00,U+5f53,U+5f97,U+5fc3,U+603b,U+6210-6211,U+6240,U+6280,U+62a5,U+63d0,U+6539,U+653f,U+6587,U+65b0,U+65b9,U+65e5,U+65f6,U+662f,U+6708-6709,U+672c,U+673a,U+675c,U+6765,U+6c11,U+6c34,U+6cd5,U+6ce2,U+6d4e,U+6d77,U+73b0,U+7406,U+751f,U+7528,U+7535,U+7684,U+76ee,U+793e,U+79cd,U+79d1,U+7acb,U+7b2c,U+7b49,U+7ba1,U+7ecf,U+8005,U+800c,U+80fd,U+81ea,U+884c,U+8981,U+8bbe,U+8bf4,U+8d44,U+8d77,U+8fbe,U+8fc7,U+8fd8-8fd9,U+8fdb,U+901a,U+90e8,U+91cd,U+91cf,U+91d1,U+9485,U+957f,U+95ee,U+9762,U+9ad8,U+9ea6,U+9f99,U+9fcf,U+9fd4,U+9fed,U+fe10-fe19,U+fe30-fe31,U+fe33-fe44,U+ff01,U+ff0c,U+ff1f,U+2b4e7,U+2b7f7,U+2b7fc,U+2cb2d,U+2cb3b,U+2cb4a,U+2cb5b,U+2cb73"}},{uri:zW,descriptors:{unicodeRange:"U+6490,U+6493-6494,U+6497-6498,U+649a-649d,U+649f-64a3,U+64a5-64a8,U+64aa-64ab,U+64af,U+64b1-64b4,U+64b6,U+64b9,U+64bb,U+64bd-64bf,U+64c1,U+64c3-64c4,U+64c6-64cc,U+64cf,U+64d1,U+64d3-64d6,U+64d9-64dd,U+64df-64e1,U+64e3,U+64e5,U+64e7-64ff,U+6501-6508,U+650a-6511,U+6513-6517,U+6519-6524,U+6526-652a,U+652c-652d,U+6530-6533,U+6537,U+653a,U+653c-653d,U+6540-6544,U+6546-6547,U+654a-654b,U+654d-654e,U+6550,U+6552-6554,U+6557-6558,U+655a,U+655c,U+655f-6561,U+6564-6565,U+6567-6568"}},{uri:FW,descriptors:{unicodeRange:"U+9695-9696,U+969a-969b,U+969d-96a6,U+96a8-96af,U+96b1-96b2,U+96b4-96b5,U+96b7-96b8,U+96ba-96bb,U+96bf,U+96c2-96c3,U+96c8,U+96ca-96cb,U+96d0-96d1,U+96d3-96d4,U+96d6-96df,U+96e1-96e7,U+96eb-96ee,U+96f0-96f2,U+96f4-96f5,U+96f8,U+96fa-96fd,U+96ff,U+9702-9703,U+9705,U+970a-970c,U+9710-9712,U+9714-9715,U+9717-971b,U+971d,U+971f-9729,U+972b-972c,U+972e-972f,U+9731,U+9733-9737,U+973a-973d,U+973f-9751,U+9754-9755,U+9757-9758,U+975a,U+975c-975d,U+975f,U+9763-9764,U+9766-9768,U+976a-9770"}},{uri:BW,descriptors:{unicodeRange:"U+6af0-6b1f,U+6b25-6b26,U+6b28-6b31,U+6b33-6b36,U+6b38,U+6b3b-6b3d,U+6b3f-6b42,U+6b44-6b45,U+6b48,U+6b4a-6b4b,U+6b4d-6b58,U+6b5a-6b61,U+6b68-6b69,U+6b6b-6b78,U+6b7a,U+6b7d-6b80,U+6b85,U+6b88,U+6b8c,U+6b8e-6b91,U+6b94-6b95,U+6b97-6b99,U+6b9c-6ba0,U+6ba2-6ba9,U+6bab-6bb2,U+6bb6,U+6bb8-6bba"}},{uri:HW,descriptors:{unicodeRange:"U+430e-439a,U+29e8a,U+29ec4,U+29edb,U+29ee9,U+29f7e,U+29f83,U+29f8c,U+29fce,U+2a01a,U+2a02f,U+2a082,U+2a0f9,U+2a190,U+2a38c"}},{uri:WW,descriptors:{unicodeRange:"U+92ef-933d,U+933f-9369,U+936b-9388"}},{uri:XW,descriptors:{unicodeRange:"U+4512-458d,U+2b300,U+2b363,U+2b36f,U+2b372,U+2b37d,U+2b404,U+2b410,U+2b413,U+2b461,U+2b4ef,U+2b4f6,U+2b4f9,U+2b50d-2b50e,U+2b536,U+2b5ae,U+2b5b3,U+2b5e7,U+2b5f4,U+2b61c-2b61d,U+2b626-2b628,U+2b62a,U+2b62c,U+2b695-2b696,U+2b6ad,U+2b6ed"}},{uri:VW,descriptors:{unicodeRange:"U+88bd-88c0,U+88c3-88c4,U+88c7-88c8,U+88ca-88cd,U+88cf-88d1,U+88d3,U+88d6-88d7,U+88da-88de,U+88e0-88e1,U+88e6-88e7,U+88e9-88ef,U+88f2,U+88f5-88f7,U+88fa-88fb,U+88fd,U+88ff-8901,U+8903-8909,U+890b-890f,U+8911,U+8914-8918,U+891c-8920,U+8922-8924,U+8926-8929,U+892c-892f,U+8931-8933,U+8935,U+8937-8940,U+8942-8943,U+8945-895d,U+8960-8965,U+8967-897a,U+897c-897e,U+8980,U+8982,U+8984-8985"}},{uri:GW,descriptors:{unicodeRange:"U+4b0b-4ba0"}},{uri:YW,descriptors:{unicodeRange:"U+7179,U+717b-717c,U+717e-7183,U+7185-7189,U+718b-718e,U+7190-7193,U+7195-7197,U+719a-719e,U+71a1-71a7,U+71a9-71ab,U+71ad-71b2,U+71b4,U+71b6-71b8,U+71ba-71c2,U+71c4-71cd,U+71cf-71d3,U+71d6-71df,U+71e1-71e4,U+71e6,U+71e8-71ed,U+71ef-71f8,U+71fa-7205,U+7207-721c,U+721e-7227,U+7229,U+722b,U+722d"}},{uri:ZW,descriptors:{unicodeRange:"U+982e-9874,U+988b,U+988e,U+9892,U+9895,U+9899,U+98a3,U+98a8-98cd,U+98cf-98d0,U+98d4,U+98d6-98d7,U+98db-98dd,U+98e0-98e6,U+98e9-98fa"}},{uri:KW,descriptors:{unicodeRange:"U+7c14-7c15,U+7c17-7c1e,U+7c20-7c25,U+7c28-7c29,U+7c2b-7c37,U+7c39-7c3e,U+7c42-7c4c,U+7c4e-7c72,U+7c75-7c7a,U+7c7e-7c88,U+7c8a-7c90,U+7c93-7c94,U+7c96,U+7c99-7c9b,U+7ca0-7ca1,U+7ca3,U+7ca6-7ca9,U+7cab-7cad,U+7caf-7cb0,U+7cb4-7cb8,U+7cba-7cbb,U+7cbf-7cc0,U+7cc2-7cc4,U+7cc6,U+7cc9,U+7ccb,U+7cce-7cd4"}},{uri:qW,descriptors:{unicodeRange:"U+7d95-7da5,U+7da7-7dad,U+7daf-7e2a"}},{uri:QW,descriptors:{unicodeRange:"U+4a78-4b0a"}},{uri:JW,descriptors:{unicodeRange:"U+9b30-9b31,U+9b33-9b3a,U+9b3d-9b40,U+9b46,U+9b4a-9b4c,U+9b4e,U+9b50,U+9b52-9b53,U+9b55-9bcf"}},{uri:eX,descriptors:{unicodeRange:"U+6a4b-6a4f,U+6a51-6a57,U+6a5a,U+6a5c-6a60,U+6a62-6a64,U+6a66-6a70,U+6a72-6a78,U+6a7a-6a7b,U+6a7d-6a7f,U+6a81-6a83,U+6a85-6a8d,U+6a8f,U+6a92-6a96,U+6a98-6a9f,U+6aa1-6aa8,U+6aaa,U+6aad-6aef"}},{uri:tX,descriptors:{unicodeRange:"U+99c9-9a53"}},{uri:nX,descriptors:{unicodeRange:"U+8550-8555,U+8557-8558,U+855a-855d,U+855f-8563,U+8565-8567,U+8569-8571,U+8573,U+8575-8578,U+857c-857d,U+857f-8583,U+8586,U+8588-858e,U+8590-859a,U+859d-85a3,U+85a5-85a7,U+85a9,U+85ab-85ad,U+85b1-85b6,U+85b8,U+85ba-85c0,U+85c2-85c8,U+85ca-85ce,U+85d1-85d2,U+85d4,U+85d6-85db,U+85dd-85e3,U+85e5-85e8,U+85ea-85fa,U+85fc-85fe,U+8600-8603"}},{uri:rX,descriptors:{unicodeRange:"U+6fb2,U+6fb4-6fb5,U+6fb7-6fb8,U+6fba-6fbf,U+6fc1,U+6fc3-6fc8,U+6fca-6fd0,U+6fd3-6fdd,U+6fdf,U+6fe2-6fed,U+6ff0-7010,U+7012-7019,U+701c-7022,U+7024-7034,U+7036-7038,U+703a-704b,U+704d-704e,U+7050-7053"}},{uri:aX,descriptors:{unicodeRange:"U+4ba1-4c2c"}},{uri:iX,descriptors:{unicodeRange:"U+9a54-9a6b,U+9a72,U+9a83,U+9a89,U+9a8d-9a8e,U+9a94-9a95,U+9a99,U+9aa6,U+9aa9-9aaf,U+9ab2-9ab5,U+9ab9,U+9abb,U+9abd-9abf,U+9ac3-9ac4,U+9ac6-9aca,U+9acd-9ad0,U+9ad2,U+9ad4-9ad7,U+9ad9-9ade,U+9ae0,U+9ae2-9ae5,U+9ae7-9aea,U+9aec,U+9aee,U+9af0-9af8,U+9afa,U+9afc-9b02,U+9b04-9b07,U+9b09-9b0e,U+9b10-9b12,U+9b14-9b1e,U+9b20-9b22,U+9b24-9b2e"}},{uri:lX,descriptors:{unicodeRange:"U+9d1a-9da1"}},{uri:sX,descriptors:{unicodeRange:"U+9e13-9e1e,U+9e24,U+9e27,U+9e2e,U+9e30,U+9e34,U+9e3b-9e3c,U+9e40,U+9e4d,U+9e50,U+9e52-9e54,U+9e56,U+9e59,U+9e5d,U+9e5f-9e62,U+9e65,U+9e6e-9e6f,U+9e72,U+9e74-9e7d,U+9e80-9e81,U+9e83-9e86,U+9e89-9e8a,U+9e8c-9e91,U+9e94-9e9c,U+9e9e,U+9ea0-9ea5,U+9ea7-9eb3,U+9eb5-9eb7,U+9eb9-9eba,U+9ebc,U+9ebf-9ec3,U+9ec5-9ec8,U+9eca-9ecc,U+9ed0,U+9ed2-9ed3,U+9ed5-9ed7,U+9ed9-9eda,U+9ede,U+9ee1,U+9ee3-9ee4,U+9ee6,U+9ee8,U+9eeb-9eee,U+9ef0-9ef8"}},{uri:oX,descriptors:{unicodeRange:"U+8b1c-8b25,U+8b27-8b65,U+8b67-8b6b,U+8b6d-8b9f,U+8bac,U+8bb1,U+8bbb,U+8bc7,U+8bd0"}},{uri:cX,descriptors:{unicodeRange:"U+4cad-4d2f"}},{uri:dX,descriptors:{unicodeRange:"U+9c4b-9c7b,U+9c7d-9c7e,U+9c80,U+9c83-9c84,U+9c89-9c8a,U+9c8c,U+9c8f,U+9c93,U+9c96-9c99,U+9c9d,U+9caa,U+9cac,U+9caf,U+9cb9,U+9cbe-9cc2,U+9cc8-9cc9,U+9cd1-9cd2,U+9cda-9cdb,U+9ce0-9ce1,U+9ce3-9d19"}},{uri:uX,descriptors:{unicodeRange:"U+9389-938e,U+9390-93c9,U+93cb-93d5,U+93d7-9410"}},{uri:fX,descriptors:{unicodeRange:"U+20a0-20b5,U+20b9-20ba,U+20bc-20bd,U+4e2c,U+5107,U+5216,U+5293,U+54f3,U+5523,U+5819,U+5adc,U+5c88,U+5e3b,U+5fee,U+62f6,U+63be,U+6484,U+6499,U+67d9,U+67dd,U+6d5e,U+6f46,U+717a,U+71e0,U+72c1,U+73e7,U+75b0,U+7603,U+7722,U+7809,U+7811,U+7946,U+7967,U+799a,U+7b45,U+7ba2,U+8014,U+80d9,U+8159,U+817d,U+81a3,U+81aa,U+8201,U+833c,U+836e,U+83e5,U+8459,U+84f0,U+8729,U+8753,U+87d3,U+89dc,U+8bf6,U+8c2e,U+8e2c,U+8e9c,U+8e9e,U+8ece,U+8fee,U+9139,U+914f,U+9174,U+9191,U+960c,U+9622,U+9a98,U+9b48,U+9ca6,U+9cb0,U+9da2-9e12,U+9e88,U+9f44,U+9f86"}},{uri:hX,descriptors:{unicodeRange:"U+9bd0-9c4a"}},{uri:pX,descriptors:{unicodeRange:"U+4c2d-4cac"}},{uri:mX,descriptors:{unicodeRange:"U+4d30-4dab"}},{uri:UX,descriptors:{unicodeRange:"U+9411-943d,U+943f-946a,U+946c-9484"}},{uri:gX,descriptors:{unicodeRange:"U+9efa,U+9efd,U+9eff-9f0a,U+9f0c,U+9f0f,U+9f11-9f12,U+9f14-9f16,U+9f18,U+9f1a-9f1f,U+9f21,U+9f23-9f2b,U+9f2d-9f2e,U+9f30-9f36,U+9f38,U+9f3a,U+9f3c,U+9f3f-9f43,U+9f45-9f4f,U+9f52-9f7e,U+9f81-9f82,U+9f8d-9f94"}},{uri:bX,descriptors:{unicodeRange:"U+7e2b-7e3a,U+7e3c-7e40,U+7e42-7e46,U+7e48-7e81,U+7e83-7e9a,U+7e9c-7e9e,U+7eae,U+7eb4,U+7ebb-7ebc,U+7ed6,U+7ee4,U+7eec,U+7ef9,U+7f0a,U+7f10,U+7f1e,U+7f37,U+7f39,U+7f3b"}}],ql=class At{constructor(t){F(this,"scene"),F(this,"getSceneFamilies",()=>At.getUniqueFamilies(this.scene.getNonDeletedElements())),F(this,"onLoaded",n=>{let r=!0;for(let l of n){let s=`${l.family}-${l.style}-${l.weight}-${l.unicodeRange}`;At.loadedFontsCache.has(s)||(At.loadedFontsCache.add(s),r=!1)}if(r)return;let a=!1,i=this.scene.getNonDeletedElementsMap();for(let l of this.scene.getNonDeletedElements())if(ke(l)){a=!0,Qt.delete(l),Of.clearCache(_t(l));let s=Bn(l,i);s&&Qt.delete(s)}a&&this.scene.triggerUpdate()}),F(this,"loadSceneFonts",async()=>{let n=this.getSceneFamilies(),r=At.getCharsPerFamily(this.scene.getNonDeletedElements());return At.loadFontFaces(n,r)}),this.scene=t}static get registered(){return At._registered?At._initialized||(At._registered=new Map([...At.init().entries(),...At._registered.entries()])):At._registered=At.init(),At._registered}get registered(){return At.registered}static async generateFontFaceDeclarations(t){let n=At.getUniqueFamilies(t),r=At.getCharsPerFamily(t),a=n.find(d=>CE(d).includes(Cc));if(a){let d=At.getCharacters(r,a);if(HO(d)){let u=Mc[Cc];r[u]=new Set(d),n.unshift(Mc[Cc])}}let i=At.fontFacesStylesGenerator(n,r),l=3,s=await new Dv(i,l).all();return Array.from(new Set(s))}static async loadFontFaces(t,n){for(let{fontFaces:i,metadata:l}of At.registered.values())if(!l.local)for(let{fontFace:s}of i)window.document.fonts.has(s)||window.document.fonts.add(s);let r=At.fontFacesLoader(t,n),a=10;return(await new Dv(r,a).all()).flat().filter(Boolean)}static*fontFacesLoader(t,n){for(let[r,a]of t.entries()){let i=_t({fontFamily:a,fontSize:16}),l=At.getCharacters(n,a);window.document.fonts.check(i,l)||(yield Zc(async()=>{var s;try{let d=await window.document.fonts.load(i,l);return[r,d]}catch(d){console.error(`Failed to load font "${i}" from urls "${(s=At.registered.get(a))==null?void 0:s.fontFaces.map(u=>u.urls)}"`,d)}}))}}static*fontFacesStylesGenerator(t,n){for(let[r,a]of t.entries()){let{fontFaces:i,metadata:l}=At.registered.get(a)??{};if(!Array.isArray(i)){console.error(`Couldn't find registered fonts for font-family "${a}"`,At.registered);continue}if(!(l!=null&&l.local))for(let[s,d]of i.entries())yield Zc(async()=>{try{let u=At.getCharacters(n,a),o=await d.toCSS(u);return o?[r*1e4+s,o]:void 0}catch(u){console.error(`Couldn't transform font-face to css for family "${d.fontFace.family}"`,u)}})}}static register(t,n,...r){let a=Xt[t]??Mc[t];return this.registered.get(a)||this.registered.set(a,{metadata:n,fontFaces:r.map(({uri:i,descriptors:l})=>new Zz(t,i,l))}),this.registered}static init(){let t={registered:new Map},n=(r,...a)=>{let i=Xt[r]??Mc[r],l=zp[i]??zp[Xt.Excalifont];At.register.call(t,r,l,...a)};return n("Cascadia",...qz),n("Comic Shanns",...nF),n("Excalifont",...uF),n("Helvetica",...fF),n("Liberation Sans",...pF),n("Lilita One",...gF),n("Nunito",...EF),n("Virgil",...kF),n(Cc,...vX),n(sf,...rF),At._initialized=!0,t.registered}static getUniqueFamilies(t){return Array.from(t.reduce((n,r)=>(ke(r)&&n.add(r.fontFamily),n),new Set))}static getCharsPerFamily(t){let n={};for(let r of t)if(ke(r))for(let a of r.originalText)n[r.fontFamily]||(n[r.fontFamily]=new Set),n[r.fontFamily].add(a);return n}static getCharacters(t,n){return t[n]?Array.from(t[n]).join(""):""}static getAllFamilies(){return Array.from(At.registered.keys())}};F(ql,"loadedFontsCache",new Set),F(ql,"_registered"),F(ql,"_initialized",!1),F(ql,"loadElementsFonts",async e=>{let t=ql.getUniqueFamilies(e),n=ql.getCharsPerFamily(e);return ql.loadFontFaces(t,n)});var al=ql,xS=(e,t,n)=>{var d;let{unitsPerEm:r,ascender:a,descender:i}=((d=al.registered.get(e))==null?void 0:d.metadata.metrics)||zp[Xt.Virgil].metrics,l=t/r,s=(n-l*a+l*i)/2;return l*a+s},Co=e=>{var n;let{lineHeight:t}=((n=al.registered.get(e))==null?void 0:n.metadata.metrics)||zp[Xt.Excalifont].metrics;return t},wS=e=>{let{angle:t,width:n,height:r,x:a,y:i}=e,l=a+n/2,s=i+r/2,d=A(l,s),u;return e.type==="diamond"?u=Tv(ce(A(l,i),d,t),ce(A(a+n,s),d,t),ce(A(l,i+r),d,t),ce(A(a,s),d,t)):u=Tv(ce(A(a,i),d,t),ce(A(a+n,i),d,t),ce(A(a+n,i+r),d,t),ce(A(a,i+r),d,t)),{type:"polygon",data:u}},yX=(e,t,n=10)=>{let[r,a,i,l,s,d]=Ze(e,t,!0);r-=n,i+=n,a-=n,l+=n;let u=A(s,d),o=ce(A(r,a),u,e.angle),f=ce(A(i,a),u,e.angle),m=ce(A(r,l),u,e.angle),U=ce(A(i,l),u,e.angle);return{type:"polygon",data:[o,f,U,m]}},xX=e=>{let{width:t,height:n,angle:r,x:a,y:i}=e;return{type:"ellipse",data:{center:A(a+t/2,i+n/2),angle:r,halfWidth:t/2,halfHeight:n/2}}},Ss=e=>{if(!e)return[];for(let t of e.sets)if(t.type==="path")return t.ops;return e.sets[0].ops},wX=(e,t=A(0,0),n,r)=>{let a=d=>ce(A(d[0]+t[0],d[1]+t[1]),r,n),i=Ss(e),l=[],s=A(0,0);for(let d of i){if(d.op==="move"){let u=g5(d.data);lr(u!=null,"Ops data is not a point"),s=a(u)}if(d.op==="bcurveTo"){let u=a(A(d.data[0],d.data[1])),o=a(A(d.data[2],d.data[3])),f=a(A(d.data[4],d.data[5]));l.push(el(s,u,o,f)),s=f}}return{type:"polycurve",data:l}},EX=e=>{let t=e[0],n=[];for(let r=1;r<e.length;r++){let a=e[r];n.push(Oe(t,a)),t=a}return n},SX=(e,t,n=!1)=>{let r=i=>ce(st(ls(Pe(i),Vn(e.x,e.y))),t,e.angle),a=EX(e.points.map(i=>r(i)));return n?{type:"polygon",data:Dp(a.flat())}:{type:"polyline",data:a}},kX=(e,t,n=A(0,0),r,a)=>{let i=o=>ce(A(o[0]+n[0],o[1]+n[1]),a,r);if(e.roundness===null)return{type:"polygon",data:Dp(e.points.map(o=>i(o)))};let l=Ss(t),s=[],d=!1;for(let o of l)o.op==="move"?(d=!d,d&&s.push(A(o.data[0],o.data[1]))):o.op==="bcurveTo"?d&&(s.push(A(o.data[0],o.data[1])),s.push(A(o.data[2],o.data[3])),s.push(A(o.data[4],o.data[5]))):o.op==="lineTo"&&d&&s.push(A(o.data[0],o.data[1]));let u=fN(s,10,5).map(o=>i(o));return{type:"polygon",data:Dp(u)}},CX=(e,t)=>{let{angle:n,halfWidth:r,halfHeight:a,center:i}=t,l=r,s=a,d=ls(Pe(e),an(Pe(i),-1)),[u,o]=ce(st(d),A(0,0),-n),f=Math.abs(u),m=Math.abs(o),U=.707,g=.707;for(let w=0;w<3;w++){let E=l*U,S=s*g,k=(l*l-s*s)*U**3/l,I=(s*s-l*l)*g**3/s,T=E-k,M=S-I,j=f-k,D=m-I,P=Math.hypot(M,T),N=Math.hypot(D,j);U=Math.min(1,Math.max(0,(j*P/N+k)/l)),g=Math.min(1,Math.max(0,(D*P/N+I)/s));let $=Math.hypot(g,U);U/=$,g/=$}let[v,y]=[l*U*Math.sign(u),s*g*Math.sign(o)];return yt(A(u,o),A(v,y))},MX=(e,t,n=1e-4)=>CX(e,t)<=n,IX=(e,t)=>{let{center:n,angle:r,halfWidth:a,halfHeight:i}=t,l=ls(Pe(e),an(Pe(n),-1)),[s,d]=ce(st(l),A(0,0),-r);return s/a*(s/a)+d/i*(d/i)<=1},r6=(e,t,n=0)=>{switch(t.type){case"polygon":return pO(e,t.data,n);case"ellipse":return MX(e,t.data,n);case"line":return xo(e,t.data,n);case"polyline":return SS(e,t.data,n);case"curve":return ES(e,t.data,n);case"polycurve":return _X(e,t.data,n);default:throw Error(`shape ${t} is not implemented`)}},Fp=(e,t)=>{switch(t.type){case"polygon":return Av(e,t.data);case"line":return!1;case"curve":return!1;case"ellipse":return IX(e,t.data);case"polyline":{let n=Dp(t.data.flat());return Av(e,n)}case"polycurve":return!1;default:throw Error(`shape ${t} is not implemented`)}},_X=(e,t,n)=>t.some(r=>ES(e,r,n)),TX=e=>{let[t,n,r,a]=e;return(i,l)=>Math.pow(1-i,3)*a[l]+3*i*Math.pow(1-i,2)*r[l]+3*Math.pow(i,2)*(1-i)*n[l]+t[l]*Math.pow(i,3)},AX=(e,t=10)=>{let n=TX(e),r=[n(0,0),n(0,1)],a=[],i=0,l=1/t;for(let s=0;s<t;s++)if(i+=l,i<=1){let d=A(n(i,0),n(i,1));a.push(Oe(r,d)),r=d}return a},ES=(e,t,n)=>SS(e,AX(t),n),SS=(e,t,n=1e-4)=>t.some(r=>xo(e,r,n));function kS(e,t,n){return{center:e,halfWidth:t,halfHeight:n}}var RX=(e,t)=>{let{halfWidth:n,halfHeight:r,center:a}=t,i=n,l=r,s=ls(Pe(e),an(Pe(a),-1)),d=Math.abs(s[0]),u=Math.abs(s[1]),o=.707,f=.707;for(let g=0;g<3;g++){let v=i*o,y=l*f,w=(i*i-l*l)*o**3/i,E=(l*l-i*i)*f**3/l,S=v-w,k=y-E,I=d-w,T=u-E,M=Math.hypot(k,S),j=Math.hypot(T,I);o=Math.min(1,Math.max(0,(I*M/j+w)/i)),f=Math.min(1,Math.max(0,(T*M/j+E)/l));let D=Math.hypot(f,o);o/=D,f/=D}let[m,U]=[i*o*Math.sign(s[0]),l*f*Math.sign(s[1])];return yt(st(s),A(m,U))};function jX({center:e,halfWidth:t,halfHeight:n},[r,a]){let[i,l]=e,s=r[0]-i,d=r[1]-l,u=a[0]-i,o=a[1]-l,f=Math.pow(u-s,2)/Math.pow(t,2)+Math.pow(o-d,2)/Math.pow(n,2),m=2*(s*(u-s)/Math.pow(t,2)+d*(o-d)/Math.pow(n,2)),U=Math.pow(s,2)/Math.pow(t,2)+Math.pow(d,2)/Math.pow(n,2)-1,g=(-m+Math.sqrt(Math.pow(m,2)-4*f*U))/(2*f),v=(-m-Math.sqrt(Math.pow(m,2)-4*f*U))/(2*f),y=[A(s+g*(u-s)+i,d+g*(o-d)+l),A(s+v*(u-s)+i,d+v*(o-d)+l)].filter(w=>!isNaN(w[0])&&!isNaN(w[1]));return y.length===2&&Xa(y[0],y[1])?[y[0]]:y}function CS(e,t=0){let n=Ba(Math.min(e.width,e.height),e);if(n<=0){let f=Zg(A(e.x-t,e.y-t),A(e.x+e.width+t,e.y+e.height+t)),m=Oe(A(f[0][0]+n,f[0][1]),A(f[1][0]-n,f[0][1])),U=Oe(A(f[1][0],f[0][1]+n),A(f[1][0],f[1][1]-n)),g=Oe(A(f[0][0]+n,f[1][1]),A(f[1][0]-n,f[1][1])),v=Oe(A(f[0][0],f[1][1]-n),A(f[0][0],f[0][1]+n));return[[m,U,g,v],[]]}let r=A(e.x+e.width/2,e.y+e.height/2),a=Zg(A(e.x,e.y),A(e.x+e.width,e.y+e.height)),i=Oe(A(a[0][0]+n,a[0][1]),A(a[1][0]-n,a[0][1])),l=Oe(A(a[1][0],a[0][1]+n),A(a[1][0],a[1][1]-n)),s=Oe(A(a[0][0]+n,a[1][1]),A(a[1][0]-n,a[1][1])),d=Oe(A(a[0][0],a[1][1]-n),A(a[0][0],a[0][1]+n)),u=[an(ar(Pe(A(a[0][0]-t,a[0][1]-t),r)),t),an(ar(Pe(A(a[1][0]+t,a[0][1]-t),r)),t),an(ar(Pe(A(a[1][0]+t,a[1][1]+t),r)),t),an(ar(Pe(A(a[0][0]-t,a[1][1]+t),r)),t)],o=[el(st(u[0],d[1]),st(u[0],A(d[1][0]+2/3*(a[0][0]-d[1][0]),d[1][1]+2/3*(a[0][1]-d[1][1]))),st(u[0],A(i[0][0]+2/3*(a[0][0]-i[0][0]),i[0][1]+2/3*(a[0][1]-i[0][1]))),st(u[0],i[0])),el(st(u[1],i[1]),st(u[1],A(i[1][0]+2/3*(a[1][0]-i[1][0]),i[1][1]+2/3*(a[0][1]-i[1][1]))),st(u[1],A(l[0][0]+2/3*(a[1][0]-l[0][0]),l[0][1]+2/3*(a[0][1]-l[0][1]))),st(u[1],l[0])),el(st(u[2],l[1]),st(u[2],A(l[1][0]+2/3*(a[1][0]-l[1][0]),l[1][1]+2/3*(a[1][1]-l[1][1]))),st(u[2],A(s[1][0]+2/3*(a[1][0]-s[1][0]),s[1][1]+2/3*(a[1][1]-s[1][1]))),st(u[2],s[1])),el(st(u[3],s[0]),st(u[3],A(s[0][0]+2/3*(a[0][0]-s[0][0]),s[0][1]+2/3*(a[1][1]-s[0][1]))),st(u[3],A(d[0][0]+2/3*(a[0][0]-d[0][0]),d[0][1]+2/3*(a[1][1]-d[0][1]))),st(u[3],d[0]))];return[[Oe(o[0][3],o[1][0]),Oe(o[1][3],o[2][0]),Oe(o[2][3],o[3][0]),Oe(o[3][3],o[0][0])],o]}function MS(e,t=0){var S;let[n,r,a,i,l,s,d,u]=VS(e),o=Ba(Math.abs(n-d),e),f=Ba(Math.abs(i-r),e);if(((S=e.roundness)==null?void 0:S.type)==null){let[k,I,T,M]=[A(e.x+n,e.y+r-t),A(e.x+a+t,e.y+i),A(e.x+l,e.y+s+t),A(e.x+d-t,e.y+u)],j=Oe(A(k[0]+o,k[1]+f),A(I[0]-o,I[1]-f)),D=Oe(A(I[0]-o,I[1]+f),A(T[0]+o,T[1]-f)),P=Oe(A(T[0]-o,T[1]-f),A(M[0]+o,M[1]+f)),N=Oe(A(M[0]+o,M[1]-f),A(k[0]-o,k[1]+f));return[[j,D,P,N],[]]}let m=A(e.x+e.width/2,e.y+e.height/2),[U,g,v,y]=[A(e.x+n,e.y+r),A(e.x+a,e.y+i),A(e.x+l,e.y+s),A(e.x+d,e.y+u)],w=[an(ar(Pe(g,m)),t),an(ar(Pe(v,m)),t),an(ar(Pe(y,m)),t),an(ar(Pe(U,m)),t)],E=[el(st(w[0],A(g[0]-o,g[1]-f)),st(w[0],g),st(w[0],g),st(w[0],A(g[0]-o,g[1]+f))),el(st(w[1],A(v[0]+o,v[1]-f)),st(w[1],v),st(w[1],v),st(w[1],A(v[0]-o,v[1]-f))),el(st(w[2],A(y[0]+o,y[1]+f)),st(w[2],y),st(w[2],y),st(w[2],A(y[0]+o,y[1]-f))),el(st(w[3],A(U[0]-o,U[1]+f)),st(w[3],U),st(w[3],U),st(w[3],A(U[0]+o,U[1]+f)))];return[[Oe(E[0][3],E[1][0]),Oe(E[1][3],E[2][0]),Oe(E[2][3],E[3][0]),Oe(E[3][3],E[0][0])],E]}var a6=e=>{if(e.type==="arrow")return!1;let t=!Na(e.backgroundColor)||Ua(e)||sa(e)||ke(e);return e.type==="line"||e.type==="freedraw"?t&&sl(e.points):t||vt(e)},Sc=({x:e,y:t,element:n,shape:r,threshold:a=10,frameNameBound:i=null})=>{let l=a6(n)&&Fp(A(e,t),r)||r6(A(e,t),r,a);return!l&&i&&(l=Fp(A(e,t),{type:"polygon",data:wS(i).data})),l},R5=(e,t,n,r,a=0)=>{let[i,l,s,d]=Ga(n,r);return i-=a,l-=a,s+=a,d+=a,LE(A(i,l),A(e,t),A(s,d))},LX=(e,t)=>!Sc(e)&&!IS(e.x,e.y,TS(e.element,t))&&R5(e.x,e.y,e.element,t),IS=(e,t,n)=>!!n&&Fp(A(e,t),n),_S=(e,t,n=0)=>{switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return DX(e,t,n);case"diamond":return PX(e,t,n);case"ellipse":return NX(e,t,n);default:throw new Error(`Unimplemented element type '${e.type}'`)}},DX=(e,t,n=0)=>{let r=A(e.x+e.width/2,e.y+e.height/2),a=ce(t[0],r,-e.angle),i=ce(t[1],r,-e.angle),[l,s]=CS(e,n);return[...l.map(d=>df(Oe(a,i),d)).filter(d=>d!=null).map(d=>ce(d,r,e.angle)),...s.flatMap(d=>DE(d,Oe(a,i))).filter(d=>d!=null).map(d=>ce(d,r,e.angle))].filter((d,u,o)=>o.findIndex(f=>Xa(d,f))===u)},PX=(e,t,n=0)=>{let r=A(e.x+e.width/2,e.y+e.height/2),a=ce(t[0],r,-e.angle),i=ce(t[1],r,-e.angle),[l,s]=MS(e,n);return[...l.map(d=>df(Oe(a,i),d)).filter(d=>d!=null).map(d=>ce(d,r,e.angle)),...s.flatMap(d=>DE(d,Oe(a,i))).filter(d=>d!=null).map(d=>ce(d,r,e.angle))].filter((d,u,o)=>o.findIndex(f=>Xa(d,f))===u)},NX=(e,t,n=0)=>{let r=A(e.x+e.width/2,e.y+e.height/2),a=ce(t[0],r,-e.angle),i=ce(t[1],r,-e.angle);return jX(kS(r,e.width/2+n,e.height/2+n),Yg(a,i)).map(l=>ce(l,r,e.angle))},ft={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},B={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:xi?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SLASH:"/",A:"a",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},OX=new Map([[B.Z,ft.Z],[B.Y,ft.Y]]),$X=e=>/^[a-z]$/.test(e.toLowerCase()),i6=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=OX.get(t);return!!(n&&!$X(e.key)&&e.code===n)},ku=e=>e===B.ARROW_LEFT||e===B.ARROW_RIGHT||e===B.ARROW_DOWN||e===B.ARROW_UP,F2=e=>e.altKey,du=e=>e.shiftKey,Fu=e=>e.shiftKey,j5=[{icon:l$,value:"selection",key:B.V,numericKey:B[1],fillable:!0},{icon:s$,value:"rectangle",key:B.R,numericKey:B[2],fillable:!0},{icon:o$,value:"diamond",key:B.D,numericKey:B[3],fillable:!0},{icon:c$,value:"ellipse",key:B.O,numericKey:B[4],fillable:!0},{icon:d$,value:"arrow",key:B.A,numericKey:B[5],fillable:!0},{icon:u$,value:"line",key:B.L,numericKey:B[6],fillable:!0},{icon:uf,value:"freedraw",key:[B.P,B.X],numericKey:B[7],fillable:!1},{icon:JE,value:"text",key:B.T,numericKey:B[8],fillable:!1},{icon:h$,value:"image",key:null,numericKey:B[9],fillable:!1},{icon:p$,value:"eraser",key:B.E,numericKey:B[0],fillable:!1}],zX=e=>{var t;return((t=j5.find((n,r)=>n.numericKey!=null&&e===n.numericKey.toString()||n.key&&(typeof n.key=="string"?n.key===e:n.key.includes(e))))==null?void 0:t.value)||null},qi=(e,t)=>{var n;switch(e.type){case"rectangle":case"diamond":case"frame":case"magicframe":case"embeddable":case"image":case"iframe":case"text":case"selection":return wS(e);case"arrow":case"line":{let r=((n=Qt.get(e))==null?void 0:n[0])??Qt.generateElementShape(e,null)[0],[,,,,a,i]=Ze(e,t);return a6(e)?kX(e,r,A(e.x,e.y),e.angle,A(a,i)):wX(r,A(e.x,e.y),e.angle,A(a,i))}case"ellipse":return xX(e);case"freedraw":{let[,,,,r,a]=Ze(e,t);return SX(e,A(r,a),a6(e))}}},TS=(e,t)=>{let n=Je(e,t);return n?e.type==="arrow"?qi({...n,...Ce.getBoundTextElementPosition(e,n,t)},t):qi(n,t):null},AS=(e,t)=>{let n=Qt.generateElementShape(e,null);if(!n)return null;let r=Ss(n[0]),a=A(0,0),i=0,l=1/0,s=null;for(;i<r.length;){let{op:d,data:u}=r[i];if(d==="move"&&(lr(oO(u),"The returned ops is not compatible with a point"),a=u),d==="bcurveTo"){let o=a,f=A(u[0],u[1]),m=A(u[2],u[3]),U=A(u[4],u[5]),g=yt(U,t);g<l&&(l=g,s=[o,f,m,U]),a=U}i++}return s},RS=(e,t,n,r,a)=>{let i=(d,u)=>Math.pow(1-d,3)*r[u]+3*d*Math.pow(1-d,2)*n[u]+3*Math.pow(d,2)*(1-d)*t[u]+e[u]*Math.pow(d,3),l=i(a,0),s=i(a,1);return A(l,s)},FX=(e,t)=>{let n=AS(e,t);if(!n)return[];let r=[],a=1;for(;a>0;){let i=RS(n[0],n[1],n[2],n[3],a);r.push(A(i[0],i[1])),a-=.05}return r.length&&Xa(r.at(-1),t)&&r.push(A(t[0],t[1])),r},jS=(e,t)=>{let n=[];n[0]=0;let r=FX(e,t),a=0,i=0;for(;a<r.length-1;){let l=yt(r[a],r[a+1]);i+=l,n.push(i),a++}return n},BX=(e,t)=>jS(e,t).at(-1),HX=(e,t,n)=>{let r=jS(e,t),a=r.length-1,i=r.at(-1),l=n*i,s=0,d=a,u=0;for(;s<d;)u=Math.floor(s+(d-s)/2),r[u]<l?s=u+1:d=u;return r[u]>l&&u--,r[u]===l?u/a:1-(u+(l-r[u])/(r[u+1]-r[u]))/a},fi=(e,t)=>{let n={minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height,midX:e.x+e.width/2,midY:e.y+e.height/2},r=A(n.midX,n.midY),[a,i]=ce(A(n.minX,n.minY),r,e.angle),[l,s]=ce(A(n.maxX,n.minY),r,e.angle),[d,u]=ce(A(n.maxX,n.maxY),r,e.angle),[o,f]=ce(A(n.minX,n.maxY),r,e.angle),m=[Math.min(a,l,d,o),Math.min(i,s,u,f),Math.max(a,l,d,o),Math.max(i,s,u,f)];if(t){let[U,g,v,y]=t;return[m[0]-y,m[1]-U,m[2]+g,m[3]+v]}return m},qc=(e,t)=>e[0]>t[0]&&e[0]<t[2]&&e[1]>t[1]&&e[1]<t[3],Ba=(e,t)=>{var n,r,a,i;if(((n=t.roundness)==null?void 0:n.type)===bn.PROPORTIONAL_RADIUS||((r=t.roundness)==null?void 0:r.type)===bn.LEGACY)return e*A2;if(((a=t.roundness)==null?void 0:a.type)===bn.ADAPTIVE_RADIUS){let l=((i=t.roundness)==null?void 0:i.value)??JN,s=l/A2;return e<=s?e*A2:l}return 0},sl=(e,t=1)=>{if(e.length>=3){let[n,r]=[e[0],e[e.length-1]];return yt(n,r)<=Q1/t}return!1},Pn=10,WX=(e,t,n,r,a,i,l)=>{var P,N;let{width:s,height:d}=ol(e),u=n/s,o=r/d,f=(((P=e.crop)==null?void 0:P.x)??0)/u,m=(((N=e.crop)==null?void 0:N.y)??0)/o,U=ce(A(a,i),A(e.x+e.width/2,e.y+e.height/2),-e.angle);a=U[0],i=U[1];let g=e.width,v=e.height,y=e.crop??{x:0,y:0,width:n,height:r,naturalWidth:n,naturalHeight:r},w=y.height,E=y.width,S=e.scale[0]===-1,k=e.scale[1]===-1,I=i-e.y,T=a-e.x;t.includes("n")&&(v=lt(e.height-I,Pn,k?d-m:e.height+m)),t.includes("s")&&(I=i-e.y-e.height,v=lt(e.height+I,Pn,k?e.height+m:d-m)),t.includes("e")&&(T=a-e.x-e.width,g=lt(e.width+T,Pn,S?e.width+f:s-f)),t.includes("w")&&(g=lt(e.width-T,Pn,S?s-f:e.width+f));let M=$=>{$.height=v*o,$.width=g*u};M(y);let j=($,z)=>{M(z),$.includes("n")&&(k||(z.y+=w-z.height)),$.includes("s")&&k&&(z.y+=w-z.height),$.includes("e")&&S&&(z.x+=E-z.width),$.includes("w")&&(S||(z.x+=E-z.width))};switch(t){case"n":{if(l){let $=f+e.width/2,z=s-f-e.width/2,Z=Math.min($,z)*2;g=lt(v*l,Pn,Z),v=g/l}j(t,y),l&&(y.x+=(E-y.width)/2);break}case"s":{if(l){let $=f+e.width/2,z=s-f-e.width/2,Z=Math.min($,z)*2;g=lt(v*l,Pn,Z),v=g/l}j(t,y),l&&(y.x+=(E-y.width)/2);break}case"w":{if(l){let $=m+e.height/2,z=d-m-e.height/2,Z=Math.min($,z)*2;v=lt(g/l,Pn,Z),g=v*l}j(t,y),l&&(y.y+=(w-y.height)/2);break}case"e":{if(l){let $=m+e.height/2,z=d-m-e.height/2,Z=Math.min($,z)*2;v=lt(g/l,Pn,Z),g=v*l}j(t,y),l&&(y.y+=(w-y.height)/2);break}case"ne":{if(l)if(T>-I){let $=k?d-m:m+e.height;v=lt(g/l,Pn,$),g=v*l}else{let $=S?f+e.width:s-f;g=lt(v*l,Pn,$),v=g/l}j(t,y);break}case"nw":{if(l)if(T<I){let $=k?d-m:m+e.height;v=lt(g/l,Pn,$),g=v*l}else{let $=S?s-f:f+e.width;g=lt(v*l,Pn,$),v=g/l}j(t,y);break}case"se":{if(l)if(T>I){let $=k?m+e.height:d-m;v=lt(g/l,Pn,$),g=v*l}else{let $=S?f+e.width:s-f;g=lt(v*l,Pn,$),v=g/l}j(t,y);break}case"sw":{if(l)if(-T>I){let $=k?m+e.height:d-m;v=lt(g/l,Pn,$),g=v*l}else{let $=S?s-f:f+e.width;g=lt(v*l,Pn,$),v=g/l}j(t,y);break}}let D=XX(e,t,g,v,!!l);return Mv(y.width,y.naturalWidth)&&Mv(y.height,y.naturalHeight)&&(y=null),{x:D[0],y:D[1],width:g,height:v,crop:y}},XX=(e,t,n,r,a)=>{let[i,l,s,d]=fs(e,e.width,e.height,!0),u=A(i,l),o=A(s,d),f=Df(u,o),[m,U,g,v]=fs(e,n,r,!0),y=g-m,w=v-U,E=[...u];if(["n","w","nw"].includes(t)&&(E=[o[0]-Math.abs(y),o[1]-Math.abs(w)]),t==="ne"){let j=[u[0],o[1]];E=[j[0],j[1]-Math.abs(w)]}if(t==="sw"){let j=[o[0],u[1]];E=[j[0]-Math.abs(y),j[1]]}a&&(["s","n"].includes(t)&&(E[0]=f[0]-y/2),["e","w"].includes(t)&&(E[1]=f[1]-w/2));let S=e.angle,k=ce(E,f,S),I=[E[0]+Math.abs(y)/2,E[1]+Math.abs(w)/2],T=ce(I,f,S);E=ce(k,T,-S);let M=[...E];return M[0]+=e.x-m,M[1]+=e.y-U,M},VX=(e,t)=>{if(e.crop){let{width:n,height:r}=ol(e),[a,i,l,s,d,u]=Ze(e,t),o=Pe(ce(A(a,i),A(d,u),e.angle)),f=Pe(ce(A(l,i),A(d,u),e.angle)),m=ar(jp(f,o)),U=Pe(ce(A(a,s),A(d,u),e.angle)),g=jp(U,o),v=ar(g),{cropX:y,cropY:w}=GX(e.crop,e.scale),E=ls(ls(o,an(m,-y*n/e.crop.naturalWidth)),an(v,-w*r/e.crop.naturalHeight)),S=st(ls(ls(E,an(m,n/2)),an(v,r/2))),k=ce(st(E),S,-e.angle);return{...e,x:k[0],y:k[1],width:n,height:r,crop:null}}return e},ol=e=>{if(e.crop){let t=e.width/(e.crop.width/e.crop.naturalWidth),n=e.height/(e.crop.height/e.crop.naturalHeight);return{width:t,height:n}}return{width:e.width,height:e.height}},GX=(e,t)=>{let n=e.x,r=e.y,a=t[0]===-1,i=t[1]===-1;return a&&(n=e.naturalWidth-Math.abs(n)-e.width),i&&(r=e.naturalHeight-Math.abs(r)-e.height),{cropX:n,cropY:r}},YX=(e,t=!1)=>{let n=e.crop;if(!n)return null;let r=e.scale[0]===-1,a=e.scale[1]===-1,i=n.x,l=n.y;if(r&&(i=n.naturalWidth-n.width-n.x),a&&(l=n.naturalHeight-n.height-n.y),t)return{x:i,y:l};let{width:s,height:d}=ol(e);return{x:i/(n.naturalWidth/s),y:l/(n.naturalHeight/d)}},LS="invert(100%) hue-rotate(180deg) saturate(1.25)",ZX=wi(),DS=(e,t)=>la(e)&&!t.imageCache.has(e.fileId),PS=(e,t,n)=>{var r;return n.theme===ot.DARK&&la(e)&&!DS(e,t)&&((r=t.imageCache.get(e.fileId))==null?void 0:r.mimeType)!==De.svg},A0=e=>{switch(e.type){case"freedraw":return e.strokeWidth*12;case"text":return e.fontSize/2;default:return 20}},NS=(e,t,n,r,a=1)=>{let i=((t==null?void 0:t.opacity)??100)*e.opacity/1e4*a;return(n.has(e.id)||r&&r.some(l=>l.id===e.id)||t&&n.has(t.id))&&(i*=QN/100),i},KX=(e,t,n)=>{let r=A0(e),[a,i,l,s]=Ze(e,t),d=Ge(e)||ma(e)?nr(a,l):e.width,u=Ge(e)||ma(e)?nr(i,s):e.height,o=d*window.devicePixelRatio+r*2,f=u*window.devicePixelRatio+r*2,m=n.value;return(o*m>32767||f*m>32767)&&(m=Math.min(32767/o,32767/f)),o*f*m*m>16777216&&(m=Math.sqrt(16777216/(o*f))),o=Math.floor(o*m),f=Math.floor(f*m),{width:o,height:f,scale:m}},OS=(e,t,n,r,a)=>{var w,E;let i=document.createElement("canvas"),l=i.getContext("2d"),s=A0(e),{width:d,height:u,scale:o}=KX(e,t,n);if(!d||!u)return null;i.width=d,i.height=u;let f=-100,m=0;if(Ge(e)||ma(e)){let[S,k]=Ze(e,t);f=e.x>S?nr(e.x,S)*window.devicePixelRatio*o:0,m=e.y>k?nr(e.y,k)*window.devicePixelRatio*o:0,l.translate(f,m)}l.save(),l.translate(s*o,s*o),l.scale(window.devicePixelRatio*o,window.devicePixelRatio*o);let U=ws.canvas(i);PS(e,r,a)&&(l.filter=LS),ap(e,U,l,r),l.restore();let g=Je(e,t),v=document.createElement("canvas"),y=v.getContext("2d");if(nt(e)&&g){let[S,k,I,T]=Ze(e,t),M=Math.max(nr(S,I),nr(k,T));v.width=M*window.devicePixelRatio*o+s*o*10,v.height=M*window.devicePixelRatio*o+s*o*10,y.translate(v.width/2,v.height/2),y.rotate(e.angle),y.drawImage(i,-i.width/2,-i.height/2,i.width,i.height);let[,,,,j,D]=Ze(g,t);y.rotate(-e.angle);let P=(v.width-i.width)/2,N=(v.height-i.height)/2,$=v.width/2-(j-S)*window.devicePixelRatio*o-P-s*o,z=v.height/2-(D-k)*window.devicePixelRatio*o-N-s*o;y.translate(-$,-z),y.clearRect(-(g.width/2+wn)*window.devicePixelRatio*o,-(g.height/2+wn)*window.devicePixelRatio*o,(g.width+wn*2)*window.devicePixelRatio*o,(g.height+wn*2)*window.devicePixelRatio*o)}return{element:e,canvas:i,theme:a.theme,scale:o,zoomValue:n.value,canvasOffsetX:f,canvasOffsetY:m,boundTextElementVersion:((w=Je(e,t))==null?void 0:w.version)||null,containingFrameOpacity:((E=jr(e,t))==null?void 0:E.opacity)||100,boundTextCanvas:v,angle:e.angle,imageCrop:vt(e)?e.crop:null}},qX=14,$S=document.createElement("img");$S.src=`data:${De.svg},${encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>')}`;var zS=document.createElement("img");zS.src=`data:${De.svg},${encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>')}`;var QX=(e,t)=>{t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);let n=Math.min(e.width,e.height),r=Math.min(n,Math.min(n*.4,100));t.drawImage(e.status==="error"?zS:$S,e.width/2-r/2,e.height/2-r/2,r,r)},ap=(e,t,n,r,a)=>{var i;switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":{n.lineJoin="round",n.lineCap="round",t.draw(Qt.get(e));break}case"arrow":case"line":{n.lineJoin="round",n.lineCap="round",Qt.get(e).forEach(l=>{t.draw(l)});break}case"freedraw":{n.save(),n.fillStyle=e.strokeColor;let l=tV(e),s=Qt.get(e);s&&t.draw(s),n.fillStyle=e.strokeColor,n.fill(l),n.restore();break}case"image":{let l=la(e)?(i=r.imageCache.get(e.fileId))==null?void 0:i.image:void 0;if(l!=null&&!(l instanceof Promise)){e.roundness&&n.roundRect&&(n.beginPath(),n.roundRect(0,0,e.width,e.height,Ba(Math.min(e.width,e.height),e)),n.clip());let{x:s,y:d,width:u,height:o}=e.crop?e.crop:{x:0,y:0,width:l.naturalWidth,height:l.naturalHeight};n.drawImage(l,s,d,u,o,0,0,e.width,e.height)}else QX(e,n);break}default:if(ke(e)){let l=OE(e.text),s=l&&!n.canvas.isConnected;s&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",l?"rtl":"ltr"),n.save(),n.font=_t(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;let d=e.text.replace(/\r\n?/g,`
|
|
55
|
+
`).split(`
|
|
56
|
+
`),u=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,o=Nf(e.fontSize,e.lineHeight),f=xS(e.fontFamily,e.fontSize,o);for(let m=0;m<d.length;m++)n.fillText(d[m],u,m*o+f);n.restore(),s&&n.canvas.remove()}else throw new Error(`Unimplemented type ${e.type}`)}},l6=new WeakMap,ay=(e,t,n,r)=>{var f;let a=n?r.zoom:ZX.zoom,i=l6.get(e),l=i&&i.zoomValue!==a.value&&!(r!=null&&r.shouldCacheIgnoreZoom),s=Je(e,t),d=(s==null?void 0:s.version)||null,u=vt(e)?e.crop:null,o=((f=jr(e,t))==null?void 0:f.opacity)||100;if(!i||l||i.theme!==r.theme||i.boundTextElementVersion!==d||i.imageCrop!==u||i.containingFrameOpacity!==o||nt(e)&&s&&e.angle!==i.angle){let m=OS(e,t,a,n,r);return m?(l6.set(e,m),m):null}return i},B2=(e,t,n,r,a)=>{let i=e.element,l=A0(i),s=e.scale,[d,u,o,f]=Ze(i,a),m=((d+o)/2+r.scrollX)*window.devicePixelRatio,U=((u+f)/2+r.scrollY)*window.devicePixelRatio;t.save(),t.scale(1/window.devicePixelRatio,1/window.devicePixelRatio);let g=Je(i,a);if(nt(i)&&g){let v=(e.boundTextCanvas.width-e.canvas.width)/2,y=(e.boundTextCanvas.height-e.canvas.height)/2;t.translate(m,U),t.drawImage(e.boundTextCanvas,-(o-d)/2*window.devicePixelRatio-v/s-l,-(f-u)/2*window.devicePixelRatio-y/s-l,e.boundTextCanvas.width/s,e.boundTextCanvas.height/s)}else t.translate(m,U),t.rotate(i.angle),"scale"in e.element&&!DS(i,n)&&t.scale(e.element.scale[0],e.element.scale[1]),t.translate(-m,-U),t.drawImage(e.canvas,(d+r.scrollX)*window.devicePixelRatio-l*e.scale/e.scale,(u+r.scrollY)*window.devicePixelRatio-l*e.scale/e.scale,e.canvas.width/e.scale,e.canvas.height/e.scale),et.VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX;t.restore()},JX=(e,t,n,r)=>{t.save(),t.translate(e.x+n.scrollX,e.y+n.scrollY),t.fillStyle="rgba(0, 0, 200, 0.04)";let a=.5/n.zoom.value;t.fillRect(a,a,e.width,e.height),t.lineWidth=1/n.zoom.value,t.strokeStyle=r,t.strokeRect(a,a,e.width,e.height),t.restore()},qs=(e,t,n,r,a,i,l)=>{var d;let s=((d=l.openDialog)==null?void 0:d.name)==="elementLinkSelector"&&!l.selectedElementIds[e.id]&&!l.hoveredElementIds[e.id];switch(a.globalAlpha=NS(e,jr(e,t),i.elementsPendingErasure,i.pendingFlowchartNodes,s?AE:1),e.type){case"magicframe":case"frame":{l.frameRendering.enabled&&l.frameRendering.outline&&(a.save(),a.translate(e.x+l.scrollX,e.y+l.scrollY),a.fillStyle="rgba(0, 0, 200, 0.04)",a.lineWidth=Kt.strokeWidth/l.zoom.value,a.strokeStyle=Kt.strokeColor,tp(e)&&(a.strokeStyle=l.theme===ot.LIGHT?"#7affd7":"#1d8264"),a.roundRect?(a.beginPath(),a.roundRect(0,0,e.width,e.height,Kt.radius/l.zoom.value),a.stroke(),a.closePath()):a.strokeRect(0,0,e.width,e.height),a.restore());break}case"freedraw":{if(Qt.generateElementShape(e,null),i.isExporting){let[u,o,f,m]=Ze(e,t),U=(u+f)/2+l.scrollX,g=(o+m)/2+l.scrollY,v=(f-u)/2-(e.x-u),y=(m-o)/2-(e.y-o);a.save(),a.translate(U,g),a.rotate(e.angle),a.translate(-v,-y),ap(e,r,a,i),a.restore()}else{let u=ay(e,n,i,l);if(!u)return;B2(u,a,i,l,n)}break}case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":case"iframe":case"embeddable":{if(Qt.generateElementShape(e,i),i.isExporting){let[u,o,f,m]=Ze(e,t),U=(u+f)/2+l.scrollX,g=(o+m)/2+l.scrollY,v=(f-u)/2-(e.x-u),y=(m-o)/2-(e.y-o);if(ke(e)){let E=Bn(e,t);if(nt(E)){let S=Ce.getBoundTextElementPosition(E,e,t);v=(f-u)/2-(S.x-u),y=(m-o)/2-(S.y-o)}}a.save(),a.translate(U,g),PS(e,i,l)&&(a.filter="none");let w=Je(e,t);if(nt(e)&&w){let E=document.createElement("canvas"),S=E.getContext("2d"),k=Math.max(nr(u,f),nr(o,m)),I=A0(e);E.width=k*l.exportScale+I*10*l.exportScale,E.height=k*l.exportScale+I*10*l.exportScale,S.translate(E.width/2,E.height/2),S.scale(l.exportScale,l.exportScale),v=e.width/2-(e.x-u),y=e.height/2-(e.y-o),S.rotate(e.angle);let T=ws.canvas(E);S.translate(-v,-y),ap(e,T,S,i),S.translate(v,y),S.rotate(-e.angle);let[,,,,M,j]=Ze(w,t),D=(u+f)/2-M,P=(o+m)/2-j;S.translate(-D,-P),S.clearRect(-w.width/2,-w.height/2,w.width,w.height),a.scale(1/l.exportScale,1/l.exportScale),a.drawImage(E,-E.width/2,-E.height/2,E.width,E.height)}else a.rotate(e.angle),e.type==="image"&&a.scale(e.scale[0],e.scale[1]),a.translate(-v,-y),ap(e,r,a,i);a.restore()}else{let u=ay(e,n,i,l);if(!u)return;let o=a.imageSmoothingEnabled;if(!(l!=null&&l.shouldCacheIgnoreZoom)&&(!e.angle||iO(e.angle))&&(a.imageSmoothingEnabled=!1),e.id===l.croppingElementId&&vt(u.element)&&u.element.crop!==null){a.save(),a.globalAlpha=.1;let f=OS(VX(u.element,t),n,l.zoom,i,l);f&&B2(f,a,i,l,n),a.restore()}B2(u,a,i,l,n),a.imageSmoothingEnabled=o}break}default:throw new Error(`Unimplemented type ${e.type}`)}a.globalAlpha=1},FS=new WeakMap([]);function eV(e){let t=L5(e),n=new Path2D(t);return FS.set(e,n),n}function tV(e){return FS.get(e)}function L5(e){let t=e.simulatePressure?e.points:e.points.length?e.points.map(([r,a],i)=>[r,a,e.pressures[i]]):[[0,0,.5]],n={simulatePressure:e.simulatePressure,size:e.strokeWidth*4.25,thinning:.6,smoothing:.5,streamline:.5,easing:r=>Math.sin(r*Math.PI/2),last:!!e.lastCommittedPoint};return rV(sN(t,n))}function iy(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var nV=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;function rV(e){if(!e.length)return"";let t=e.length-1;return e.reduce((n,r,a,i)=>(a===t?n.push(r,iy(r,i[0]),"L",i[0],"Z"):n.push(r,iy(r,i[a+1])),n),["M",e[0],"Q"]).join(" ").replace(nV,"$1")}var Qc=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="line"||e==="freedraw",s6=e=>e!=="image"&&e!=="frame"&&e!=="magicframe",ly=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="freedraw"||e==="arrow"||e==="line",sy=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="arrow"||e==="line",o6=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="line"||e==="diamond"||e==="image",oy=e=>e==="arrow",Bp=e=>e==="arrow",rn=[1,0],zn=[0,1],Mr=[-1,0],Ir=[0,-1],k1=(e,t)=>{let n=Lf(Math.atan2(t[1]-e[1],t[0]-e[0]));return n>=315||n<45?Ir:n>=45&&n<135?rn:n>=135&&n<225?zn:Mr},Mo=e=>{let[t,n]=e,r=Math.abs(t),a=Math.abs(n);return t>a?rn:t<=-a?Mr:n>r?zn:Ir},ff=(e,t)=>Mo(Pe(e,t)),Qi=(e,t)=>tl(ff(e,t)),ln=(e,t)=>e[0]===t[0]&&e[1]===t[1],tl=e=>ln(e,rn)||ln(e,Mr),BS=(e,t,n)=>{let r=N5(t);if(e.type==="diamond"){if(n[0]<e.x)return Mr;if(n[1]<e.y)return Ir;if(n[0]>e.x+e.width)return rn;if(n[1]>e.y+e.height)return zn;let d=ce(Vi(A(e.x+e.width/2,e.y),r,2),r,e.angle),u=ce(Vi(A(e.x+e.width,e.y+e.height/2),r,2),r,e.angle),o=ce(Vi(A(e.x+e.width/2,e.y+e.height),r,2),r,e.angle),f=ce(Vi(A(e.x,e.y+e.height/2),r,2),r,e.angle);return pc([d,u,r],n)?k1(d,u):pc([u,o,r],n)?k1(u,o):pc([o,f,r],n)?k1(o,f):k1(f,d)}let a=Vi(A(t[0],t[1]),r,2),i=Vi(A(t[2],t[1]),r,2),l=Vi(A(t[0],t[3]),r,2),s=Vi(A(t[2],t[3]),r,2);return pc([a,i,r],n)?Ir:pc([i,s,r],n)?rn:pc([s,l,r],n)?zn:Mr},HS=e=>[e[0]===0?0:e[0]>0?-1:1,e[1]===0?0:e[1]>0?-1:1],aV=e=>[8,8+e],WS=e=>[1.5,6+e];function iV(e){let t=e.roughness,n=Math.max(e.width,e.height),r=Math.min(e.width,e.height);return r>=20&&n>=50||r>=15&&e.roundness&&o6(e.type)||Ge(e)&&n>=50?t:Math.min(t/(n<10?3:2),2.5)}var zr=(e,t=!1)=>{let n={seed:e.seed,strokeLineDash:e.strokeStyle==="dashed"?aV(e.strokeWidth):e.strokeStyle==="dotted"?WS(e.strokeWidth):void 0,disableMultiStroke:e.strokeStyle!=="solid",strokeWidth:e.strokeStyle!=="solid"?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:e.strokeWidth*4,roughness:iV(e),stroke:e.strokeColor,preserveVertices:t||e.roughness<IE.cartoonist};switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill=Na(e.backgroundColor)?void 0:e.backgroundColor,e.type==="ellipse"&&(n.curveFitting=1),n;case"line":case"freedraw":return sl(e.points)&&(n.fillStyle=e.fillStyle,n.fill=e.backgroundColor==="transparent"?void 0:e.backgroundColor),n;case"arrow":return n;default:throw new Error(`Unimplemented type ${e.type}`)}},cy=(e,t,n)=>sa(e)&&(t||Cr(e)&&(n==null?void 0:n.get(e.id))!==!0)&&Na(e.backgroundColor)&&Na(e.strokeColor)?{...e,roughness:0,backgroundColor:"#d3d3d3",fillStyle:"solid"}:es(e)?{...e,strokeColor:Na(e.strokeColor)?"#000000":e.strokeColor,backgroundColor:Na(e.backgroundColor)?"#f4f4f6":e.backgroundColor}:e,dy=(e,t,n,r,a,i,l)=>{let s=py(e,t,n,r);if(s===null)return[];let d=(u,o)=>{if(u===null)return[];let[,,f,m,U,g]=u;return[a.line(f,m,U,g,o)]};switch(r){case"dot":case"circle":case"circle_outline":{let[u,o,f]=s;return delete i.strokeLineDash,[a.circle(u,o,f,{...i,fill:r==="circle_outline"?l:e.strokeColor,fillStyle:"solid",stroke:e.strokeColor,roughness:Math.min(.5,i.roughness||0)})]}case"triangle":case"triangle_outline":{let[u,o,f,m,U,g]=s;return delete i.strokeLineDash,[a.polygon([[u,o],[f,m],[U,g],[u,o]],{...i,fill:r==="triangle_outline"?l:e.strokeColor,fillStyle:"solid",roughness:Math.min(1,i.roughness||0)})]}case"diamond":case"diamond_outline":{let[u,o,f,m,U,g,v,y]=s;return delete i.strokeLineDash,[a.polygon([[u,o],[f,m],[U,g],[v,y],[u,o]],{...i,fill:r==="diamond_outline"?l:e.strokeColor,fillStyle:"solid",roughness:Math.min(1,i.roughness||0)})]}case"crowfoot_one":return d(s,i);case"bar":case"arrow":case"crowfoot_many":case"crowfoot_one_or_many":default:{let[u,o,f,m,U,g]=s;if(e.strokeStyle==="dotted"){let v=WS(e.strokeWidth-1);i.strokeLineDash=[v[0],v[1]-1]}else delete i.strokeLineDash;return i.roughness=Math.min(1,i.roughness||0),[a.line(f,m,u,o,i),a.line(U,g,u,o,i),...r==="crowfoot_one_or_many"?d(py(e,t,n,"crowfoot_one"),i):[]]}}},lV=(e,t,{isExporting:n,canvasBackgroundColor:r,embedsValidationStatus:a})=>{switch(e.type){case"rectangle":case"iframe":case"embeddable":{let i;if(e.roundness){let l=e.width,s=e.height,d=Ba(Math.min(l,s),e);i=t.path(`M ${d} 0 L ${l-d} 0 Q ${l} 0, ${l} ${d} L ${l} ${s-d} Q ${l} ${s}, ${l-d} ${s} L ${d} ${s} Q 0 ${s}, 0 ${s-d} L 0 ${d} Q 0 0, ${d} 0`,zr(cy(e,n,a),!0))}else i=t.rectangle(0,0,e.width,e.height,zr(cy(e,n,a),!1));return i}case"diamond":{let i,[l,s,d,u,o,f,m,U]=VS(e);if(e.roundness){let g=Ba(Math.abs(l-m),e),v=Ba(Math.abs(u-s),e);i=t.path(`M ${l+g} ${s+v} L ${d-g} ${u-v}
|
|
57
|
+
C ${d} ${u}, ${d} ${u}, ${d-g} ${u+v}
|
|
58
|
+
L ${o+g} ${f-v}
|
|
59
|
+
C ${o} ${f}, ${o} ${f}, ${o-g} ${f-v}
|
|
60
|
+
L ${m+g} ${U+v}
|
|
61
|
+
C ${m} ${U}, ${m} ${U}, ${m+g} ${U-v}
|
|
62
|
+
L ${l-g} ${s+v}
|
|
63
|
+
C ${l} ${s}, ${l} ${s}, ${l+g} ${s+v}`,zr(e,!0))}else i=t.polygon([[l,s],[d,u],[o,f],[m,U]],zr(e));return i}case"ellipse":return t.ellipse(e.width/2,e.height/2,e.width,e.height,zr(e));case"line":case"arrow":{let i,l=zr(e),s=e.points.length?e.points:[A(0,0)];if(Me(e)?s.every(d=>Math.abs(d[0])<=1e6&&Math.abs(d[1])<=1e6)?i=[t.path(sV(s,16),zr(e,!0))]:(console.error("Elbow arrow with extreme point positions detected. Arrow not rendered.",e.id,JSON.stringify(s)),i=[]):e.roundness?i=[t.curve(s,l)]:l.fill?i=[t.polygon(s,l)]:i=[t.linearPath(s,l)],e.type==="arrow"){let{startArrowhead:d=null,endArrowhead:u="arrow"}=e;if(d!==null){let o=dy(e,i,"start",d,t,l,r);i.push(...o)}if(u!==null){let o=dy(e,i,"end",u,t,l,r);i.push(...o)}}return i}case"freedraw":{let i;if(eV(e),sl(e.points)){let l=uN(e.points,.75);i=t.curve(l,{...zr(e),stroke:"none"})}else i=null;return i}case"frame":case"magicframe":case"text":case"image":return null;default:return wo(e,`generateElementShape(): Unimplemented type ${e==null?void 0:e.type}`),null}},sV=(e,t)=>{let n=[];for(let a=1;a<e.length-1;a+=1){let i=e[a-1],l=e[a+1],s=e[a],d=Qi(s,i),u=Qi(l,s),o=Math.min(t,yt(e[a],l)/2,yt(e[a],i)/2);d?i[0]<s[0]?n.push([e[a][0]-o,e[a][1]]):n.push([e[a][0]+o,e[a][1]]):i[1]<s[1]?n.push([e[a][0],e[a][1]-o]):n.push([e[a][0],e[a][1]+o]),n.push(e[a]),u?l[0]<s[0]?n.push([e[a][0]-o,e[a][1]]):n.push([e[a][0]+o,e[a][1]]):l[1]<s[1]?n.push([e[a][0],e[a][1]-o]):n.push([e[a][0],e[a][1]+o])}let r=[`M ${e[0][0]} ${e[0][1]}`];for(let a=0;a<n.length;a+=3)r.push(`L ${n[a][0]} ${n[a][1]}`),r.push(`Q ${n[a+1][0]} ${n[a+1][1]}, ${n[a+2][0]} ${n[a+2][1]}`);return r.push(`L ${e[e.length-1][0]} ${e[e.length-1][1]}`),r.join(" ")},Jc=e=>{let t=e.map(r=>r[0]),n=e.map(r=>r[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},Hp=(e,t,n,r)=>{let a=n.map(m=>m[e]),i=Math.max(...a),l=Math.min(...a),s=i-l,d=s===0?1:t/s,u=1/0,o=n.map(m=>{let U=m[e]*d,g=[...m];return g[e]=U,U<u&&(u=U),g});if(!r||o.length===2)return o;let f=l-u;return o.map(m=>m.map((U,g)=>g===e?U+f:U))},XS=class ip{static getBounds(t,n){let r=ip.boundsCache.get(t);if(r!=null&&r.version&&r.version===t.version&&!Ft(t))return r.bounds;let a=ip.calculateBounds(t,n);return ip.boundsCache.set(t,{version:t.version,bounds:a}),a}static calculateBounds(t,n){let r,[a,i,l,s,d,u]=Ze(t,n);if(ma(t)){let[o,f,m,U]=D5(t.points.map(([g,v])=>ce(A(g,v),A(d-t.x,u-t.y),t.angle)));return[o+t.x,f+t.y,m+t.x,U+t.y]}else if(Ge(t))r=pV(t,d,u,n);else if(t.type==="diamond"){let[o,f]=ce(A(d,i),A(d,u),t.angle),[m,U]=ce(A(d,s),A(d,u),t.angle),[g,v]=ce(A(a,u),A(d,u),t.angle),[y,w]=ce(A(l,u),A(d,u),t.angle),E=Math.min(o,m,g,y),S=Math.min(f,U,v,w),k=Math.max(o,m,g,y),I=Math.max(f,U,v,w);r=[E,S,k,I]}else if(t.type==="ellipse"){let o=(l-a)/2,f=(s-i)/2,m=Math.cos(t.angle),U=Math.sin(t.angle),g=Math.hypot(o*m,f*U),v=Math.hypot(f*m,o*U);r=[d-g,u-v,d+g,u+v]}else{let[o,f]=ce(A(a,i),A(d,u),t.angle),[m,U]=ce(A(a,s),A(d,u),t.angle),[g,v]=ce(A(l,s),A(d,u),t.angle),[y,w]=ce(A(l,i),A(d,u),t.angle),E=Math.min(o,m,g,y),S=Math.min(f,U,v,w),k=Math.max(o,m,g,y),I=Math.max(f,U,v,w);r=[E,S,k,I]}return r}};F(XS,"boundsCache",new WeakMap);var oV=XS,Ze=(e,t,n=!1)=>{if(ma(e))return dV(e);if(Ge(e))return Ce.getElementAbsoluteCoords(e,t,n);if(ke(e)){let r=t?Bn(e,t):null;if(nt(r)){let{x:a,y:i}=Ce.getBoundTextElementPosition(r,e,t);return[a,i,a+e.width,i+e.height,a+e.width/2,i+e.height/2]}}return[e.x,e.y,e.x+e.width,e.y+e.height,e.x+e.width/2,e.y+e.height/2]},uy=(e,t)=>{let[n,r,a,i,l,s]=Ze(e,t),d=A(l,s);if(Ge(e)||ma(e)){let w=[],E=0;for(;E<e.points.length-1;)w.push(Oe(ce(A(e.points[E][0]+e.x,e.points[E][1]+e.y),d,e.angle),ce(A(e.points[E+1][0]+e.x,e.points[E+1][1]+e.y),d,e.angle))),E++;return w}let[u,o,f,m,U,g,v,y]=[[n,r],[a,r],[n,i],[a,i],[l,r],[l,i],[n,s],[a,s]].map(w=>ce(w,d,e.angle));return e.type==="diamond"?[Oe(U,v),Oe(U,y),Oe(g,v),Oe(g,y)]:e.type==="ellipse"?[Oe(U,v),Oe(U,y),Oe(g,v),Oe(g,y),Oe(U,v),Oe(U,y),Oe(g,v),Oe(g,y)]:[Oe(u,o),Oe(f,m),Oe(u,f),Oe(o,m),Oe(u,y),Oe(f,y),Oe(o,v),Oe(m,v)]},VS=e=>{let t=Math.floor(e.width/2)+1,n=0,r=e.width,a=Math.floor(e.height/2)+1,i=t,l=e.height;return[t,n,r,a,i,l,0,a]},fy=(e,t,n,r,a)=>{let i=1-e;return Math.pow(i,3)*t+3*Math.pow(i,2)*e*n+3*i*Math.pow(e,2)*r+Math.pow(e,3)*a},hy=(e,t,n,r)=>{let a=t-e,i=n-t,l=r-n,s=3*a-6*i+3*l,d=6*i-6*a,u=3*a,o=d*d-4*s*u;if(!(o>=0))return!1;let f=null,m=null,U=1/0,g=1/0;return s===0?U=g=-u/d:(U=(-d+Math.sqrt(o))/(2*s),g=(-d-Math.sqrt(o))/(2*s)),U>=0&&U<=1&&(f=fy(U,e,t,n,r)),g>=0&&g<=1&&(m=fy(g,e,t,n,r)),[f,m]},cV=(e,t,n,r)=>{let a=hy(e[0],t[0],n[0],r[0]),i=hy(e[1],t[1],n[1],r[1]),l=Math.min(e[0],r[0]),s=Math.max(e[0],r[0]);if(a){let o=a.filter(f=>f!==null);l=Math.min(l,...o),s=Math.max(s,...o)}let d=Math.min(e[1],r[1]),u=Math.max(e[1],r[1]);if(i){let o=i.filter(f=>f!==null);d=Math.min(d,...o),u=Math.max(u,...o)}return[l,d,s,u]},R0=(e,t)=>{let n=A(0,0),{minX:r,minY:a,maxX:i,maxY:l}=e.reduce((s,{op:d,data:u})=>{if(d==="move"){let o=g5(u);lr(o!=null,"Op data is not a point"),n=o}else if(d==="bcurveTo"){let o=A(u[0],u[1]),f=A(u[2],u[3]),m=A(u[4],u[5]),U=t?t(o):o,g=t?t(f):f,v=t?t(m):m,y=t?t(n):n;n=m;let[w,E,S,k]=cV(y,U,g,v);s.minX=Math.min(s.minX,w),s.minY=Math.min(s.minY,E),s.maxX=Math.max(s.maxX,S),s.maxY=Math.max(s.maxY,k)}return s},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,a,i,l]},D5=e=>{let t=1/0,n=1/0,r=-1/0,a=-1/0;for(let[i,l]of e)t=Math.min(t,i),n=Math.min(n,l),r=Math.max(r,i),a=Math.max(a,l);return[t,n,r,a]},dV=e=>{let[t,n,r,a]=D5(e.points),i=t+e.x,l=n+e.y,s=r+e.x,d=a+e.y;return[i,l,s,d,(i+s)/2,(l+d)/2]},uV=e=>{switch(e){case"arrow":return 25;case"diamond":case"diamond_outline":return 12;case"crowfoot_many":case"crowfoot_one":case"crowfoot_one_or_many":return 20;default:return 15}},fV=e=>{switch(e){case"bar":return 90;case"arrow":return 20;default:return 25}},py=(e,t,n,r)=>{if(t.length<1)return null;let a=Ss(t[0]);if(a.length<1)return null;let i=n==="start"?1:a.length-1,l=a[i].data;lr(l.length===6,"Op data length is not 6");let s=A(l[4],l[5]),d=A(l[2],l[3]),u=A(l[0],l[1]),o=a[i-1],f=A(0,0);if(o.op==="move"){let Z=g5(o.data);lr(Z!=null,"Op data is not a point"),f=Z}else o.op==="bcurveTo"&&(f=A(o.data[4],o.data[5]));let m=(Z,K)=>Math.pow(1-Z,3)*s[K]+3*Z*Math.pow(1-Z,2)*d[K]+3*Math.pow(Z,2)*(1-Z)*u[K]+f[K]*Math.pow(Z,3),[U,g]=n==="start"?f:s,[v,y]=[m(.3,0),m(.3,1)],w=Math.hypot(U-v,g-y),E=(U-v)/w,S=(g-y)/w,k=uV(r),I=0;{let[Z,K]=n==="end"?e.points[e.points.length-1]:e.points[0],[Q,W]=e.points.length>1?n==="end"?e.points[e.points.length-2]:e.points[1]:[0,0];I=Math.hypot(Z-Q,K-W)}let T=Math.min(k,I*(r==="diamond"||r==="diamond_outline"?.25:.5)),M=U-E*T,j=g-S*T;if(r==="dot"||r==="circle"||r==="circle_outline"){let Z=Math.hypot(j-g,M-U)+e.strokeWidth-2;return[U,g,Z]}let D=fV(r);if(r==="crowfoot_many"||r==="crowfoot_one_or_many"){let[Z,K]=ce(A(U,g),A(M,j),oo(-D)),[Q,W]=ce(A(U,g),A(M,j),oo(D));return[M,j,Z,K,Q,W]}let[P,N]=ce(A(M,j),A(U,g),-D*Math.PI/180),[$,z]=ce(A(M,j),A(U,g),oo(D));if(r==="diamond"||r==="diamond_outline"){let Z,K;if(n==="start"){let[Q,W]=e.points.length>1?e.points[1]:[0,0];[Z,K]=ce(A(U+T*2,g),A(U,g),Math.atan2(W-g,Q-U))}else{let[Q,W]=e.points.length>1?e.points[e.points.length-2]:[0,0];[Z,K]=ce(A(U-T*2,g),A(U,g),Math.atan2(g-W,U-Q))}return[U,g,P,N,Z,K,$,z]}return[U,g,P,N,$,z]},hV=e=>{let t=ws.generator(),n=zr(e),r=e.roundness?"curve":n.fill?"polygon":"linearPath";return t[r](e.points,n)},pV=(e,t,n,r)=>{var u;let a=Je(e,r);if(e.points.length<2){let[o,f]=e.points[0],[m,U]=ce(A(e.x+o,e.y+f),A(t,n),e.angle),g=[m,U,m,U];if(a){let v=Ce.getMinMaxXYWithBoundText(e,r,[m,U,m,U],a);g=[v[0],v[1],v[2],v[3]]}return g}let i=((u=Qt.get(e))==null?void 0:u[0])??hV(e),l=Ss(i),s=R0(l,([o,f])=>ce(A(e.x+o,e.y+f),A(t,n),e.angle)),d=[s[0],s[1],s[2],s[3]];if(a){let o=Ce.getMinMaxXYWithBoundText(e,r,d,a);d=[o[0],o[1],o[2],o[3]]}return d},Ga=(e,t)=>oV.getBounds(e,t),xt=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=-1/0,a=1/0,i=-1/0,l=t||We(e);return e.forEach(s=>{let[d,u,o,f]=Ga(s,l);n=Math.min(n,d),a=Math.min(a,u),r=Math.max(r,o),i=Math.max(i,f)}),[n,a,r,i]},P5=(e,t)=>{let[n,r,a,i]=xt(e);return[n+t.x,r+t.y,a+t.x,i+t.y]},fs=(e,t,n,r)=>{if(!(Ge(e)||ma(e)))return[e.x,e.y,e.x+t,e.y+n];let a=Hp(0,t,Hp(1,n,e.points,r),r),i;if(ma(e))i=D5(a);else{let o=ws.generator(),f=e.roundness?o.curve(a,zr(e)):o.linearPath(a,zr(e)),m=Ss(f);i=R0(m)}let[l,s,d,u]=i;return[l+e.x,s+e.y,d+e.x,u+e.y]},my=(e,t)=>{let n=ws.generator(),r=e.roundness==null?n.linearPath(t,zr(e)):n.curve(t,zr(e)),a=Ss(r),[i,l,s,d]=R0(a);return[i+e.x,l+e.y,s+e.x,d+e.y]},mV=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=e[0],a=We(e);return e.forEach(i=>{let[l,s,d,u]=Ga(i,a),o=yt(A((l+d)/2,(s+u)/2),A(t.x,t.y));o<n&&(n=o,r=i)}),Ga(r,a)},Ha=e=>{let[t,n,r,a]=xt(e);return{minX:t,minY:n,maxX:r,maxY:a,width:r-t,height:a-n,midX:(t+r)/2,midY:(n+a)/2}},GS=({scrollX:e,scrollY:t,width:n,height:r,zoom:a})=>[-e,-t,-e+n/a.value,-t+r/a.value],N5=e=>A(e[0]+(e[2]-e[0])/2,e[1]+(e[3]-e[1])/2),UV=(e,t)=>{if(e==null||t==null)return!1;let[n,r,a,i]=e,[l,s,d,u]=t;return n<d&&a>l&&r<u&&i>s},j0=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return gV(e,t);case"diamond":return bV(e,t);case"ellipse":return vV(e,t)}},gV=(e,t)=>{let n=A(e.x+e.width/2,e.y+e.height/2),r=ce(t,n,-e.angle),[a,i]=CS(e);return Math.min(...a.map(l=>b5(r,l)),...i.map(l=>PE(l,r)).filter(l=>l!==null))},bV=(e,t)=>{let n=A(e.x+e.width/2,e.y+e.height/2),r=ce(t,n,-e.angle),[a,i]=MS(e);return Math.min(...a.map(l=>b5(r,l)),...i.map(l=>PE(l,r)).filter(l=>l!==null))},vV=(e,t)=>{let n=A(e.x+e.width/2,e.y+e.height/2);return RX(ce(t,n,-e.angle),kS(n,e.width/2,e.height/2))},yV=e=>!e[B.CTRL_OR_CMD],io=e=>e.isBindingEnabled,Pt=5,O5=10,$5=4,xV=(e,t)=>{let n=[];return t.forEach(r=>{let a=e.getNonDeletedElement(r);a!=null&&n.push(a)}),n},L0=(e,t,n,r,a)=>{let i=new Set,l=new Set;Uy(e,t,n,"start",i,l,r),Uy(e,n,t,"end",i,l,r);let s=Array.from(l).filter(d=>!i.has(d));xV(a,s).forEach(d=>{var u;pe(d,{boundElements:(u=d.boundElements)==null?void 0:u.filter(o=>o.type!=="arrow"||o.id!==e.id)})})},Uy=(e,t,n,r,a,i,l)=>{if(t!=="keep"){if(t===null){let s=CV(e,r);s!=null&&i.add(s);return}qS(e)?(n==null||(n==="keep"?!ZS(e,t,r):r==="start"||n.id!==t.id))&&(Ei(e,t,r,l),a.add(t.id)):(Ei(e,t,r,l),a.add(t.id))}},wV=(e,t,n,r)=>{var l,s;let a=QS(e,t,n),i=t==="start"?(l=e.startBinding)==null?void 0:l.elementId:(s=e.endBinding)==null?void 0:s.elementId;if(i){let d=n.get(i);if(Va(d)&&lp(d,a,n,r))return d}return null},YS=(e,t,n)=>["start","end"].map(r=>wV(e,r,t,n)),EV=(e,t,n,r,a,i)=>{let l=e.points.length-1,s=n.findIndex(f=>f===0)>-1,d=n.findIndex(f=>f===l)>-1,u=s?t?_c(e,"start",r,a,i):null:Me(e)?"keep":_c(e,"start",r,a,i),o=d?t?_c(e,"end",r,a,i):null:Me(e)?"keep":_c(e,"end",r,a,i);return[u,o]},SV=(e,t,n,r,a)=>{if(Me(e))return["keep","keep"];let[i,l]=YS(e,t,a),s=i&&r?_c(e,"start",t,n,a):null,d=l&&r?_c(e,"end",t,n,a):null;return[s,d]},Wp=(e,t,n,r,a,i,l)=>{e.forEach(s=>{let[d,u]=i!=null&&i.length?EV(s,a,i??[],t,n,l):SV(s,t,n,a,l);L0(s,d,u,t,r)})},H2=(e,t,n)=>e.length>50?[]:e.filter(Ge).flatMap(r=>YS(r,t,n)).filter(r=>r!==null).filter(r=>e.filter(a=>a.id===(r==null?void 0:r.id)).length===0),c6=(e,t,n,r,a)=>{t.startBoundElement!=null&&Ei(e,t.startBoundElement,"start",r);let i=Oa(n,a,r,t.zoom,Me(e),Me(e));i!==null&&(ZS(e,i,"end")||Ei(e,i,"end",r))},kV=(e,t)=>{let n=e.gap,r=$f(t,t.width,t.height);return n>r&&(n=O5+$5),{...e,gap:n}},Ei=(e,t,n,r)=>{if(!nt(e))return;let a={elementId:t.id,...Me(e)?{...Xp(e,t,n),focus:0,gap:0}:{...kV(_V(e,t,n,r),t)}};pe(e,{[n==="start"?"startBinding":"endBinding"]:a}),We(t.boundElements||[]).has(e.id)||pe(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},ZS=(e,t,n)=>{let r=e[n==="start"?"endBinding":"startBinding"];return KS(e,r==null?void 0:r.elementId,t)},KS=(e,t,n)=>t===n.id&&qS(e),qS=e=>e.points.length<3,CV=(e,t)=>{let n=t==="start"?"startBinding":"endBinding",r=e[n];return r==null?null:(pe(e,{[n]:null}),r.elementId)},Oa=(e,t,n,r,a,i)=>{if(i){let l=!1,s=IV(t,u=>Va(u,!1)&&lp(u,e,n,r,(a||!j2(u))&&!He(u))).filter(u=>l?!1:(j2(u)||(l=!0),!0));if(!s||s.length===0)return null;if(s.length===1)return s[0];let d=s.filter(u=>lp(u,e,n,r,!1));return d.length===1?d[0]:s.sort((u,o)=>o.width**2+o.height**2-(u.width**2+u.height**2)).pop()}return MV(t,l=>Va(l,!1)&&lp(l,e,n,r,(a||!j2(l))&&!He(l)))},MV=(e,t)=>{let n=null;for(let r=e.length-1;r>=0;--r){let a=e[r];if(!a.isDeleted&&t(a)){n=a;break}}return n},IV=(e,t)=>{let n=[];for(let r=e.length-1;r>=0;--r){let a=e[r];a.isDeleted||t(a)&&n.push(a)}return n},_V=(e,t,n,r)=>{let a=n==="start"?-1:1,i=a===-1?0:e.points.length-1,l=i-a,s=Ce.getPointAtIndexGlobalCoordinates(e,i,r),d=Ce.getPointAtIndexGlobalCoordinates(e,l,r);return{focus:OV(t,d,s),gap:Math.max(1,j0(t,s))}},Ar=(e,t,n)=>{let{newSize:r,simultaneouslyUpdated:a}=n??{},i=AV(a);Va(e)&&D0(t,e,l=>{var g,v;if(!Ge(l)||l.isDeleted||!TV(l,e))return;let s=l.startBinding?t.get(l.startBinding.elementId):null,d=l.endBinding?t.get(l.endBinding.elementId):null,u=null,o=null;s&&d&&(u=Ga(s,t),o=Ga(d,t));let f={startBinding:gy(e,l.startBinding,r),endBinding:gy(e,l.endBinding,r)};if(i.has(l.id)){pe(l,f,!0);return}let m=P0(t,l,(y,w)=>{var E,S;if(y&&Va(y)&&(w==="startBinding"||w==="endBinding")&&(e.id===((E=l[w])==null?void 0:E.elementId)||e.id===((S=l[w==="startBinding"?"endBinding":"startBinding"])==null?void 0:S.elementId)&&!UV(u,o))){let k=NV(l,w,f[w],y,t);if(k)return{index:w==="startBinding"?0:l.points.length-1,point:k}}return null}).filter(y=>y!==null);Ce.movePoints(l,m,{...e.id===((g=l.startBinding)==null?void 0:g.elementId)?{startBinding:f.startBinding}:{},...e.id===((v=l.endBinding)==null?void 0:v.elementId)?{endBinding:f.endBinding}:{}});let U=Je(l,t);U&&!U.isDeleted&&zf(l,t,!1)})},TV=(e,t)=>{var n,r;return((n=e.startBinding)==null?void 0:n.elementId)===t.id||((r=e.endBinding)==null?void 0:r.elementId)===t.id},AV=e=>new Set((e||[]).map(t=>t.id)),RV=(e,t,n,r,a,i,l)=>{let s=Mo(Pe(t,e));return!n||!r?s:jV(i,n,a,l)?BS(n,r,e):Mo(Pe(e,A(n.x+n.width/2,n.y+n.height/2)))},jV=(e,t,n,r)=>{let a=j0(t,e),i=$f(t,t.width,t.height,r);return a>i?null:a},hf=(e,t,n)=>{let r=t&&fi(t),a=e.points[n==="start"?0:e.points.length-1],i=A(e.x+a[0],e.y+a[1]),l=DO(t)?DV(t,i):i;if(t&&r){let s=N5(r),d=_S(t,Oe(s,st(an(ar(Pe(l,s)),Math.max(t.width,t.height)),s)))[0],u=yt(l,s),o=Math.max(yt(d??l,s),1e-4),f=vi(u/o,6);switch(!0){case f>.9:return u-o>Pt||cf(l,d)<1e-4?l:st(an(ar(Pe(l,d??s)),f>1?Pt:-Pt),d??s);default:return LV(l,t,r)}}return l},LV=(e,t,n)=>{let r=N5(n),a=Mo(Pe(e,r));switch(!0){case ln(a,Ir):return ce(A((n[0]+n[2])/2+.1,n[1]),r,t.angle);case ln(a,rn):return ce(A(n[2],(n[1]+n[3])/2+.1),r,t.angle);case ln(a,zn):return ce(A((n[0]+n[2])/2-.1,n[3]),r,t.angle);default:return ce(A(n[0],(n[1]+n[3])/2-.1),r,t.angle)}},DV=(e,t)=>{let n=A(e.x+e.width/2,e.y+e.height/2),r=ce(t,n,-e.angle);return r[0]<e.x&&r[1]<e.y?r[1]-e.y>-Pt?ce(A(e.x-Pt,e.y),n,e.angle):ce(A(e.x,e.y-Pt),n,e.angle):r[0]<e.x&&r[1]>e.y+e.height?r[0]-e.x>-Pt?ce(A(e.x,e.y+e.height+Pt),n,e.angle):ce(A(e.x-Pt,e.y+e.height),n,e.angle):r[0]>e.x+e.width&&r[1]>e.y+e.height?r[0]-e.x<e.width+Pt?ce(A(e.x+e.width,e.y+e.height+Pt),n,e.angle):ce(A(e.x+e.width+Pt,e.y+e.height),n,e.angle):r[0]>e.x+e.width&&r[1]<e.y?r[0]-e.x<e.width+Pt?ce(A(e.x+e.width,e.y-Pt),n,e.angle):ce(A(e.x+e.width+Pt,e.y),n,e.angle):t},PV=(e,t,n=.05)=>{let{x:r,y:a,width:i,height:l,angle:s}=e,d=A(r+i/2-.1,a+l/2-.1),u=ce(t,d,-s),o=lt(n*l,5,80),f=lt(n*i,5,80);return u[0]<=r+i/2&&u[1]>d[1]-o&&u[1]<d[1]+o?ce(A(r-Pt,d[1]),d,s):u[1]<=a+l/2&&u[0]>d[0]-f&&u[0]<d[0]+f?ce(A(d[0],a-Pt),d,s):u[0]>=r+i/2&&u[1]>d[1]-o&&u[1]<d[1]+o?ce(A(r+i+Pt,d[1]),d,s):u[1]>=a+l/2&&u[0]>d[0]-f&&u[0]<d[0]+f?ce(A(d[0],a+l+Pt),d,s):t},NV=(e,t,n,r,a)=>{if(n==null||n.elementId!==r.id&&e.points.length>2)return null;let i=t==="startBinding"?-1:1,l=i===-1?0:e.points.length-1;if(Me(e)&&Op(n)){let f=N0(n.fixedPoint)??Xp(e,r,t==="startBinding"?"start":"end").fixedPoint,m=A(r.x+r.width/2,r.y+r.height/2),U=A(r.x+f[0]*r.width,r.y+f[1]*r.height),g=ce(U,m,r.angle);return Ce.pointFromAbsoluteCoords(e,g,a)}let s=l-i,d=Ce.getPointAtIndexGlobalCoordinates(e,s,a),u=$V(r,n.focus,d),o;if(n.gap===0)o=u;else{let f=Ce.getPointAtIndexGlobalCoordinates(e,l,a),m=A(r.x+r.width/2,r.y+r.height/2),U=yt(d,f)+yt(d,m)+Math.max(r.width,r.height)*2,g=_S(r,Oe(d,st(an(ar(Pe(u,d)),U),d)),n.gap).sort((v,y)=>cf(v,d)-cf(y,d));g.length>1?o=g[0]:g.length===1?o=u:o=f}return Ce.pointFromAbsoluteCoords(e,o,a)},Xp=(e,t,n,r)=>{let a=[t.x,t.y,t.x+t.width,t.y+t.height],i=hf(e,t,n),l=A(a[0]+(a[2]-a[0])/2,a[1]+(a[3]-a[1])/2),s=ce(i,l,-t.angle);return{fixedPoint:N0([(s[0]-t.x)/t.width,(s[1]-t.y)/t.height])}},gy=(e,t,n)=>{if(t==null||n==null)return t;let{width:r,height:a}=n,{width:i,height:l}=e,s=Math.max(1,Math.min($f(e,r,a),t.gap*(r<a?r/i:a/l)));return{...t,gap:s}},_c=(e,t,n,r,a)=>Oa(QS(e,t,n),r,n,a,Me(e),Me(e)),QS=(e,t,n)=>{let r=t==="start"?0:-1;return Pa(Ce.getPointAtIndexGlobalCoordinates(e,r,n))},JS=(e,t,n,r)=>{let a=new Set,i=new Set,l=r==="duplicatesServeAsOld",s=new Map([...n].map(([d,u])=>[u,d]));t.forEach(d=>{let{boundElements:u}=d;if(u!=null&&u.length>0&&(u.forEach(o=>{l&&!n.has(o.id)&&a.add(o.id)}),i.add(n.get(d.id))),mi(d)){if(d.startBinding!=null){let{elementId:o}=d.startBinding;l&&!n.has(o)&&i.add(o)}if(d.endBinding!=null){let{elementId:o}=d.endBinding;l&&!n.has(o)&&i.add(o)}(d.startBinding!=null||d.endBinding!=null)&&a.add(n.get(d.id))}}),e.filter(({id:d})=>a.has(d)).forEach(d=>{let{startBinding:u,endBinding:o}=d;pe(d,{startBinding:by(u,n),endBinding:by(o,n)})}),e.filter(({id:d})=>i.has(d)).forEach(d=>{var f;let u=s.get(d.id),o=(f=e.find(({id:m})=>m===u))==null?void 0:f.boundElements;o&&o.length>0&&pe(d,{boundElements:o.map(m=>n.has(m.id)?{id:n.get(m.id),type:m.type}:m)})})},by=(e,t)=>e==null?null:{...e,elementId:t.get(e.elementId)??e.elementId},ek=(e,t)=>{let n=We(e);for(let r of t)Tc.unbindAffected(n,r,pe),Ac.unbindAffected(n,r,pe)},pf=(e,t,n=[])=>{if(!e)return null;let r=e.filter(a=>!t.has(a.id));return r.push(...n.map(a=>({id:a.id,type:a.type}))),r},lp=(e,{x:t,y:n},r,a,i)=>{let l=$f(e,e.width,e.height,a),s=qi(e,r);return r6(A(t,n),s,l)||i===!0&&qc(A(t,n),fi(e))},$f=(e,t,n,r)=>{let a=r!=null&&r.value&&r.value<1?r.value:1,i=(e.type==="diamond"?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*i,32),O5/a+$5)},OV=(e,t,n)=>{let r=A(e.x+e.width/2,e.y+e.height/2);if(Xa(t,n))return 0;let a=ce(t,r,-e.angle),i=ce(n,r,-e.angle),l=Math.sign(In(Pe(i,t),Pe(i,r)))*-1,s=Oe(i,st(an(ar(Pe(i,a)),Math.max(e.width*2,e.height*2)),i)),d=e.type==="diamond"?[Oe(A(e.x+e.width/2,e.y),A(e.x+e.width/2,e.y+e.height)),Oe(A(e.x,e.y+e.height/2),A(e.x+e.width,e.y+e.height/2))]:[Oe(A(e.x,e.y),A(e.x+e.width,e.y+e.height)),Oe(A(e.x+e.width,e.y),A(e.x,e.y+e.height))],u=e.type==="diamond"?[Oe(A(e.x+e.width/2,e.y-e.height),A(e.x+e.width/2,e.y+e.height*2)),Oe(A(e.x-e.width,e.y+e.height/2),A(e.x+e.width*2,e.y+e.height/2))]:[Oe(A(e.x-e.width,e.y-e.height),A(e.x+e.width*2,e.y+e.height*2)),Oe(A(e.x+e.width*2,e.y-e.height),A(e.x-e.width,e.y+e.height*2))];return[df(s,u[0]),df(s,u[1])].filter(o=>o!==null).sort((o,f)=>cf(o,n)-cf(f,n)).map((o,f)=>l*yt(r,o)/(e.type==="diamond"?yt(d[f][0],d[f][1])/2:Math.sqrt(e.width**2+e.height**2)/2)).sort((o,f)=>Math.abs(o)-Math.abs(f))[0]??0},$V=(e,t,n)=>{let r=A(e.x+e.width/2,e.y+e.height/2);if(t===0)return r;let a=(e.type==="diamond"?[A(e.x,e.y+e.height/2),A(e.x+e.width/2,e.y),A(e.x+e.width,e.y+e.height/2),A(e.x+e.width/2,e.y+e.height)]:[A(e.x,e.y),A(e.x+e.width,e.y),A(e.x+e.width,e.y+e.height),A(e.x,e.y+e.height)]).map(l=>st(an(Pe(l,r),Math.abs(t)),r)).map(l=>ce(l,r,e.angle)),i=[In(Pe(n,a[0]),Pe(a[1],a[0]))>0&&(t>0?In(Pe(n,a[1]),Pe(a[2],a[1]))<0:In(Pe(n,a[3]),Pe(a[0],a[3]))<0),In(Pe(n,a[1]),Pe(a[2],a[1]))>0&&(t>0?In(Pe(n,a[2]),Pe(a[3],a[2]))<0:In(Pe(n,a[0]),Pe(a[1],a[0]))<0),In(Pe(n,a[2]),Pe(a[3],a[2]))>0&&(t>0?In(Pe(n,a[3]),Pe(a[0],a[3]))<0:In(Pe(n,a[1]),Pe(a[2],a[1]))<0),In(Pe(n,a[3]),Pe(a[0],a[3]))>0&&(t>0?In(Pe(n,a[0]),Pe(a[1],a[0]))<0:In(Pe(n,a[2]),Pe(a[3],a[2]))<0)];return i[0]?t>0?a[1]:a[0]:i[1]?t>0?a[2]:a[1]:i[2]?t>0?a[3]:a[2]:t>0?a[0]:a[3]},zV=new Set(["boundElements","frameId","containerId","startBinding","endBinding"]),D0=(e,t,n)=>{var r;Va(t)&&(((r=t.boundElements)==null?void 0:r.slice())??[]).forEach(({id:a})=>{n(e.get(a),"boundElements",a)})},P0=(e,t,n)=>{let r=[];if(t.frameId){let a=t.frameId;r.push(n(e.get(a),"frameId",a))}if(Ft(t)){let a=t.containerId;r.push(n(e.get(a),"containerId",a))}if(nt(t)){if(t.startBinding){let a=t.startBinding.elementId;r.push(n(e.get(a),"startBinding",a))}if(t.endBinding){let a=t.endBinding.elementId;r.push(n(e.get(a),"endBinding",a))}}return r},Tc=class{static unbindAffected(e,t,n){t&&P0(e,t,r=>{!r||r.isDeleted||D0(e,r,(a,i,l)=>{l===t.id&&n(r,{boundElements:pf(r.boundElements,new Set([l]))})})})}};F(Tc,"rebindAffected",(e,t,n)=>{!t||t.isDeleted||P0(e,t,(r,a)=>{var i,l;if(!r||r.isDeleted){n(t,{[a]:null});return}a!=="frameId"&&((i=r.boundElements)!=null&&i.find(s=>s.id===t.id)||(nt(t)&&n(r,{boundElements:pf(r.boundElements,new Set,new Array(t))}),ke(t)&&((l=r.boundElements)!=null&&l.find(s=>s.type==="text")?n(t,{[a]:null}):n(r,{boundElements:pf(r.boundElements,new Set,new Array(t))}))))})});var Ac=class{static unbindAffected(e,t,n){t&&D0(e,t,r=>{!r||r.isDeleted||P0(e,r,(a,i,l)=>{l===t.id&&n(r,{[i]:null})})})}};F(Ac,"rebindAffected",(e,t,n)=>{!t||t.isDeleted||D0(e,t,(r,a,i)=>{var l,s;if(!r||r.isDeleted){n(t,{boundElements:pf(t.boundElements,new Set([i]))});return}ke(r)&&(((s=(((l=t.boundElements)==null?void 0:l.slice())??[]).reverse().find(d=>d.type==="text"))==null?void 0:s.id)===r.id?r.containerId!==t.id&&n(r,{containerId:t.id}):(r.containerId!==null&&n(r,{containerId:null}),n(t,{boundElements:pf(t.boundElements,new Set([r.id]))})))})});var d6=(e,t)=>{let[n,r]=N0(e);return ce(A(t.x+t.width*n,t.y+t.height*r),A(t.x+t.width/2,t.y+t.height/2),t.angle)},FV=(e,t)=>{let n=e.startBinding&&t.get(e.startBinding.elementId),r=e.endBinding&&t.get(e.endBinding.elementId),a=n&&e.startBinding?d6(e.startBinding.fixedPoint,n):A(e.x+e.points[0][0],e.y+e.points[0][1]),i=r&&e.endBinding?d6(e.endBinding.fixedPoint,r):A(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]);return[a,i]},BV=(e,t)=>{let[n,r]=FV(e,t);return[Ce.pointFromAbsoluteCoords(e,n,t),Ce.pointFromAbsoluteCoords(e,r,t)]},N0=e=>e&&(Math.abs(e[0]-.5)<1e-4||Math.abs(e[1]-.5)<1e-4)?e.map(t=>Math.abs(t-.5)<1e-4?.5001:t):e,HV=(e,t)=>{let[n,r,a,i]=t,{x:l,y:s}=oa({sceneX:n,sceneY:r},e),{x:d,y:u}=oa({sceneX:a,sceneY:i},e);return d-l>e.width||u-s>e.height},tk=({scenePoint:e,viewportDimensions:t,zoom:n,offsets:r})=>{let a=(t.width-((r==null?void 0:r.right)??0))/2/n.value-e.x;a+=((r==null?void 0:r.left)??0)/2/n.value;let i=(t.height-((r==null?void 0:r.bottom)??0))/2/n.value-e.y;return i+=((r==null?void 0:r.top)??0)/2/n.value,{scrollX:a,scrollY:i}},mf=(e,t)=>{if(e=uZ(e),!e.length)return{scrollX:0,scrollY:0};let[n,r,a,i]=xt(e);HV(t,[n,r,a,i])&&([n,r,a,i]=mV(e,jt({clientX:t.scrollX,clientY:t.scrollY},t)));let l=(n+a)/2,s=(r+i)/2;return tk({scenePoint:{x:l,y:s},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},nl=e=>lt(vi(e,6),h5,p5),WV=e=>lt(Math.round(e),1,100),nk=e=>lt(Math.round(e),1,100),rk=(e,t,n)=>{let r=n.reduce((a,i)=>(i.groupIds.includes(e)&&(a[i.id]=!0),a),{});return Object.keys(r).length<2?t.selectedGroupIds[e]||t.editingGroupId===e?{selectedElementIds:t.selectedElementIds,selectedGroupIds:{...t.selectedGroupIds,[e]:!1},editingGroupId:null}:t:{editingGroupId:t.editingGroupId,selectedGroupIds:{...t.selectedGroupIds,[e]:!0},selectedElementIds:{...t.selectedElementIds,...r}}},fr=(function(){let e=null,t=null,n=null,r=(i,l,s,d)=>{if(n!==void 0&&l===t&&i===e&&s.editingGroupId===(n==null?void 0:n.editingGroupId))return n;let u={};for(let m of i){let U=m.groupIds;if(s.editingGroupId){let g=U.indexOf(s.editingGroupId);g>-1&&(U=U.slice(0,g))}if(U.length>0){let g=U[U.length-1];u[g]=!0}}let o={},f=l.reduce((m,U)=>{if(U.isDeleted)return m;let g=U.groupIds.find(v=>u[v]);return g&&(m[U.id]=!0,Array.isArray(o[g])?o[g].push(U.id):o[g]=[U.id]),m},{});for(let m of Object.keys(o))o[m].length<2&&u[m]&&(u[m]=!1);return t=l,e=i,n={editingGroupId:s.editingGroupId,selectedGroupIds:u,selectedElementIds:bt({...s.selectedElementIds,...f},d)},n},a=(i,l,s,d)=>{let u=d?d.scene.getSelectedElements({selectedElementIds:i.selectedElementIds,elements:l}):tt(l,i);return u.length?r(u,l,i,s):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:bt(i.selectedElementIds,s)}};return a.clearCache=()=>{t=null,e=null,n=null},a})(),ak=(e,t)=>ik(e,t)!=null,ik=(e,t)=>t.groupIds.filter(n=>n!==e.editingGroupId).find(n=>e.selectedGroupIds[n]),fo=e=>Object.entries(e.selectedGroupIds).filter(([t,n])=>n).map(([t,n])=>t),lk=(e,t)=>{let n={...t,selectedGroupIds:{}};for(let r of e){let a=r.groupIds;if(t.editingGroupId){let i=a.indexOf(t.editingGroupId);i>-1&&(a=a.slice(0,i))}if(a.length>0){let i=a[a.length-1];n={...n,...rk(i,n,e)}}}return n.selectedGroupIds},XV=(e,t)=>({...e,editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[t.id]:!0}}),Uf=(e,t)=>e.groupIds.includes(t),zt=(e,t)=>{let n=[];for(let r of e.values())Uf(r,t)&&n.push(r);return n},VV=(e,t)=>e.groupIds.find(n=>t[n]),GV=(e,t,n)=>{let r=[...e],a=t?e.indexOf(t):-1,i=a>-1?a:e.length;for(let l=0;l<i;l++)r[l]=n(r[l]);return r},YV=(e,t,n)=>{let r=[...e],a=n?r.indexOf(n):-1,i=a>-1?a:r.length;return r.splice(i,0,t),r},ZV=(e,t)=>e.filter(n=>!t[n]),O0=(e,t)=>{let n=new Map;return e.forEach(r=>{let a=r.groupIds.length===0?r.id:r.groupIds[r.groupIds.length-1],i=n.get(a)||[],l=Je(r,t);l&&i.push(l),n.set(a,[...i,r])}),Array.from(n.values())},KV=e=>{let t=new Set;for(let[,n]of e)if(!n.isDeleted)for(let r of n.groupIds??[])t.add(r);return t},sk=e=>{let t=e.flatMap(a=>a.groupIds),n=new Map,r=0;for(let a of t)n.set(a,(n.get(a)??0)+1),n.get(a)>r&&(r=n.get(a));return r===e.length},ed=e=>e.groupIds.length>0,qV=8,vy=99999,$0=e=>qV/e,Sr=class{};F(Sr,"referenceSnapPoints",null),F(Sr,"visibleGaps",null),F(Sr,"setReferenceSnapPoints",e=>{Sr.referenceSnapPoints=e}),F(Sr,"getReferenceSnapPoints",()=>Sr.referenceSnapPoints),F(Sr,"setVisibleGaps",e=>{Sr.visibleGaps=e}),F(Sr,"getVisibleGaps",()=>Sr.visibleGaps),F(Sr,"destroy",()=>{Sr.referenceSnapPoints=null,Sr.visibleGaps=null});var Yi=Sr,gf=e=>e.props.gridModeEnabled??e.state.gridModeEnabled,Us=({event:e,app:t,selectedElements:n})=>e?t.state.objectsSnapModeEnabled&&!e[B.CTRL_OR_CMD]||!t.state.objectsSnapModeEnabled&&e[B.CTRL_OR_CMD]&&!gf(t):n.length===1&&n[0].type==="arrow"?!1:t.state.objectsSnapModeEnabled,QV=(e,t,n=.01)=>Math.abs(e-t)<=n,bf=(e,t,{omitCenter:n,boundingBoxCorners:r,dragOffset:a}={omitCenter:!1,boundingBoxCorners:!1})=>{let i=[];if(e.length===1){let l=e[0],[s,d,u,o,f,m]=Ze(l,t);a&&(s+=a.x,u+=a.x,f+=a.x,d+=a.y,o+=a.y,m+=a.y);let U=(u-s)/2,g=(o-d)/2;if((l.type==="diamond"||l.type==="ellipse")&&!r){let v=ce(A(s,d+g),A(f,m),l.angle),y=ce(A(s+U,d),A(f,m),l.angle),w=ce(A(u,d+g),A(f,m),l.angle),E=ce(A(s+U,o),A(f,m),l.angle),S=A(f,m);i=n?[v,y,w,E]:[v,y,w,E,S]}else{let v=ce(A(s,d),A(f,m),l.angle),y=ce(A(u,d),A(f,m),l.angle),w=ce(A(s,o),A(f,m),l.angle),E=ce(A(u,o),A(f,m),l.angle),S=A(f,m);i=n?[v,y,w,E]:[v,y,w,E,S]}}else if(e.length>1){let[l,s,d,u]=P5(e,a??{x:0,y:0}),o=d-l,f=u-s,m=A(l,s),U=A(d,s),g=A(l,u),v=A(d,u),y=A(l+o/2,s+f/2);i=n?[m,U,g,v]:[m,U,g,v,y]}return i.map(l=>A(qt(l[0]),qt(l[1])))},ok=(e,t,n,r)=>{let a=t.filter(i=>He(i)).map(i=>i.id);return aC(e,t,n,r).filter(i=>!(i.frameId&&a.includes(i.frameId)))},JV=(e,t,n,r)=>{let a=ok(e,t,n,r),i=O0(a,r).filter(f=>!(f.length===1&&Ft(f[0]))).map(f=>xt(f).map(m=>qt(m))),l=i.sort((f,m)=>f[0]-m[0]),s=[],d=0;e:for(let f=0;f<l.length;f++){let m=l[f];for(let U=f+1;U<l.length;U++){if(++d>vy)break e;let g=l[U],[,v,y,w]=m,[E,S,,k]=g;y<E&&Pp(tr(v,w),tr(S,k))&&s.push({startBounds:m,endBounds:g,startSide:[A(y,v),A(y,w)],endSide:[A(E,S),A(E,k)],length:E-y,overlap:Np(tr(v,w),tr(S,k))})}}let u=i.sort((f,m)=>f[1]-m[1]),o=[];d=0;e:for(let f=0;f<u.length;f++){let m=u[f];for(let U=f+1;U<u.length;U++){if(++d>vy)break e;let g=u[U],[v,,y,w]=m,[E,S,k]=g;w<S&&Pp(tr(v,y),tr(E,k))&&o.push({startBounds:m,endBounds:g,startSide:[A(v,w),A(y,w)],endSide:[A(E,S),A(k,S)],length:S-w,overlap:Np(tr(v,y),tr(E,k))})}}return{horizontalGaps:s,verticalGaps:o}},yy=(e,t,n,r,a,i,l)=>{if(!Us({app:n,event:r,selectedElements:e}))return[];if(e.length===0)return[];let s=Yi.getVisibleGaps();if(s){let{horizontalGaps:d,verticalGaps:u}=s,[o,f,m,U]=P5(e,t).map(y=>qt(y)),g=(o+m)/2,v=(f+U)/2;for(let y of d){if(!Pp(tr(f,U),y.overlap))continue;let w=y.startSide[0][0]+y.length/2,E=qt(w-g);if(y.length>m-o&&Math.abs(E)<=l.x){Math.abs(E)<l.x&&(a.length=0),l.x=Math.abs(E);let D={type:"gap",direction:"center_horizontal",gap:y,offset:E};a.push(D);continue}let[,,S]=y.endBounds,k=o-S,I=qt(y.length-k);if(Math.abs(I)<=l.x){Math.abs(I)<l.x&&(a.length=0),l.x=Math.abs(I);let D={type:"gap",direction:"side_right",gap:y,offset:I};a.push(D);continue}let[T,,,]=y.startBounds,M=T-m,j=qt(M-y.length);if(Math.abs(j)<=l.x){Math.abs(j)<l.x&&(a.length=0),l.x=Math.abs(j);let D={type:"gap",direction:"side_left",gap:y,offset:j};a.push(D);continue}}for(let y of u){if(!Pp(tr(o,m),y.overlap))continue;let w=y.startSide[0][1]+y.length/2,E=qt(w-v);if(y.length>U-f&&Math.abs(E)<=l.y){Math.abs(E)<l.y&&(i.length=0),l.y=Math.abs(E);let D={type:"gap",direction:"center_vertical",gap:y,offset:E};i.push(D);continue}let[,S,,]=y.startBounds,k=S-U,I=qt(k-y.length);if(Math.abs(I)<=l.y){Math.abs(I)<l.y&&(i.length=0),l.y=Math.abs(I);let D={type:"gap",direction:"side_top",gap:y,offset:I};i.push(D);continue}let[,,,T]=y.endBounds,M=qt(f-T),j=y.length-M;if(Math.abs(j)<=l.y){Math.abs(j)<l.y&&(i.length=0),l.y=Math.abs(j);let D={type:"gap",direction:"side_bottom",gap:y,offset:j};i.push(D);continue}}}},eG=(e,t,n,r)=>{let a=ok(e,t,n,r);return O0(a,r).filter(i=>!(i.length===1&&Ft(i[0]))).flatMap(i=>bf(i,r))},td=(e,t,n,r,a,i,l)=>{if(!Us({app:n,event:r,selectedElements:e})||e.length===0&&t.length===0)return[];let s=Yi.getReferenceSnapPoints();if(s)for(let d of t)for(let u of s){let o=u[0]-d[0],f=u[1]-d[1];Math.abs(o)<=l.x&&(Math.abs(o)<l.x&&(a.length=0),a.push({type:"point",points:[d,u],offset:o}),l.x=Math.abs(o)),Math.abs(f)<=l.y&&(Math.abs(f)<l.y&&(i.length=0),i.push({type:"point",points:[d,u],offset:f}),l.y=Math.abs(f))}},tG=(e,t,n,r,a)=>{var y,w;let i=n.state,l=tt(e,i);if(!Us({app:n,event:r,selectedElements:l})||l.length===0)return{snapOffset:{x:0,y:0},snapLines:[]};t.x=qt(t.x),t.y=qt(t.y);let s=[],d=[],u=$0(i.zoom.value),o={x:u,y:u},f=bf(l,a,{dragOffset:t});td(l,f,n,r,s,d,o),yy(l,t,n,r,s,d,o);let m={x:((y=s[0])==null?void 0:y.offset)??0,y:((w=d[0])==null?void 0:w.offset)??0};o.x=0,o.y=0,s.length=0,d.length=0;let U={x:qt(t.x+m.x),y:qt(t.y+m.y)};td(l,bf(l,a,{dragOffset:U}),n,r,s,d,o),yy(l,U,n,r,s,d,o);let g=z5(s,d),v=rG(l,U,[...s,...d].filter(E=>E.type==="gap"));return{snapOffset:m,snapLines:[...g,...v]}},qt=e=>Math.round(e*10**6)/10**6,xy=e=>{let t=new Map;for(let n of e){let r=n.join(",");t.has(r)||t.set(r,n)}return Array.from(t.values())},z5=(e,t)=>{let n={},r={};if(e.length>0){for(let a of e)if(a.type==="point"){let i=qt(a.points[0][0]);n[i]||(n[i]=[]),n[i].push(...a.points.map(l=>A(qt(l[0]),qt(l[1]))))}}if(t.length>0){for(let a of t)if(a.type==="point"){let i=qt(a.points[0][1]);r[i]||(r[i]=[]),r[i].push(...a.points.map(l=>A(qt(l[0]),qt(l[1]))))}}return Object.entries(n).map(([a,i])=>({type:"points",points:xy(i.map(l=>A(Number(a),l[1])).sort((l,s)=>l[1]-s[1]))})).concat(Object.entries(r).map(([a,i])=>({type:"points",points:xy(i.map(l=>A(l[0],Number(a))).sort((l,s)=>l[0]-s[0]))})))},nG=e=>{let t=new Map;for(let n of e){let r=n.points.flat().map(a=>[qt(a)]).join(",");t.has(r)||t.set(r,n)}return Array.from(t.values())},rG=(e,t,n)=>{let[r,a,i,l]=P5(e,t),s=[];for(let d of n){let[u,o,f,m]=d.gap.startBounds,[U,g,v,y]=d.gap.endBounds,w=Np(tr(a,l),d.gap.overlap),E=Np(tr(r,i),d.gap.overlap);switch(d.direction){case"center_horizontal":{if(w){let S=(w[0]+w[1])/2;s.push({type:"gap",direction:"horizontal",points:[A(d.gap.startSide[0][0],S),A(r,S)]},{type:"gap",direction:"horizontal",points:[A(i,S),A(d.gap.endSide[0][0],S)]})}break}case"center_vertical":{if(E){let S=(E[0]+E[1])/2;s.push({type:"gap",direction:"vertical",points:[A(S,d.gap.startSide[0][1]),A(S,a)]},{type:"gap",direction:"vertical",points:[A(S,l),A(S,d.gap.endSide[0][1])]})}break}case"side_right":{if(w){let S=(w[0]+w[1])/2;s.push({type:"gap",direction:"horizontal",points:[A(f,S),A(U,S)]},{type:"gap",direction:"horizontal",points:[A(v,S),A(r,S)]})}break}case"side_left":{if(w){let S=(w[0]+w[1])/2;s.push({type:"gap",direction:"horizontal",points:[A(i,S),A(u,S)]},{type:"gap",direction:"horizontal",points:[A(f,S),A(U,S)]})}break}case"side_top":{if(E){let S=(E[0]+E[1])/2;s.push({type:"gap",direction:"vertical",points:[A(S,l),A(S,o)]},{type:"gap",direction:"vertical",points:[A(S,m),A(S,g)]})}break}case"side_bottom":{if(E){let S=(E[0]+E[1])/2;s.push({type:"gap",direction:"vertical",points:[A(S,m),A(S,g)]},{type:"gap",direction:"vertical",points:[A(S,y),A(S,a)]})}break}}}return nG(s.map(d=>({...d,points:d.points.map(u=>A(qt(u[0]),qt(u[1])))})))},wy=(e,t,n,r,a,i)=>{var T,M;if(!Us({event:r,selectedElements:e,app:n})||e.length===0||e.length===1&&!QV(e[0].angle,0))return{snapOffset:{x:0,y:0},snapLines:[]};let[l,s,d,u]=xt(t);i&&(i.includes("e")?d+=a.x:i.includes("w")&&(l+=a.x),i.includes("n")?s+=a.y:i.includes("s")&&(u+=a.y));let o=[];if(i)switch(i){case"e":{o.push(A(d,s),A(d,u));break}case"w":{o.push(A(l,s),A(l,u));break}case"n":{o.push(A(l,s),A(d,s));break}case"s":{o.push(A(l,u),A(d,u));break}case"ne":{o.push(A(d,s));break}case"nw":{o.push(A(l,s));break}case"se":{o.push(A(d,u));break}case"sw":{o.push(A(l,u));break}}let f=$0(n.state.zoom.value),m={x:f,y:f},U=[],g=[];td(t,o,n,r,U,g,m);let v={x:((T=U[0])==null?void 0:T.offset)??0,y:((M=g[0])==null?void 0:M.offset)??0};m.x=0,m.y=0,U.length=0,g.length=0;let[y,w,E,S]=xt(e).map(j=>qt(j)),k=[A(y,w),A(y,S),A(E,w),A(E,S)];td(e,k,n,r,U,g,m);let I=z5(U,g);return{snapOffset:v,snapLines:I}},aG=(e,t,n,r,a,i)=>{var g,v;if(!Us({event:n,selectedElements:[e],app:t}))return{snapOffset:{x:0,y:0},snapLines:[]};let l=[A(r.x+a.x,r.y+a.y)],s=$0(t.state.zoom.value),d={x:s,y:s},u=[],o=[];td([e],l,t,n,u,o,d);let f={x:((g=u[0])==null?void 0:g.offset)??0,y:((v=o[0])==null?void 0:v.offset)??0};d.x=0,d.y=0,u.length=0,o.length=0;let m=bf([e],i,{boundingBoxCorners:!0,omitCenter:!0});td([e],m,t,n,u,o,d);let U=z5(u,o);return{snapOffset:f,snapLines:U}},iG=(e,t,n,r,a)=>{if(!Us({event:r,selectedElements:[],app:t}))return{originOffset:{x:0,y:0},snapLines:[]};let i=aC(e,[],t.state,a),l=$0(t.state.zoom.value),s={x:l,y:l},d=[],u=[];for(let o of i){let f=bf([o],a);for(let m of f){let U=m[0]-n.x;Math.abs(U)<=Math.abs(s.x)&&(Math.abs(U)<Math.abs(s.x)&&(u.length=0),u.push({type:"pointer",points:[m,A(m[0],n.y)],direction:"vertical"}),s.x=U);let g=m[1]-n.y;Math.abs(g)<=Math.abs(s.y)&&(Math.abs(g)<Math.abs(s.y)&&(d.length=0),d.push({type:"pointer",points:[m,A(n.x,m[1])],direction:"horizontal"}),s.y=g)}}return{originOffset:{x:u.length>0?u[0].points[0][0]-n.x:0,y:d.length>0?d[0].points[0][1]-n.y:0},snapLines:[...u,...d]}},lG=e=>e===_n.rectangle||e===_n.ellipse||e===_n.diamond||e===_n.frame||e===_n.magicframe||e===_n.image||e===_n.text,xn=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t],Xl={version:null,points:[],zoom:null},dn=class rt{constructor(t){F(this,"elementId"),F(this,"selectedPointsIndices"),F(this,"pointerDownState"),F(this,"isDragging"),F(this,"lastUncommittedPoint"),F(this,"pointerOffset"),F(this,"startBindingElement"),F(this,"endBindingElement"),F(this,"hoverPointIndex"),F(this,"segmentMidPointHoveredCoords"),F(this,"elbowed"),this.elementId=t.id,Xa(t.points[0],A(0,0))||console.error("Linear element is not normalized",Error().stack),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep",this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:null,segmentMidpoint:{value:null,index:null,added:!1}},this.hoverPointIndex=-1,this.segmentMidPointHoveredCoords=null,this.elbowed=Me(t)&&t.elbowed}static getElement(t,n){return n.get(t)||null}static handleBoxSelection(t,n,r,a){if(!n.editingLinearElement||!n.selectionElement)return!1;let{editingLinearElement:i}=n,{selectedPointsIndices:l,elementId:s}=i,d=rt.getElement(s,a);if(!d)return!1;let[u,o,f,m]=Ze(n.selectionElement,a),U=rt.getPointsGlobalCoordinates(d,a).reduce((g,v,y)=>((v[0]>=u&&v[0]<=f&&v[1]>=o&&v[1]<=m||t.shiftKey&&(l!=null&&l.includes(y)))&&g.push(y),g),[]).filter(g=>!(Me(d)&&g!==0&&g!==d.points.length-1));r({editingLinearElement:{...i,selectedPointsIndices:U.length?U:null}})}static handlePointDragging(t,n,r,a,i,l,s){var g;if(!l)return!1;let{elementId:d}=l,u=s.getNonDeletedElementsMap(),o=rt.getElement(d,u);if(!o||Me(o)&&!l.pointerDownState.lastClickedIsEndPoint&&l.pointerDownState.lastClickedPoint!==0)return!1;let f=Me(o)?(g=l.selectedPointsIndices)==null?void 0:g.reduce((v,y)=>y===0?[0,v[1]]:[v[0],o.points.length-1],[!1,!1]).filter(v=>typeof v=="number"):l.selectedPointsIndices,m=Me(o)?l.pointerDownState.lastClickedPoint>0?o.points.length-1:0:l.pointerDownState.lastClickedPoint,U=o.points[m];if(f&&U){if(Fu(t)&&f.length===1&&o.points.length>1){let v=f[0],y=o.points[v===0?1:v-1],[w,E]=rt._getShiftLockedDelta(o,u,y,A(r,a),t[B.CTRL_OR_CMD]?null:n.getEffectiveGridSize());rt.movePoints(o,[{index:v,point:A(w+y[0],E+y[1]),isDragging:v===m}])}else{let v=rt.createPointAt(o,u,r-l.pointerOffset.x,a-l.pointerOffset.y,t[B.CTRL_OR_CMD]?null:n.getEffectiveGridSize()),y=v[0]-U[0],w=v[1]-U[1];rt.movePoints(o,f.map(E=>{let S=E===m?rt.createPointAt(o,u,r-l.pointerOffset.x,a-l.pointerOffset.y,t[B.CTRL_OR_CMD]?null:n.getEffectiveGridSize()):A(o.points[E][0]+y,o.points[E][1]+w);return{index:E,point:S,isDragging:E===m}}))}if(Je(o,u)&&zf(o,u,!1),mi(o,!1)){let v=[];f[0]===0&&v.push(Pa(rt.getPointGlobalCoordinates(o,o.points[0],u)));let y=f[f.length-1];y===o.points.length-1&&v.push(Pa(rt.getPointGlobalCoordinates(o,o.points[y],u))),v.length&&i(o,v)}return!0}return!1}static handlePointerUp(t,n,r,a){var U;let i=a.getNonDeletedElementsMap(),l=a.getNonDeletedElements(),{elementId:s,selectedPointsIndices:d,isDragging:u,pointerDownState:o}=n,f=rt.getElement(s,i);if(!f)return n;let m={};if(u&&d){for(let g of d)if(g===0||g===f.points.length-1){sl(f.points,r.zoom.value)&&rt.movePoints(f,[{index:g,point:g===0?f.points[f.points.length-1]:f.points[0]}]);let v=io(r)?Oa(Pa(rt.getPointAtIndexGlobalCoordinates(f,g,i)),l,i,r.zoom,Me(f),Me(f)):null;m[g===0?"startBindingElement":"endBindingElement"]=v}}return{...n,...m,selectedPointsIndices:u||t.shiftKey?!u&&t.shiftKey&&((U=o.prevSelectedPointsIndices)!=null&&U.includes(o.lastClickedPoint))?d&&d.filter(g=>g!==o.lastClickedPoint):d:d!=null&&d.includes(o.lastClickedPoint)?[o.lastClickedPoint]:d,isDragging:!1,pointerOffset:{x:0,y:0}}}static isSegmentTooShort(t,n,r,a,i){if(Me(t))return a>=0&&a<t.points.length?yt(n,r)*i.value<rt.POINT_HANDLE_SIZE/2:!1;let l=yt(n,r);return t.points.length>2&&t.roundness&&(l=BX(t,r)),l*i.value<rt.POINT_HANDLE_SIZE*4}static getSegmentMidPoint(t,n,r,a,i){let l=Df(n,r);if(t.points.length>2&&t.roundness){let s=AS(t,t.points[a]);if(s){let d=HX(t,t.points[a],.5);l=rt.getPointGlobalCoordinates(t,RS(s[0],s[1],s[2],s[3],d),i)}}return l}static getSegmentMidPointIndex(t,n,r,a){let i=rt.getElement(t.elementId,a);if(!i)return-1;let l=rt.getEditorMidPoints(i,a,n),s=0;for(;s<l.length;){if(rt.arePointsEqual(r,l[s]))return s+1;s++}return-1}static handlePointerDown(t,n,r,a,i,l){var j;let s=n.state,d=l.getNonDeletedElementsMap(),u=l.getNonDeletedElements(),o={didAddPoint:!1,hitElement:null,linearElementEditor:null};if(!i)return o;let{elementId:f}=i,m=rt.getElement(f,d);if(!m)return o;let U=rt.getSegmentMidpointHitCoords(i,a,s,d),g=null;if(U)g=rt.getSegmentMidPointIndex(i,s,U,d);else if(t.altKey&&s.editingLinearElement)return i.lastUncommittedPoint==null&&(pe(m,{points:[...m.points,rt.createPointAt(m,d,a.x,a.y,t[B.CTRL_OR_CMD]?null:n.getEffectiveGridSize())]}),o.didAddPoint=!0),r.shouldCaptureIncrement(),o.linearElementEditor={...i,pointerDownState:{prevSelectedPointsIndices:i.selectedPointsIndices,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:{x:a.x,y:a.y},segmentMidpoint:{value:U,index:g,added:!1}},selectedPointsIndices:[m.points.length-1],lastUncommittedPoint:null,endBindingElement:Oa(a,u,d,n.state.zoom,i.elbowed)},o.didAddPoint=!0,o;let v=rt.getPointIndexUnderCursor(m,d,s.zoom,a.x,a.y);if(v>=0||U)o.hitElement=m;else{let{startBindingElement:D,endBindingElement:P}=i;io(s)&&mi(m)&&L0(m,D,P,d,l)}let[y,w,E,S]=Ze(m,d),k=(y+E)/2,I=(w+S)/2,T=v>-1&&ce(A(m.x+m.points[v][0],m.y+m.points[v][1]),A(k,I),m.angle),M=v>-1||t.shiftKey?t.shiftKey||(j=i.selectedPointsIndices)!=null&&j.includes(v)?sG([...i.selectedPointsIndices||[],v]):[v]:null;return o.linearElementEditor={...i,pointerDownState:{prevSelectedPointsIndices:i.selectedPointsIndices,lastClickedPoint:v,lastClickedIsEndPoint:v===m.points.length-1,origin:{x:a.x,y:a.y},segmentMidpoint:{value:U,index:g,added:!1}},selectedPointsIndices:M,pointerOffset:T?{x:a.x-T[0],y:a.y-T[1]}:{x:0,y:0}},o}static arePointsEqual(t,n){return!t&&!n?!0:!t||!n?!1:Xa(t,n)}static handlePointerMove(t,n,r,a,i){let l=a.state;if(!l.editingLinearElement)return null;let{elementId:s,lastUncommittedPoint:d}=l.editingLinearElement,u=rt.getElement(s,i);if(!u)return l.editingLinearElement;let{points:o}=u,f=o[o.length-1];if(!t.altKey)return f===d&&rt.deletePoints(u,[o.length-1]),{...l.editingLinearElement,lastUncommittedPoint:null};let m;if(Fu(t)&&o.length>=2){let U=o[o.length-2],[g,v]=rt._getShiftLockedDelta(u,i,U,A(n,r),t[B.CTRL_OR_CMD]?null:a.getEffectiveGridSize());m=A(g+U[0],v+U[1])}else m=rt.createPointAt(u,i,n-l.editingLinearElement.pointerOffset.x,r-l.editingLinearElement.pointerOffset.y,t[B.CTRL_OR_CMD]||Me(u)?null:a.getEffectiveGridSize());return f===d?rt.movePoints(u,[{index:u.points.length-1,point:m}]):rt.addPoints(u,[{point:m}]),{...l.editingLinearElement,lastUncommittedPoint:u.points[u.points.length-1]}}static getPointGlobalCoordinates(t,n,r){let[a,i,l,s]=Ze(t,r),d=(a+l)/2,u=(i+s)/2,{x:o,y:f}=t;return ce(A(o+n[0],f+n[1]),A(d,u),t.angle)}static getPointsGlobalCoordinates(t,n){let[r,a,i,l]=Ze(t,n),s=(r+i)/2,d=(a+l)/2;return t.points.map(u=>{let{x:o,y:f}=t;return ce(A(o+u[0],f+u[1]),A(s,d),t.angle)})}static getPointAtIndexGlobalCoordinates(t,n,r){let a=n<0?t.points.length+n:n,[i,l,s,d]=Ze(t,r),u=(i+s)/2,o=(l+d)/2,f=t.points[a],{x:m,y:U}=t;return ce(f?A(m+f[0],U+f[1]):A(m,U),A(u,o),t.angle)}static pointFromAbsoluteCoords(t,n,r){if(Me(t))return A(n[0]-t.x,n[1]-t.y);let[a,i,l,s]=Ze(t,r),d=(a+l)/2,u=(i+s)/2,[o,f]=ce(A(n[0],n[1]),A(d,u),-t.angle);return A(o-t.x,f-t.y)}static getPointIndexUnderCursor(t,n,r,a,i){let l=rt.getPointsGlobalCoordinates(t,n),s=l.length;for(;--s>-1;){let d=l[s];if(yt(A(a,i),A(d[0],d[1]))*r.value<rt.POINT_HANDLE_SIZE+1)return s}return-1}static createPointAt(t,n,r,a,i){let l=xn(r,a,i),[s,d,u,o]=Ze(t,n),f=(s+u)/2,m=(d+o)/2,[U,g]=ce(A(l[0],l[1]),A(f,m),-t.angle);return A(U-t.x,g-t.y)}static getNormalizedPoints(t){let{points:n}=t,r=n[0][0],a=n[0][1];return{points:n.map(i=>A(i[0]-r,i[1]-a)),x:t.x+r,y:t.y+a}}static normalizePoints(t){pe(t,rt.getNormalizedPoints(t))}static duplicateSelectedPoints(t,n){lr(t.editingLinearElement,"Not currently editing a linear element");let{selectedPointsIndices:r,elementId:a}=t.editingLinearElement,i=rt.getElement(a,n);lr(i,"The linear element does not exist in the provided Scene"),lr(r!=null,"There are no selected points to duplicate");let{points:l}=i,s=[],d=!1,u=-1,o=l.reduce((f,m,U)=>{if(++u,f.push(m),r.includes(U)){let g=l[U+1];g||(d=!0),f.push(g?A((m[0]+g[0])/2,(m[1]+g[1])/2):A(m[0],m[1])),s.push(u+1),++u}return f},[]);if(pe(i,{points:o}),d){let f=i.points[i.points.length-1];rt.movePoints(i,[{index:i.points.length-1,point:A(f[0]+30,f[1]+30)}])}return{...t,editingLinearElement:{...t.editingLinearElement,selectedPointsIndices:s}}}static deletePoints(t,n){let r=0,a=0;if(n.includes(0)){let l=t.points.find((s,d)=>!n.includes(d));l&&(r=l[0],a=l[1])}let i=t.points.reduce((l,s,d)=>(n.includes(d)||l.push(l.length?A(s[0]-r,s[1]-a):A(0,0)),l),[]);rt._updatePoints(t,i,r,a)}static addPoints(t,n){let r=[...t.points,...n.map(a=>a.point)];rt._updatePoints(t,r,0,0)}static movePoints(t,n,r){var o,f,m;let{points:a}=t,[i,l]=((o=n.find(({index:U})=>U===0))==null?void 0:o.point)??A(0,0),[s,d]=A(i-a[0][0],l-a[0][1]),u=Me(t)?[((f=n.find(U=>U.index===0))==null?void 0:f.point)??a[0],((m=n.find(U=>U.index===a.length-1))==null?void 0:m.point)??a[a.length-1]]:a.map((U,g)=>{var y;let v=((y=n.find(w=>w.index===g))==null?void 0:y.point)??U;return A(v[0]-s,v[1]-d)});rt._updatePoints(t,u,s,d,r,{isDragging:n.reduce((U,g)=>U||g.isDragging===!0,!1)})}static shouldAddMidpoint(t,n,r,a){let i=rt.getElement(t.elementId,a);if(i&&Me(i)||!i)return!1;let{segmentMidpoint:l}=t.pointerDownState;if(l.added||l.value===null||l.index===null||t.pointerDownState.origin===null)return!1;let s=t.pointerDownState.origin,d=yt(A(s.x,s.y),A(n.x,n.y));return!(!r.editingLinearElement&&d<Ks/r.zoom.value)}static addMidpoint(t,n,r,a,i){let l=rt.getElement(t.elementId,i);if(!l)return;let{segmentMidpoint:s}=t.pointerDownState,d={pointerDownState:t.pointerDownState,selectedPointsIndices:t.selectedPointsIndices},u=rt.createPointAt(l,i,n.x,n.y,a&&!Me(l)?r.getEffectiveGridSize():null),o=[...l.points.slice(0,s.index),u,...l.points.slice(s.index)];return pe(l,{points:o}),d.pointerDownState={...t.pointerDownState,segmentMidpoint:{...t.pointerDownState.segmentMidpoint,added:!0},lastClickedPoint:s.index},d.selectedPointsIndices=[s.index],d}static _updatePoints(t,n,r,a,i,l){if(Me(t)){let s={};(i==null?void 0:i.startBinding)!==void 0&&(s.startBinding=i.startBinding!==null&&Op(i.startBinding)?i.startBinding:null),(i==null?void 0:i.endBinding)!==void 0&&(s.endBinding=i.endBinding!==null&&Op(i.endBinding)?i.endBinding:null),s.points=Array.from(n),pe(t,s,!0,{isDragging:l==null?void 0:l.isDragging})}else{let s=my(t,n),d=my(t,t.points),u=(s[0]+s[2])/2,o=(s[1]+s[3])/2,f=(d[0]+d[2])/2,m=(d[1]+d[3])/2,U=f-u,g=m-o,v=ce(A(r,a),A(U,g),t.angle);pe(t,{...i,points:n,x:t.x+v[0],y:t.y+v[1]})}}static _getShiftLockedDelta(t,n,r,a,i){let l=rt.getPointGlobalCoordinates(t,r,n);if(Me(t))return[a[0]-l[0],a[1]-l[1]];let[s,d]=xn(a[0],a[1],i),{width:u,height:o}=v6(l[0],l[1],s,d);return ce(A(u,o),A(0,0),-t.angle)}static moveFixedSegment(t,n,r,a,i){let l=rt.getElement(t.elementId,i);if(!l||!Me(l))return t;if(n&&n>0&&n<l.points.length){let s=tl(Mo(Pe(l.points[n],l.points[n-1]))),d=(l.fixedSegments??[]).reduce((m,U)=>(m[U.index]=U,m),{});d[n]={index:n,start:A(s?l.points[n-1][0]:r-l.x,s?a-l.y:l.points[n-1][1]),end:A(s?l.points[n][0]:r-l.x,s?a-l.y:l.points[n][1])};let u=Object.values(d).sort((m,U)=>m.index-U.index),o=u.map(m=>m.index).reduce((m,U)=>U<n?m+1:m,0);pe(l,{fixedSegments:u});let f=A(l.x+(l.fixedSegments[o].start[0]+l.fixedSegments[o].end[0])/2,l.y+(l.fixedSegments[o].start[1]+l.fixedSegments[o].end[1])/2);return{...t,segmentMidPointHoveredCoords:f,pointerDownState:{...t.pointerDownState,segmentMidpoint:{added:!1,index:l.fixedSegments[o].index,value:f}}}}return t}static deleteFixedSegment(t,n){var r;pe(t,{fixedSegments:(r=t.fixedSegments)==null?void 0:r.filter(a=>a.index!==n)}),pe(t,{},!0)}};F(dn,"POINT_HANDLE_SIZE",10),F(dn,"getEditorMidPoints",(e,t,n)=>{let r=Je(e,t);return!Me(e)&&!n.editingLinearElement&&e.points.length>2&&!r?[]:(Xl.version===e.version&&Xl.zoom===n.zoom.value||dn.updateEditorMidPointsCache(e,t,n),Xl.points)}),F(dn,"updateEditorMidPointsCache",(e,t,n)=>{let r=dn.getPointsGlobalCoordinates(e,t),a=0,i=[];for(;a<r.length-1;){if(dn.isSegmentTooShort(e,e.points[a],e.points[a+1],a,n.zoom)){i.push(null),a++;continue}let l=dn.getSegmentMidPoint(e,r[a],r[a+1],a+1,t);i.push(l),a++}Xl.points=i,Xl.version=e.version,Xl.zoom=n.zoom.value}),F(dn,"getSegmentMidpointHitCoords",(e,t,n,r)=>{let{elementId:a}=e,i=dn.getElement(a,r);if(!i)return null;let l=dn.getPointIndexUnderCursor(i,r,n.zoom,t.x,t.y);if(!Me(i)&&l>=0||dn.getPointsGlobalCoordinates(i,r).length>=3&&!n.editingLinearElement&&!Me(i))return null;let s=(dn.POINT_HANDLE_SIZE+1)/n.zoom.value,d=e.segmentMidPointHoveredCoords;if(d&&yt(A(d[0],d[1]),A(t.x,t.y))<=s)return d;let u=0,o=dn.getEditorMidPoints(i,r,n);for(;u<o.length;){if(o[u]!==null&&yt(o[u],A(t.x,t.y))<=s)return o[u];u++}return null}),F(dn,"getBoundTextElementPosition",(e,t,n)=>{let r=dn.getPointsGlobalCoordinates(e,n);r.length<2&&pe(t,{isDeleted:!0});let a=0,i=0;if(e.points.length%2===1){let l=Math.floor(e.points.length/2),s=dn.getPointGlobalCoordinates(e,e.points[l],n);a=s[0]-t.width/2,i=s[1]-t.height/2}else{let l=e.points.length/2-1,s=Xl.points[l];e.points.length===2&&(s=Df(r[0],r[1])),(!s||Xl.version!==e.version)&&(s=dn.getSegmentMidPoint(e,r[l],r[l+1],l+1,n)),a=s[0]-t.width/2,i=s[1]-t.height/2}return{x:a,y:i}}),F(dn,"getMinMaxXYWithBoundText",(e,t,n,r)=>{let[a,i,l,s]=n,d=(a+l)/2,u=(i+s)/2,{x:o,y:f}=dn.getBoundTextElementPosition(e,r,t),m=o+r.width,U=f+r.height,g=A(d,u),v=ce(A(a,i),g,e.angle),y=ce(A(l,i),g,e.angle),w=ce(A(o,f),g,-e.angle),E=ce(A(m,f),g,-e.angle),S=ce(A(o,U),g,-e.angle),k=ce(A(m,U),g,-e.angle);return v[0]<y[0]&&v[1]>=y[1]?(a=Math.min(a,S[0]),l=Math.max(l,Math.max(E[0],k[0])),i=Math.min(i,w[1]),s=Math.max(s,k[1])):v[0]>=y[0]&&v[1]>y[1]?(a=Math.min(a,k[0]),l=Math.max(l,Math.max(w[0],E[0])),i=Math.min(i,S[1]),s=Math.max(s,E[1])):v[0]>=y[0]?(a=Math.min(a,E[0]),l=Math.max(l,S[0]),i=Math.min(i,k[1]),s=Math.max(s,w[1])):v[1]<=y[1]&&(a=Math.min(a,Math.min(E[0],w[0])),l=Math.max(l,k[0]),i=Math.min(i,E[1]),s=Math.max(s,S[1])),[a,i,l,s,d,u]}),F(dn,"getElementAbsoluteCoords",(e,t,n=!1)=>{let r,a,i,l,s;if(e.points.length<2||!Qt.get(e)){let{minX:f,minY:m,maxX:U,maxY:g}=e.points.reduce((v,[y,w])=>(v.minY=Math.min(v.minY,w),v.minX=Math.min(v.minX,y),v.maxX=Math.max(v.maxX,y),v.maxY=Math.max(v.maxY,w),v),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});a=f+e.x,i=m+e.y,l=U+e.x,s=g+e.y}else{let f=Qt.generateElementShape(e,null),m=Ss(f[0]),[U,g,v,y]=R0(m);a=U+e.x,i=g+e.y,l=v+e.x,s=y+e.y}let d=(a+l)/2,u=(i+s)/2;if(r=[a,i,l,s,d,u],!n)return r;let o=Je(e,t);return o&&(r=dn.getMinMaxXYWithBoundText(e,t,[a,i,l,s],o)),r});var Ce=dn,sG=e=>{let t=[...new Set(e.filter(n=>n!==null&&n!==-1))];return t=t.sort((n,r)=>n-r),t.length?t:null},nd={},Vp=(e,t)=>{let n=nd[e]||(nd[e]={height:t});return n.height=t,n},ck=e=>{nd[e]&&delete nd[e]},oG=e=>{var t;return((t=nd[e])==null?void 0:t.height)??null},hr=(e,t,n,r=!0)=>{let a,i={x:e.x,y:e.y,text:e.text,width:e.width,height:e.height,angle:(t==null?void 0:t.angle)??e.angle};i.text=e.text,(t||!e.autoResize)&&(a=t?dl(t,e):e.width,i.text=Po(e.originalText,_t(e),a));let l=sr(i.text,_t(e),e.lineHeight);if(e.autoResize&&(i.width=l.width),i.height=l.height,t){let s=F0(t,e),d=dl(t,e);if(!nt(t)&&l.height>s){let m=Io(l.height,t.type);pe(t,{height:m},r),Vp(t.id,m)}if(l.width>d){let m=Io(l.width,t.type);pe(t,{width:m},r)}let u={...e,...i},{x:o,y:f}=z0(t,u,n);i.x=o,i.y=f}pe(e,i,r)},dk=(e,t,n)=>{let r=We(e);t.forEach(a=>{let i=n.get(a.id),l=cl(a);if(l){let s=n.get(l);if(s){let d=r.get(i);d&&pe(d,{boundElements:(a.boundElements||[]).filter(o=>o.id!==s&&o.id!==l).concat({type:"text",id:s})});let u=r.get(s);u&&ke(u)&&pe(u,{containerId:d?i:null})}}})},zf=(e,t,n,r=!1)=>{if(!cl(e))return;ck(e.id);let a=Je(e,t);if(a&&a.text){if(!e)return;let i=a.text,l=a.height,s=a.width,d=dl(e,a),u=F0(e,a),o=e.height;if(r||n!=="n"&&n!=="s"){i&&(i=Po(a.originalText,_t(a),d));let f=sr(i,_t(a),a.lineHeight);l=f.height,s=f.width}if(l>u){o=Io(l,e.type);let f=o-e.height,m=!nt(e)&&(n==="ne"||n==="nw"||n==="n")?e.y-f:e.y;pe(e,{height:o,y:m})}pe(a,{text:i,width:s,height:l}),nt(e)||pe(a,z0(e,a,t))}},z0=(e,t,n)=>{if(nt(e))return Ce.getBoundTextElementPosition(e,t,n);let r=cG(e),a=F0(e,t),i=dl(e,t),l,s;return t.verticalAlign===Br.TOP?s=r.y:t.verticalAlign===Br.BOTTOM?s=r.y+(a-t.height):s=r.y+(a/2-t.height/2),t.textAlign===of.LEFT?l=r.x:t.textAlign===of.RIGHT?l=r.x+(i-t.width):l=r.x+(i/2-t.width/2),{x:l,y:s}},cl=e=>{var t,n,r;return((t=e==null?void 0:e.boundElements)==null?void 0:t.length)&&((r=(n=e==null?void 0:e.boundElements)==null?void 0:n.find(a=>a.type==="text"))==null?void 0:r.id)||null},Je=(e,t)=>{if(!e)return null;let n=cl(e);return n&&t.get(n)||null},Bn=(e,t)=>e&&e.containerId&&t.get(e.containerId)||null,W2=(e,t,n)=>{if(!nt(e))return{x:e.x+e.width/2,y:e.y+e.height/2};let r=Ce.getPointsGlobalCoordinates(e,n);if(r.length%2===1){let l=Math.floor(e.points.length/2),s=Ce.getPointGlobalCoordinates(e,e.points[l],n);return{x:s[0],y:s[1]}}let a=e.points.length/2-1,i=Ce.getEditorMidPoints(e,n,t)[a];return i||(i=Ce.getSegmentMidPoint(e,r[a],r[a+1],a+1,n)),{x:i[0],y:i[1]}},cG=e=>{let t=wn,n=wn;return e.type==="ellipse"&&(t+=e.width/2*(1-Math.sqrt(2)/2),n+=e.height/2*(1-Math.sqrt(2)/2)),e.type==="diamond"&&(t+=e.width/4,n+=e.height/4),{x:e.x+t,y:e.y+n}},dG=(e,t)=>!t||nt(t)?e.angle:t.angle,uG=(e,t)=>e.some(n=>{if(Ft(n)){let r=Bn(n,t);return!nt(r)}return!1}),fG=(e,t)=>e.some(n=>{if(Ft(n)){let r=Bn(n,t);return!nt(r)}return ke(n)}),hG=new Set(["rectangle","ellipse","diamond","arrow"]),pG=e=>hG.has(e.type),Io=(e,t)=>{e=Math.ceil(e);let n=wn*2;return t==="ellipse"?Math.round((e+n)/Math.sqrt(2)*2):t==="arrow"?e+n*8:t==="diamond"?2*(e+n):e+n},dl=(e,t)=>{let{width:n}=e;if(nt(e)){let r=((t==null?void 0:t.fontSize)??bl)*qN;return Math.max(KN*n,r)}return e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-wn*2:e.type==="diamond"?Math.round(n/2)-wn*2:n-wn*2},F0=(e,t)=>{let{height:n}=e;return nt(e)?n-wn*8*2<=0?t.height:n:e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-wn*2:e.type==="diamond"?Math.round(n/2)-wn*2:n-wn*2},uk=(e,t=`
|
|
64
|
+
|
|
65
|
+
`)=>e.reduce((n,r)=>(ke(r)&&n.push(r.text),n),[]).join(t),Rr=e=>(e=e.trim(),e&&pN.sanitizeUrl(ep(e))),fk=e=>!!(e!=null&&e.includes(location.origin)||e!=null&&e.startsWith("/")),hk=e=>{if(e=Rr(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e},u6=[],xe=e=>(u6=u6.concat(e),e),pk='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',mG='<path d="M6.164 11.755a5.314 5.314 0 0 1-4.932-5.298 5.314 5.314 0 0 1 5.311-5.311 5.314 5.314 0 0 1 5.307 5.113l8.773 8.773a3.322 3.322 0 0 1 0 4.696l-.895.895a3.322 3.322 0 0 1-4.696 0l-8.868-8.868Z" style="fill:#fff"/>',mk='<path stroke="#1b1b1f" fill="#fff" d="m7.868 11.113 7.773 7.774a2.359 2.359 0 0 0 1.667.691 2.368 2.368 0 0 0 2.357-2.358c0-.625-.248-1.225-.69-1.667L11.201 7.78 9.558 9.469l-1.69 1.643v.001Zm10.273 3.606-3.333 3.333m-3.25-6.583 2 2m-7-7 3 3M3.664 3.625l1 1M2.529 6.922l1.407-.144m5.735-2.932-1.118.866M4.285 9.823l.758-1.194m1.863-6.207-.13 1.408"/>',UG=`data:${De.svg},${encodeURIComponent(`${pk}${mk}</svg>`)}`,gG=`data:${De.svg},${encodeURIComponent(`${pk}${mG}${mk}</svg>`)}`,Ta=e=>{e&&(e.style.cursor="")},It=(e,t)=>{e&&(e.style.cursor=t)},ai,Ey,Uk=(e,t)=>{let n=()=>{let r=t===ot.DARK;ai=document.createElement("canvas"),ai.theme=t,ai.height=20,ai.width=20;let a=ai.getContext("2d");a.lineWidth=1,a.beginPath(),a.arc(ai.width/2,ai.height/2,5,0,2*Math.PI),a.fillStyle=r?Fn.black:Fn.white,a.fill(),a.strokeStyle=r?Fn.white:Fn.black,a.stroke(),Ey=ai.toDataURL(De.svg)};(!ai||ai.theme!==t)&&n(),It(e,`url(${Ey}) ${20/2} ${20/2}, auto`)},oi=(e,t)=>{if(e)if(t.activeTool.type==="selection")Ta(e);else if(Vc(t))e.style.cursor=kt.GRAB;else if(ci(t))Uk(e,t.theme);else if(t.activeTool.type==="laser"){let n=t.theme===ot.LIGHT?UG:gG;e.style.cursor=`url(${n}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=kt.AUTO):e.style.cursor=kt.CROSSHAIR},bG=new lE(Date.now()),vG=0,Si=()=>Math.floor(bG.next()*2**31),ga=()=>ll()?`id${vG++}`:o5(),Ya=(e,{x:t,y:n,strokeColor:r=nn.strokeColor,backgroundColor:a=nn.backgroundColor,fillStyle:i=nn.fillStyle,strokeWidth:l=nn.strokeWidth,strokeStyle:s=nn.strokeStyle,roughness:d=nn.roughness,opacity:u=nn.opacity,width:o=0,height:f=0,angle:m=0,groupIds:U=[],frameId:g=null,index:v=null,roundness:y=null,boundElements:w=null,link:E=null,locked:S=nn.locked,...k})=>((t<-1e6||t>1e6||n<-1e6||n>1e6||o<-1e6||o>1e6||f<-1e6||f>1e6)&&console.error("New element size or position is too large",{x:t,y:n,width:o,height:f,points:k.points}),{id:k.id||ga(),type:e,x:t,y:n,width:o,height:f,angle:m,strokeColor:r,backgroundColor:a,fillStyle:i,strokeWidth:l,strokeStyle:s,roughness:d,opacity:u,groupIds:U,frameId:g,index:v,roundness:y,seed:k.seed??Si(),version:k.version||1,versionNonce:k.versionNonce??0,isDeleted:!1,boundElements:w,updated:ud(),link:E,locked:S,customData:k.customData}),ki=e=>Ya(e.type,e),Sy=e=>Ya("embeddable",e),yG=e=>({...Ya("iframe",e)}),F5=e=>Ke({...Ya("frame",e),type:"frame",name:(e==null?void 0:e.name)||null},{}),f6=e=>Ke({...Ya("magicframe",e),type:"magicframe",name:(e==null?void 0:e.name)||null},{}),gk=(e,t)=>({x:e.textAlign==="center"?t.width/2:e.textAlign==="right"?t.width:0,y:e.verticalAlign==="middle"?t.height/2:0}),Wr=e=>{let t=e.fontFamily||Es,n=e.fontSize||bl,r=e.lineHeight||Co(t),a=Kc(e.text),i=sr(a,_t({fontFamily:t,fontSize:n}),r),l=e.textAlign||jf,s=e.verticalAlign||Mp,d=gk({textAlign:l,verticalAlign:s},i),u={...Ya("text",e),text:a,fontSize:n,fontFamily:t,textAlign:l,verticalAlign:s,x:e.x-d.x,y:e.y-d.y,width:i.width,height:i.height,containerId:e.containerId||null,originalText:e.originalText??a,autoResize:e.autoResize??!0,lineHeight:r};return Ke(u,{})},xG=(e,t,n)=>{let{width:r,height:a}=sr(n,_t(e),e.lineHeight);e.autoResize||(r=e.width);let{textAlign:i,verticalAlign:l}=e,s,d;if(i==="center"&&l===Br.MIDDLE&&!e.containerId&&e.autoResize){let u=sr(e.text,_t(e),e.lineHeight),o=gk(e,{width:r-u.width,height:a-u.height});s=e.x-o.x,d=e.y-o.y}else{let[u,o,f,m]=Ze(e,t),[U,g,v,y]=fs(e,r,a,!1),w=(u-U)/2,E=(o-g)/2,S=(f-v)/2,k=(m-y)/2;[s,d]=wG({s:!0,e:i==="center"||i==="left",w:i==="center"||i==="right"},e.x,e.y,e.angle,w,E,S,k)}return{width:r,height:a,x:Number.isFinite(s)?s:e.x,y:Number.isFinite(d)?d:e.y}},wG=(e,t,n,r,a,i,l,s)=>{let d=Math.cos(r),u=Math.sin(r);return e.e&&e.w?t+=a+l:e.e?(t+=a*(1+d),n+=a*u,t+=l*(1-d),n+=l*-u):e.w&&(t+=a*(1-d),n+=a*-u,t+=l*(1+d),n+=l*u),e.n&&e.s?n+=i+s:e.n?(t+=i*u,n+=i*(1-d),t+=s*-u,n+=s*(1+d)):(t+=i*-u,n+=i*(1+d),t+=s*u,n+=s*(1-d)),[t,n]},bk=(e,t,n,r=e.text)=>{if(e.isDeleted)return;(t||!e.autoResize)&&(r=Po(r,_t(e),t?dl(t,e):e.width));let a=xG(e,n,r);return{text:r,...a}},EG=e=>({...Ya(e.type,e),points:e.points||[],pressures:e.pressures||[],simulatePressure:e.simulatePressure,lastCommittedPoint:null}),ho=e=>({...Ya(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:null,endArrowhead:null}),B5=e=>e.elbowed?{...Ya(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!0,fixedSegments:e.fixedSegments||[],startIsSpecial:!1,endIsSpecial:!1}:{...Ya(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!1},vk=e=>({...Ya("image",e),strokeColor:"transparent",status:e.status??"pending",fileId:e.fileId??null,scale:e.scale??[1,1],crop:e.crop??null}),Gp=(e,t=0)=>{if(e==null||typeof e!="object")return e;let n=Object.prototype.toString.call(e);if(n==="[object Object]"){let r=typeof e.constructor=="function"?Object.create(Object.getPrototypeOf(e)):{};for(let a in e)if(e.hasOwnProperty(a)){if(t===0&&(a==="shape"||a==="canvas"))continue;r[a]=Gp(e[a],t+1)}return r}if(Array.isArray(e)){let r=e.length,a=new Array(r);for(;r--;)a[r]=Gp(e[r],t+1);return a}return et.DEV&&n!=="[object Object]"&&n!=="[object Array]"&&n.startsWith("[object ")&&console.warn(`_deepCloneElement: unexpected object type ${n}. This value will not be cloned!`),e},No=e=>Gp(e),yk=(e,t)=>{Object.defineProperty(e,eO,{value:t,writable:!1,enumerable:!1})},Yp=()=>ga(),xk=(e,t,n,r)=>{let a=No(n);return ll()&&yk(a,n.id),a.id=Yp(),a.boundElements=null,a.updated=ud(),a.seed=Si(),a.groupIds=GV(a.groupIds,e,i=>(t.has(i)||t.set(i,Yp()),t.get(i))),r&&(a=Object.assign(a,r)),a},wk=(e,t)=>{let n=[],r=We(e),a=new Map,i=s=>{if(a.has(s))return a.get(s);if(r.has(s)){let d=Yp();return a.set(s,d),d}return null},l=new Map;for(let s of e){let d=Gp(s);if(d.id=i(s.id),ll()&&yk(d,s.id),t!=null&&t.randomizeSeed&&(d.seed=Si(),Gf(d)),d.groupIds&&(d.groupIds=d.groupIds.map(u=>(l.has(u)||l.set(u,Yp()),l.get(u)))),"containerId"in d&&d.containerId){let u=i(d.containerId);d.containerId=u}if("boundElements"in d&&d.boundElements&&(d.boundElements=d.boundElements.reduce((u,o)=>{let f=i(o.id);return f&&u.push({...o,id:f}),u},[])),"endBinding"in d&&d.endBinding){let u=i(d.endBinding.elementId);d.endBinding=u?{...d.endBinding,elementId:u}:null}if("startBinding"in d&&d.startBinding){let u=i(d.startBinding.elementId);d.startBinding=u?{...d.startBinding,elementId:u}:null}d.frameId&&(d.frameId=i(d.frameId)),n.push(d)}return n},H5=(e,{shouldThrow:t=!1,includeBoundTextValidation:n=!1,ignoreLogs:r,reconciliationContext:a})=>{let i=[],l=d=>`${d==null?void 0:d.index}:${d==null?void 0:d.id}:${d==null?void 0:d.type}:${d==null?void 0:d.isDeleted}:${d==null?void 0:d.version}:${d==null?void 0:d.versionNonce}`,s=e.map(d=>d.index);for(let[d,u]of s.entries()){let o=s[d-1],f=s[d+1];if(h6(u,o,f)||i.push(`Fractional indices invariant has been compromised: "${l(e[d-1])}", "${l(e[d])}", "${l(e[d+1])}"`),n&&Ua(e[d])){let m=e[d],U=Je(m,We(e));U&&U.index<=m.index&&i.push(`Fractional indices invariant for bound elements has been compromised: "${l(U)}", "${l(m)}"`)}}if(i.length){let d=new Bz,u=[];if(a&&(u.push("Additional reconciliation context:"),u.push(a.localElements.map(o=>l(o))),u.push(a.remoteElements.map(o=>l(o)))),r||console.error(i.join(`
|
|
66
|
+
|
|
67
|
+
`),d.stack,e.map(o=>l(o)),...u),t)throw d}},SG=e=>e.sort((t,n)=>ky(t)&&ky(n)?t.index<n.index?-1:t.index>n.index?1:t.id<n.id?-1:1:1),Ci=(e,t)=>{try{let n=kG(e,t),r=Ek(e,n),a=e.map(i=>r.has(i)?{...i,...r.get(i)}:i);H5(a,{includeBoundTextValidation:!1,shouldThrow:!0,ignoreLogs:!0});for(let[i,l]of r)pe(i,l,!1)}catch{ul(e)}return e},ul=e=>{let t=CG(e),n=Ek(e,t);for(let[r,a]of n)pe(r,a,!1);return e},kG=(e,t)=>{let n=[],r=0;for(;r<e.length;)if(t.has(e[r].id)){let a=[r-1,r];for(;++r<e.length&&t.has(e[r].id);)a.push(r);a.push(r),n.push(a)}else r++;return n},CG=e=>{let t=[],n,r,a=-1,i=0,l=u=>{var m;let o=e[a]?e[a].index:void 0,f=(m=e[u-1])==null?void 0:m.index;return!o&&f||o&&f&&f>o?[f,u-1]:[o,a]},s=u=>{var m;let o=e[i]?e[i].index:void 0;if(o&&u<i)return[o,i];let f=i;for(;++f<e.length;){let U=(m=e[f])==null?void 0:m.index;if(!o&&U||o&&U&&U>o)return[U,f]}return[void 0,f]},d=0;for(;d<e.length;){let u=e[d].index;if([n,a]=l(d),[r,i]=s(d),h6(u,n,r))d++;else{let o=[a,d];for(;++d<e.length;){let f=e[d].index,[m,U]=l(d),[g,v]=s(d);if(h6(f,m,g))break;[n,a]=[m,U],[r,i]=[g,v],o.push(d)}o.push(i),t.push(o)}}return t},h6=(e,t,n)=>e?t&&n?t<e&&e<n:!t&&n?e<n:t&&!n?t<e:!!e:!1,Ek=(e,t)=>{var r,a;let n=new Map;for(let i of t){let l=i.shift(),s=i.pop(),d=Vg((r=e[l])==null?void 0:r.index,(a=e[s])==null?void 0:a.index,i.length);for(let u=0;u<i.length;u++){let o=e[i[u]];n.set(o,{index:d[u]})}}return n},ky=e=>!!e.index,Un=class si{constructor(t,n){this.deleted=t,this.inserted=n}static create(t,n,r,a){let i=r&&a!=="inserted"?r(t):t,l=r&&a!=="deleted"?r(n):n;return new si(i,l)}static calculate(t,n,r,a){if(t===n)return si.empty();let i={},l={};for(let u of this.distinctKeysIterator("full",t,n))i[u]=t[u],l[u]=n[u];let[s,d]=a?a(i,l):[i,l];return si.create(s,d,r)}static empty(){return new si({},{})}static isEmpty(t){return!Object.keys(t.deleted).length&&!Object.keys(t.inserted).length}static mergeObjects(t,n,r){let a={...t};for(let i of Object.keys(r))delete a[i];return{...a,...n}}static mergeArrays(t,n,r,a){return Object.values(si.mergeObjects(Wi(t??[],a),Wi(n??[],a),Wi(r??[],a)))}static diffObjects(t,n,r,a){if(!(!t[r]&&!n[r])&&(typeof t[r]=="object"||typeof n[r]=="object")){let i=t[r]??{},l=n[r]??{},s=si.getLeftDifferences(i,l).reduce((u,o)=>(u[o]=a(i[o]),u),{}),d=si.getRightDifferences(i,l).reduce((u,o)=>(u[o]=a(l[o]),u),{});Object.keys(s).length||Object.keys(d).length?(Reflect.set(t,r,s),Reflect.set(n,r,d)):(Reflect.deleteProperty(t,r),Reflect.deleteProperty(n,r))}}static diffArrays(t,n,r,a){if(!(!t[r]&&!n[r])&&(Array.isArray(t[r])||Array.isArray(n[r]))){let i=Array.isArray(t[r])?t[r]:[],l=Array.isArray(n[r])?n[r]:[],s=Wi(si.getLeftDifferences(Wi(i,a),Wi(l,a))),d=Wi(si.getRightDifferences(Wi(i,a),Wi(l,a)));if(Object.keys(s).length||Object.keys(d).length){let u=i.filter(f=>s[a?a(f):String(f)]),o=l.filter(f=>d[a?a(f):String(f)]);Reflect.set(t,r,u),Reflect.set(n,r,o)}else Reflect.deleteProperty(t,r),Reflect.deleteProperty(n,r)}}static isLeftDifferent(t,n,r=!1){return!!this.distinctKeysIterator("left",t,n,r).next().value}static isRightDifferent(t,n,r=!1){return!!this.distinctKeysIterator("right",t,n,r).next().value}static getLeftDifferences(t,n,r=!1){return Array.from(this.distinctKeysIterator("left",t,n,r))}static getRightDifferences(t,n,r=!1){return Array.from(this.distinctKeysIterator("right",t,n,r))}static*distinctKeysIterator(t,n,r,a=!1){if(n===r)return;let i=[];t==="left"?i=Object.keys(n):t==="right"?i=Object.keys(r):t==="full"?i=Array.from(new Set([...Object.keys(n),...Object.keys(r)])):wo(t,`Unknown distinctKeysIterator's join param "${t}"`,!0);for(let l of i){let s=n[l],d=r[l];if(s!==d){if(!a&&typeof s=="object"&&typeof d=="object"&&s!==null&&d!==null&&Yn(s,d))continue;yield l}}}},Cy=class kr{constructor(t){this.delta=t}static calculate(t,n){let r=Un.calculate(t,n,void 0,kr.postProcess);return new kr(r)}static empty(){return new kr(Un.create({},{}))}inverse(){let t=Un.create(this.delta.inserted,this.delta.deleted);return new kr(t)}applyTo(t,n){try{let{selectedElementIds:r={},selectedGroupIds:a={}}=this.delta.deleted,{selectedElementIds:i={},selectedGroupIds:l={},selectedLinearElementId:s,editingLinearElementId:d,...u}=this.delta.inserted,o=Un.mergeObjects(t.selectedElementIds,i,r),f=Un.mergeObjects(t.selectedGroupIds,l,a),m=s&&n.has(s)?new Ce(n.get(s)):null,U=d&&n.has(d)?new Ce(n.get(d)):null,g={...t,...u,selectedElementIds:o,selectedGroupIds:f,selectedLinearElement:typeof s<"u"?m:t.selectedLinearElement,editingLinearElement:typeof d<"u"?U:t.editingLinearElement},v=this.filterInvisibleChanges(t,g,n);return[g,v]}catch(r){if(console.error("Couldn't apply appstate change",r),et.DEV||et.MODE===Tr.TEST)throw r;return[t,!1]}}isEmpty(){return Un.isEmpty(this.delta)}static postProcess(t,n){try{Un.diffObjects(t,n,"selectedElementIds",r=>!0),Un.diffObjects(t,n,"selectedGroupIds",r=>r??!1)}catch(r){if(console.error("Couldn't postprocess appstate change deltas."),et.DEV||et.MODE===Tr.TEST)throw r}finally{return[t,n]}}filterInvisibleChanges(t,n,r){let a=Zp(t),i=Zp(n),l=Un.isRightDifferent(kr.stripElementsProps(a),kr.stripElementsProps(i)),s=Un.isRightDifferent(kr.stripStandaloneProps(a),kr.stripStandaloneProps(i));if(!l&&!s)return!1;let d={value:l};if(s){let u=Un.getRightDifferences(kr.stripStandaloneProps(a),kr.stripStandaloneProps(i)),o=new Set;(u.includes("editingGroupId")||u.includes("selectedGroupIds"))&&(o=KV(r));for(let f of u)switch(f){case"selectedElementIds":n[f]=kr.filterSelectedElements(n[f],r,d);break;case"selectedGroupIds":n[f]=kr.filterSelectedGroups(n[f],o,d);break;case"croppingElementId":{let v=n[f],y=v&&r.get(v);y&&!y.isDeleted?d.value=!0:n[f]=null;break}case"editingGroupId":let m=n[f];m?o.has(m)?d.value=!0:n[f]=null:d.value=!0;break;case"selectedLinearElementId":case"editingLinearElementId":let U=kr.convertToAppStateKey(f),g=n[U];if(!g)d.value=!0;else{let v=r.get(g.elementId);v&&!v.isDeleted?d.value=!0:n[U]=null}break;default:wo(f,`Unknown ObservedElementsAppState's key "${f}"`,!0)}}return d.value}static convertToAppStateKey(t){switch(t){case"selectedLinearElementId":return"selectedLinearElement";case"editingLinearElementId":return"editingLinearElement"}}static filterSelectedElements(t,n,r){let a=Object.keys(t);if(!a.length)return r.value=!0,t;let i={...t};for(let l of a){let s=n.get(l);s&&!s.isDeleted?r.value=!0:delete i[l]}return i}static filterSelectedGroups(t,n,r){if(!Object.keys(t).length)return r.value=!0,t;let a={...t};for(let i of Object.keys(a))n.has(i)?r.value=!0:delete a[i];return a}static stripElementsProps(t){let{editingGroupId:n,selectedGroupIds:r,selectedElementIds:a,editingLinearElementId:i,selectedLinearElementId:l,croppingElementId:s,...d}=t;return d}static stripStandaloneProps(t){let{name:n,viewBackgroundColor:r,...a}=t;return a}},Ql=class Zt{constructor(t,n,r){this.added=t,this.removed=n,this.updated=r}static create(t,n,r,a={shouldRedistribute:!1}){let i;if(a.shouldRedistribute){let l=new Map,s=new Map,d=new Map,u=[...t,...n,...r];for(let[o,f]of u)this.satisfiesAddition(f)?l.set(o,f):this.satisfiesRemoval(f)?s.set(o,f):d.set(o,f);i=new Zt(l,s,d)}else i=new Zt(t,n,r);return(et.DEV||et.MODE===Tr.TEST)&&(Zt.validate(i,"added",this.satisfiesAddition),Zt.validate(i,"removed",this.satisfiesRemoval),Zt.validate(i,"updated",this.satisfiesUpdate)),i}static validate(t,n,r){for(let[a,i]of t[n].entries())if(!r(i))throw console.error(`Broken invariant for "${n}" delta, element "${a}", delta:`,i),new Error(`ElementsChange invariant broken for element "${a}".`)}static calculate(t,n){if(t===n)return Zt.empty();let r=new Map,a=new Map,i=new Map;for(let l of t.values())if(!n.get(l.id)){let s={...l,isDeleted:!1},d={isDeleted:!0},u=Un.create(s,d,Zt.stripIrrelevantProps);a.set(l.id,u)}for(let l of n.values()){let s=t.get(l.id);if(!s){let d={isDeleted:!0},u={...l,isDeleted:!1},o=Un.create(d,u,Zt.stripIrrelevantProps);r.set(l.id,o);continue}if(s.versionNonce!==l.versionNonce){let d=Un.calculate(s,l,Zt.stripIrrelevantProps,Zt.postProcess);if(typeof s.isDeleted=="boolean"&&typeof l.isDeleted=="boolean"&&s.isDeleted!==l.isDeleted){s.isDeleted&&!l.isDeleted?r.set(l.id,d):a.set(l.id,d);continue}Un.isEmpty(d)||i.set(l.id,d)}}return Zt.create(r,a,i)}static empty(){return Zt.create(new Map,new Map,new Map)}inverse(){let t=i=>{let l=new Map;for(let[s,d]of i.entries())l.set(s,Un.create(d.inserted,d.deleted));return l},n=t(this.added),r=t(this.removed),a=t(this.updated);return Zt.create(r,n,a)}isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}applyLatestChanges(t){let n=s=>d=>{let u={};for(let o of Object.keys(d))switch(o){case"boundElements":u[o]=d[o];break;default:u[o]=s[o]}return u},r=s=>{let d=new Map;for(let[u,o]of s.entries()){let f=t.get(u);if(f){let m=Un.create(o.deleted,o.inserted,n(f),"inserted");d.set(u,m)}else d.set(u,o)}return d},a=r(this.added),i=r(this.removed),l=r(this.updated);return Zt.create(a,i,l,{shouldRedistribute:!0})}applyTo(t,n){let r=pa(new Map(t)),a,i={containsVisibleDifference:!1,containsZindexDifference:!1};try{let l=Zt.createApplier(r,n,i),s=l(this.added),d=l(this.removed),u=l(this.updated),o=this.resolveConflicts(t,r);a=new Map([...s,...d,...u,...o])}catch(l){if(console.error("Couldn't apply elements change",l),et.DEV||et.MODE===Tr.TEST)throw l;return[t,!0]}try{Zt.redrawTextBoundingBoxes(r,a),r=Zt.reorderElements(r,a,i),Zt.redrawBoundArrows(r,a)}catch(l){if(console.error("Couldn't mutate elements after applying elements change",l),et.DEV||et.MODE===Tr.TEST)throw l}finally{return[r,i.containsVisibleDifference]}}static applyDelta(t,n,r={containsVisibleDifference:!0,containsZindexDifference:!0}){var l,s;let{boundElements:a,...i}=n.inserted;if((l=n.deleted.boundElements)!=null&&l.length||(s=n.inserted.boundElements)!=null&&s.length){let d=Un.mergeArrays(t.boundElements,n.inserted.boundElements,n.deleted.boundElements,u=>u.id);Object.assign(i,{boundElements:d})}if(vt(t)){let d=n;(d.deleted.crop||d.inserted.crop)&&Object.assign(i,{crop:d.inserted.crop??null})}if(!r.containsVisibleDifference){let{index:d,...u}=i,o=Zt.checkForVisibleDifference(t,u);r.containsVisibleDifference=o}return r.containsZindexDifference||(r.containsZindexDifference=n.deleted.index!==n.inserted.index),Ke(t,i)}static checkForVisibleDifference(t,n){return t.isDeleted&&n.isDeleted!==!1?!1:t.isDeleted&&n.isDeleted===!1||t.isDeleted===!1&&n.isDeleted?!0:Un.isRightDifferent(t,n)}resolveConflicts(t,n){let r=new Map,a=(u,o)=>{let f=n.get(u.id);if(!f)return;let m;t.get(u.id)===f?m=Ke(f,o):m=pe(f,o),r.set(m.id,m),n.set(m.id,m)};for(let[u]of this.removed)Zt.unbindAffected(t,n,u,a);for(let[u]of this.added)Zt.rebindAffected(t,n,u,a);for(let[u]of Array.from(this.updated).filter(([o,f])=>Object.keys({...f.deleted,...f.inserted}).find(m=>zV.has(m)))){let o=n.get(u);!o||o.isDeleted||Zt.rebindAffected(t,n,u,a)}let i=new Map(Array.from(t).filter(([u])=>r.has(u))),{added:l,removed:s,updated:d}=Zt.calculate(i,r);for(let[u,o]of l)this.added.set(u,o);for(let[u,o]of s)this.removed.set(u,o);for(let[u,o]of d)this.updated.set(u,o);return r}static unbindAffected(t,n,r,a){let i=()=>t.get(r),l=()=>n.get(r);Tc.unbindAffected(n,i(),a),Tc.unbindAffected(n,l(),a),Ac.unbindAffected(n,i(),a),Ac.unbindAffected(n,l(),a)}static rebindAffected(t,n,r,a){let i=()=>t.get(r),l=()=>n.get(r);Tc.unbindAffected(n,i(),a),Tc.rebindAffected(n,l(),a),Ac.unbindAffected(n,i(),(s,d)=>{ke(s)&&a(s,d)}),Ac.rebindAffected(n,l(),a)}static redrawTextBoundingBoxes(t,n){let r=new Map;for(let a of n.values()){if(Ft(a)){let{containerId:i}=a,l=i?t.get(i):void 0;l&&r.set(l.id,{container:l,boundText:a})}if(Ua(a)){let i=cl(a),l=i?t.get(i):void 0;l&&r.set(a.id,{container:a,boundText:l})}}for(let{container:a,boundText:i}of r.values())a.isDeleted||i.isDeleted||hr(i,a,t,!1)}static redrawBoundArrows(t,n){for(let r of n.values())!r.isDeleted&&Va(r)&&Ar(r,t,{})}static reorderElements(t,n,r){if(!r.containsZindexDifference)return t;let a=Array.from(t.values()),i=SG([...a]),l=Un.getRightDifferences(a,i,!0).reduce((s,d)=>{let u=a[Number(d)];return u&&n.has(u.id)&&s.set(u.id,u),s},new Map);return!r.containsVisibleDifference&&l.size&&(r.containsVisibleDifference=!0),We(Ci(i,l))}static postProcess(t,n){try{Un.diffArrays(t,n,"boundElements",r=>r.id)}catch(r){if(console.error("Couldn't postprocess elements change deltas."),et.DEV||et.MODE===Tr.TEST)throw r}finally{return[t,n]}}static stripIrrelevantProps(t){let{id:n,updated:r,version:a,versionNonce:i,seed:l,...s}=t;return s}};F(Ql,"satisfiesAddition",({deleted:e,inserted:t})=>e.isDeleted===!0&&!t.isDeleted),F(Ql,"satisfiesRemoval",({deleted:e,inserted:t})=>!e.isDeleted&&t.isDeleted===!0),F(Ql,"satisfiesUpdate",({deleted:e,inserted:t})=>!!e.isDeleted==!!t.isDeleted),F(Ql,"createApplier",(e,t,n)=>{let r=Ql.createGetter(e,t,n);return a=>Array.from(a.entries()).reduce((i,[l,s])=>{let d=r(l,s.inserted);if(d){let u=Ql.applyDelta(d,s,n);e.set(u.id,u),i.set(u.id,u)}return i},new Map)}),F(Ql,"createGetter",(e,t,n)=>(r,a)=>{let i=e.get(r);return i||(i=t.get(r),i&&(n.containsZindexDifference=!0,(a.isDeleted===!1||a.isDeleted!==!0&&i.isDeleted===!1)&&(n.containsVisibleDifference=!0))),i});var My=Ql,di=class{constructor(){F(this,"subscribers",[])}on(...e){let t=e.flat().filter(n=>typeof n=="function");return this.subscribers.push(...t),()=>this.off(t)}once(...e){let t=e.flat().filter(r=>typeof r=="function");t.push(()=>n());let n=this.on(...t);return n}off(...e){let t=e.flat();this.subscribers=this.subscribers.filter(n=>!t.includes(n))}trigger(...e){for(let t of this.subscribers)t(...e);return this}clear(){this.subscribers=[]}},Sk="__observedAppState",Zp=e=>{var n,r;let t={name:e.name,editingGroupId:e.editingGroupId,viewBackgroundColor:e.viewBackgroundColor,selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,editingLinearElementId:((n=e.editingLinearElement)==null?void 0:n.elementId)||null,selectedLinearElementId:((r=e.selectedLinearElement)==null?void 0:r.elementId)||null,croppingElementId:e.croppingElementId};return Reflect.defineProperty(t,Sk,{value:!0,enumerable:!1}),t},MG=e=>!!Reflect.get(e,Sk),ie={IMMEDIATELY:"IMMEDIATELY",NEVER:"NEVER",EVENTUALLY:"EVENTUALLY"},IG=class{constructor(e,t){this.elementsChange=e,this.appStateChange=t}},_G=class{constructor(){F(this,"onStoreIncrementEmitter",new di),F(this,"scheduledActions",new Set),F(this,"_snapshot",Iy.empty()),F(this,"shouldCaptureIncrement",()=>{this.scheduleAction(ie.IMMEDIATELY)}),F(this,"shouldUpdateSnapshot",()=>{this.scheduleAction(ie.NEVER)}),F(this,"scheduleAction",e=>{this.scheduledActions.add(e),this.satisfiesScheduledActionsInvariant()}),F(this,"commit",(e,t)=>{try{this.scheduledActions.has(ie.IMMEDIATELY)?this.captureIncrement(e,t):this.scheduledActions.has(ie.NEVER)&&this.updateSnapshot(e,t)}finally{this.satisfiesScheduledActionsInvariant(),this.scheduledActions=new Set}}),F(this,"captureIncrement",(e,t)=>{let n=this.snapshot,r=this.snapshot.maybeClone(e,t);if(n!==r){let a=r.meta.didElementsChange?My.calculate(n.elements,r.elements):My.empty(),i=r.meta.didAppStateChange?Cy.calculate(n.appState,r.appState):Cy.empty();(!a.isEmpty()||!i.isEmpty())&&this.onStoreIncrementEmitter.trigger(new IG(a,i)),this.snapshot=r}}),F(this,"updateSnapshot",(e,t)=>{let n=this.snapshot.maybeClone(e,t);this.snapshot!==n&&(this.snapshot=n)}),F(this,"filterUncomittedElements",(e,t)=>{for(let[n,r]of e.entries()){if(!t.get(n))continue;let a=this.snapshot.elements.get(n);a?a.version<r.version&&t.set(n,a):t.delete(n)}return t}),F(this,"clear",()=>{this.snapshot=Iy.empty(),this.scheduledActions=new Set}),F(this,"satisfiesScheduledActionsInvariant",()=>{if(!(this.scheduledActions.size>=0&&this.scheduledActions.size<=3)){let e=`There can be at most three store actions scheduled at the same time, but there are "${this.scheduledActions.size}".`;if(console.error(e,this.scheduledActions.values()),et.DEV||et.MODE===Tr.TEST)throw new Error(e)}})}get snapshot(){return this._snapshot}set snapshot(e){this._snapshot=e}},Iy=class p6{constructor(t,n,r={didElementsChange:!1,didAppStateChange:!1,isEmpty:!1}){this.elements=t,this.appState=n,this.meta=r}static empty(){return new p6(new Map,Zp(wi()),{didElementsChange:!1,didAppStateChange:!1,isEmpty:!0})}isEmpty(){return this.meta.isEmpty}maybeClone(t,n){let r=this.maybeCreateElementsSnapshot(t),a=this.maybeCreateAppStateSnapshot(n),i=!1,l=!1;return this.elements!==r&&(i=!0),this.appState!==a&&(l=!0),!i&&!l?this:new p6(r,a,{didElementsChange:i,didAppStateChange:l})}maybeCreateAppStateSnapshot(t){if(!t)return this.appState;let n=MG(t)?t:Zp(t);return this.detectChangedAppState(n)?n:this.appState}detectChangedAppState(t){return!Yn(this.appState,t,{selectedElementIds:Yn,selectedGroupIds:Yn})}maybeCreateElementsSnapshot(t){return t?this.detectChangedElements(t)?this.createElementsSnapshot(t):this.elements:this.elements}detectChangedElements(t){if(this.elements===t)return!1;if(this.elements.size!==t.size)return!0;let n=Array.from(t.keys());for(let r=n.length-1;r>=0;r--){let a=this.elements.get(n[r]),i=t.get(n[r]);if(!a||!i||a.id!==i.id||a.versionNonce!==i.versionNonce)return!0}return!1}createElementsSnapshot(t){let n=new Map;for(let[r,a]of this.elements.entries())t.get(r)?n.set(r,a):n.set(r,Ke(a,{isDeleted:!0}));for(let[r,a]of t.entries()){let i=n.get(r);(!i||i&&i.versionNonce!==a.versionNonce)&&n.set(r,No(a))}return n}},ii=new Map,TG=/^(?:http(?:s)?:\/\/)?(?:www\.)?youtu(?:be\.com|\.be)\/(embed\/|watch\?v=|shorts\/|playlist\?list=|embed\/videoseries\?list=)?([a-zA-Z0-9_-]+)(?:\?t=|&t=|\?start=|&start=)?([a-zA-Z0-9_-]+)?[^\s]*$/,AG=/^(?:http(?:s)?:\/\/)?(?:(?:w){3}\.)?(?:player\.)?vimeo\.com\/(?:video\/)?([^?\s]+)(?:\?.*)?$/,RG=/^https:\/\/(?:www\.)?figma\.com/,_y=/^https:\/\/gist\.github\.com\/([\w_-]+)\/([\w_-]+)/,jG=/^<script[\s\S]*?\ssrc=["'](https:\/\/gist\.github\.com\/.*?)\.js["']/i,Ty=/(?:https?:\/\/)?(?:(?:w){3}\.)?(?:twitter|x)\.com\/[^/]+\/status\/(\d+)/,LG=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:twitter|x)\.com\/[^"']*)/i,DG=/^https:\/\/(?:www\.)?val\.town\/(v|embed)\/[a-zA-Z_$][0-9a-zA-Z_$]+\.[a-zA-Z_$][0-9a-zA-Z_$]+/,PG=/^<(?:iframe|blockquote)[\s\S]*?\s(?:src|href)=["']([^"']*)["'][\s\S]*?>$/i,Ay=/giphy.com\/(?:clips|embed|gifs)\/[a-zA-Z0-9]*?-?([a-zA-Z0-9]+)(?:[^a-zA-Z0-9]|$)/,Ry=/^(?:http(?:s)?:\/\/)?(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)\/?(?:\?[^#\s]*)?(?:#[^\s]*)?$/,NG=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:www\.)?reddit\.com\/[^"']*)/i,m6=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","figma.com","link.excalidraw.com","gist.github.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","val.town","giphy.com","reddit.com"]),jy=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","figma.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","reddit.com"]),Bu=e=>`<html><body>${e}</body></html>`,Rc=e=>{if(!e)return null;if(ii.has(e))return ii.get(e);let t=e,n=jy.has(U6(e,jy)||""),r="generic",a={w:560,h:840},i=e.match(TG);if(i!=null&&i[2]){let d=i[3]?`&start=${i[3]}`:"",u=e.includes("shorts");switch(r="video",i[1]){case"embed/":case"watch?v=":case"shorts/":e=`https://www.youtube.com/embed/${i[2]}?enablejsapi=1${d}`;break;case"playlist?list=":case"embed/videoseries?list=":e=`https://www.youtube.com/embed/videoseries?list=${i[2]}&enablejsapi=1${d}`;break;default:e=`https://www.youtube.com/embed/${i[2]}?enablejsapi=1${d}`;break}return a=u?{w:315,h:560}:{w:560,h:315},ii.set(t,{link:e,intrinsicSize:a,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:a,type:r,sandbox:{allowSameOrigin:n}}}let l=e.match(AG);if(l!=null&&l[1]){let d=l==null?void 0:l[1],u=/^\d+$/.test(d)?void 0:new URIError("Invalid embed link format");return r="video",e=`https://player.vimeo.com/video/${d}?api=1`,a={w:560,h:315},ii.set(t,{link:e,intrinsicSize:a,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:a,type:r,error:u,sandbox:{allowSameOrigin:n}}}if(e.match(RG))return r="generic",e=`https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(e)}`,a={w:550,h:550},ii.set(t,{link:e,intrinsicSize:a,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:a,type:r,sandbox:{allowSameOrigin:n}};let s=e.match(DG);if(s)return e=s[1]==="embed"?s[0]:s[0].replace("/v","/embed"),ii.set(t,{link:e,intrinsicSize:a,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:a,type:r,sandbox:{allowSameOrigin:n}};if(Ty.test(e)){let d=e.match(Ty)[1],u=ep(`https://twitter.com/x/status/${d}`),o={type:"document",srcdoc:f=>Bu(`<blockquote class="twitter-tweet" data-dnt="true" data-theme="${f}"><a href="${u}"></a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return ii.set(t,o),o}if(Ry.test(e)){let[,d,u,o]=e.match(Ry),f=ep(`https://reddit.com/r/${d}/comments/${u}/${o}`),m={type:"document",srcdoc:U=>Bu(`<blockquote class="reddit-embed-bq" data-embed-theme="${U}"><a href="${f}"></a><br></blockquote><script async="" src="https://embed.reddit.com/widgets.js" charset="UTF-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return ii.set(t,m),m}if(_y.test(e)){let[,d,u]=e.match(_y),o=ep(`https://gist.github.com/${d}/${u}`),f={type:"document",srcdoc:()=>Bu(`
|
|
68
|
+
<script src="${o}.js"><\/script>
|
|
69
|
+
<style type="text/css">
|
|
70
|
+
* { margin: 0px; }
|
|
71
|
+
table, .gist { height: 100%; }
|
|
72
|
+
.gist .gist-file { height: calc(100vh - 2px); padding: 0px; display: grid; grid-template-rows: 1fr auto; }
|
|
73
|
+
</style>
|
|
74
|
+
`),intrinsicSize:{w:550,h:720},sandbox:{allowSameOrigin:n}};return ii.set(e,f),f}return ii.set(e,{link:e,intrinsicSize:a,type:r,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:a,type:r,sandbox:{allowSameOrigin:n}}},kk=e=>{let t;es(e)?t="IFrame element":t=!e.link||(e==null?void 0:e.link)===""?"Empty Web-Embed":e.link;let n=Math.max(Math.min(e.width/2,e.width/t.length),e.width/30),r=Xt.Helvetica,a=_t({fontSize:n,fontFamily:r});return Wr({x:e.x+e.width/2,y:e.y+e.height/2,strokeColor:e.strokeColor!=="transparent"?e.strokeColor:"black",backgroundColor:"transparent",fontFamily:r,fontSize:n,text:Po(t,a,e.width-20),textAlign:"center",verticalAlign:Br.MIDDLE,angle:e.angle??0})};xe({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,n,r)=>{let a=gn(t,{type:"embeddable"});return oi(r.canvas,{...t,activeTool:a}),{elements:e,appState:{...t,activeTool:gn(t,{type:"embeddable"})},captureUpdate:ie.EVENTUALLY}}});var U6=(e,t)=>{try{let{hostname:n}=new URL(e),r=n.replace(/^www\./,"");if(t instanceof Set){if(m6.has(r))return r;let i=r.replace(/^([^.]+)/,"*");return m6.has(i)?i:null}let a=t.replace(/^www\./,"");if(r===a)return a}catch{}return null},OG=e=>{let t=e.match(LG);if(t&&t.length===2)return t[1];let n=e.match(NG);if(n&&n.length===2)return n[1];let r=e.match(jG);if(r&&r.length===2)return r[1];if(Ay.test(e))return`https://giphy.com/embed/${Ay.exec(e)[1]}`;let a=e.match(PG);return a&&a.length===2?a[1]:e},sp=(e,t)=>{if(!e)return!1;if(t!=null)if(typeof t=="function"){let n=t(e);if(typeof n=="boolean")return n}else{if(typeof t=="boolean")return t;if(t instanceof RegExp)return t.test(e);if(Array.isArray(t)){for(let n of t)if(n instanceof RegExp){if(e.match(n))return!0}else if(U6(e,n))return!0;return!1}}return!!U6(e,m6)},uu=(e,t,n)=>{let r={sets:t.sets,shape:t.shape,options:{...t.options,fixedDecimalPlaceDigits:n}};return e.draw(r)},fu=(e,t,n,r,a)=>{if(!r.enabled||!r.clip)return null;let i=jr(e,a);if(i){let l=t.ownerDocument.createElementNS(pt,"g");return l.setAttributeNS(pt,"clip-path",`url(#${i.id})`),n.forEach(s=>l.appendChild(s)),l}return null},op=(e,t,n,r,a,i,l,s)=>{var S;let d={x:i,y:l},[u,o,f,m]=Ze(e,t),U=(f-u)/2-(e.x-u),g=(m-o)/2-(e.y-o);if(ke(e)){let k=Bn(e,t);if(nt(k)){let[I,T,M,j]=Ze(k,t),D=Ce.getBoundTextElementPosition(k,e,t);U=(M-I)/2-(D.x-I),g=(j-T)/2-(D.y-T),i=i+D.x-e.x,l=l+D.y-e.y}}let v=180*e.angle/Math.PI,y=r;if(e.link){let k=r.ownerDocument.createElementNS(pt,"a");k.setAttribute("href",Rr(e.link)),y.appendChild(k),y=k}let w=(k,I)=>{ll()&&k.setAttribute("data-id",I.id),y.appendChild(k)},E=(((S=jr(e,t))==null?void 0:S.opacity)??100)*e.opacity/1e4;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{let k=Qt.generateElementShape(e,null),I=uu(n,k,ou);E!==1&&(I.setAttribute("stroke-opacity",`${E}`),I.setAttribute("fill-opacity",`${E}`)),I.setAttribute("stroke-linecap","round"),I.setAttribute("transform",`translate(${i||0} ${l||0}) rotate(${v} ${U} ${g})`);let T=fu(e,y,[I],s.frameRendering,t);w(T||I,e);break}case"iframe":case"embeddable":{let k=Qt.generateElementShape(e,s),I=uu(n,k,ou),T=e.opacity/100;T!==1&&(I.setAttribute("stroke-opacity",`${T}`),I.setAttribute("fill-opacity",`${T}`)),I.setAttribute("stroke-linecap","round"),I.setAttribute("transform",`translate(${i||0} ${l||0}) rotate(${v} ${U} ${g})`),w(I,e);let M=kk(e);op(M,t,n,y,a,M.x+d.x-e.x,M.y+d.y-e.y,s);let j=uu(n,k,ou);for(j.setAttribute("stroke-linecap","round"),j.setAttribute("transform",`translate(${i||0} ${l||0}) rotate(${v} ${U} ${g})`);j.firstChild;)j.removeChild(j.firstChild);let D=Ba(Math.min(e.width,e.height),e),P=Rc(hk(e.link||""));if(s.renderEmbeddables===!1||(P==null?void 0:P.type)==="document"){let N=r.ownerDocument.createElementNS(pt,"a");N.setAttribute("href",Rr(e.link||"")),N.setAttribute("target","_blank"),N.setAttribute("rel","noopener noreferrer"),N.style.borderRadius=`${D}px`,j.appendChild(N)}else{let N=r.ownerDocument.createElementNS(pt,"foreignObject");N.style.width=`${e.width}px`,N.style.height=`${e.height}px`,N.style.border="none";let $=N.ownerDocument.createElementNS(pt,"div");$.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),$.style.width="100%",$.style.height="100%";let z=$.ownerDocument.createElement("iframe");z.src=(P==null?void 0:P.link)??"",z.style.width="100%",z.style.height="100%",z.style.border="none",z.style.borderRadius=`${D}px`,z.style.top="0",z.style.left="0",z.allowFullscreen=!0,$.appendChild(z),N.appendChild($),j.appendChild(N)}w(j,e);break}case"line":case"arrow":{let k=Je(e,t),I=r.ownerDocument.createElementNS(pt,"mask");if(k){I.setAttribute("id",`mask-${e.id}`);let j=r.ownerDocument.createElementNS(pt,"rect");i=i||0,l=l||0,j.setAttribute("x","0"),j.setAttribute("y","0"),j.setAttribute("fill","#fff"),j.setAttribute("width",`${e.width+100+i}`),j.setAttribute("height",`${e.height+100+l}`),I.appendChild(j);let D=r.ownerDocument.createElementNS(pt,"rect"),P=Ce.getBoundTextElementPosition(e,k,t),N=i+P.x-e.x,$=l+P.y-e.y;D.setAttribute("x",N.toString()),D.setAttribute("y",$.toString()),D.setAttribute("fill","#000"),D.setAttribute("width",`${k.width}`),D.setAttribute("height",`${k.height}`),D.setAttribute("opacity","1"),I.appendChild(D)}let T=r.ownerDocument.createElementNS(pt,"g");k&&T.setAttribute("mask",`url(#mask-${e.id})`),T.setAttribute("stroke-linecap","round"),Qt.generateElementShape(e,s).forEach(j=>{let D=uu(n,j,ou);E!==1&&(D.setAttribute("stroke-opacity",`${E}`),D.setAttribute("fill-opacity",`${E}`)),D.setAttribute("transform",`translate(${i||0} ${l||0}) rotate(${v} ${U} ${g})`),e.type==="line"&&sl(e.points)&&e.backgroundColor!=="transparent"&&D.setAttribute("fill-rule","evenodd"),T.appendChild(D)});let M=fu(e,y,[T,I],s.frameRendering,t);M?(w(M,e),y.appendChild(M)):(w(T,e),y.append(I));break}case"freedraw":{let k=Qt.generateElementShape(e,s),I=k?uu(n,k,ou):r.ownerDocument.createElementNS(pt,"g");E!==1&&(I.setAttribute("stroke-opacity",`${E}`),I.setAttribute("fill-opacity",`${E}`)),I.setAttribute("transform",`translate(${i||0} ${l||0}) rotate(${v} ${U} ${g})`),I.setAttribute("stroke","none");let T=r.ownerDocument.createElementNS(pt,"path");T.setAttribute("fill",e.strokeColor),T.setAttribute("d",L5(e)),I.appendChild(T);let M=fu(e,y,[I],s.frameRendering,t);w(M||I,e);break}case"image":{let k=Math.round(e.width),I=Math.round(e.height),T=la(e)&&a[e.fileId];if(T){let{reuseImages:M=!0}=s,j=`image-${T.id}`,D=e.width,P=e.height;e.crop&&({width:D,height:P}=ol(e),j=`image-crop-${T.id}-${fC(`${D}x${P}`)}`),M||(j=`image-${e.id}`);let N=r.querySelector(`#${j}`);if(!N){N=r.ownerDocument.createElementNS(pt,"symbol"),N.id=j;let V=r.ownerDocument.createElementNS(pt,"image");V.setAttribute("href",T.dataURL),V.setAttribute("preserveAspectRatio","none"),e.crop||!M?(V.setAttribute("width",`${D}`),V.setAttribute("height",`${P}`)):(V.setAttribute("width","100%"),V.setAttribute("height","100%")),N.appendChild(V),(y.querySelector("defs")||y).prepend(N)}let $=r.ownerDocument.createElementNS(pt,"use");$.setAttribute("href",`#${j}`),s.exportWithDarkMode&&T.mimeType!==De.svg&&$.setAttribute("filter",LS);let z=0,Z=0;if(e.crop){let{width:V,height:ee}=ol(e);z=e.crop.x/(e.crop.naturalWidth/V),Z=e.crop.y/(e.crop.naturalHeight/ee)}let K=U+z,Q=g+Z;$.setAttribute("width",`${k+z}`),$.setAttribute("height",`${I+Z}`),$.setAttribute("opacity",`${E}`),(e.scale[0]!==1||e.scale[1]!==1)&&$.setAttribute("transform",`translate(${K} ${Q}) scale(${e.scale[0]} ${e.scale[1]}) translate(${-K} ${-Q})`);let W=r.ownerDocument.createElementNS(pt,"g");if(e.crop){let V=r.ownerDocument.createElementNS(pt,"mask");V.setAttribute("id",`mask-image-crop-${e.id}`),V.setAttribute("fill","#fff");let ee=r.ownerDocument.createElementNS(pt,"rect");ee.setAttribute("x",`${z}`),ee.setAttribute("y",`${Z}`),ee.setAttribute("width",`${k}`),ee.setAttribute("height",`${I}`),V.appendChild(ee),y.appendChild(V),W.setAttribute("mask",`url(#${V.id})`)}if(W.appendChild($),W.setAttribute("transform",`translate(${i-z} ${l-Z}) rotate(${v} ${K} ${Q})`),e.roundness){let V=r.ownerDocument.createElementNS(pt,"clipPath");V.id=`image-clipPath-${e.id}`;let ee=r.ownerDocument.createElementNS(pt,"rect"),X=Ba(Math.min(e.width,e.height),e);ee.setAttribute("width",`${e.width}`),ee.setAttribute("height",`${e.height}`),ee.setAttribute("rx",`${X}`),ee.setAttribute("ry",`${X}`),V.appendChild(ee),w(V,e),W.setAttributeNS(pt,"clip-path",`url(#${V.id})`)}let q=fu(e,y,[W],s.frameRendering,t);w(q||W,e)}break}case"frame":case"magicframe":{if(s.frameRendering.enabled&&s.frameRendering.outline){let k=document.createElementNS(pt,"rect");k.setAttribute("transform",`translate(${i||0} ${l||0}) rotate(${v} ${U} ${g})`),k.setAttribute("width",`${e.width}px`),k.setAttribute("height",`${e.height}px`),k.setAttribute("rx",Kt.radius.toString()),k.setAttribute("ry",Kt.radius.toString()),k.setAttribute("fill","none"),k.setAttribute("stroke",Kt.strokeColor),k.setAttribute("stroke-width",Kt.strokeWidth.toString()),w(k,e)}break}default:if(ke(e)){let k=r.ownerDocument.createElementNS(pt,"g");E!==1&&(k.setAttribute("stroke-opacity",`${E}`),k.setAttribute("fill-opacity",`${E}`)),k.setAttribute("transform",`translate(${i||0} ${l||0}) rotate(${v} ${U} ${g})`);let I=e.text.replace(/\r\n?/g,`
|
|
75
|
+
`).split(`
|
|
76
|
+
`),T=Nf(e.fontSize,e.lineHeight),M=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,j=xS(e.fontFamily,e.fontSize,T),D=OE(e.text)?"rtl":"ltr",P=e.textAlign==="center"?"middle":e.textAlign==="right"||D==="rtl"?"end":"start";for(let $=0;$<I.length;$++){let z=r.ownerDocument.createElementNS(pt,"text");z.textContent=I[$],z.setAttribute("x",`${M}`),z.setAttribute("y",`${$*T+j}`),z.setAttribute("font-family",Gc(e)),z.setAttribute("font-size",`${e.fontSize}px`),z.setAttribute("fill",e.strokeColor),z.setAttribute("text-anchor",P),z.setAttribute("style","white-space: pre;"),z.setAttribute("direction",D),z.setAttribute("dominant-baseline","alphabetic"),k.appendChild(z)}let N=fu(e,y,[k],s.frameRendering,t);w(N||k,e)}else throw new Error(`Unimplemented type ${e.type}`)}},$G=(e,t,n,r,a,i)=>{r&&(e.filter(l=>!sa(l)).forEach(l=>{if(!l.isDeleted){if(ke(l)&&l.containerId&&t.has(l.containerId))return;try{op(l,t,n,r,a,l.x+i.offsetX,l.y+i.offsetY,i);let s=Je(l,t);s&&op(s,t,n,r,a,s.x+i.offsetX,s.y+i.offsetY,i)}catch(s){console.error(s)}}}),e.filter(l=>sa(l)).forEach(l=>{if(!l.isDeleted)try{op(l,t,n,r,a,l.x+i.offsetX,l.y+i.offsetY,i)}catch(s){console.error(s)}}))},Ly=500,W5=e=>{var r,a;let t=(r=e.extensions)==null?void 0:r.reduce((i,l)=>(i.push(De[l]),i),[]),n=(a=e.extensions)==null?void 0:a.reduce((i,l)=>l==="jpg"?i.concat(".jpg",".jpeg"):i.concat(`.${l}`),[]);return gN({description:e.description,extensions:n,mimeTypes:t,multiple:e.multiple??!1,legacySetup:(i,l,s)=>{let d=Yc(l,Ly),u=()=>{o(),document.addEventListener("keyup",d),document.addEventListener("pointerup",d),d()},o=()=>{var m;if((m=s.files)!=null&&m.length){let U=e.multiple?[...s.files]:s.files[0];i(U)}};requestAnimationFrame(()=>{window.addEventListener("focus",u)});let f=window.setInterval(()=>{o()},Ly);return m=>{clearInterval(f),d.cancel(),window.removeEventListener("focus",u),document.removeEventListener("keyup",d),document.removeEventListener("pointerup",d),m&&(console.warn("Opening the file was canceled (legacy-fs)."),m(new T0))}}})},Kp=(e,t)=>vN(e,{fileName:`${t.name}.${t.extension}`,description:t.description,extensions:[`.${t.extension}`],mimeTypes:t.mimeTypes},t.fileHandle),zG=(e,t)=>{let n={};for(let r of e)!r.isDeleted&&"fileId"in r&&r.fileId&&t[r.fileId]&&(n[r.fileId]=t[r.fileId]);return n},Ff=(e,t,n,r)=>{let a={type:ua.excalidraw,version:E0.excalidraw,source:f5,elements:hC(e),appState:jE(t),files:zG(e,n)};return JSON.stringify(a,null,2)},Ck=async(e,t,n,r=t.name||TE)=>{let a=Ff(e,t,n),i=new Blob([a],{type:De.excalidraw});return{fileHandle:await Kp(i,{name:r,extension:"excalidraw",description:"Excalidraw file",fileHandle:v8(t.fileHandle)?null:t.fileHandle})}},FG=async(e,t)=>{let n=await W5({description:"Excalidraw files"});return x8(await w8(n),e,t,n.handle)},BG=e=>(e==null?void 0:e.type)===ua.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||typeof e.appState=="object")),Mk=e=>typeof e=="object"&&e&&e.type===ua.excalidrawLibrary&&(e.version===1||e.version===2),X5=e=>{let t={type:ua.excalidrawLibrary,version:E0.excalidrawLibrary,source:f5,libraryItems:e};return JSON.stringify(t,null,2)},HG=async e=>{let t=X5(e);await Kp(new Blob([t],{type:De.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})},Ik=e=>new Promise((t,n)=>{let r=new Image;r.onload=()=>{t(r)},r.onerror=a=>{n(a)},r.src=e}),_k=async({fileIds:e,files:t,imageCache:n})=>{let r=new Map,a=new Map;return await Promise.all(e.reduce((i,l)=>{let s=t[l];return s&&!r.has(l)?(r.set(l,!0),i.concat((async()=>{try{if(s.mimeType===De.binary)throw new Error("Only images can be added to ImageCache");let d=Ik(s.dataURL),u={image:d,mimeType:s.mimeType};n.set(l,u);let o=await d;n.set(l,{...u,image:o})}catch{a.set(l,!0)}})())):i},[])),{imageCache:n,updatedFiles:r,erroredFiles:a}},Tk=e=>e.filter(t=>la(t)),WG=e=>(e==null?void 0:e.nodeName.toLowerCase())==="svg",Dy=e=>{let t=new DOMParser().parseFromString(e,De.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||!WG(n))throw new Error("Invalid SVG");{n.hasAttribute("xmlns")||n.setAttribute("xmlns",pt);let r=n.getAttribute("width"),a=n.getAttribute("height");(r!=null&&r.includes("%")||r==="auto")&&(r=null),(a!=null&&a.includes("%")||a==="auto")&&(a=null);let i=n.getAttribute("viewBox");if(!r||!a){if(r=r||"50",a=a||"50",i){let l=i.match(/\d+ +\d+ +(\d+(?:\.\d+)?) +(\d+(?:\.\d+)?)/);l&&([,r,a]=l)}n.setAttribute("width",r),n.setAttribute("height",a)}return i||n.setAttribute("viewBox",`0 0 ${r} ${a}`),n.outerHTML}},Ak=document.createElement("img");Ak.src=`data:${De.svg}, ${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>')}`;var Rk=document.createElement("img");Rk.src=`data:${De.svg}, ${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-big-right-line"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 9v-3.586a1 1 0 0 1 1.707 -.707l6.586 6.586a1 1 0 0 1 0 1.414l-6.586 6.586a1 1 0 0 1 -1.707 -.707v-3.586h-6v-6h6z" /><path d="M3 9v6" /></svg>')}`;var V5=([e,t,n,r],a,i)=>{let l=qX,s=l/i.zoom.value,d=l/i.zoom.value,u=l/i.zoom.value,o=(e+n)/2,f=(t+r)/2,m=(l-8)/(2*i.zoom.value),U=4/i.zoom.value,g=n+U-m,v=t-U-u+m,[y,w]=ce(A(g+s/2,v+d/2),A(o,f),a);return[y-s/2,w-d/2,s,d]},jk=(e,t,n,[r,a])=>{let i=4/n.zoom.value,[l,s,d,u]=Ze(e,t),[o,f,m,U]=V5([l,s,d,u],e.angle,n);return r>o-i&&r<o+i+m&&a>f-i&&a<f+U+i},X2=(e,t,n,[r,a],i)=>!e.link||n.selectedElementIds[e.id]?!1:!i&&n.viewModeEnabled&&R5(r,a,e,t)?!0:jk(e,t,n,A(r,a)),B0=(e,t,n,r,a=!0)=>{e.beginPath(),e.arc(t,n,r,0,Math.PI*2),e.fill(),a&&e.stroke()},G5=(e,t)=>[e.width/t,e.height/t],Y5=({canvas:e,scale:t,normalizedWidth:n,normalizedHeight:r,theme:a,isExporting:i,viewBackgroundColor:l})=>{let s=e.getContext("2d");return s.setTransform(1,0,0,1,0,0),s.scale(t,t),i&&a===ot.DARK&&(s.filter=m5),typeof l=="string"?((l==="transparent"||l.length===5||l.length===9||/(hsla|rgba)\(/.test(l))&&s.clearRect(0,0,n,r),s.save(),s.fillStyle=l,s.fillRect(0,0,n,r),s.restore()):s.clearRect(0,0,n,r),s},Lk=(e,t)=>{let n=window.location.href;try{let r=new URL(n);return r.searchParams.set(Ap,e),Rr(r.toString())}catch(r){console.error(r)}return Rr(n)},Dk=(e,t)=>{if(e.length>0&&qp(e)){if(e.length===1)return{id:e[0].id,type:"element"};if(e.length>1){let n=Object.keys(t.selectedGroupIds)[0];return n?{id:n,type:"group"}:{id:e[0].groupIds[0],type:"group"}}}return null},qp=e=>!!(e.length===1||e.length>1&&sk(e)),Nc=e=>{try{let t=new URL(e);return t.searchParams.has(Ap)&&t.host===window.location.host}catch{return!1}},XG=e=>{try{let{searchParams:t}=new URL(e);if(t.has(Ap))return t.get(Ap)}catch{}return null},C1={Bold:"#dddddd",Regular:"#e5e5e5"},VG=(e,t,n,r,a,i,l,s)=>{let d=r%t-t,u=a%t-t,o=t*i.value,f=1/i.value;e.save(),i.value===1&&e.translate(d%1?0:.5,u%1?0:.5);for(let m=d;m<d+l+t*2;m+=t){let U=n>1&&Math.round(m-r)%(n*t)===0;if(!U&&o<10)continue;let g=Math.min(1/i.value,U?4:1);e.lineWidth=g;let v=[g*3,f+(g+f)];e.beginPath(),e.setLineDash(U?[]:v),e.strokeStyle=U?C1.Bold:C1.Regular,e.moveTo(m,u-t),e.lineTo(m,Math.ceil(u+s+t*2)),e.stroke()}for(let m=u;m<u+s+t*2;m+=t){let U=n>1&&Math.round(m-a)%(n*t)===0;if(!U&&o<10)continue;let g=Math.min(1/i.value,U?4:1);e.lineWidth=g;let v=[g*3,f+(g+f)];e.beginPath(),e.setLineDash(U?[]:v),e.strokeStyle=U?C1.Bold:C1.Regular,e.moveTo(d-t,m),e.lineTo(Math.ceil(d+l+t*2),m),e.stroke()}e.restore()},Py=(e,t,n,r)=>{t.translate(e.x+r.scrollX,e.y+r.scrollY),t.beginPath(),t.roundRect?t.roundRect(0,0,e.width,e.height,Kt.radius/r.zoom.value):t.rect(0,0,e.width,e.height),t.clip(),t.translate(-(e.x+r.scrollX),-(e.y+r.scrollY))},Ny={regularLink:null,elementLink:null},Oy=(e,t,n,r)=>{if(e.link&&!n.selectedElementIds[e.id]){let[a,i,l,s]=Ze(e,r),[d,u,o,f]=V5([a,i,l,s],e.angle,n),m=d+o/2,U=u+f/2;t.save(),t.translate(n.scrollX+m,n.scrollY+U),t.rotate(e.angle);let g=Nc(e.link)?"elementLink":"regularLink",v=Ny[g];if(!v||v.zoom!==n.zoom.value){v=Object.assign(document.createElement("canvas"),{zoom:n.zoom.value}),v.width=o*window.devicePixelRatio*n.zoom.value,v.height=f*window.devicePixelRatio*n.zoom.value,Ny[g]=v;let y=v.getContext("2d");y.scale(window.devicePixelRatio*n.zoom.value,window.devicePixelRatio*n.zoom.value),y.fillStyle="#fff",y.fillRect(0,0,o,f),g==="elementLink"?y.drawImage(Rk,0,0,o,f):y.drawImage(Ak,0,0,o,f),y.restore()}t.drawImage(v,d-m,u-U,o,f),t.restore()}},Pk=({canvas:e,rc:t,elementsMap:n,allElementsMap:r,visibleElements:a,scale:i,appState:l,renderConfig:s})=>{var v;if(e===null)return;let{renderGrid:d=!0,isExporting:u}=s,[o,f]=G5(e,i),m=Y5({canvas:e,scale:i,normalizedWidth:o,normalizedHeight:f,theme:l.theme,isExporting:u,viewBackgroundColor:l.viewBackgroundColor});m.scale(l.zoom.value,l.zoom.value),d&&VG(m,l.gridSize,l.gridStep,l.scrollX,l.scrollY,l.zoom,o/l.zoom.value,f/l.zoom.value);let U=new Set;a.forEach(y=>{y.groupIds.length>0&&l.frameToHighlight&&l.selectedElementIds[y.id]&&(bs(y,l.frameToHighlight,n)||y.groupIds.find(w=>U.has(w)))&&y.groupIds.forEach(w=>U.add(w))});let g=new Map;a.filter(y=>!sa(y)).forEach(y=>{var w;try{let E=y.frameId||((w=l.frameToHighlight)==null?void 0:w.id);if(ke(y)&&y.containerId&&n.has(y.containerId))return;if(m.save(),E&&l.frameRendering.enabled&&l.frameRendering.clip){let k=g6(y,n,l);k&&Qy(y,k,l,n,g)&&Py(k,m,s,l),qs(y,n,r,t,m,s,l)}else qs(y,n,r,t,m,s,l);let S=Je(y,n);S&&qs(S,n,r,t,m,s,l),m.restore(),u||Oy(y,m,l,n)}catch(E){console.error(E,y.id,y.x,y.y,y.width,y.height)}}),a.filter(y=>sa(y)).forEach(y=>{var w;try{let E=()=>{if(qs(y,n,r,t,m,s,l),sa(y)&&(u||Cr(y)&&s.embedsValidationStatus.get(y.id)!==!0)&&y.width&&y.height){let S=kk(y);qs(S,n,r,t,m,s,l)}u||Oy(y,m,l,n)};if((y.frameId||(w=l.frameToHighlight)!=null&&w.id)&&l.frameRendering.enabled&&l.frameRendering.clip){m.save();let S=g6(y,n,l);S&&Qy(y,S,l,n,g)&&Py(S,m,s,l),E(),m.restore()}else E()}catch(E){console.error(E)}}),(v=s.pendingFlowchartNodes)==null||v.forEach(y=>{try{qs(y,n,r,t,m,s,l)}catch(w){console.error(w)}})},Nk=S0(e=>{Pk(e)},{trailing:!0}),Ok=(e,t)=>{if(t){Nk(e);return}Pk(e)},GG=(e,t)=>{if(e.width<=t)return e;let n=document.createElement("canvas").getContext("2d");n.font=_t({fontFamily:e.fontFamily,fontSize:e.fontSize});let r=e.text;if(n.measureText(r).width>t)for(let a=r.length;a>0;a--){let i=`${r.slice(0,a)}...`;if(n.measureText(i).width<=t){r=i;break}}return Ke(e,{text:r,width:t})},YG=(e,t)=>{let n=[];for(let r of e){if(He(r)){let a=Wr({x:r.x,y:r.y-Kt.nameOffsetY,fontFamily:Xt.Helvetica,fontSize:Kt.nameFontSize,lineHeight:Kt.nameLineHeight,strokeColor:t.exportWithDarkMode?Kt.nameColorDarkTheme:Kt.nameColorLightTheme,text:nC(r)});a.y-=a.height,a=GG(a,r.width),n.push(a)}n.push(r)}return n},$k=(e,t)=>(t=t||wi().frameRendering,{enabled:e?!0:t.enabled,outline:e?!1:t.outline,name:e?!1:t.name,clip:e?!0:t.clip}),zk=({elements:e,exportingFrame:t,frameRendering:n,exportWithDarkMode:r})=>{let a;return t?a=u8(e,t):n.enabled&&n.name?a=YG(e,{exportWithDarkMode:r}):a=e,a},Fk=async(e,t,n,{exportBackground:r,exportPadding:a=dd,viewBackgroundColor:i,exportingFrame:l},s=(u,o)=>{let f=document.createElement("canvas");return f.width=u*t.exportScale,f.height=o*t.exportScale,{canvas:f,scale:t.exportScale}},d=async()=>{await al.loadElementsFonts(e)})=>{await d();let u=$k(l??null,t.frameRendering??null);l&&(u.clip=!1);let o=zk({elements:e,exportingFrame:l,exportWithDarkMode:t.exportWithDarkMode,frameRendering:u});l&&(a=0);let[f,m,U,g]=K5(l?[l]:d8(o),a),{canvas:v,scale:y=1}=s(U,g),w=wi(),{imageCache:E}=await _k({imageCache:new Map,fileIds:Tk(o).map(S=>S.fileId),files:n});return Ok({canvas:v,rc:ws.canvas(v),elementsMap:pa(We(o)),allElementsMap:pa(We(ul(e))),visibleElements:o,scale:y,appState:{...t,frameRendering:u,viewBackgroundColor:r?i:null,scrollX:-f+a,scrollY:-m+a,zoom:w.zoom,shouldCacheIgnoreZoom:!1,theme:t.exportWithDarkMode?ot.DARK:ot.LIGHT},renderConfig:{canvasBackgroundColor:i,imageCache:E,renderGrid:!1,isExporting:!0,embedsValidationStatus:new Map,elementsPendingErasure:new Set,pendingFlowchartNodes:null}}),v},Cu=e=>document.createComment(` ${e} `),Z5=async(e,t,n,r)=>{let a=$k((r==null?void 0:r.exportingFrame)??null,t.frameRendering??null),{exportPadding:i=dd,exportWithDarkMode:l=!1,viewBackgroundColor:s,exportScale:d=1,exportEmbedScene:u}=t,{exportingFrame:o=null}=r||{},f=zk({elements:e,exportingFrame:o,exportWithDarkMode:l,frameRendering:a});o&&(i=0);let[m,U,g,v]=K5(o?[o]:d8(f),i),y=-m+i,w=-U+i,E=document.createElementNS(pt,"svg");E.setAttribute("version","1.1"),E.setAttribute("xmlns",pt),E.setAttribute("viewBox",`0 0 ${g} ${v}`),E.setAttribute("width",`${g*d}`),E.setAttribute("height",`${v*d}`),l&&E.setAttribute("filter",m5);let S=E.ownerDocument.createElementNS(pt,"defs"),k=E.ownerDocument.createElementNS(pt,"metadata");if(E.appendChild(Cu("svg-source:excalidraw")),E.appendChild(k),E.appendChild(S),u)try{ZG({metadataElement:k,payload:Ff(e,t,n||{},"local")})}catch(N){console.error(N)}let I=c8(e);if(I.length){let N=We(e);for(let $ of I){let z=E.ownerDocument.createElementNS(pt,"clipPath");z.setAttribute("id",$.id);let[Z,K,Q,W]=Ze($,N),q=(Q-Z)/2-($.x-Z),V=(W-K)/2-($.y-K),ee=E.ownerDocument.createElementNS(pt,"rect");ee.setAttribute("transform",`translate(${$.x+y} ${$.y+w}) rotate(${$.angle} ${q} ${V})`),ee.setAttribute("width",`${$.width}`),ee.setAttribute("height",`${$.height}`),o||(ee.setAttribute("rx",`${Kt.radius}`),ee.setAttribute("ry",`${Kt.radius}`)),z.appendChild(ee),S.appendChild(z)}}let T=r!=null&&r.skipInliningFonts?[]:await al.generateFontFaceDeclarations(e),M=`
|
|
77
|
+
`,j=E.ownerDocument.createElementNS(pt,"style");if(j.classList.add("style-fonts"),j.appendChild(document.createTextNode(`${M}${T.join(M)}`)),S.appendChild(j),t.exportBackground&&s){let N=E.ownerDocument.createElementNS(pt,"rect");N.setAttribute("x","0"),N.setAttribute("y","0"),N.setAttribute("width",`${g}`),N.setAttribute("height",`${v}`),N.setAttribute("fill",s),E.appendChild(N)}let D=ws.svg(E),P=(r==null?void 0:r.renderEmbeddables)??!1;return $G(f,pa(We(f)),D,E,n||{},{offsetX:y,offsetY:w,isExporting:!0,exportWithDarkMode:l,renderEmbeddables:P,frameRendering:a,canvasBackgroundColor:s,embedsValidationStatus:P?new Map(f.filter(N=>He(N)).map(N=>[N.id,!0])):new Map,reuseImages:(r==null?void 0:r.reuseImages)??!0}),E},ZG=({payload:e,metadataElement:t})=>{let n=xC(JSON.stringify(EC({text:e})),!0);t.appendChild(Cu(`payload-type:${De.excalidraw}`)),t.appendChild(Cu("payload-version:2")),t.appendChild(Cu("payload-start")),t.appendChild(document.createTextNode(n)),t.appendChild(Cu("payload-end"))},KG=({svg:e})=>{var t;if(e.includes(`payload-type:${De.excalidraw}`)){let n=e.match(/<!-- payload-start -->\s*(.+?)\s*<!-- payload-end -->/);if(!n)throw new Error("INVALID");let r=(((t=e.match(/<!-- payload-version:(\d+) -->/))==null?void 0:t[1])||"1")!=="1";try{let a=wC(n[1],r),i=JSON.parse(a);if(!("encoded"in i)){if("type"in i&&i.type===ua.excalidraw)return a;throw new Error("FAILED")}return SC(i)}catch(a){throw console.error(a),new Error("FAILED")}}throw new Error("INVALID")},K5=(e,t)=>{let[n,r,a,i]=xt(e),l=nr(n,a)+t*2,s=nr(r,i)+t*2;return[n,r,l,s]},qG=(e,t,n)=>{let[,,r,a]=K5(e,t).map(i=>Math.trunc(i*n));return[r,a]},QG=class{constructor(t){this.scoreFunction=t,F(this,"content",[])}sinkDown(t){let n=this.content[t];for(;t>0;){let r=(t+1>>1)-1,a=this.content[r];if(this.scoreFunction(n)<this.scoreFunction(a))this.content[r]=n,this.content[t]=a,t=r;else break}}bubbleUp(t){let n=this.content.length,r=this.content[t],a=this.scoreFunction(r);for(;;){let i=t+1<<1,l=i-1,s=null,d=0;if(l<n){let u=this.content[l];d=this.scoreFunction(u),d<a&&(s=l)}if(i<n){let u=this.content[i];this.scoreFunction(u)<(s===null?a:d)&&(s=i)}if(s!==null)this.content[t]=this.content[s],this.content[s]=r,t=s;else break}}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),r=this.content.pop();n<this.content.length&&(this.content[n]=r,this.scoreFunction(r)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}},q5=1,Ct=40,JG=(e,t)=>{let n=e.fixedSegments?e.fixedSegments.slice():null;if(n){let r=[];e.points.map(l=>A(e.x+l[0],e.y+l[1])).forEach((l,s,d)=>{if(s<2)return r.push(l);let u=ff(l,d[s-1]),o=ff(d[s-1],d[s-2]);if(ln(u,o)){let f=(n==null?void 0:n.findIndex(U=>U.index===s-1))??-1,m=(n==null?void 0:n.findIndex(U=>U.index===s))??-1;m!==-1&&(n[m].start=A(d[s-2][0]-e.x,d[s-2][1]-e.y)),f!==-1&&n.splice(f,1),r.splice(-1,1),n.forEach(U=>{U.index>s-1&&(U.index-=1)})}return r.push(l)});let a=[];r.forEach((l,s,d)=>{if(s<3)return a.push(l);if(yt(d[s-2],d[s-1])<q5){let u=(n==null?void 0:n.findIndex(m=>m.index===s-2))??-1,o=(n==null?void 0:n.findIndex(m=>m.index===s-1))??-1;o!==-1&&n.splice(o,1),u!==-1&&n.splice(u,1),a.splice(-2,2),n.forEach(m=>{m.index>s-2&&(m.index-=2)});let f=Qi(l,d[s-1]);return a.push(A(f?l[0]:d[s-2][0],f?d[s-2][1]:l[1]))}a.push(l)});let i=n.filter(l=>l.index!==1&&l.index!==a.length-1);return i.length===0?gs(t8(n8(e8(e,J5(e,t,a.map(l=>A(l[0]-e.x,l[1]-e.y)),e.startBinding&&rd(e.startBinding.elementId,t),e.endBinding&&rd(e.endBinding.elementId,t)))??[])),i,null,null):(et.DEV&&lr(r8(a),"Invalid elbow points with fixed segments"),gs(a,i,e.startIsSpecial,e.endIsSpecial))}return{x:e.x,y:e.y,points:e.points,fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}},eY=(e,t,n)=>{var j,D;let r=t.map(P=>P.index),a=(((j=e.fixedSegments)==null?void 0:j.map(P=>P.index))??[]).findIndex(P=>!r.includes(P));if(a===-1||!((D=e.fixedSegments)!=null&&D[a]))return{points:e.points};let i=e.fixedSegments[a].index,l=e.fixedSegments[a-1],s=e.fixedSegments[a+1],d=e.x+(l?l.end[0]:0),u=e.y+(l?l.end[1]:0),o=l?null:e.startBinding,f=s?null:e.endBinding,{startHeading:m,endHeading:U,startGlobalPoint:g,endGlobalPoint:v,hoveredStartElement:y,hoveredEndElement:w,...E}=J5({x:d,y:u,startBinding:o,endBinding:f,startArrowhead:null,endArrowhead:null,points:e.points},n,[A(0,0),A(e.x+((s==null?void 0:s.start[0])??e.points[e.points.length-1][0])-d,e.y+((s==null?void 0:s.start[1])??e.points[e.points.length-1][1])-u)],o&&rd(o.elementId,n),f&&rd(f.elementId,n),{isDragging:!1}),{points:S}=gs(t8(n8(e8(e,{startHeading:m,endHeading:U,startGlobalPoint:g,endGlobalPoint:v,hoveredEndElement:w,...E})??[])),t,null,null),k=[];if(l)for(let P=0;P<l.index;P++)k.push(A(e.x+e.points[P][0],e.y+e.points[P][1]));if(S.forEach(P=>{k.push(A(e.x+(l?l.end[0]:0)+P[0],e.y+(l?l.end[1]:0)+P[1]))}),s)for(let P=s.index;P<e.points.length;P++)k.push(A(e.x+e.points[P][0],e.y+e.points[P][1]));let I=((s==null?void 0:s.index)??e.points.length)-((l==null?void 0:l.index)??0)-1,T=t.map(P=>P.index>i?{...P,index:P.index-I+(S.length-1)}:P),M=k.flatMap((P,N)=>{let $=k[N-1],z=k[N+1];if($&&z){let Z=ff(P,$),K=ff(z,P);if(ln(Z,K))return T.forEach(Q=>{Q.index>N&&(Q.index-=1)}),[];if(ln(Z,HS(K)))return T.forEach(Q=>{Q.index>N&&(Q.index+=1)}),[P,P]}return[P]});return gs(M,T,!1,!1)},tY=(e,t,n,r,a,i)=>{var I,T;let l=t.map((M,j)=>e.fixedSegments==null||e.fixedSegments[j]===void 0||e.fixedSegments[j].index!==M.index||(M.start[0]!==e.fixedSegments[j].start[0]&&M.end[0]!==e.fixedSegments[j].end[0])!=(M.start[1]!==e.fixedSegments[j].start[1]&&M.end[1]!==e.fixedSegments[j].end[1])?j:null).filter(M=>M!==null).shift();if(l==null)return{points:e.points};let s=((I=e.fixedSegments)==null?void 0:I.findIndex(M=>M.index===1))??-1,d=((T=e.fixedSegments)==null?void 0:T.findIndex(M=>M.index===e.points.length-1))??-1,u=yt(t[l].start,t[l].end),o=u<Ct+5;if(s===-1&&t[l].index===1&&a){let M=tl(n),j=(M?ln(n,rn):ln(n,zn))?o?u/2:Ct:o?-u/2:-Ct;t[l].start=A(t[l].start[0]+(M?j:0),t[l].start[1]+(M?0:j))}if(d===-1&&t[l].index===e.points.length-1&&i){let M=tl(r),j=(M?ln(r,rn):ln(r,zn))?o?u/2:Ct:o?-u/2:-Ct;t[l].end=A(t[l].end[0]+(M?j:0),t[l].end[1]+(M?0:j))}let f=t.map(M=>({...M,start:A(e.x+M.start[0],e.y+M.start[1]),end:A(e.x+M.end[0],e.y+M.end[1])})),m=e.points.map((M,j)=>A(e.x+M[0],e.y+M[1])),U=f[l].index-1,g=f[l].index,v=f[l].start,y=f[l].end,w=m[U-1]&&!Xa(m[U],m[U-1])?Qi(m[U-1],m[U]):void 0,E=m[g+1]&&!Xa(m[g],m[g+1])?Qi(m[g+1],m[g]):void 0;if(w!==void 0){let M=w?1:0;m[U-1][M]=v[M]}if(m[U]=v,m[g]=y,E!==void 0){let M=E?1:0;m[g+1][M]=y[M]}let S=f.findIndex(M=>M.index===U);if(S!==-1){let M=Qi(f[S].end,f[S].start)?1:0;f[S].start[M]=v[M],f[S].end=v}let k=f.findIndex(M=>M.index===g+1);if(k!==-1){let M=Qi(f[k].end,f[k].start)?1:0;f[k].end[M]=y[M],f[k].start=y}if(s===-1&&U===0){let M=a?tl(n):Qi(m[1],m[0]);m.unshift(A(M?v[0]:e.x+e.points[0][0],M?e.y+e.points[0][1]:v[1])),a&&m.unshift(A(e.x+e.points[0][0],e.y+e.points[0][1]));for(let j of f)j.index+=a?2:1}if(d===-1&&g===e.points.length-1){let M=tl(r);m.push(A(M?y[0]:e.x+e.points[e.points.length-1][0],M?e.y+e.points[e.points.length-1][1]:y[1])),i&&m.push(A(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]))}return gs(m,f.map(M=>({...M,start:A(M.start[0]-e.x,M.start[1]-e.y),end:A(M.end[0]-e.x,M.end[1]-e.y)})),!1,!1)},nY=(e,t,n,r,a,i,l,s,d)=>{let u=e.startIsSpecial??null,o=e.endIsSpecial??null,f=t.map((y,w)=>w===0||w===t.length-1?A(e.x+y[0],e.y+y[1]):A(e.x+e.points[w][0],e.y+e.points[w][1])),m=n.map(y=>({...y,start:A(e.x+(y.start[0]-t[0][0]),e.y+(y.start[1]-t[0][1])),end:A(e.x+(y.end[0]-t[0][0]),e.y+(y.end[1]-t[0][1]))})),U=[],g=2+(u?1:0),v=2+(o?1:0);for(;U.length+g<f.length-v;)U.push(f[U.length+g]);{let y=f[u?2:1],w=f[u?3:2],E=tl(r),S=tl(Mo(Pe(y,w)));if(s&&E===S){let k=E?ln(r,rn):ln(r,zn);if(U.unshift(A(S?i[0]+(k?Ct:-Ct):w[0],S?w[1]:i[1]+(k?Ct:-Ct))),U.unshift(A(E?i[0]+(k?Ct:-Ct):i[0],E?i[1]:i[1]+(k?Ct:-Ct))),!u){u=!0;for(let I of m)I.index>1&&(I.index+=1)}}else if(U.unshift(A(S?i[0]:y[0],S?y[1]:i[1])),u){u=!1;for(let k of m)k.index>1&&(k.index-=1)}U.unshift(i)}{let y=f[f.length-(o?3:2)],w=f[f.length-(o?4:3)],E=tl(a),S=Qi(w,y);if(d&&E===S){let k=E?ln(a,rn):ln(a,zn);U.push(A(S?l[0]+(k?Ct:-Ct):w[0],S?w[1]:l[1]+(k?Ct:-Ct))),U.push(A(E?l[0]+(k?Ct:-Ct):l[0],E?l[1]:l[1]+(k?Ct:-Ct))),o||(o=!0)}else U.push(A(S?l[0]:y[0],S?y[1]:l[1])),o&&(o=!1)}return U.push(l),gs(U,m.map(({index:y})=>({index:y,start:U[y-1],end:U[y]})).map(y=>({...y,start:A(y.start[0]-i[0],y.start[1]-i[1]),end:A(y.end[0]-i[0],y.end[1]-i[1])})),u,o)},Lt=1e6,Q5=(e,t,n,r)=>{var w,E,S,k,I,T,M,j,D,P,N,$,z,Z,K,Q,W,q,V,ee,X,se,ge,_e,Y;if(e.points.length<2)return{points:n.points??e.points};(e.x<-Lt||e.x>Lt||e.y<-Lt||e.y>Lt||e.x+(((S=(E=n==null?void 0:n.points)==null?void 0:E[((w=n==null?void 0:n.points)==null?void 0:w.length)-1])==null?void 0:S[0])??0)<-Lt||e.x+(((T=(I=n==null?void 0:n.points)==null?void 0:I[((k=n==null?void 0:n.points)==null?void 0:k.length)-1])==null?void 0:T[0])??0)>Lt||e.y+(((D=(j=n==null?void 0:n.points)==null?void 0:j[((M=n==null?void 0:n.points)==null?void 0:M.length)-1])==null?void 0:D[1])??0)<-Lt||e.y+((($=(N=n==null?void 0:n.points)==null?void 0:N[((P=n==null?void 0:n.points)==null?void 0:P.length)-1])==null?void 0:$[1])??0)>Lt||e.x+(((K=(Z=e==null?void 0:e.points)==null?void 0:Z[((z=e==null?void 0:e.points)==null?void 0:z.length)-1])==null?void 0:K[0])??0)<-Lt||e.x+(((q=(W=e==null?void 0:e.points)==null?void 0:W[((Q=e==null?void 0:e.points)==null?void 0:Q.length)-1])==null?void 0:q[0])??0)>Lt||e.y+(((X=(ee=e==null?void 0:e.points)==null?void 0:ee[((V=e==null?void 0:e.points)==null?void 0:V.length)-1])==null?void 0:X[1])??0)<-Lt||e.y+(((_e=(ge=e==null?void 0:e.points)==null?void 0:ge[((se=e==null?void 0:e.points)==null?void 0:se.length)-1])==null?void 0:_e[1])??0)>Lt)&&console.error("Elbow arrow (or update) is outside reasonable bounds (> 1e6)",{arrow:e,updates:n}),e.x=lt(e.x,-Lt,Lt),e.y=lt(e.y,-Lt,Lt),n.points&&(n.points=n.points.map(([H,re])=>A(lt(H,-Lt,Lt),lt(re,-Lt,Lt))));let a=n.points?n.points&&n.points.length===2?e.points.map((H,re)=>re===0?n.points[0]:re===e.points.length-1?n.points[1]:H):n.points.slice():e.points.slice(),i=typeof n.startBinding<"u"?n.startBinding:e.startBinding,l=typeof n.endBinding<"u"?n.endBinding:e.endBinding,s=i&&rd(i.elementId,t),d=l&&rd(l.elementId,t);if(t.size===0&&r8(a)||(s==null?void 0:s.id)!==(i==null?void 0:i.elementId)||(d==null?void 0:d.id)!==(l==null?void 0:l.elementId))return gs(a.map(H=>A(e.x+H[0],e.y+H[1])),e.fixedSegments,e.startIsSpecial,e.endIsSpecial);let{startHeading:u,endHeading:o,startGlobalPoint:f,endGlobalPoint:m,hoveredStartElement:U,hoveredEndElement:g,...v}=J5({x:e.x,y:e.y,startBinding:i,endBinding:l,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead,points:e.points},t,a,s,d,r),y=n.fixedSegments??e.fixedSegments??[];return!n.points&&!n.fixedSegments&&!n.startBinding&&!n.endBinding?JG(e,t):n.startBinding===e.startBinding&&n.endBinding===e.endBinding&&(n.points??[]).every((H,re)=>Xa(H,e.points[re]??A(1/0,1/0)))?{}:y.length===0?gs(t8(n8(e8(e,{startHeading:u,endHeading:o,startGlobalPoint:f,endGlobalPoint:m,hoveredEndElement:g,...v})??[])),y,null,null):(((Y=e.fixedSegments)==null?void 0:Y.length)??0)>y.length?eY(e,y,t):n.points?n.points&&n.fixedSegments?n:nY(e,a,y,u,o,f,m,U,g):tY(e,y,u,o,U,g)},J5=(e,t,n,r,a,i)=>{var M,j;let l=Lp(n[0],Vn(e.x,e.y)),s=Lp(n[n.length-1],Vn(e.x,e.y)),d=r,u=a;if(i!=null&&i.isDragging){let D=Array.from(t.values());d=By(l,t,D,i==null?void 0:i.zoom)||r,u=By(s,t,D,i==null?void 0:i.zoom)||a}let o=zy({...e,points:n},"start",(M=e.startBinding)==null?void 0:M.fixedPoint,l,r,d,i==null?void 0:i.isDragging),f=zy({...e,points:n},"end",(j=e.endBinding)==null?void 0:j.fixedPoint,s,a,u,i==null?void 0:i.isDragging),m=Fy(o,f,t,d,l),U=Fy(f,o,t,u,s),g=[o[0]-2,o[1]-2,o[0]+2,o[1]+2],v=[f[0]-2,f[1]-2,f[0]+2,f[1]+2],y=d?fi(d,Vl(m,e.startArrowhead?Pt*6:Pt*2,1)):g,w=u?fi(u,Vl(U,e.endArrowhead?Pt*6:Pt*2,1)):v,E=qc(o,u?fi(u,Vl(U,Ct,Ct)):v)||qc(f,d?fi(d,Vl(m,Ct,Ct)):g),S=Bk(E?[g,v]:[y,w]),k=iY(E?g:y,E?v:w,S,E?Vl(m,!d&&!u?0:Ct,0):Vl(m,!d&&!u?0:Ct-(e.startArrowhead?Pt*6:Pt*2),Ct),E?Vl(U,!d&&!u?0:Ct,0):Vl(U,!d&&!u?0:Ct-(e.endArrowhead?Pt*6:Pt*2),Ct),E,d&&fi(d),u&&fi(u)),I=$y(k[0],m,o),T=$y(k[1],U,f);return{dynamicAABBs:k,startDonglePosition:I,startGlobalPoint:o,startHeading:m,endDonglePosition:T,endGlobalPoint:f,endHeading:U,commonBounds:S,hoveredStartElement:d,hoveredEndElement:u,boundsOverlap:E,startElementBounds:y,endElementBounds:w}},e8=(e,t)=>{let{dynamicAABBs:n,startDonglePosition:r,startGlobalPoint:a,startHeading:i,endDonglePosition:l,endGlobalPoint:s,endHeading:d,commonBounds:u,hoveredEndElement:o}=t,f=lY(n,r||a,i,l||s,d,u),m=r&&M1(r,f),U=l&&M1(l,f),g=M1(s,f);g&&o&&(g.closed=!0);let v=M1(a,f);v&&e.startBinding&&(v.closed=!0);let y=m&&U&&(qc(m.pos,n[1])||qc(U.pos,n[0])),w=rY(m||v,U||g,f,i||rn,d||rn,y?[]:n);if(w){let E=w.map(S=>[S.pos[0],S.pos[1]]);return m&&E.unshift(a),U&&E.push(s),E}return null},Vl=(e,t,n)=>{switch(e){case Ir:return[t,n,n,n];case rn:return[n,t,n,n];case zn:return[n,n,t,n]}return[n,n,n,t]},rY=(e,t,n,r,a,i)=>{let l=V2(e.pos,t.pos),s=new QG(d=>d.f);for(s.push(e);s.size()>0;){let d=s.pop();if(!d||d.closed)continue;if(d===t)return aY(e,d);d.closed=!0;let u=oY(d.addr,n);for(let o=0;o<4;o++){let f=u[o];if(!f||f.closed)continue;let m=Vi(f.pos,d.pos,.5);if(jO(...i.map(S=>qc(m,S))))continue;let U=cY(o),g=d.parent?Mo(Pe(d.pos,d.parent.pos)):r,v=HS(g);if(ln(v,U)||Hy(e.addr,f.addr)&&ln(U,r)||Hy(t.addr,f.addr)&&ln(U,a))continue;let y=g!==U,w=d.g+V2(f.pos,d.pos)+(y?Math.pow(l,3):0),E=f.visited;if(!E||w<f.g){let S=sY(f,t,U,a);f.visited=!0,f.parent=d,f.h=V2(t.pos,f.pos)+S*Math.pow(l,2),f.g=w,f.f=f.g+f.h,E?s.rescoreElement(f):s.push(f)}}}return null},aY=(e,t)=>{let n=t,r=[];for(;n.parent;)r.unshift(n),n=n.parent;return r.unshift(e),r},V2=(e,t)=>Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1]),iY=(e,t,n,r,a,i,l,s)=>{let d=l??e,u=s??t,[o,f,m,U]=r??[0,0,0,0],[g,v,y,w]=a??[0,0,0,0],E=[e[0]>t[2]?e[1]>t[3]||e[3]<t[1]?Math.min((d[0]+u[2])/2,e[0]-U):(d[0]+u[2])/2:e[0]>t[0]?e[0]-U:n[0]-U,e[1]>t[3]?e[0]>t[2]||e[2]<t[0]?Math.min((d[1]+u[3])/2,e[1]-o):(d[1]+u[3])/2:e[1]>t[1]?e[1]-o:n[1]-o,e[2]<t[0]?e[1]>t[3]||e[3]<t[1]?Math.max((d[2]+u[0])/2,e[2]+f):(d[2]+u[0])/2:e[2]<t[2]?e[2]+f:n[2]+f,e[3]<t[1]?e[0]>t[2]||e[2]<t[0]?Math.max((d[3]+u[1])/2,e[3]+m):(d[3]+u[1])/2:e[3]<t[3]?e[3]+m:n[3]+m],S=[t[0]>e[2]?t[1]>e[3]||t[3]<e[1]?Math.min((u[0]+d[2])/2,t[0]-w):(u[0]+d[2])/2:t[0]>e[0]?t[0]-w:n[0]-w,t[1]>e[3]?t[0]>e[2]||t[2]<e[0]?Math.min((u[1]+d[3])/2,t[1]-g):(u[1]+d[3])/2:t[1]>e[1]?t[1]-g:n[1]-g,t[2]<e[0]?t[1]>e[3]||t[3]<e[1]?Math.max((u[2]+d[0])/2,t[2]+v):(u[2]+d[0])/2:t[2]<e[2]?t[2]+v:n[2]+v,t[3]<e[1]?t[0]>e[2]||t[2]<e[0]?Math.max((u[3]+d[1])/2,t[3]+y):(u[3]+d[1])/2:t[3]<e[3]?t[3]+y:n[3]+y],k=Bk([E,S]);if(!i&&E[2]-E[0]+S[2]-S[0]>k[2]-k[0]+1e-11&&E[3]-E[1]+S[3]-S[1]>k[3]-k[1]+1e-11){let[I,T]=[(S[0]+S[2])/2,(S[1]+S[3])/2];if(t[0]>e[2]&&e[1]>t[3]){let M=E[2]+(S[0]-E[2])/2,j=S[3]+(E[1]-S[3])/2;return In(Vn(e[2]-I,e[1]-T),Vn(e[0]-I,e[3]-T))>0?[[E[0],E[1],M,E[3]],[M,S[1],S[2],S[3]]]:[[E[0],j,E[2],E[3]],[S[0],S[1],S[2],j]]}else if(e[2]<t[0]&&e[3]<t[1]){let M=E[2]+(S[0]-E[2])/2,j=E[3]+(S[1]-E[3])/2;return In(Vn(e[0]-I,e[1]-T),Vn(e[2]-I,e[3]-T))>0?[[E[0],E[1],E[2],j],[S[0],j,S[2],S[3]]]:[[E[0],E[1],M,E[3]],[M,S[1],S[2],S[3]]]}else if(e[0]>t[2]&&e[3]<t[1]){let M=S[2]+(E[0]-S[2])/2,j=E[3]+(S[1]-E[3])/2;return In(Vn(e[2]-I,e[1]-T),Vn(e[0]-I,e[3]-T))>0?[[M,E[1],E[2],E[3]],[S[0],S[1],M,S[3]]]:[[E[0],E[1],E[2],j],[S[0],j,S[2],S[3]]]}else if(e[0]>t[2]&&e[1]>t[3]){let M=S[2]+(E[0]-S[2])/2,j=S[3]+(E[1]-S[3])/2;return In(Vn(e[0]-I,e[1]-T),Vn(e[2]-I,e[3]-T))>0?[[M,E[1],E[2],E[3]],[S[0],S[1],M,S[3]]]:[[E[0],j,E[2],E[3]],[S[0],S[1],S[2],j]]}}return[E,S]},lY=(e,t,n,r,a,i)=>{let l=new Set,s=new Set;n===Mr||n===rn?s.add(t[1]):l.add(t[0]),a===Mr||a===rn?s.add(r[1]):l.add(r[0]),e.forEach(o=>{l.add(o[0]),l.add(o[2]),s.add(o[1]),s.add(o[3])}),l.add(i[0]),l.add(i[2]),s.add(i[1]),s.add(i[3]);let d=Array.from(s).sort((o,f)=>o-f),u=Array.from(l).sort((o,f)=>o-f);return{row:d.length,col:u.length,data:d.flatMap((o,f)=>u.map((m,U)=>({f:0,g:0,h:0,closed:!1,visited:!1,parent:null,addr:[U,f],pos:[m,o]})))}},$y=(e,t,n)=>{switch(t){case Ir:return A(n[0],e[1]);case rn:return A(e[2],n[1]);case zn:return A(n[0],e[3])}return A(e[0],n[1])},sY=(e,t,n,r)=>{if(r===rn)switch(n){case rn:return e.pos[0]>=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2;case Ir:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case zn:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case Mr:return e.pos[1]===t.pos[1]?4:2}else if(r===Mr)switch(n){case rn:return e.pos[1]===t.pos[1]?4:2;case Ir:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case zn:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case Mr:return e.pos[0]<=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2}else if(r===Ir)switch(n){case rn:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case Ir:return e.pos[1]>=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case zn:return e.pos[0]===t.pos[0]?4:2;case Mr:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3}else if(r===zn)switch(n){case rn:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case Ir:return e.pos[0]===t.pos[0]?4:2;case zn:return e.pos[1]<=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case Mr:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3}return 0},oY=([e,t],n)=>[Mu([e,t-1],n),Mu([e+1,t],n),Mu([e,t+1],n),Mu([e-1,t],n)],Mu=([e,t],n)=>e<0||e>=n.col||t<0||t>=n.row?null:n.data[t*n.col+e]??null,M1=(e,t)=>{for(let n=0;n<t.col;n++)for(let r=0;r<t.row;r++){let a=Mu([n,r],t);if(a&&e[0]===a.pos[0]&&e[1]===a.pos[1])return a}return null},Bk=e=>[Math.min(...e.map(t=>t[0])),Math.min(...e.map(t=>t[1])),Math.max(...e.map(t=>t[2])),Math.max(...e.map(t=>t[3]))],rd=(e,t)=>{let n=t.get(e);return n&&Va(n)?n:null},gs=(e,t,n,r)=>{let a=e[0][0],i=e[0][1],l=e.map(s=>Lp(s,an(Pe(e[0]),-1)));return(a<-Lt||a>Lt||i<-Lt||i>Lt||a+l[l.length-1][0]<-Lt||i+l[l.length-1][0]>Lt||a+l[l.length-1][1]<-Lt||i+l[l.length-1][1]>Lt)&&console.error("Elbow arrow normalization is outside reasonable bounds (> 1e6)",{x:a,y:i,points:l,...Jc(l)}),l=l.map(([s,d])=>A(lt(s,-1e6,1e6),lt(d,-1e6,1e6))),{points:l,x:lt(a,-1e6,1e6),y:lt(i,-1e6,1e6),fixedSegments:((t==null?void 0:t.length)??0)>0?t:null,...Jc(l),startIsSpecial:n,endIsSpecial:r}},t8=e=>{if(e.length>1){let t=Math.abs(e[0][1]-e[1][1])<Math.abs(e[0][0]-e[1][0]);return e.filter((n,r)=>{if(r===0||r===e.length-1)return!0;let a=e[r+1],i=Math.abs(n[1]-a[1])<Math.abs(n[0]-a[0]);return t===i?(t=i,!1):(t=i,!0)})}return e},n8=e=>e.length>=4?e.filter((t,n)=>{if(n===0||n===e.length-1)return!0;let r=e[n-1];return yt(r,t)>q5}):e,cY=e=>{switch(e){case 0:return Ir;case 1:return rn;case 2:return zn}return Mr},zy=(e,t,n,r,a,i,l)=>{if(l){if(i){let s=hf(e,i,t);return PV(i,s)}return r}if(a){let s=d6(n||[0,0],a);return Math.abs(j0(a,s)-Pt)>.01?hf(e,a,t):s}return r},Fy=(e,t,n,r,a)=>RV(e,t,r,r&&fi(r,Array(4).fill(j0(r,e))),n,a),By=(e,t,n,r)=>Oa(Pa(e),n,t,r,!0,!0),Hy=(e,t)=>e[0]===t[0]&&e[1]===t[1],r8=(e,t=q5)=>e.slice(1).map((n,r)=>Math.abs(n[0]-e[r][0])<t||Math.abs(n[1]-e[r][1])<t).every(Boolean),dY={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0,eraser:!1,custom:!0,frame:!0,embeddable:!0,hand:!0,laser:!1,magicframe:!1},uY=e=>Object.keys(Xt).includes(e)?Xt[e]:Es,mc=(e,t)=>{if(!t)return null;let n=t.focus||0;return Me(e)?Op(t)?{...t,focus:n,fixedPoint:N0(t.fixedPoint??[0,0])}:null:{...t,focus:n}},Gl=(e,t)=>{let n={type:t.type||e.type,version:e.version||1,versionNonce:e.versionNonce??0,index:e.index??null,isDeleted:e.isDeleted??!1,id:e.id||ga(),fillStyle:e.fillStyle||nn.fillStyle,strokeWidth:e.strokeWidth||nn.strokeWidth,strokeStyle:e.strokeStyle??nn.strokeStyle,roughness:e.roughness??nn.roughness,opacity:e.opacity==null?nn.opacity:e.opacity,angle:e.angle||0,x:t.x??e.x??0,y:t.y??e.y??0,strokeColor:e.strokeColor||nn.strokeColor,backgroundColor:e.backgroundColor||nn.backgroundColor,width:e.width||0,height:e.height||0,seed:e.seed??1,groupIds:e.groupIds??[],frameId:e.frameId??null,roundness:e.roundness?e.roundness:e.strokeSharpness==="round"?{type:fd(e.type)?bn.LEGACY:bn.PROPORTIONAL_RADIUS}:null,boundElements:e.boundElementIds?e.boundElementIds.map(r=>({type:"arrow",id:r})):e.boundElements??[],updated:e.updated??ud(),link:e.link?Rr(e.link):null,locked:e.locked??!1};return("customData"in e||"customData"in t)&&(n.customData="customData"in t?t.customData:e.customData),{...e,...n,...lC(n),...t}},fY=e=>{switch(e={...e},e.type){case"text":delete e.rawText;let t=e.fontSize,n=e.fontFamily;if("font"in e){let[o,f]=e.font.split(" ");t=parseFloat(o),n=uY(f)}let r=typeof e.text=="string"&&e.text||"",a=e.lineHeight||(e.height?$O(e):Co(e.fontFamily));return e=Gl(e,{fontSize:t,fontFamily:n,text:r,textAlign:e.textAlign||jf,verticalAlign:e.verticalAlign||Mp,containerId:e.containerId??null,originalText:e.originalText||r,autoResize:e.autoResize??!0,lineHeight:a}),!r&&!e.isDeleted&&(e={...e,originalText:r,isDeleted:!0},e=Gf(e)),e;case"freedraw":return Gl(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return Gl(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1],crop:e.crop??null});case"line":case"draw":let{startArrowhead:i=null,endArrowhead:l=null}=e,s=e.x,d=e.y,u=!Array.isArray(e.points)||e.points.length<2?[A(0,0),A(e.width,e.height)]:e.points;return(u[0][0]!==0||u[0][1]!==0)&&({points:u,x:s,y:d}=Ce.getNormalizedPoints(e)),Gl(e,{type:e.type==="draw"?"line":e.type,startBinding:mc(e,e.startBinding),endBinding:mc(e,e.endBinding),lastCommittedPoint:null,startArrowhead:i,endArrowhead:l,points:u,x:s,y:d,...Jc(u)});case"arrow":{let{startArrowhead:o=null,endArrowhead:f="arrow"}=e,m=e.x,U=e.y,g=!Array.isArray(e.points)||e.points.length<2?[A(0,0),A(e.width,e.height)]:e.points;(g[0][0]!==0||g[0][1]!==0)&&({points:g,x:m,y:U}=Ce.getNormalizedPoints(e));let v={type:e.type,startBinding:mc(e,e.startBinding),endBinding:mc(e,e.endBinding),lastCommittedPoint:null,startArrowhead:o,endArrowhead:f,points:g,x:m,y:U,elbowed:e.elbowed,...Jc(g)};return Me(e)?Gl(e,{...v,elbowed:!0,startBinding:mc(e,e.startBinding),endBinding:mc(e,e.endBinding),fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}):Gl(e,v)}case"ellipse":case"rectangle":case"diamond":case"iframe":case"embeddable":return Gl(e,{});case"magicframe":case"frame":return Gl(e,{name:e.name??null})}return null},hY=(e,t)=>{if(e.boundElements){let n=e.boundElements.slice(),r=new Set;e.boundElements=n.reduce((a,i)=>{let l=t.get(i.id);if(l&&!r.has(i.id)){if(r.add(i.id),l.isDeleted)return a;a.push(i),ke(l)&&!l.containerId&&(l.containerId=e.id)}return a},[])}},pY=(e,t)=>{let n=e.containerId?t.get(e.containerId):null;if(!n){e.containerId=null;return}if(!e.isDeleted&&n.boundElements&&!n.boundElements.find(r=>r.id===e.id)){let r=(n.boundElements||(n.boundElements=[])).slice();r.push({type:"text",id:e.id}),n.boundElements=r}},mY=(e,t)=>{e.frameId&&(t.get(e.frameId)||(e.frameId=null))},Bf=(e,t,n)=>{let r=new Set,a=t?We(t):null,i=ul((e||[]).reduce((s,d)=>{if(d.type!=="selection"&&!_o(d)){let u=fY(d);if(u){let o=a==null?void 0:a.get(d.id);o&&o.version>u.version&&(u=Gf(u,o.version)),r.has(u.id)&&(u={...u,id:ga()}),r.add(u.id),s.push(u)}}return s},[]));if(!(n!=null&&n.repairBindings))return i;let l=We(i);for(let s of i)s.frameId&&mY(s,l),ke(s)&&s.containerId?pY(s,l):s.boundElements&&hY(s,l),n.refreshDimensions&&ke(s)&&Object.assign(s,bk(s,Bn(s,l),l)),Ge(s)&&(s.startBinding&&(!l.has(s.startBinding.elementId)||!nt(s))&&(s.startBinding=null),s.endBinding&&(!l.has(s.endBinding.elementId)||!nt(s))&&(s.endBinding=null));return i.map(s=>{if(Me(s)&&s.startBinding==null&&s.endBinding==null&&!r8(s.points))return{...s,...Q5(s,l,{points:[A(0,0),s.points[s.points.length-1]]}),index:s.index};if(Me(s)&&s.startBinding&&s.endBinding&&s.startBinding.elementId===s.endBinding.elementId&&s.points.length>1&&s.points.some(([d,u])=>Math.abs(d)>1e6||Math.abs(u)>1e6)){console.error("Fixing self-bound elbow arrow",s.id);let d=l.get(s.startBinding.elementId);return d?{...s,x:d.x+d.width/2,y:d.y-5,width:d.width,height:d.height,points:[A(0,0),A(0,-10),A(d.width/2+5,-10),A(d.width/2+5,d.height/2+5)]}:(console.error("Bound element not found",s.startBinding.elementId),s)}return s})},UY=(e,t,n)=>{let r=t[e];return r!==void 0?r:n[e]},Wy={isSidebarDocked:(e,t)=>["defaultSidebarDockedPreference",e.isSidebarDocked??UY("defaultSidebarDockedPreference",e,t)]},Hk=(e,t)=>{var a;e=e||{};let n=wi(),r={};for(let i of Object.keys(Wy))if(i in e){let[l,s]=Wy[i](e,n);r[l]=s}for(let[i,l]of Object.entries(n)){let s=e[i],d=t?t[i]:void 0;r[i]=s!==void 0?s:d!==void 0?d:l}return{...r,cursorButton:(t==null?void 0:t.cursorButton)||"up",penDetected:(t==null?void 0:t.penDetected)??(e.penMode?e.penDetected??!1:!1),activeTool:{...gn(n,r.activeTool.type&&dY[r.activeTool.type]?r.activeTool:{type:"selection"}),lastActiveTool:null,locked:r.activeTool.locked??!1},zoom:{value:nl(Ou(e.zoom)?e.zoom:((a=e.zoom)==null?void 0:a.value)??n.zoom.value)},openSidebar:typeof e.openSidebar=="string"?{name:Fa.name}:r.openSidebar,gridSize:WV(Ou(e.gridSize)?e.gridSize:_p),gridStep:nk(Ou(e.gridStep)?e.gridStep:ME),editingFrame:null}},Hf=(e,t,n,r)=>({elements:Bf(e==null?void 0:e.elements,n,r),appState:Hk(e==null?void 0:e.appState,t||null),files:(e==null?void 0:e.files)||{}}),Xy=e=>{let t=Bf(Rt(e.elements),null);return t.length?{...e,elements:t}:null},H0=(e=[],t)=>{let n=[];for(let r of e)if(Array.isArray(r)){let a=Xy({status:t,elements:r,id:ga(),created:Date.now()});a&&n.push(a)}else{let a=r,i=Xy({...a,id:a.id||ga(),status:a.status||t,created:a.created||Date.now()});i&&n.push(i)}return n},La=32,Dt=12,hs=256,Wk=50,to="NOT_SPREADSHEET",vf="VALID_SPREADSHEET",Iu=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},G2=(e,t)=>e.slice(1).every(n=>Iu(n[t])!==null),Vy=e=>{let t=e[0].length;if(t>2)return{type:to,reason:"More than 2 columns"};if(t===1){if(!G2(e,0))return{type:to,reason:"Value is not numeric"};let d=Iu(e[0][0])===null,u=(d?e.slice(1):e).map(o=>Iu(o[0]));return u.length<2?{type:to,reason:"Less than two rows"}:{type:vf,spreadsheet:{title:d?e[0][0]:null,labels:null,values:u}}}let n=G2(e,0),r=G2(e,1);if(!n&&!r)return{type:to,reason:"Value is not numeric"};let[a,i]=r?[0,1]:[1,0],l=Iu(e[0][i])===null,s=l?e.slice(1):e;return s.length<2?{type:to,reason:"Less than 2 rows"}:{type:vf,spreadsheet:{title:l?e[0][i]:null,labels:s.map(d=>d[a]),values:s.map(d=>Iu(d[i]))}}},gY=e=>{let t=[];for(let n=0;n<e[0].length;n++){let r=[];for(let a=0;a<e.length;a++)r.push(e[a][n]);t.push(r)}return t},bY=e=>{let t=e.trim().split(`
|
|
78
|
+
`).map(a=>a.trim().split(" "));if(t.length&&t[0].length!==2&&(t=e.trim().split(`
|
|
79
|
+
`).map(a=>a.trim().split(","))),t.length===0)return{type:to,reason:"No values"};let n=t[0].length;if(!t.every(a=>a.length===n))return{type:to,reason:"All rows don't have same number of columns"};let r=Vy(t);if(r.type!==vf){let a=Vy(gY(t));if(a.type===vf)return a}return r},Qp=kN(wN),fa={fillStyle:"hachure",fontFamily:Es,fontSize:bl,opacity:100,roughness:1,strokeColor:at.black,roundness:null,strokeStyle:"solid",strokeWidth:1,verticalAlign:Br.MIDDLE,locked:!1},Xk=e=>{let t=(La+Dt)*e.values.length+Dt,n=hs+Dt*2;return{chartWidth:t,chartHeight:n}},vY=(e,t,n,r,a)=>{var i;return((i=e.labels)==null?void 0:i.map((l,s)=>Wr({groupIds:[r],backgroundColor:a,...fa,text:l.length>8?`${l.slice(0,5)}...`:l,x:t+s*(La+Dt)+Dt*2,y:n+Dt/2,width:La,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))||[]},yY=(e,t,n,r,a)=>{let i=Wr({groupIds:[r],backgroundColor:a,...fa,x:t-Dt,y:n-Dt,text:"0",textAlign:"right"}),l=Wr({groupIds:[r],backgroundColor:a,...fa,x:t-Dt,y:n-hs-i.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"});return[i,l]},xY=(e,t,n,r,a)=>{let{chartWidth:i,chartHeight:l}=Xk(e),s=ho({backgroundColor:a,groupIds:[r],...fa,type:"line",x:t,y:n,width:i,points:[A(0,0),A(i,0)]}),d=ho({backgroundColor:a,groupIds:[r],...fa,type:"line",x:t,y:n,height:l,points:[A(0,0),A(0,-l)]}),u=ho({backgroundColor:a,groupIds:[r],...fa,type:"line",x:t,y:n-hs-Dt,strokeStyle:"dotted",width:i,opacity:Wk,points:[A(0,0),A(i,0)]});return[s,d,u]},Vk=(e,t,n,r,a,i)=>{let{chartWidth:l,chartHeight:s}=Xk(e),d=e.title?Wr({backgroundColor:a,groupIds:[r],...fa,text:e.title,x:t+l/2,y:n-hs-Dt*2-bl,roundness:null,textAlign:"center"}):null,u=i?ki({backgroundColor:a,groupIds:[r],...fa,type:"rectangle",x:t,y:n-s,width:l,height:s,strokeColor:at.black,fillStyle:"solid",opacity:6}):null;return[...u?[u]:[],...d?[d]:[],...vY(e,t,n,r,a),...yY(e,t,n,r,a),...xY(e,t,n,r,a)]},wY=(e,t,n)=>{let r=Math.max(...e.values),a=ga(),i=Qp[Math.floor(Math.random()*Qp.length)];return[...e.values.map((l,s)=>{let d=l/r*hs;return ki({backgroundColor:i,groupIds:[a],...fa,type:"rectangle",x:t+s*(La+Dt)+Dt,y:n-d-Dt,width:La,height:d})}),...Vk(e,t,n,a,i,et.DEV)]},EY=(e,t,n)=>{let r=Math.max(...e.values),a=ga(),i=Qp[Math.floor(Math.random()*Qp.length)],l=0,s=[];for(let v of e.values){let y=l*(La+Dt),w=-(v/r)*hs;s.push([y,w]),l++}let d=Math.max(...s.map(v=>v[0])),u=Math.max(...s.map(v=>v[1])),o=Math.min(...s.map(v=>v[0])),f=Math.min(...s.map(v=>v[1])),m=ho({backgroundColor:i,groupIds:[a],...fa,type:"line",x:t+Dt+La/2,y:n-Dt,height:u-f,width:d-o,strokeWidth:2,points:s}),U=e.values.map((v,y)=>{let w=y*(La+Dt)+Dt/2,E=-(v/r)*hs+Dt/2;return ki({backgroundColor:i,groupIds:[a],...fa,fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+w+La/2,y:n+E-Dt*2,width:Dt,height:Dt})}),g=e.values.map((v,y)=>{let w=y*(La+Dt)+Dt/2,E=v/r*hs+Dt/2+Dt;return ho({backgroundColor:i,groupIds:[a],...fa,type:"line",x:t+w+La/2+Dt/2,y:n-E,height:E,strokeStyle:"dotted",opacity:Wk,points:[A(0,0),A(0,E)]})});return[...Vk(e,t,n,a,i,et.DEV),m,...g,...U]},SY=(e,t,n,r)=>e==="line"?EY(t,n,r):wY(t,n,r),a8="clipboard"in navigator&&"writeText"in navigator.clipboard,i8="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,kY=e=>!!([ua.excalidraw,ua.excalidrawClipboard,ua.excalidrawClipboardWithAPI].includes(e==null?void 0:e.type)&&Array.isArray(e.elements)),CY=({types:e,files:t})=>{var r,a,i,l;!e&&!t&&console.warn("createPasteEvent: no types or files provided");let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});if(e)for(let[s,d]of Object.entries(e)){if(typeof d!="string"){t=t||[],t.push(d);continue}try{if((r=n.clipboardData)==null||r.setData(s,d),((a=n.clipboardData)==null?void 0:a.getData(s))!==d)throw new Error(`Failed to set "${s}" as clipboardData item`)}catch(u){throw new Error(u.message)}}if(t){let s=-1;for(let d of t){s++;try{if((i=n.clipboardData)==null||i.items.add(d),((l=n.clipboardData)==null?void 0:l.files[s])!==d)throw new Error(`Failed to set file "${d.name}" as clipboardData item`)}catch(u){throw new Error(u.message)}}}return n},MY=({elements:e,files:t})=>{let n=We(e),r=new Set(e.filter(s=>He(s))),a=!1,i=e.reduce((s,d)=>(la(d)&&(a=!0,t&&t[d.fileId]&&(s[d.fileId]=t[d.fileId])),s),{});a&&!t&&console.warn("copyToClipboard: attempting to file element(s) without providing associated `files` object.");let l={type:ua.excalidrawClipboard,elements:e.map(s=>{if(jr(s,n)&&!r.has(jr(s,n))){let d=No(s);return pe(d,{frameId:null}),d}return s}),files:t?i:void 0};return JSON.stringify(l)},IY=async(e,t,n)=>{await Wf(MY({elements:e,files:t}),n)},_Y=e=>{let t=bY(e);return t.type===vf?{spreadsheet:t.spreadsheet}:null};function Gk(e){var n;let t=[];for(let r of e.childNodes)if(r.nodeType===3){let a=(n=r.textContent)==null?void 0:n.trim();a&&t.push({type:"text",value:a})}else if(r instanceof HTMLImageElement){let a=r.getAttribute("src");a&&a.startsWith("http")&&t.push({type:"imageUrl",value:a})}else t=t.concat(Gk(r));return t}var TY=e=>{var n;let t=(n=e.clipboardData)==null?void 0:n.getData(De.html);if(!t)return null;try{let r=new DOMParser().parseFromString(t,De.html),a=Gk(r.body);if(a.length)return{type:"mixedContent",value:a}}catch(r){console.error(`error in parseHTMLFromPaste: ${r.message}`)}return null},AY=async()=>{var n,r,a,i;let e={},t;try{t=await((n=navigator.clipboard)==null?void 0:n.read())}catch(l){try{if((r=navigator.clipboard)!=null&&r.readText){console.warn(`navigator.clipboard.readText() failed (${l.message}). Failling back to navigator.clipboard.read()`);let s=await((a=navigator.clipboard)==null?void 0:a.readText());if(s)return{[De.text]:s}}}catch(s){if((i=navigator.clipboard)!=null&&i.read)console.warn(`navigator.clipboard.readText() failed (${s.message}). Failling back to navigator.clipboard.read()`);else{if(s.name==="DataError")return console.warn(`navigator.clipboard.read() error, clipboard is probably empty: ${s.message}`),e;throw s}}throw l}for(let l of t)for(let s of l.types)if(HE($N,s))try{if(s===De.text||s===De.html)e[s]=await(await l.getType(s)).text();else if(UC(s)){let d=await l.getType(s),u=_u(d,s,void 0);e[s]=u}else throw new ny(`Unsupported clipboard type: ${s}`)}catch(d){console.warn(d instanceof ny?d.message:`Cannot retrieve ${s} from clipboardItem: ${d.message}`)}return Object.keys(e).length===0&&console.warn("No clipboard data found from clipboard.read()."),e},RY=async(e,t=!1)=>{var n,r;try{let a=!t&&e&&TY(e);return a?a.value.every(i=>i.type==="text")?{type:"text",value:((n=e.clipboardData)==null?void 0:n.getData(De.text))||a.value.map(i=>i.value).join(`
|
|
80
|
+
`).trim()}:a:{type:"text",value:(((r=e.clipboardData)==null?void 0:r.getData(De.text))||"").trim()}}catch{return{type:"text",value:""}}},Yk=async(e,t=!1)=>{let n=await RY(e,t);if(n.type==="mixedContent")return{mixedContent:n.value};try{let r=!t&&_Y(n.value);if(r)return r}catch(r){console.error(r)}try{let r=JSON.parse(n.value),a=r.type===ua.excalidrawClipboardWithAPI;if(kY(r))return{elements:r.elements,files:r.files,text:t?JSON.stringify(r.elements,null,2):void 0,programmaticAPI:a}}catch{}return{text:n.value}},jY=async e=>{try{await navigator.clipboard.write([new window.ClipboardItem({[De.png]:e})])}catch(t){if(Pf(e))await navigator.clipboard.write([new window.ClipboardItem({[De.png]:await e})]);else throw t}},Wf=async(e,t)=>{var n,r;if(a8)try{await navigator.clipboard.writeText(e||"");return}catch(a){console.error(a)}try{if(t){if((n=t.clipboardData)==null||n.setData(De.text,e||""),((r=t.clipboardData)==null?void 0:r.getData(De.text))!==e)throw new Error("Failed to setData on clipboardEvent");return}}catch(a){console.error(a)}if(!LY(e))throw new Error("Error copying to clipboard.")},LY=e=>{e||(e=" ");let t=document.documentElement.getAttribute("dir")==="rtl",n=document.createElement("textarea");n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";let r=window.pageYOffset||document.documentElement.scrollTop;n.style.top=`${r}px`,n.style.fontSize="12pt",n.setAttribute("readonly",""),n.value=e,document.body.appendChild(n);let a=!1;try{n.select(),n.setSelectionRange(0,n.value.length),a=document.execCommand("copy")}catch(i){console.error(i)}return n.remove(),a},Xf=({elements:e,appState:t,files:n,maxWidthOrHeight:r,getDimensions:a,exportPadding:i,exportingFrame:l})=>{let{elements:s,appState:d}=Hf({elements:e,appState:t},null,null),{exportBackground:u,viewBackgroundColor:o}=d;return Fk(s,{...d,offsetTop:0,offsetLeft:0,width:0,height:0},n||{},{exportBackground:u,exportPadding:i,viewBackgroundColor:o,exportingFrame:l},(f,m)=>{let U=document.createElement("canvas");if(r){typeof a=="function"&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");let v=Math.max(f,m),y=r<v?r/v:(t==null?void 0:t.exportScale)??1;return U.width=f*y,U.height=m*y,{canvas:U,scale:y}}let g=(a==null?void 0:a(f,m))||{width:f,height:m};return U.width=g.width,U.height=g.height,{canvas:U,scale:g.scale??1}})},Zk=async e=>{var a;let{mimeType:t=De.png,quality:n}=e;t===De.png&&typeof n=="number"&&console.warn(`"quality" will be ignored for "${De.png}" mimeType`),t==="image/jpg"&&(t=De.jpg),t===De.jpg&&!((a=e.appState)!=null&&a.exportBackground)&&(console.warn(`Defaulting "exportBackground" to "true" for "${De.jpg}" mimeType`),e={...e,appState:{...e.appState,exportBackground:!0}});let r=await Xf(e);return n=n||(/image\/jpe?g/.test(t)?.92:.8),new Promise((i,l)=>{r.toBlob(async s=>{var d;if(!s)return l(new Error("couldn't export to blob"));s&&t===De.png&&((d=e.appState)!=null&&d.exportEmbedScene)&&(s=await CC({blob:s,metadata:Ff(e.elements,e.appState,e.files||{})})),i(s)},t,n)})},l8=async({elements:e,appState:t=wi(),files:n={},exportPadding:r,renderEmbeddables:a,exportingFrame:i,skipInliningFonts:l,reuseImages:s})=>{let{elements:d,appState:u}=Hf({elements:e,appState:t},null,null),o={...u,exportPadding:r};return Z5(d,o,n,{exportingFrame:i,renderEmbeddables:a,skipInliningFonts:l,reuseImages:s})},DY=e=>e.type==="diamond"?[A(e.width/2,0),A(e.width,e.height/2),A(e.width/2,e.height),A(0,e.height/2)]:[A(0,0),A(0+e.width,0),A(0+e.width,e.height),A(0,e.height)],PY=e=>Ge(e)||ma(e)?e.points:DY(e),Gy=e=>{let t=e.reduce((n,[r,a])=>(n.minY=Math.min(n.minY,a),n.minX=Math.min(n.minX,r),n.maxX=Math.max(n.maxX,r),n.maxY=Math.max(n.maxY,a),n),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,cx:0,cy:0});return t.cx=(t.maxX+t.minX)/2,t.cy=(t.maxY+t.minY)/2,t},NY=e=>{let t=PY(e),{cx:n,cy:r}=Gy(t),a=A(n,r),i=t.map(o=>ce(o,a,e.angle)),{minX:l,minY:s,maxX:d,maxY:u}=Gy(i);return[l+e.x,s+e.y,d+e.x,u+e.y]},Kk=(e,t)=>{let n=NY(e);return(w1(n[0],tr(t[0],t[2]))||w1(t[0],tr(n[0],n[2])))&&(w1(n[1],tr(t[1],t[3]))||w1(t[1],tr(n[1],n[3])))},qk=({elements:e,bounds:t,type:n,errorMargin:r=0})=>{var l;GE(t)&&(t=Ga(t,We(e)));let a=[t[0]-r,t[1]-r,t[2]+r,t[3]+r],i=new Set;for(let s of e)if(!i.has(s.id)&&Kk(s,a)){if(i.add(s.id),s.boundElements)for(let d of s.boundElements)i.add(d.id);ke(s)&&s.containerId&&i.add(s.containerId),nt(s)&&(s.startBinding&&i.add(s.startBinding.elementId),s.endBinding&&i.add((l=s.endBinding)==null?void 0:l.elementId))}return e.filter(s=>i.has(s.id))};function Yy(e){return[Math.min(e[0][0],e[1][0]),Math.min(e[0][1],e[1][1]),Math.max(e[0][0],e[1][0]),Math.max(e[0][1],e[1][1])]}function OY(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}var $Y=1e-6;function Zy(e,t){let n=Pe(e[1],e[0]),r=Pe(t,e[0]),a=In(n,r);return Math.abs(a)<$Y}function Y2(e,t){let n=Pe(e[1],e[0]),r=Pe(t,e[0]);return In(n,r)<0}function Ky(e,t){return Zy(e,t[0])||Zy(e,t[1])||(Y2(e,t[0])?!Y2(e,t[1]):Y2(e,t[1]))}function zY(e,t){return OY(Yy(e),Yy(t))&&Ky(e,t)&&Ky(t,e)}var Qk=(e,t,n)=>{let r=We(e);for(let a of t)if(a.frameId){let i=n.get(a.id),l=n.get(a.frameId);if(i){let s=r.get(i);s&&pe(s,{frameId:l??a.frameId},!1)}}};function s8(e,t,n){let r=uy(t,n),a=uy(e,n);return r.some(i=>a.some(l=>zY(i,l)))}var Jk=(e,t,n)=>X0(h8(e,t,n,!1)).filter(r=>!He(r)&&!r.frameId||r.frameId===t.id),o8=(e,t,n)=>h8([t],e,n).some(r=>r.id===t.id),Vf=(e,t,n)=>{let[r,a,i,l]=Ze(t,n),[s,d,u,o]=xt(e);return r<=s&&a<=d&&i>=u&&l>=o},bs=(e,t,n)=>Vf([e],t,n)||s8(e,t,n)||o8(e,t,n),qy=(e,t,n)=>{let[r,a,i,l]=Ze(t,n);return LE(A(r,a),A(e.x,e.y),A(i,l))},FY=e=>{let t=new Map;for(let n of e){let r=He(n)?n.id:n.frameId;r&&!t.has(r)&&t.set(r,Mi(e,r))}return t},Mi=(e,t)=>{let n=[];for(let r of e.values())r.frameId===t&&n.push(r);return n},c8=e=>e.filter(t=>He(t)),d8=e=>{let t=We(c8(e));return e.filter(n=>t.has(n.id)||!n.frameId||!t.has(n.frameId))},cp=(e,t,n,r)=>{let a=Mi(e,t.id),i=new Set(a),l=new Set([...Jk(e,t,r),...a.filter(m=>o8(m,t,r))]),s=a.filter(m=>!l.has(m)),d=new Set(Array.from(l).flatMap(m=>m.groupIds));for(let m of s)if(!s8(m,t,r))m.groupIds.length===0&&i.delete(m);else if(m.groupIds.length>0)for(let U of m.groupIds)d.add(U);for(let m of s)if(m.groupIds.length>0){let U=!0;for(let g of m.groupIds)d.has(g)&&(U=!1);U&&i.delete(m)}let u=Array.from(l).filter(m=>m.groupIds.length===0);for(let m of u)i.add(m);let o=Array.from(l).filter(m=>m.groupIds.length>0),f=lk(o,n);for(let[m,U]of Object.entries(f))if(U){let g=zt(e,m);if(Vf(g,t,r))for(let v of g)i.add(v)}return[...i].filter(m=>!(ke(m)&&m.containerId))},BY=(e,t,n)=>HY(X0(e,Jk(e,t,n)),t,n),HY=(e,t,n)=>{let r=[],a=new Map;for(let i of e){let l=!1;if(i.groupIds.length>0){if(i.groupIds.some(s=>a.get(s)))l=!0;else{let s=new Set(i.groupIds.flatMap(d=>zt(n,d)));l=!Vf(Array.from(s),t,n)}i.groupIds.forEach(s=>{a.set(s,l)})}l||r.push(i)}return r},jr=(e,t)=>e.frameId&&t.get(e.frameId)||null,WY=(e,t)=>{let n=new Set,r=We(e);e=X0(e);for(let l of e)He(l)&&l.id!==t.id&&n.add(l.id);let a=new Set,i=[];for(let l of e)if(!(He(l)||l.frameId&&n.has(l.frameId)))if(l.groupIds.length){let s=l.groupIds.at(-1);if(!a.has(s)){a.add(s);let d=zt(e,s);if(d.some(u=>bs(u,t,r)))for(let u of d)i.push(u)}}else bs(l,t,r)&&i.push(l);return i},Hu=(e,t,n,r)=>{let a=We(e),i=new Map;for(let u of e.values())u.frameId===n.id&&i.set(u.id,!0);let l=new Set(t.map(u=>u.id)),s=[],d=new Set;for(let u of t)He(u)&&u.id!==n.id&&d.add(u.id);for(let u of X0(e,t)){if(He(u)||u.frameId&&d.has(u.frameId)||u.frameId&&r.selectedElementIds[u.id]&&r.selectedElementIds[u.frameId])continue;i.has(u.id)||s.push(u);let o=Je(u,a);o&&!l.has(o.id)&&!i.has(o.id)&&s.push(o)}for(let u of s)pe(u,{frameId:n.id},!1);return e},W0=(e,t)=>{let n=new Map,r=new Map;for(let a of e)if(a.frameId){n.set(a.id,a);let i=r.get(a.frameId)||[];i.push(a);let l=Je(a,t);l&&(n.set(l.id,l),i.push(l)),r.set(a.frameId,i)}for(let[,a]of n)pe(a,{frameId:null},!1)},eC=(e,t)=>{let n=Mi(e,t.id);return W0(n,We(e)),e},tC=(e,t,n,r)=>Hu(eC(e,n),t,n,r.state).slice(),ad=(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,elements:e}),a=new Set(r);if(t.editingGroupId)for(let s of r)s.groupIds.length===0?a.add(s):s.groupIds.flatMap(d=>zt(e,d)).forEach(d=>a.add(d));let i=new Set,l=We(e);return a.forEach(s=>{s.frameId&&!He(s)&&!Jp(s,l,t)&&i.add(s)}),i.size>0&&W0(i,l),e},X0=(e,t)=>{let n=new Set,r=t||e;for(let l of r.values()){let s=l.groupIds[l.groupIds.length-1];s&&n.add(s)}let a=new Set;for(let l of n)zt(e,l).some(s=>He(s))&&a.add(l);let i=[];for(let l of r.values())a.has(l.groupIds[l.groupIds.length-1])||i.push(l);return i},g6=(e,t,n)=>{let r=ke(e)&&Bn(e,t)||e;return r.frameId&&n.selectedElementIds[r.id]&&n.selectedElementIds[r.frameId]?jr(r,t):n.selectedElementIds[r.id]&&n.selectedElementsAreBeingDragged?n.frameToHighlight:jr(r,t)},Jp=(e,t,n,r)=>{var d;let a=(r==null?void 0:r.targetFrame)??g6(e,t,n);if(!a)return!1;let i=ke(e)&&Bn(e,t)||e,l=u=>{r!=null&&r.checkedGroups&&i.groupIds.forEach(o=>{var f;(f=r.checkedGroups)==null||f.set(o,u)})};if(!n.selectedElementIds[i.id]||!n.selectedElementsAreBeingDragged||n.selectedElementIds[i.id]&&n.selectedElementIds[a.id])return!0;if(i.groupIds.length===0)return bs(i,a,t);for(let u of i.groupIds)if((d=r==null?void 0:r.checkedGroups)!=null&&d.has(u))return r.checkedGroups.get(u);let s=new Set(i.groupIds.filter(u=>r!=null&&r.checkedGroups?!r.checkedGroups.has(u):!0).flatMap(u=>zt(t,u)));if(n.editingGroupId&&n.selectedElementsAreBeingDragged){let u=new Set(tt(t,n));if(n.frameToHighlight!==null)return!0;u.forEach(o=>{s.delete(o)})}for(let u of s)if(He(u))return l(!1),!1;for(let u of s)if(bs(u,a,t))return l(!0),!0;return!1},Qy=(e,t,n,r,a)=>{if(!n.frameRendering||!n.frameRendering.clip)return!1;let i=s8(e,t,r)||o8(e,t,r);if(i){for(let l of e.groupIds)a==null||a.set(l,!0);return!0}if(!i&&e.groupIds.length>0&&!Vf([e],t,r)){let l=!1;if(n.selectedElementsAreBeingDragged)l=Jp(e,r,n,{targetFrame:t,checkedGroups:a});else{l=e.frameId===t.id;for(let s of e.groupIds)a==null||a.set(s,l)}for(let s of e.groupIds)a==null||a.set(s,l);return l}return!1},nC=e=>e.name===null?XE(e)?"Frame":"AI Frame":e.name,u8=(e,t)=>qk({elements:e,bounds:t,type:"overlap"}).filter(n=>!n.frameId||n.frameId===t.id),rC=e=>{let t=We(e);return e.length>1&&e.some(n=>n.frameId&&t.has(n.frameId))},f8=e=>{let t=new Set;return e.forEach(n=>{He(n)&&t.add(n.id)}),e.filter(n=>!(n.frameId&&t.has(n.frameId)))},h8=(e,t,n,r=!0)=>{let[a,i,l,s]=Ze(t,n),d=e.filter(u=>{let[o,f,m,U]=Ga(u,n),g=jr(u,n);if(g){let[v,y,w,E]=Ga(g,n);o=Math.max(v,o),f=Math.max(y,f),m=Math.min(w,m),U=Math.min(E,U)}return u.locked===!1&&u.type!=="selection"&&!Ft(u)&&a<=o&&i<=f&&l>=m&&s>=U});return d=r?f8(d):d,d=d.filter(u=>{let o=jr(u,n);return o?bs(u,o,n):!0}),d},aC=(e,t,n,r)=>{let a=new Set(t.map(i=>i.id));return e.filter(i=>{let l=e0(i,n.width,n.height,n,r);return!a.has(i.id)&&l})},En=(function(){let e=null,t=null,n=null,r=(a,i)=>(n!=null&&a===e&&i.selectedElementIds===t||(n=a.some(l=>i.selectedElementIds[l.id]),e=a,t=i.selectedElementIds),n);return r.clearCache=()=>{e=null,t=null,n=null},r})(),XY=(e,t,n)=>{let r=Array.from(new Set(tt(e,t).map(a=>n(a))));return r.length===1?r[0]:null},tt=(e,t,n)=>{let r=new Set,a=[];for(let i of e.values()){if(t.selectedElementIds[i.id]){a.push(i),r.add(i.id);continue}if(n!=null&&n.includeBoundTextElement&&Ft(i)&&t.selectedElementIds[i==null?void 0:i.containerId]){a.push(i),r.add(i.id);continue}}if(n!=null&&n.includeElementsInFrames){let i=[];return a.forEach(l=>{He(l)&&Mi(e,l.id).forEach(s=>!r.has(s.id)&&i.push(s)),i.push(l)}),i}return a},iC=(e,t)=>t.editingTextElement?[t.editingTextElement]:t.newElement?[t.newElement]:tt(e,t,{includeBoundTextElement:!0}),bt=(e,t)=>Yn(t.selectedElementIds,e)?t.selectedElementIds:e,Jy=e=>{let t=new Map,n=[];for(let r of e)r.isDeleted||(n.push(r),t.set(r.id,r));return{elementsMap:t,elements:n}},VY=Af(e=>{(et.DEV||et.MODE===Tr.TEST||window!=null&&window.DEBUG_FRACTIONAL_INDICES)&&H5(e,{shouldThrow:et.DEV||et.MODE===Tr.TEST,includeBoundTextValidation:!0})},1e3*60,{leading:!0,trailing:!1}),GY=e=>{let t=["includeBoundTextElement","includeElementsInFrames"],n="";for(let r of t)n+=`${r}:${e[r]?"1":"0"}`;return n},e9=e=>typeof e=="string",b6=class dp{constructor(){F(this,"callbacks",new Set),F(this,"nonDeletedElements",[]),F(this,"nonDeletedElementsMap",pa(new Map)),F(this,"elements",[]),F(this,"nonDeletedFramesLikes",[]),F(this,"frames",[]),F(this,"elementsMap",pa(new Map)),F(this,"selectedElementsCache",{selectedElementIds:null,elements:null,cache:new Map}),F(this,"sceneNonce"),F(this,"insertElement",t=>{let n=t.frameId?this.getElementIndex(t.frameId):this.elements.length;this.insertElementAtIndex(t,n)}),F(this,"insertElements",t=>{var r;if(!t.length)return;let n=(r=t[0])!=null&&r.frameId?this.getElementIndex(t[0].frameId):this.elements.length;this.insertElementsAtIndex(t,n)}),F(this,"getContainerElement",t=>t&&t.containerId&&this.getElement(t.containerId)||null),F(this,"getElementsFromId",t=>{let n=this.getNonDeletedElementsMap(),r=n.get(t);return r?[r]:zt(n,t)})}static mapElementToScene(t,n){e9(t)?this.sceneMapById.set(t,n):(this.sceneMapByElement.set(t,n),this.sceneMapById.set(t.id,n))}static getScene(t){return e9(t)?this.sceneMapById.get(t)||null:this.sceneMapByElement.get(t)||null}getSceneNonce(){return this.sceneNonce}getNonDeletedElementsMap(){return this.nonDeletedElementsMap}getElementsIncludingDeleted(){return this.elements}getElementsMapIncludingDeleted(){return this.elementsMap}getNonDeletedElements(){return this.nonDeletedElements}getFramesIncludingDeleted(){return this.frames}getSelectedElements(t){let n=GY(t),r=(t==null?void 0:t.elements)||this.nonDeletedElements;if(this.selectedElementsCache.elements===r&&this.selectedElementsCache.selectedElementIds===t.selectedElementIds){let i=this.selectedElementsCache.cache.get(n);if(i)return i}else(t==null?void 0:t.elements)==null&&this.selectedElementsCache.cache.clear();let a=tt(r,{selectedElementIds:t.selectedElementIds},t);return(t==null?void 0:t.elements)==null&&(this.selectedElementsCache.selectedElementIds=t.selectedElementIds,this.selectedElementsCache.elements=this.nonDeletedElements,this.selectedElementsCache.cache.set(n,a)),a}getNonDeletedFramesLikes(){return this.nonDeletedFramesLikes}getElement(t){return this.elementsMap.get(t)||null}getNonDeletedElement(t){let n=this.getElement(t);return n&&x6(n)?n:null}mapElements(t){let n=!1,r=this.elements.map(a=>{let i=t(a);return i!==a&&(n=!0),i});return n&&this.replaceAllElements(r),n}replaceAllElements(t){let n=t instanceof Array?t:Array.from(t.values()),r=[];VY(n),this.elements=ul(n),this.elementsMap.clear(),this.elements.forEach(i=>{He(i)&&r.push(i),this.elementsMap.set(i.id,i),dp.mapElementToScene(i,this)});let a=Jy(this.elements);this.nonDeletedElements=a.elements,this.nonDeletedElementsMap=a.elementsMap,this.frames=r,this.nonDeletedFramesLikes=Jy(this.frames).elements,this.triggerUpdate()}triggerUpdate(){this.sceneNonce=Si();for(let t of Array.from(this.callbacks))t()}onUpdate(t){if(this.callbacks.has(t))throw new Error;return this.callbacks.add(t),()=>{if(!this.callbacks.has(t))throw new Error;this.callbacks.delete(t)}}destroy(){this.elements=[],this.nonDeletedElements=[],this.nonDeletedFramesLikes=[],this.frames=[],this.elementsMap.clear(),this.selectedElementsCache.selectedElementIds=null,this.selectedElementsCache.elements=null,this.selectedElementsCache.cache.clear(),dp.sceneMapById.forEach((t,n)=>{t===this&&dp.sceneMapById.delete(n)}),this.callbacks.clear()}insertElementAtIndex(t,n){if(!Number.isFinite(n)||n<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let r=[...this.elements.slice(0,n),t,...this.elements.slice(n)];Ci(r,We([t])),this.replaceAllElements(r)}insertElementsAtIndex(t,n){if(!t.length)return;if(!Number.isFinite(n)||n<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let r=[...this.elements.slice(0,n),...t,...this.elements.slice(n)];Ci(r,We(t)),this.replaceAllElements(r)}getElementIndex(t){return this.elements.findIndex(n=>n.id===t)}};F(b6,"sceneMapByElement",new WeakMap),F(b6,"sceneMapById",new Map);var YY=b6,fl=YY,pe=(e,t,n=!0,r)=>{var o,f;let a=!1,{points:i,fixedSegments:l,fileId:s,startBinding:d,endBinding:u}=t;if(Me(e)&&(Object.keys(t).length===0||typeof i<"u"||typeof l<"u"||typeof d<"u"||typeof u<"u")){let m=pa(((o=fl.getScene(e))==null?void 0:o.getNonDeletedElementsMap())??new Map);t={...t,angle:0,...Q5({...e,x:t.x||e.x,y:t.y||e.y},m,{fixedSegments:l,points:i,startBinding:d,endBinding:u},{isDragging:r==null?void 0:r.isDragging})}}else typeof i<"u"&&(t={...Jc(i),...t});for(let m in t){let U=t[m];if(typeof U<"u"){if(e[m]===U&&(typeof U!="object"||U===null||m==="groupIds"||m==="scale"))continue;if(m==="scale"){let g=e[m],v=U;if(g[0]===v[0]&&g[1]===v[1])continue}else if(m==="points"){let g=e[m],v=U;if(g.length===v.length){let y=!1,w=g.length;for(;--w;){let E=g[w],S=v[w];if(E[0]!==S[0]||E[1]!==S[1]){y=!0;break}}if(!y)continue}}e[m]=U,a=!0}}return a&&((typeof t.height<"u"||typeof t.width<"u"||typeof s<"u"||typeof i<"u")&&Qt.delete(e),e.version++,e.versionNonce=Si(),e.updated=ud(),n&&((f=fl.getScene(e))==null||f.triggerUpdate())),e},Ke=(e,t,n=!1)=>{let r=!1;for(let a in t){let i=t[a];if(typeof i<"u"){if(e[a]===i&&(typeof i!="object"||i===null))continue;r=!0}}return!r&&!n?e:{...e,...t,updated:ud(),version:e.version+1,versionNonce:Si()}},Gf=(e,t)=>(e.version=(t??e.version)+1,e.versionNonce=Si(),e.updated=ud(),e),_o=e=>Ge(e)||ma(e)?e.points.length<2:e.width===0&&e.height===0,e0=(e,t,n,r,a)=>{let[i,l,s,d]=Ga(e,a),u=jt({clientX:r.offsetLeft,clientY:r.offsetTop},r),o=jt({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return u.x<=s&&u.y<=d&&o.x>=i&&o.y>=l},up=(e,t,n,r,a,i)=>{let[l,s,d,u]=xt(e,a),o=jt({clientX:r.offsetLeft+((i==null?void 0:i.left)||0),clientY:r.offsetTop+((i==null?void 0:i.top)||0)},r),f=jt({clientX:r.offsetLeft+t-((i==null?void 0:i.right)||0),clientY:r.offsetTop+n-((i==null?void 0:i.bottom)||0)},r);return l>=o.x&&s>=o.y&&d<=f.x&&u<=f.y},t9=(e,t,n)=>{let r=Math.abs(t),a=Math.abs(n);if(e==="line"||e==="arrow"||e==="freedraw"){let i=Math.round(Math.atan(a/r)/ms)*ms;i===0?n=0:i===Math.PI/2?t=0:n=r*Math.tan(i)*Math.sign(n)||n}else e!=="selection"&&(n=r*Math.sign(n));return{width:t,height:n}},v6=(e,t,n,r)=>{let a=n-e,i=r-t,l=Math.round(Math.atan(i/a)/ms)*ms;if(l===0)i=0;else if(l===Math.PI/2)a=0;else{let s=Math.tan(l),d=-1,u=t-s*e,o=-1/s,f=-1,m=r-o*n,U=(d*m-f*u)/(s*f-o*d),g=(u*o-m*s)/(s*f-o*d);a=U-e,i=g-t}return{width:a,height:i}},lC=e=>{let t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){let n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){let n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t},n9={mouse:8,pen:16,touch:28},ZY=16,sC={e:!0,s:!0,n:!0,w:!0},r9={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},Z2={e:!0,s:!0,n:!0,w:!0},Xi=(e,t,n,r,a,i,l)=>{let[s,d]=ce(A(e+n/2,t+r/2),A(a,i),l);return[s-n/2,d-r/2,n,r]},p8=e=>!(e.viewport.isMobile||e.isTouchScreen&&(MN||SE)),Wu=e=>p8(e)?sC:{},m8=([e,t,n,r,a,i],l,s,d,u={},o=4,f=yo)=>{let m=n9[d],U=m/s.value,g=m/s.value,v=m/s.value,y=m/s.value,w=n-e,E=r-t,S=o/s.value,k=(m-f*2)/(2*s.value),I={nw:u.nw?void 0:Xi(e-S-v+k,t-S-y+k,U,g,a,i,l),ne:u.ne?void 0:Xi(n+S-k,t-S-y+k,U,g,a,i,l),sw:u.sw?void 0:Xi(e-S-v+k,r+S-k,U,g,a,i,l),se:u.se?void 0:Xi(n+S-k,r+S-k,U,g,a,i,l),rotation:u.rotation?void 0:Xi(e+w/2-U/2,t-S-y+k-ZY/s.value,U,g,a,i,l)},T=5*n9.mouse/s.value;return Math.abs(w)>T&&(u.n||(I.n=Xi(e+w/2-U/2,t-S-y+k,U,g,a,i,l)),u.s||(I.s=Xi(e+w/2-U/2,r+S-k,U,g,a,i,l))),Math.abs(E)>T&&(u.w||(I.w=Xi(e-S-v+k,t+E/2-g/2,U,g,a,i,l)),u.e||(I.e=Xi(n+S-k,t+E/2-g/2,U,g,a,i,l))),I},oC=(e,t,n,r="mouse",a=sC)=>{if(e.locked||Me(e))return{};if(e.type==="freedraw"||Ge(e)){if(e.points.length===2){let[,l]=e.points;l[0]===0||l[1]===0?a=Z2:l[0]>0&&l[1]<0?a=r9:l[0]>0&&l[1]>0?a=Z2:l[0]<0&&l[1]>0?a=r9:l[0]<0&&l[1]<0&&(a=Z2)}}else He(e)&&(a={...a,rotation:!0});let i=Ge(e)?yo+8:vt(e)?0:yo;return m8(Ze(e,n,!0),e.angle,t,r,a,i,vt(e)?0:void 0)},cC=(e,t)=>{if(t.editingLinearElement)return!1;if(e.length>1)return!0;let n=e[0];return Me(n)?!1:Ge(n)?n.points.length>2:!0},y6=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],KY=(e,t,n,r,a,i,l,s)=>{if(!n.selectedElementIds[e.id])return!1;let{rotation:d,...u}=oC(e,i,t,l,Wu(s));if(d&&y6(d,r,a))return"rotation";let o=Object.keys(u).filter(f=>{let m=u[f];return m?y6(m,r,a):!1});if(o.length>0)return o[0];if(p8(s)){let[f,m,U,g,v,y]=Ze(e,t);if(!(Ge(e)&&e.points.length<=2)){let w=vt(e)?0:Ip/i.value,E=Ip/i.value,S=dC(A(f-w,m-w),A(U+w,g+w),A(v,y),e.angle);for(let[k,I]of Object.entries(S))if(xo(A(r,a),I,E))return k}}return!1},a9=(e,t,n,r,a,i,l,s)=>e.reduce((d,u)=>{if(d)return d;let o=KY(u,l,t,n,r,a,i,s);return o?{element:u,transformHandleType:o}:null},null),i9=([e,t,n,r],a,i,l,s,d)=>{let u=m8([e,t,n,r,(e+n)/2,(t+r)/2],0,l,s,Wu(d)),o=Object.keys(u).find(f=>{let m=u[f];return m&&y6(m,a,i)});if(o)return o;if(p8(d)){let f=(e+n)/2,m=(t+r)/2,U=Ip/l.value,g=dC(A(e-U,t-U),A(n+U,r+U),A(f,m),0);for(let[v,y]of Object.entries(g))if(xo(A(a,i),y,U))return v}return!1},K2=["ns","nesw","ew","nwse"],qY=(e,t)=>{let n=K2.indexOf(e);if(n>=0){let r=Math.round(t/(Math.PI/4));e=K2[(n+r)%K2.length]}return e},l9=e=>{let{element:t,transformHandleType:n}=e,r=t&&Math.sign(t.height)*Math.sign(t.width)===-1,a=null;switch(n){case"n":case"s":a="ns";break;case"w":case"e":a="ew";break;case"nw":case"se":r?a="nesw":a="nwse";break;case"ne":case"sw":r?a="nwse":a="nesw";break;case"rotation":return"grab"}return a&&t&&(a=qY(a,t.angle)),a?`${a}-resize`:""},dC=([e,t],[n,r],a,i)=>{let l=ce(A(e,t),a,i),s=ce(A(n,t),a,i),d=ce(A(e,r),a,i),u=ce(A(n,r),a,i);return{n:[l,s],e:[s,u],s:[u,d],w:[d,l]}},QY=(e,t,n,r,a,i,l,s,d,u,o,f)=>{if(n.length===1){let[m]=n;if(t==="rotation")Me(m)||(JY(m,r,a,d,u,i),Ar(m,r));else{if(ke(m)&&t)return eZ(e,m,r,t,l,d,u),Ar(m,r),!0;if(t){let U=n[0].id,g=r.get(U),v=e.get(U);if(g&&v){let{nextWidth:y,nextHeight:w}=lZ(g,v,r,e,t,d,u,{shouldMaintainAspectRatio:s,shouldResizeFromCenter:l});yf(y,w,g,v,r,e,t,{shouldMaintainAspectRatio:s,shouldResizeFromCenter:l})}}}return!0}else if(n.length>1){if(t==="rotation")return tZ(e,n,r,a,d,u,i,o,f),!0;if(t){let{nextWidth:m,nextHeight:U,flipByX:g,flipByY:v,originalBoundingBox:y}=sZ(n,e,r,t,d,u,{shouldMaintainAspectRatio:s,shouldResizeFromCenter:l});return uC(n,r,t,a,e,{shouldResizeFromCenter:l,shouldMaintainAspectRatio:s,flipByX:g,flipByY:v,nextWidth:m,nextHeight:U,originalBoundingBox:y}),!0}}return!1},JY=(e,t,n,r,a,i)=>{let[l,s,d,u]=Ze(e,t),o=(l+d)/2,f=(s+u)/2,m;He(e)?m=0:(m=5*Math.PI/2+Math.atan2(a-f,r-o),i&&(m=m+ms/2,m=m-m%ms),m=Rp(m));let U=cl(e);if(pe(e,{angle:m}),U){let g=n.getElement(U);g&&!nt(e)&&pe(g,{angle:m})}},U8=(e,t,n,r)=>Ge(e)||ma(e)?{points:Hp(0,t,Hp(1,n,e.points,r),r)}:{},g8=(e,t,n)=>{let r=e.width;if(Ft(e)){let i=Bn(e,t);i&&(r=dl(i,e))}let a=e.fontSize*(n/r);return a<u5?null:{size:a}},eZ=(e,t,n,r,a,i,l)=>{let[s,d,u,o,f,m]=Ze(t,n),[U,g]=ce(A(i,l),A(f,m),-t.angle),v=0,y=0;r!=="e"&&r!=="w"&&(r.includes("e")&&(v=(U-s)/(u-s)),r.includes("w")&&(v=(u-U)/(u-s)),r.includes("n")&&(y=(o-g)/(o-d)),r.includes("s")&&(y=(g-d)/(o-d)));let w=Math.max(v,y);if(w>0){let E=t.width*w,S=t.height*w,k=g8(t,n,E);if(k===null)return;let I=[s,d],T=[u,o],M=[f,m],j=A(s,d);if(["n","w","nw"].includes(r)&&(j=A(T[0]-Math.abs(E),T[1]-Math.abs(S))),r==="ne"){let K=[I[0],T[1]];j=A(K[0],K[1]-Math.abs(S))}if(r==="sw"){let K=[T[0],I[1]];j=A(K[0]-Math.abs(E),K[1])}["s","n"].includes(r)&&(j[0]=M[0]-E/2),["e","w"].includes(r)&&(j[1]=M[1]-S/2),a&&(j[0]=M[0]-Math.abs(E)/2,j[1]=M[1]-Math.abs(S)/2);let D=t.angle,P=ce(j,A(f,m),D),N=A(j[0]+Math.abs(E)/2,j[1]+Math.abs(S)/2),$=ce(N,A(f,m),D);j=ce(P,$,-D);let[z,Z]=j;pe(t,{fontSize:k.size,width:E,height:S,x:z,y:Z})}if(r==="e"||r==="w"){let E=e.get(t.id),[S,k,I,T]=fs(E,E.width,E.height,!0),M=A(S,k),j=A(I,T),D=Df(M,j),P=ce(A(i,l),D,-E.angle),[N,,$]=fs(t,t.width,t.height,!0),z=$-N,Z=j[0]-M[0],K=y5(_t({fontSize:t.fontSize,fontFamily:t.fontFamily}),t.lineHeight),Q=Z/z;r.includes("e")&&(Q=(P[0]-M[0])/z),r.includes("w")&&(Q=(j[0]-P[0])/z);let W=t.width*Q<K?K:t.width*Q,q=Po(t.originalText,_t(t),Math.abs(W)),V=sr(q,_t(t),t.lineHeight),ee=V.height,[X,se,ge,_e]=fs(E,W,ee,!0),Y=ge-X,H=_e-se,re=[...M];["n","w","nw"].includes(r)&&(re=[j[0]-Math.abs(Y),M[1]]);let te=E.angle,de=ce(re,D,te),me=A(re[0]+Math.abs(Y)/2,re[1]+Math.abs(H)/2),fe=ce(me,D,te);re=ce(de,fe,-te);let Ue={width:Math.abs(W),height:Math.abs(V.height),x:re[0],y:re[1],text:q,autoResize:!1};pe(t,Ue)}},tZ=(e,t,n,r,a,i,l,s,d)=>{var o;let u=5*Math.PI/2+Math.atan2(i-d,a-s);l&&(u+=ms/2,u-=u%ms);for(let f of t)if(!He(f)){let[m,U,g,v]=Ze(f,n),y=(m+g)/2,w=(U+v)/2,E=((o=e.get(f.id))==null?void 0:o.angle)??f.angle,[S,k]=ce(A(y,w),A(s,d),u+E-f.angle);Me(f)?pe(f,{points:BV(f,n)}):pe(f,{x:f.x+(S-y),y:f.y+(k-w),angle:Rp(u+E)},!1),Ar(f,n,{simultaneouslyUpdated:t});let I=Je(f,n);I&&!nt(f)&&pe(I,{x:I.x+(S-y),y:I.y+(k-w),angle:Rp(u+E)},!1)}r.triggerUpdate()},nZ=(e,t,n,r,a)=>{let[i,l,s,d]=t.length===1?Ze(t[0],n):xt(t),u=(i+s)/2,o=(l+d)/2,f=t.length===1?t[0].angle:0;switch([r,a]=ce(A(r,a),A(u,o),-f),e){case"n":return ce(A(r-(i+s)/2,a-l),A(0,0),f);case"s":return ce(A(r-(i+s)/2,a-d),A(0,0),f);case"w":return ce(A(r-i,a-(l+d)/2),A(0,0),f);case"e":return ce(A(r-s,a-(l+d)/2),A(0,0),f);case"nw":return ce(A(r-i,a-l),A(0,0),f);case"ne":return ce(A(r-s,a-l),A(0,0),f);case"sw":return ce(A(r-i,a-d),A(0,0),f);case"se":return ce(A(r-s,a-d),A(0,0),f);default:return[0,0]}},rZ=(e,t)=>{let[,[n,r]]=t.points;return e==="nw"&&(n<0||r<0)||e==="ne"&&n>=0||e==="sw"&&n<=0||e==="se"&&(n>0||r>0)?"end":"origin"},aZ=(e,t,n)=>{if(n)return"center";if(t)switch(e){case"n":return"south-side";case"e":return"west-side";case"s":return"north-side";case"w":return"east-side";case"ne":return"bottom-left";case"nw":return"bottom-right";case"se":return"top-left";case"sw":return"top-right"}return["e","se","s"].includes(e)?"top-left":["n","nw","w"].includes(e)?"bottom-right":e==="ne"?"bottom-left":"top-right"},iZ=(e,t,n,r,a,i,l,s,d)=>{let u=aZ(l,s,d),[o,f]=e;switch(u){case"top-left":return{x:o+(t-r)/2+(r-t)/2*Math.cos(i)+(n-a)/2*Math.sin(i),y:f+(n-a)/2+(r-t)/2*Math.sin(i)+(a-n)/2*Math.cos(i)};case"top-right":return{x:o+(t-r)/2*(Math.cos(i)+1)+(n-a)/2*Math.sin(i),y:f+(n-a)/2+(t-r)/2*Math.sin(i)+(a-n)/2*Math.cos(i)};case"bottom-left":return{x:o+(t-r)/2*(1-Math.cos(i))+(a-n)/2*Math.sin(i),y:f+(n-a)/2*(Math.cos(i)+1)+(r-t)/2*Math.sin(i)};case"bottom-right":return{x:o+(t-r)/2*(Math.cos(i)+1)+(a-n)/2*Math.sin(i),y:f+(n-a)/2*(Math.cos(i)+1)+(t-r)/2*Math.sin(i)};case"center":return{x:o-(r-t)/2,y:f-(a-n)/2};case"east-side":return{x:o+(t-r)/2*(Math.cos(i)+1),y:f+(t-r)/2*Math.sin(i)+(n-a)/2};case"west-side":return{x:o+(t-r)/2*(1-Math.cos(i)),y:f+(r-t)/2*Math.sin(i)+(n-a)/2};case"north-side":return{x:o+(t-r)/2+(n-a)/2*Math.sin(i),y:f+(a-n)/2*(Math.cos(i)-1)};case"south-side":return{x:o+(t-r)/2+(a-n)/2*Math.sin(i),y:f+(n-a)/2*(Math.cos(i)+1)}}},yf=(e,t,n,r,a,i,l,{shouldInformMutation:s=!0,shouldMaintainAspectRatio:d=!1,shouldResizeFromCenter:u=!1}={})=>{let o={},f=Je(n,a);if(f){let v=i.get(f.id);if(v&&(o={fontSize:v.fontSize}),d){let y={...n,width:e},w=g8(f,a,dl(y,f));if(w===null)return;o={fontSize:w.size}}else{let y=KE(_t(f),f.lineHeight),w=qE(f.fontSize,f.lineHeight);e=Math.max(e,y),t=Math.max(t,w)}}let m=U8(r,e,t,!0),U=A(r.x,r.y);if(Ge(r)){let[v,y]=Ga(r,i);U=A(v,y)}let g=iZ(U,r.width,r.height,e,t,r.angle,l,d,u);if(Ge(r)&&m.points){let v=r.x-U[0],y=r.y-U[1];g.x+=v,g.y+=y;let w=m.points[0][0],E=m.points[0][1];g.x+=w,g.y+=E,m.points=m.points.map(S=>A(S[0]-w,S[1]-E))}if(e<0&&(g.x=g.x+e),t<0&&(g.y=g.y+t),"scale"in n&&"scale"in r&&pe(n,{scale:[(Math.sign(e)||r.scale[0])*r.scale[0],(Math.sign(t)||r.scale[1])*r.scale[1]]}),nt(n)&&f&&d){let v=e/n.width*f.fontSize;if(v<u5)return;o.fontSize=v}if(e!==0&&t!==0&&Number.isFinite(g.x)&&Number.isFinite(g.y)){let v={...g,width:Math.abs(e),height:Math.abs(t),...m};pe(n,v,s),Ar(n,a,{newSize:{width:e,height:t}}),f&&o!=null&&pe(f,{fontSize:o.fontSize}),zf(n,a,l,d)}},lZ=(e,t,n,r,a,i,l,{shouldMaintainAspectRatio:s=!1,shouldResizeFromCenter:d=!1}={})=>{let[u,o,f,m]=fs(t,t.width,t.height,!0),U=A(u,o),g=A(f,m),v=Df(U,g),y=ce(A(i,l),v,-t.angle),[w,E,S,k]=fs(e,e.width,e.height,!0),I=S-w,T=k-E,M=g[0]-U[0],j=g[1]-U[1],D=M/I,P=j/T;a.includes("e")&&(D=(y[0]-U[0])/I),a.includes("s")&&(P=(y[1]-U[1])/T),a.includes("w")&&(D=(g[0]-y[0])/I),a.includes("n")&&(P=(g[1]-y[1])/T);let N=e.width*D,$=e.height*P;if(d&&(N=2*N-t.width,$=2*$-t.height),s){let z=Math.abs(N)/t.width,Z=Math.abs($)/t.height;if(a.length===1&&($*=z,N*=Z),a.length===2){let K=Math.max(z,Z);N=t.width*K*Math.sign(N),$=t.height*K*Math.sign($)}}return{nextWidth:N,nextHeight:$}},sZ=(e,t,n,r,a,i,{shouldMaintainAspectRatio:l=!1,shouldResizeFromCenter:s=!1}={})=>{let d=e.map(z=>t.get(z.id)),u=d.reduce((z,Z)=>{if(!Ge(Z))return z;let K=cl(Z);if(!K)return z;let Q=t.get(K)??null;return Ft(Q)?[...z,{...Q,...Ce.getBoundTextElementPosition(Z,Q,n)}]:z},[]),o=Ha(d.map(z=>z).concat(u)),{minX:f,minY:m,maxX:U,maxY:g,midX:v,midY:y}=o,w=U-f,E=g-m,S={ne:[f,g],se:[f,m],sw:[U,m],nw:[U,g],e:[f,m+E/2],w:[U,m+E/2],n:[f+w/2,g],s:[f+w/2,m]},[k,I]=s?[v,y]:S[r],T=s?2:1,M=Math.max(Math.abs(a-k)/w||0,Math.abs(i-I)/E||0)*T,j=r.includes("e")||r.includes("w")?Math.abs(a-k)*T:w,D=r.includes("n")||r.includes("s")?Math.abs(i-I)*T:E;l&&(j=w*M*Math.sign(a-k),D=E*M*Math.sign(i-I));let P={ne:[a<k,i>I],se:[a<k,i<I],sw:[a>k,i<I],nw:[a>k,i>I],e:[a<k,!1],w:[a>k,!1],n:[!1,i>I],s:[!1,i<I]},[N,$]=P[r].map(z=>z);return{originalBoundingBox:o,nextWidth:j,nextHeight:D,flipByX:N,flipByY:$}},uC=(e,t,n,r,a,{shouldMaintainAspectRatio:i=!1,shouldResizeFromCenter:l=!1,flipByX:s=!1,flipByY:d=!1,nextHeight:u,nextWidth:o,originalBoundingBox:f}={})=>{if(o===void 0&&u===void 0&&s===void 0&&d===void 0||u===0||o===0)return;a||(a=t);let m=e.reduce((T,M)=>{let j=a.get(M.id);return j&&T.push({orig:j,latest:M}),T},[]),U;if(f)U=f;else{let T=m.reduce((M,{orig:j})=>{if(!Ge(j))return M;let D=cl(j);if(!D)return M;let P=a.get(D)??null;return Ft(P)?[...M,{...P,...Ce.getBoundTextElementPosition(j,P,t)}]:M},[]);U=Ha(m.map(({orig:M})=>M).concat(T))}let{minX:g,minY:v,maxX:y,maxY:w,midX:E,midY:S}=U,k=y-g,I=w-v;if(o===void 0&&u===void 0&&(o=k,u=I),i&&(o===void 0?o=u*(k/I):u===void 0?u=o*(I/k):Math.abs(o/u-k/I)>.001&&(o=u*(k/I))),o&&u){let T=n.includes("e")||n.includes("w")?Math.abs(o)/k:1,M=n.includes("n")||n.includes("s")?Math.abs(u)/I:1,j;n.length===1?j=n.includes("e")||n.includes("w")?T:M:j=Math.max(Math.abs(o)/k||0,Math.abs(u)/I||0);let D={ne:[g,w],se:[g,v],sw:[y,v],nw:[y,w],e:[g,v+I/2],w:[y,v+I/2],n:[g+k/2,w],s:[g+k/2,v]},[P,N]=l?[E,S]:D[n],$=i||m.some(W=>W.latest.angle!==0||ke(W.latest)||ed(W.latest));$&&(T=j,M=j);let[z,Z]=[s?-1:1,d?-1:1],K=[];for(let{orig:W,latest:q}of m){if(ke(W)&&Ft(W))continue;let V=W.width*T,ee=W.height*M,X=Rp(W.angle*z*Z),se=Ge(W)||ma(W),ge=W.x-P,_e=W.y-N,Y=s&&!se?V:0,H=d&&!se?ee:0,re=P+z*(ge*T+Y),te=N+Z*(_e*M+H),de=U8(W,V*z,ee*Z,!1),me={x:re,y:te,width:V,height:ee,angle:X,...de};if(Me(W)&&(W.startBinding&&(me.startBinding={...W.startBinding,fixedPoint:[s?-W.startBinding.fixedPoint[0]+1:W.startBinding.fixedPoint[0],d?-W.startBinding.fixedPoint[1]+1:W.startBinding.fixedPoint[1]]}),W.endBinding&&(me.endBinding={...W.endBinding,fixedPoint:[s?-W.endBinding.fixedPoint[0]+1:W.endBinding.fixedPoint[0],d?-W.endBinding.fixedPoint[1]+1:W.endBinding.fixedPoint[1]]}),W.fixedSegments&&de.points&&(me.fixedSegments=W.fixedSegments.map(Ue=>({...Ue,start:de.points[Ue.index-1],end:de.points[Ue.index]})))),vt(W)&&(me.scale=[W.scale[0]*z,W.scale[1]*Z]),ke(W)){let Ue=g8(W,t,V);if(!Ue)return;me.fontSize=Ue.size}let fe=a.get(cl(W)??"");if(fe)if($){let Ue=fe.fontSize*j;if(Ue<u5)return;me.boundTextFontSize=Ue}else me.boundTextFontSize=fe.fontSize;K.push({element:q,update:me})}let Q=K.map(({element:W})=>W);for(let{element:W,update:{boundTextFontSize:q,...V}}of K){let{width:ee,height:X,angle:se}=V;pe(W,V,!1,{isDragging:!0}),Ar(W,t,{simultaneouslyUpdated:Q,newSize:{width:ee,height:X}});let ge=Je(W,t);ge&&q&&(pe(ge,{fontSize:q,angle:Ge(W)?void 0:se},!1),zf(W,t,n,!0))}r.triggerUpdate()}},oZ=(e,t,n,r,a,i)=>{if(t.length===1&&Me(t[0])&&(t[0].startBinding||t[0].endBinding))return;let l=t.filter(f=>{if(Me(f)&&f.startBinding&&f.endBinding){let m=t.find(g=>{var v;return g.id===((v=f.startBinding)==null?void 0:v.elementId)}),U=t.find(g=>{var v;return g.id===((v=f.endBinding)==null?void 0:v.elementId)});return m&&U}return!0}),s=new Set(l),d=l.filter(f=>He(f)).map(f=>f.id);if(d.length>0)for(let f of r.getNonDeletedElements())f.frameId!==null&&d.includes(f.frameId)&&s.add(f);let u=xt(Array.from(s).map(f=>e.originalElements.get(f.id)??f)),o=cZ(u,n,a,i);s.forEach(f=>{if(s9(e,f,o),!nt(f)){let m=Je(f,r.getNonDeletedElementsMap());m&&s9(e,m,o),Ar(f,r.getElementsMapIncludingDeleted(),{simultaneouslyUpdated:Array.from(s)})}})},cZ=(e,t,n,r)=>{let[a,i]=e,l=a+t.x+n.x,s=i+t.y+n.y;if(n.x===0||n.y===0){let[d,u]=xn(a+t.x,i+t.y,r);n.x===0&&(l=d),n.y===0&&(s=u)}return{x:l-a,y:s-i}},s9=(e,t,n)=>{let r=e.originalElements.get(t.id)??t,a=r.x+n.x,i=r.y+n.y;pe(t,{x:a,y:i})},dZ=(e,t,n)=>{let[r,a]=xt(e);return[t-r,n-a]},o9=({newElement:e,elementType:t,originX:n,originY:r,x:a,y:i,width:l,height:s,shouldMaintainAspectRatio:d,shouldResizeFromCenter:u,zoom:o,widthAspectRatio:f=null,originOffset:m=null,informMutation:U=!0})=>{d&&e.type!=="selection"&&(f?s=l/f:(Math.abs(i-r)>Math.abs(a-n)?{width:l,height:s}=t9(t,s,a<n?-l:l):{width:l,height:s}=t9(t,l,i<r?-s:s),s<0&&(s=-s)));let g=a<n?n-l:n,v=i<r?r-s:r;u&&(l+=l,s+=s,g=n-l/2,v=r-s/2);let y=null;if(ke(e)){s=e.height;let w=y5(_t({fontSize:e.fontSize,fontFamily:e.fontFamily}),e.lineHeight);l=Math.max(l,w),Math.abs(a-n)>RN/o&&(y={autoResize:!1}),v=r,u&&(g=n-l/2)}if(l!==0&&s!==0){let w=null;vt(e)&&(w={initialWidth:l,initialHeight:s}),pe(e,{x:g+((m==null?void 0:m.x)??0),y:v+((m==null?void 0:m.y)??0),width:l,height:s,...y,...w},U)}},b8=(e,t)=>{var n;return!!(!e.viewModeEnabled&&((n=e.openDialog)==null?void 0:n.name)!=="elementLinkSelector"&&(e.activeTool.type!=="custom"&&(e.editingTextElement||e.activeTool.type!=="selection"&&e.activeTool.type!=="eraser"&&e.activeTool.type!=="hand"&&e.activeTool.type!=="laser")||tt(t,e).length))},fC=e=>{let t=5381;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)+t+r}return t>>>0},uZ=e=>e.filter(t=>!t.isDeleted&&!_o(t)),Rt=e=>e.filter(t=>!t.isDeleted),x6=e=>!e.isDeleted,fZ=e=>Rt(e).map(t=>v5(t.type)?{...t,lastCommittedPoint:null}:t),hC=e=>fZ(e),pC=async e=>{let t;if(e.type===De.png)try{return await(await Re(async()=>{const{decodePngMetadata:n}=await Promise.resolve().then(()=>KT);return{decodePngMetadata:n}},void 0)).decodePngMetadata(e)}catch(n){throw n.message==="INVALID"?new ao("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new ao("Error: cannot restore image")}else if("text"in Blob?t=await e.text():t=await new Promise(n=>{let r=new FileReader;r.readAsText(e,"utf8"),r.onloadend=()=>{r.readyState===FileReader.DONE&&n(r.result)}}),e.type===De.svg)try{return KG({svg:t})}catch(n){throw n.message==="INVALID"?new ao("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new ao("Error: cannot restore image")}return t},mC=e=>{var t;return e&&((t=e.name.match(/\.(json|excalidraw|png|svg)$/))==null?void 0:t[1])||null},hZ=e=>e==="png"||e==="svg",v8=e=>{let t=mC(e);return t==="png"||t==="svg"},UC=e=>!!e&&Object.values(Xc).includes(e),po=e=>{let{type:t}=e||{};return UC(t)},y8=async(e,t,n,r)=>{let a=await pC(e),i;try{try{i=JSON.parse(a)}catch(l){throw po(e)?new ao("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):l}if(BG(i))return{type:De.excalidraw,data:Hf({elements:hC(i.elements||[]),appState:{theme:t==null?void 0:t.theme,fileHandle:r||e.handle||null,...jE(i.appState||{}),...t?mf(i.elements||[],t):{}},files:i.files},t,n,{repairBindings:!0,refreshDimensions:!1})};if(Mk(i))return{type:De.excalidrawlib,data:i};throw new Error("Error: invalid file")}catch(l){throw l instanceof ao?l:new Error("Error: invalid file")}},x8=async(e,t,n,r)=>{let a=await y8(e,t,n,r);if(a.type!==De.excalidraw)throw new Error("Error: invalid file");return a.data},gC=(e,t="unpublished")=>{let n=JSON.parse(e);if(!Mk(n))throw new Error("Invalid library");let r=n.libraryItems||n.library;return H0(r,t)},bC=async(e,t="unpublished")=>gC(await pC(e),t),xf=async e=>new Promise(async(t,n)=>{try{Pf(e)&&(e=await e),e.toBlob(r=>{if(!r)return n(new Fz("Error: Canvas too big","CANVAS_POSSIBLY_TOO_BIG"));t(r)})}catch(r){n(r)}}),pZ=async e=>{try{let t=await window.crypto.subtle.digest("SHA-1",await lo(e));return CO(new Uint8Array(t))}catch(t){return console.error(t),o5(40)}},w6=async e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let a=r.result;t(a)},r.onerror=a=>n(a),r.readAsDataURL(e)}),mZ=(e,t)=>`data:${t};base64,${xC(t0(e),!0)}`,UZ=(e,t="")=>{let n=e.indexOf(","),r=atob(e.slice(n+1)),a=e.slice(0,n).split(":")[1].split(";")[0],i=new ArrayBuffer(r.length),l=new Uint8Array(i);for(let s=0;s<r.length;s++)l[s]=r.charCodeAt(s);return new File([i],t,{type:a})},gZ=e=>wC(e.slice(e.indexOf(",")+1)),E6=async(e,t)=>{if(e.type===De.svg)return e;let[n,r]=await Promise.all([Re(()=>import("./pica-CtkejCRD.js").then(i=>i.p),__vite__mapDeps([2,3])).then(i=>i.default),Re(()=>import("./image-blob-reduce.esm-D6s-rqMO.js"),[]).then(i=>i.default)]),a=r({pica:n({features:["js","wasm"]})});if(t.outputType){let{outputType:i}=t;a._create_blob=function(l){return this.pica.toBlob(l.out_canvas,i,.8).then(s=>(l.out_blob=s,l))}}if(!po(e))throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"});return new File([await a.toBlob(e,{max:t.maxWidthOrHeight,alpha:!0})],e.name,{type:t.outputType||e.type})},c9=(e,t="")=>new File([new TextEncoder().encode(e)],t,{type:De.svg}),bZ=async(e,t="")=>{let n;try{n=await fetch(e)}catch{throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"})}if(!n.ok)throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"});let r=await n.blob();if(r.type&&po(r)){let a=t||r.name||"";return new File([r],a,{type:r.type})}throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"})},vZ=async e=>{let t=e.dataTransfer.files.item(0),n=await yZ(e);return{file:t?await w8(t):null,fileHandle:n}},yZ=async e=>{if(Do)try{return await e.dataTransfer.items[0].getAsFileSystemHandle()||null}catch(t){return console.warn(t.name,t.message),null}return null},d9=e=>{let t=null,n=`${[...new Uint8Array(e).slice(0,8)].join(" ")} `,r={png:"137 80 78 71 13 10 26 10 ",jpg:"255 216 255 ",gif:"71 73 70 56 57 97 "};return n===r.png?t=De.png:n.startsWith(r.jpg)?t=De.jpg:n.startsWith(r.gif)&&(t=De.gif),t},_u=(e,t,n)=>new File([e],n||"",{type:t}),w8=async e=>{var t,n;if(e.type){if(po(e)){let r=await lo(e),a=d9(r);a&&a!==e.type&&(e=_u(r,a,e.name))}}else if((t=e==null?void 0:e.name)!=null&&t.endsWith(".excalidrawlib"))e=_u(await lo(e),De.excalidrawlib,e.name);else if((n=e==null?void 0:e.name)!=null&&n.endsWith(".excalidraw"))e=_u(await lo(e),De.excalidraw,e.name);else{let r=await lo(e),a=d9(r);a&&(e=_u(r,a,e.name))}return e},lo=e=>"arrayBuffer"in e?e.arrayBuffer():new Promise((t,n)=>{let r=new FileReader;r.onload=a=>{var i;if(!((i=a.target)!=null&&i.result))return n(new Error("Couldn't convert blob to ArrayBuffer"));t(a.target.result)},r.readAsArrayBuffer(e)}),t0=e=>{let t=typeof e=="string"?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e),n="";for(let r of t)n+=String.fromCharCode(r);return n},vC=e=>{let t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let r=0,a=e.length;r<a;r++)n[r]=e.charCodeAt(r);return t},yC=e=>new TextDecoder("utf-8").decode(vC(e)),xC=(e,t=!1)=>t?window.btoa(e):window.btoa(t0(e)),wC=(e,t=!1)=>t?window.atob(e):yC(window.atob(e)),EC=({text:e,compress:t})=>{let n;if(t!==!1)try{n=t0(VD(e))}catch(r){console.error("encode: cannot deflate",r)}return{version:"1",encoding:"bstring",compressed:!!n,encoded:n||t0(e)}},SC=e=>{let t;switch(e.encoding){case"bstring":t=e.compressed?e.encoded:yC(e.encoded);break;default:throw new Error(`decode: unknown encoding "${e.encoding}"`)}return e.compressed?GD(new Uint8Array(vC(t)),{to:"string"}):t},kC=async e=>{let t=Sw(new Uint8Array(await lo(e))).find(n=>n.name==="tEXt");return t?kw.decode(t.data):null},CC=async({blob:e,metadata:t})=>{let n=Sw(new Uint8Array(await lo(e))),r=kw.encode(De.excalidraw,JSON.stringify(EC({text:t,compress:!0})));return n.splice(-1,0,r),new Blob([pj(n)],{type:De.png})},xZ=async e=>{let t=await kC(e);if((t==null?void 0:t.keyword)===De.excalidraw)try{let n=JSON.parse(t.text);if(!("encoded"in n)){if("type"in n&&n.type===ua.excalidraw)return t.text;throw new Error("FAILED")}return SC(n)}catch(n){throw console.error(n),new Error("FAILED")}throw new Error("INVALID")},MC={paste:"Paste",pasteAsPlaintext:"Paste as plaintext",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",copyText:"Copy to clipboard as text",copySource:"Copy source to clipboard",convertToCode:"Convert to code",bringForward:"Bring forward",sendToBack:"Send to back",bringToFront:"Bring to front",sendBackward:"Send backward",delete:"Delete",copyStyles:"Copy styles",pasteStyles:"Paste styles",stroke:"Stroke",changeStroke:"Change stroke color",background:"Background",changeBackground:"Change background color",fill:"Fill",strokeWidth:"Stroke width",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_circle:"Circle",arrowhead_circle_outline:"Circle (outline)",arrowhead_triangle:"Triangle",arrowhead_triangle_outline:"Triangle (outline)",arrowhead_diamond:"Diamond",arrowhead_diamond_outline:"Diamond (outline)",arrowhead_crowfoot_many:"Crow's foot (many)",arrowhead_crowfoot_one:"Crow's foot (one)",arrowhead_crowfoot_one_or_many:"Crow's foot (one or many)",more_options:"More options",arrowtypes:"Arrow type",arrowtype_sharp:"Sharp arrow",arrowtype_round:"Curved arrow",arrowtype_elbowed:"Elbow arrow",fontSize:"Font size",fontFamily:"Font family",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",zigzag:"Zigzag",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",canvasColors:"Used on canvas",canvasBackground:"Canvas background",drawingCanvas:"Drawing canvas",clearCanvas:"Clear 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",toggleGrid:"Toggle grid",addToLibrary:"Add to library",removeFromLibrary:"Remove from library",libraryLoadingMessage:"Loading library…",libraries:"Browse libraries",loadingScene:"Loading scene…",loadScene:"Load scene from file",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",share:"Share",showStroke:"Show stroke color picker",showBackground:"Show background color picker",showFonts:"Show font picker",toggleTheme:"Toggle light/dark theme",theme:"Theme",personalLib:"Personal Library",excalidrawLib:"Excalidraw Library",decreaseFontSize:"Decrease font size",increaseFontSize:"Increase font size",unbindText:"Unbind text",bindText:"Bind text to the container",createContainerFromText:"Wrap text in a container",link:{edit:"Edit link",editEmbed:"Edit embeddable link",create:"Add link",label:"Link",labelEmbed:"Link & embed",empty:"No link is set",hint:"Type or paste your link here",goToElement:"Go to target element"},lineEditor:{edit:"Edit line",editArrow:"Edit arrow"},elementLock:{lock:"Lock",unlock:"Unlock",lockAll:"Lock all",unlockAll:"Unlock all"},statusPublished:"Published",sidebarLock:"Keep sidebar open",selectAllElementsInFrame:"Select all elements in frame",removeAllElementsFromFrame:"Remove all elements from frame",eyeDropper:"Pick color from canvas",textToDiagram:"Text to diagram",prompt:"Prompt",followUs:"Follow us",discordChat:"Discord chat",zoomToFitViewport:"Zoom to fit in viewport",zoomToFitSelection:"Zoom to fit selection",zoomToFit:"Zoom to fit all elements",installPWA:"Install Excalidraw locally (PWA)",autoResize:"Enable text auto-resizing",imageCropping:"Image cropping",unCroppedDimension:"Uncropped dimension",copyElementLink:"Copy link to object",linkToElement:"Link to object",wrapSelectionInFrame:"Wrap selection in frame"},IC={title:"Link to object",desc:"Click on a shape on canvas or paste a link.",notFound:"Linked object wasn't found on canvas."},_C={noItems:"No items added yet...",hint_emptyLibrary:"Select an item on canvas to add it here, or install a library from the public repository, below.",hint_emptyPrivateLibrary:"Select an item on canvas to add it here."},TC={title:"Find on canvas",noMatch:"No matches found...",singleResult:"result",multipleResults:"results",placeholder:"Find text on canvas..."},AC={clearReset:"Reset the canvas",exportJSON:"Export to file",exportImage:"Export image...",export:"Save to...",copyToClipboard:"Copy to clipboard",copyLink:"Copy link",save:"Save to current file",saveAs:"Save as",load:"Open",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:"Reset library",createNewRoom:"Create new room",fullScreen:"Full screen",darkMode:"Dark mode",lightMode:"Light mode",systemMode:"System mode",zenMode:"Zen mode",objectsSnapMode:"Snap to objects",exitZenMode:"Exit zen mode",cancel:"Cancel",clear:"Clear",remove:"Remove",embed:"Toggle embedding",publishLibrary:"Publish",submit:"Submit",confirm:"Confirm",embeddableInteractionButton:"Click to interact"},RC={clearReset:"This will clear the whole canvas. Are you sure?",couldNotCreateShareableLink:"Couldn't create shareable link.",couldNotCreateShareableLinkTooBig:"Couldn't create shareable link: the scene is too big",couldNotLoadInvalidFile:"Couldn't load invalid file",importBackendFailed:"Importing from backend failed.",cannotExportEmptyCanvas:"Cannot export empty canvas.",couldNotCopyToClipboard:"Couldn't copy to clipboard.",decryptFailed:"Couldn't decrypt data.",uploadedSecurly:"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can't read the content.",loadSceneOverridePrompt:"Loading external drawing will replace your existing content. Do you wish to continue?",collabStopOverridePrompt:`Stopping the session will overwrite your previous, locally stored drawing. Are you sure?
|
|
81
|
+
|
|
82
|
+
(If you want to keep your local drawing, simply close the browser tab instead.)`,errorAddingToLibrary:"Couldn't add item to the library",errorRemovingFromLibrary:"Couldn't remove item from the library",confirmAddLibrary:"This will add {{numShapes}} shape(s) to your library. Are you sure?",imageDoesNotContainScene:"This image does not seem to contain any scene data. Have you enabled scene embedding during export?",cannotRestoreFromImage:"Scene couldn't be restored from this image file",invalidSceneUrl:"Couldn't import scene from the supplied URL. It's either malformed, or doesn't contain valid Excalidraw JSON data.",resetLibrary:"This will clear your library. Are you sure?",removeItemsFromsLibrary:"Delete {{count}} item(s) from library?",invalidEncryptionKey:"Encryption key must be of 22 characters. Live collaboration is disabled.",collabOfflineWarning:`No internet connection available.
|
|
83
|
+
Your changes will not be saved!`},jC={unsupportedFileType:"Unsupported file type.",imageInsertError:"Couldn't insert image. Try again later...",fileTooBig:"File is too big. Maximum allowed size is {{maxSize}}.",svgImageInsertError:"Couldn't insert SVG image. The SVG markup looks invalid.",failedToFetchImage:"Failed to fetch image.",cannotResolveCollabServer:"Couldn't connect to the collab server. Please reload the page and try again.",importLibraryError:"Couldn't load library",saveLibraryError:"Couldn't save library to storage. Please save your library to a file locally to make sure you don't lose changes.",collabSaveFailed:"Couldn't save to the backend database. If problems persist, you should save your file locally to ensure you don't lose your work.",collabSaveFailed_sizeExceeded:"Couldn't save to the backend database, the canvas seems to be too big. You should save the file locally to ensure you don't lose your work.",imageToolNotSupported:"Images are disabled.",brave_measure_text_error:{line1:"Looks like you are using Brave browser with the <bold>Aggressively Block Fingerprinting</bold> setting enabled.",line2:"This could result in breaking the <bold>Text Elements</bold> in your drawings.",line3:"We strongly recommend disabling this setting. You can follow <link>these steps</link> on how to do so.",line4:"If disabling this setting doesn't fix the display of text elements, please open an <issueLink>issue</issueLink> on our GitHub, or write us on <discordLink>Discord</discordLink>"},libraryElementTypeError:{embeddable:"Embeddable elements cannot be added to the library.",iframe:"IFrame elements cannot be added to the library.",image:"Support for adding images to the library coming soon!"},asyncPasteFailedOnRead:"Couldn't paste (couldn't read from system clipboard).",asyncPasteFailedOnParse:"Couldn't paste.",copyToSystemClipboardFailed:"Couldn't copy to clipboard."},LC={selection:"Selection",image:"Insert image",rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Draw",text:"Text",library:"Library",lock:"Keep selected tool active after drawing",penMode:"Pen mode - prevent touch",link:"Add / Update link for a selected shape",eraser:"Eraser",frame:"Frame tool",magicframe:"Wireframe to code",embeddable:"Web Embed",laser:"Laser pointer",hand:"Hand (panning tool)",extraTools:"More tools",mermaidToExcalidraw:"Mermaid to Excalidraw"},DC={rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Freedraw",text:"Text",image:"Image",group:"Group",frame:"Frame",magicframe:"Wireframe to code",embeddable:"Web Embed",selection:"Selection",iframe:"IFrame"},PC={canvasActions:"Canvas actions",selectedShapeActions:"Selected shape actions",shapes:"Shapes"},NC={dismissSearch:"Escape to dismiss search",canvasPanning:"To move canvas, hold mouse wheel or spacebar while dragging, or use the hand tool",linearElement:"Click to start multiple points, drag for single line",arrowTool:"Click to start multiple points, drag for single line. Press {{arrowShortcut}} again to change arrow type.",freeDraw:"Click and drag, release when you're finished",text:"Tip: you can also add text by double-clicking anywhere with the selection tool",embeddable:"Click-drag to create a website embed",text_selected:"Double-click or press ENTER to edit text",text_editing:"Press Escape or CtrlOrCmd+ENTER to finish editing",linearElementMulti:"Click on last point or press Escape or Enter to finish",lockAngle:"You can constrain angle by holding SHIFT",resize:`You can constrain proportions by holding SHIFT while resizing,
|
|
84
|
+
hold ALT to resize from the center`,resizeImage:`You can resize freely by holding SHIFT,
|
|
85
|
+
hold ALT to resize from the center`,rotate:"You can constrain angles by holding SHIFT while rotating",lineEditor_info:"Hold CtrlOrCmd and Double-click or press CtrlOrCmd + Enter to edit points",lineEditor_pointSelected:`Press Delete to remove point(s),
|
|
86
|
+
CtrlOrCmd+D to duplicate, or drag to move`,lineEditor_nothingSelected:`Select a point to edit (hold SHIFT to select multiple),
|
|
87
|
+
or hold Alt and click to add new points`,placeImage:"Click to place the image, or click and drag to set its size manually",publishLibrary:"Publish your own library",bindTextToElement:"Press enter to add text",createFlowchart:"Hold CtrlOrCmd and Arrow key to create a flowchart",deepBoxSelect:"Hold CtrlOrCmd to deep select, and to prevent dragging",eraserRevert:"Hold Alt to revert the elements marked for deletion",firefox_clipboard_write:'This feature can likely be enabled by setting the "dom.events.asyncClipboard.clipboardItem" flag to "true". To change the browser flags in Firefox, visit the "about:config" page.',disableSnapping:"Hold CtrlOrCmd to disable snapping",enterCropEditor:"Double click the image or press ENTER to crop the image",leaveCropEditor:"Click outside the image or press ENTER or ESCAPE to finish cropping"},OC={cannotShowPreview:"Cannot show preview",canvasTooBig:"The canvas may be too big.",canvasTooBigTip:"Tip: try moving the farthest elements a bit closer together."},$C={headingMain:"Encountered an error. Try <button>reloading the page</button>.",clearCanvasMessage:"If reloading doesn't work, try <button>clearing the canvas</button>.",clearCanvasCaveat:" This will result in loss of work ",trackedToSentry:"The error with identifier {{eventId}} was tracked on our system.",openIssueMessage:"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our <button>bug tracker</button>. Please include information below by copying and pasting into the GitHub issue.",sceneContent:"Scene content:"},zC={or:"Or"},FC={desc_intro:"Invite people to collaborate on your drawing.",desc_privacy:"Don't worry, the session is end-to-end encrypted, and fully private. Not even our server can see what you draw.",button_startSession:"Start session",button_stopSession:"Stop session",desc_inProgressIntro:"Live-collaboration session is now in progress.",desc_shareLink:"Share this link with anyone you want to collaborate with:",desc_exitSession:"Stopping the session will disconnect you from the room, but you'll be able to continue working with the scene, locally. Note that this won't affect other people, and they'll still be able to collaborate on their version.",shareTitle:"Join a live collaboration session on Excalidraw"},BC={title:"Error"},HC={disk_title:"Save to disk",disk_details:"Export the scene data to a file from which you can import later.",disk_button:"Save to file",link_title:"Shareable link",link_details:"Export as a read-only link.",link_button:"Export to Link",excalidrawplus_description:"Save the scene to your Excalidraw+ workspace.",excalidrawplus_button:"Export",excalidrawplus_exportError:"Couldn't export to Excalidraw+ at this moment..."},WC={blog:"Read our blog",click:"click",deepSelect:"Deep select",deepBoxSelect:"Deep select within box, and prevent dragging",createFlowchart:"Create a flowchart from a generic element",navigateFlowchart:"Navigate a flowchart",curvedArrow:"Curved arrow",curvedLine:"Curved line",documentation:"Documentation",doubleClick:"double-click",drag:"drag",editor:"Editor",editLineArrowPoints:"Edit line/arrow points",editText:"Edit text / add label",github:"Found an issue? Submit",howto:"Follow our guides",or:"or",preventBinding:"Prevent arrow binding",tools:"Tools",shortcuts:"Keyboard shortcuts",textFinish:"Finish editing (text editor)",textNewLine:"Add new line (text editor)",title:"Help",view:"View",zoomToFit:"Zoom to fit all elements",zoomToSelection:"Zoom to selection",toggleElementLock:"Lock/unlock selection",movePageUpDown:"Move page up/down",movePageLeftRight:"Move page left/right",cropStart:"Crop image",cropFinish:"Finish image cropping"},XC={title:"Clear canvas"},VC={title:"Publish library",itemName:"Item name",authorName:"Author name",githubUsername:"GitHub username",twitterUsername:"Twitter username",libraryName:"Library name",libraryDesc:"Library description",website:"Website",placeholder:{authorName:"Your name or username",libraryName:"Name of your library",libraryDesc:"Description of your library to help people understand its usage",githubHandle:"GitHub handle (optional), so you can edit the library once submitted for review",twitterHandle:"Twitter username (optional), so we know who to credit when promoting over Twitter",website:"Link to your personal website or elsewhere (optional)"},errors:{required:"Required",website:"Enter a valid URL"},noteDescription:"Submit your library to be included in the <link>public library repository</link> for other people to use in their drawings.",noteGuidelines:"The library needs to be manually approved first. Please read the <link>guidelines</link> before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required.",noteLicense:"By submitting, you agree the library will be published under the <link>MIT License</link>, which in short means anyone can use them without restrictions.",noteItems:"Each library item must have its own name so it's filterable. The following library items will be included:",atleastOneLibItem:"Please select at least one library item to get started",republishWarning:"Note: some of the selected items are marked as already published/submitted. You should only resubmit items when updating an existing library or submission."},GC={title:"Library submitted",content:"Thank you {{authorName}}. Your library has been submitted for review. You can track the status <link>here</link>"},YC={resetLibrary:"Reset library",removeItemsFromLib:"Remove selected items from library"},ZC={header:"Export image",label:{withBackground:"Background",onlySelected:"Only selected",darkMode:"Dark mode",embedScene:"Embed scene",scale:"Scale",padding:"Padding"},tooltip:{embedScene:`Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.
|
|
88
|
+
Will increase exported file size.`},title:{exportToPng:"Export to PNG",exportToSvg:"Export to SVG",copyPngToClipboard:"Copy PNG to clipboard"},button:{exportToPng:"PNG",exportToSvg:"SVG",copyPngToClipboard:"Copy to clipboard"}},KC={tooltip:"Your drawings are end-to-end encrypted so Excalidraw's servers will never see them.",link:"Blog post on end-to-end encryption in Excalidraw"},qC={angle:"Angle",shapes:"Shapes",height:"Height",scene:"Scene",selected:"Selected",storage:"Storage",fullTitle:"Canvas & Shape properties",title:"Properties",generalStats:"General",elementProperties:"Shape properties",total:"Total",version:"Version",versionCopy:"Click to copy",versionNotAvailable:"Version not available",width:"Width"},QC={addedToLibrary:"Added to library",copyStyles:"Copied styles.",copyToClipboard:"Copied to clipboard.",copyToClipboardAsPng:`Copied {{exportSelection}} to clipboard as PNG
|
|
89
|
+
({{exportColorScheme}})`,copyToClipboardAsSvg:`Copied {{exportSelection}} to clipboard as SVG
|
|
90
|
+
({{exportColorScheme}})`,fileSaved:"File saved.",fileSavedToFilename:"Saved to {filename}",canvas:"canvas",selection:"selection",pasteAsSingleElement:`Use {{shortcut}} to paste as a single element,
|
|
91
|
+
or paste into an existing text editor`,unableToEmbed:"Embedding this url is currently not allowed. Raise an issue on GitHub to request the url whitelisted",unrecognizedLinkFormat:"The link you embedded does not match the expected format. Please try to paste the 'embed' string provided by the source site",elementLinkCopied:"Link copied to clipboard"},JC={transparent:"Transparent",black:"Black",white:"White",red:"Red",pink:"Pink",grape:"Grape",violet:"Violet",gray:"Gray",blue:"Blue",cyan:"Cyan",teal:"Teal",green:"Green",yellow:"Yellow",orange:"Orange",bronze:"Bronze"},eM={app:{center_heading:"All your data is saved locally in your browser.",center_heading_plus:"Did you want to go to the Excalidraw+ instead?",menuHint:"Export, preferences, languages, ..."},defaults:{menuHint:"Export, preferences, and more...",center_heading:"Diagrams. Made. Simple.",toolbarHint:"Pick a tool & Start drawing!",helpHint:"Shortcuts & help"}},tM={mostUsedCustomColors:"Most used custom colors",colors:"Colors",shades:"Shades",hexCode:"Hex code",noShades:"No shades available for this color"},nM={action:{exportToImage:{title:"Export as image",button:"Export as image",description:"Export the scene data as an image from which you can import later."},saveToDisk:{title:"Save to disk",button:"Save to disk",description:"Export the scene data to a file from which you can import later."},excalidrawPlus:{title:"Excalidraw+",button:"Export to Excalidraw+",description:"Save the scene to your Excalidraw+ workspace."}},modal:{loadFromFile:{title:"Load from file",button:"Load from file",description:"Loading from a file will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first using one of the options below."},shareableLink:{title:"Load from link",button:"Replace my content",description:"Loading external drawing will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first by using one of the options below."}}},rM={title:"Mermaid to Excalidraw",button:"Insert",description:"Currently only <flowchartLink>Flowchart</flowchartLink>,<sequenceLink> Sequence, </sequenceLink> and <classLink>Class </classLink>Diagrams are supported. The other types will be rendered as image in Excalidraw.",syntax:"Mermaid Syntax",preview:"Preview"},aM={placeholder:"Quick search"},iM={badge:{old:"old"},sceneFonts:"In this scene",availableFonts:"Available fonts",empty:"No fonts found"},lM={empty:"No users found",hint:{text:"Click on user to follow",followStatus:"You're currently following this user",inCall:"User is in a voice call",micMuted:"User's microphone is muted",isSpeaking:"User is speaking"}},sM={title:"Command palette",shortcuts:{select:"Select",confirm:"Confirm",close:"Close"},recents:"Recently used",search:{placeholder:"Search menus, commands, and discover hidden gems",noMatch:"No matching commands..."},itemNotAvailable:"Command is not available...",shortcutHint:"For Command palette, use {{shortcut}}"},E8={labels:MC,elementLink:IC,library:_C,search:TC,buttons:AC,alerts:RC,errors:jC,toolBar:LC,element:DC,headings:PC,hints:NC,canvasError:OC,errorSplash:$C,shareDialog:zC,roomDialog:FC,errorDialog:BC,exportDialog:HC,helpDialog:WC,clearCanvasDialog:XC,publishDialog:VC,publishSuccessDialog:GC,confirmDialog:YC,imageExportDialog:ZC,encrypted:KC,stats:qC,toast:QC,colors:JC,welcomeScreen:eM,colorPicker:tM,overwriteConfirm:nM,mermaid:rM,quickSearch:aM,fontList:iM,userList:lM,commandPalette:sM},oM=100,cM=36,dM={"ar-SA":94,"az-AZ":17,"bg-BG":71,"bn-BD":52,"ca-ES":83,"cs-CZ":86,"da-DK":61,"de-DE":100,"el-GR":80,en:oM,"es-ES":96,"eu-ES":97,"fa-IR":84,"fi-FI":76,"fr-FR":99,"gl-ES":86,"he-IL":77,"hi-IN":76,"hu-HU":76,"id-ID":91,"it-IT":98,"ja-JP":90,kaa:cM,"kab-KAB":76,"kk-KZ":18,"km-KH":83,"ko-KR":100,"ku-TR":87,"lt-LT":48,"lv-LV":77,"mr-IN":98,"my-MM":35,"nb-NO":93,"nl-NL":75,"nn-NO":67,"oc-FR":92,"pa-IN":78,"pl-PL":99,"pt-BR":91,"pt-PT":83,"ro-RO":99,"ru-RU":92,"si-LK":7,"sk-SK":100,"sl-SI":100,"sv-SE":100,"ta-IN":81,"th-TH":44,"tr-TR":87,"uk-UA":93,"vi-VN":49,"zh-CN":100,"zh-HK":22,"zh-TW":100};const hl={};let wZ=0;function Hn(e,t){const n=`atom${++wZ}`,r={toString(){return(hl?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=EZ,r.write=SZ),r}function EZ(e){return e(this)}function SZ(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const u9=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,S6=e=>"init"in e,q2=e=>!!e.write,n0=new WeakMap,k6=e=>{var t;return C6(e)&&!((t=n0.get(e))!=null&&t[1])},kZ=(e,t)=>{const n=n0.get(e);if(n)n[1]=!0,n[0].forEach(r=>r(t));else if((hl?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},CZ=e=>{if(n0.has(e))return;const t=[new Set,!1];n0.set(e,t);const n=()=>{t[1]=!0};e.then(n,n),e.onCancel=r=>{t[0].add(r)}},C6=e=>typeof(e==null?void 0:e.then)=="function",f9=e=>"v"in e||"e"in e,I1=e=>{if("e"in e)throw e.e;if((hl?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},uM=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},h9=(e,t,n,r,a)=>{var i;if((hl?"production":void 0)!=="production"&&r===t)throw new Error("[Bug] atom cannot depend on itself");n.d.set(r,a.n),k6(n.v)&&uM(t,n.v,a),(i=a.m)==null||i.t.add(t),e&&MZ(e,r,t)},hu=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),Xu=(e,t,n)=>{e[t].add(n)},p9=(e,t,n)=>{e.D.has(t)||(e.D.set(t,new Set),Xu(e,"M",()=>{var r;(r=n.m)==null||r.l.forEach(a=>Xu(e,"M",a))}))},MZ=(e,t,n)=>{const r=e.D.get(t);r&&r.add(n)},IZ=(e,t)=>e.D.get(t),Ws=e=>{let t,n=!1;const r=a=>{try{a()}catch(i){n||(t=i,n=!0)}};for(;e.H.size||e.M.size||e.L.size;)e.D.clear(),e.H.forEach(r),e.H.clear(),e.M.forEach(r),e.M.clear(),e.L.forEach(r),e.L.clear();if(n)throw t},fM=(...[e,t,n,r])=>{const a=(w,E,S)=>{const k="v"in E,I=E.v,T=k6(E.v)?E.v:null;if(C6(S)){CZ(S);for(const M of E.d.keys())uM(w,S,e(M));E.v=S}else E.v=S;delete E.e,delete E.x,(!k||!Object.is(I,E.v))&&(++E.n,T&&kZ(T,S))},i=(w,E)=>{var S;const k=e(E);if(f9(k)&&(k.m&&!k.x||Array.from(k.d).every(([P,N])=>i(w,P).n===N)))return k;k.d.clear();let I=!0;const T=P=>{if(u9(E,P)){const $=e(P);if(!f9($))if(S6(P))a(P,$,P.init);else throw new Error("no atom init");return I1($)}const N=i(w,P);try{return I1(N)}finally{if(I)h9(w,E,k,P,N);else{const $=hu();h9($,E,k,P,N),f($,E,k),Ws($)}}};let M,j;const D={get signal(){return M||(M=new AbortController),M.signal},get setSelf(){return(hl?"production":void 0)!=="production"&&!q2(E)&&console.warn("setSelf function cannot be used with read-only atom"),!j&&q2(E)&&(j=(...P)=>{if((hl?"production":void 0)!=="production"&&I&&console.warn("setSelf function cannot be called in sync"),!I)return o(E,...P)}),j}};try{const P=t(E,T,D);if(a(E,k,P),C6(P)){(S=P.onCancel)==null||S.call(P,()=>M==null?void 0:M.abort());const N=()=>{if(k.m){const $=hu();f($,E,k),Ws($)}};P.then(N,N)}return k}catch(P){return delete k.v,k.e=P,delete k.x,++k.n,k}finally{I=!1}},l=w=>I1(i(void 0,w)),s=(w,E,S)=>{var k,I;const T=new Map;for(const M of((k=S.m)==null?void 0:k.t)||[]){const j=e(M);j.m&&T.set(M,j)}for(const M of S.p)T.set(M,e(M));return(I=IZ(w,E))==null||I.forEach(M=>{T.set(M,e(M))}),T},d=(w,E,S)=>{const k=[],I=new Set,T=new Set,M=[[E,S]];for(;M.length>0;){const[j,D]=M[M.length-1];if(T.has(j)){M.pop();continue}if(I.has(j)){k.push([j,D,D.n]),T.add(j),D.x=!0,M.pop();continue}I.add(j);for(const[P,N]of s(w,j,D))j!==P&&!I.has(P)&&M.push([P,N])}Xu(w,"H",()=>{const j=new Set([E]);for(let D=k.length-1;D>=0;--D){const[P,N,$]=k[D];let z=!1;for(const Z of N.d.keys())if(Z!==P&&j.has(Z)){z=!0;break}z&&(i(w,P),f(w,P,N),$!==N.n&&(p9(w,P,N),j.add(P))),delete N.x}})},u=(w,E,...S)=>{let k=!0;const I=M=>I1(i(w,M)),T=(M,...j)=>{const D=e(M);try{if(u9(E,M)){if(!S6(M))throw new Error("atom not writable");const P=D.n,N=j[0];a(M,D,N),f(w,M,D),P!==D.n&&(p9(w,M,D),d(w,M,D));return}else return u(w,M,...j)}finally{k||Ws(w)}};try{return n(E,I,T,...S)}finally{k=!1}},o=(w,...E)=>{const S=hu();try{return u(S,w,...E)}finally{Ws(S)}},f=(w,E,S)=>{if(S.m&&!k6(S.v)){for(const k of S.d.keys())S.m.d.has(k)||(m(w,k,e(k)).t.add(E),S.m.d.add(k));for(const k of S.m.d||[])if(!S.d.has(k)){S.m.d.delete(k);const I=U(w,k,e(k));I==null||I.t.delete(E)}}},m=(w,E,S)=>{if(!S.m){i(w,E);for(const k of S.d.keys())m(w,k,e(k)).t.add(E);if(S.m={l:new Set,d:new Set(S.d.keys()),t:new Set},q2(E)){const k=S.m;let I;const T=(M,j)=>{let D=!0;I=(...P)=>{try{return u(M,E,...P)}finally{D||Ws(M)}};try{return j()}finally{D=!1}};Xu(w,"L",()=>{const M=T(w,()=>r(E,(...j)=>I(...j)));M&&(k.u=j=>T(j,M))})}}return S.m},U=(w,E,S)=>{if(S.m&&!S.m.l.size&&!Array.from(S.m.t).some(k=>{var I;return(I=e(k).m)==null?void 0:I.d.has(E)})){const k=S.m.u;k&&Xu(w,"L",()=>k(w)),delete S.m;for(const I of S.d.keys()){const T=U(w,I,e(I));T==null||T.t.delete(E)}return}return S.m};return{get:l,set:o,sub:(w,E)=>{const S=hu(),k=e(w),T=m(S,w,k).l;return T.add(E),Ws(S),()=>{T.delete(E);const M=hu();U(M,w,k),Ws(M)}},unstable_derive:w=>fM(...w(e,t,n,r))}},_Z=e=>{const t=new WeakMap,n=new Set;let r,a=0;const i=e.unstable_derive((d,u,o,f)=>(r=d,[m=>{let U=t.get(m);if(!U){const g=d(m);U=new Proxy(g,{set(v,y,w){return y==="m"&&n.add(m),Reflect.set(v,y,w)},deleteProperty(v,y){return y==="m"&&n.delete(m),Reflect.deleteProperty(v,y)}}),t.set(m,U)}return U},u,(m,U,g,...v)=>a?g(m,...v):o(m,U,g,...v),f])),l=i.set;return Object.assign(i,{dev4_get_internal_weak_map:()=>({get:d=>{const u=r(d);if(u.n!==0)return u}}),dev4_get_mounted_atoms:()=>n,dev4_restore_atoms:d=>{l({read:()=>null,write:(o,f)=>{++a;try{for(const[m,U]of d)S6(m)&&f(m,U)}finally{--a}}})}})},S8=()=>{const e=new WeakMap,n=fM(r=>{if((hl?"production":void 0)!=="production"&&!r)throw new Error("Atom is undefined or null");let a=e.get(r);return a||(a={d:new Map,p:new Set,n:0},e.set(r,a)),a},(r,...a)=>r.read(...a),(r,...a)=>r.write(...a),(r,...a)=>{var i;return(i=r.onMount)==null?void 0:i.call(r,...a)});return(hl?"production":void 0)!=="production"?_Z(n):n};let pu;const TZ=()=>(pu||(pu=S8(),(hl?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=pu),globalThis.__JOTAI_DEFAULT_STORE__!==pu&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),pu),hM={},AZ=_.createContext(void 0),V0=e=>{const t=_.useContext(AZ);return(e==null?void 0:e.store)||t||TZ()},M6=e=>typeof(e==null?void 0:e.then)=="function",pM=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},RZ=we.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(pM(e),e)}),Q2=new WeakMap,m9=e=>{let t=Q2.get(e);return t||(t=new Promise((n,r)=>{let a=e;const i=d=>u=>{a===d&&n(u)},l=d=>u=>{a===d&&r(u)},s=d=>{"onCancel"in d&&typeof d.onCancel=="function"&&d.onCancel(u=>{if((hM?"production":void 0)!=="production"&&u===d)throw new Error("[Bug] p is not updated even after cancelation");M6(u)?(Q2.set(u,t),a=u,u.then(i(u),l(u)),s(u)):n(u)})};e.then(i(e),l(e)),s(e)}),Q2.set(e,t)),t};function mM(e,t){const n=V0(t),[[r,a,i],l]=_.useReducer(u=>{const o=n.get(e);return Object.is(u[0],o)&&u[1]===n&&u[2]===e?u:[o,n,e]},void 0,()=>[n.get(e),n,e]);let s=r;(a!==n||i!==e)&&(l(),s=n.get(e));const d=t==null?void 0:t.delay;if(_.useEffect(()=>{const u=n.sub(e,()=>{if(typeof d=="number"){const o=n.get(e);M6(o)&&pM(m9(o)),setTimeout(l,d);return}l()});return l(),u},[n,e,d]),_.useDebugValue(s),M6(s)){const u=m9(s);return RZ(u)}return s}function UM(e,t){const n=V0(t);return _.useCallback((...a)=>{if((hM?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...a)},[n,e])}function jZ(e,t){return[mM(e,t),UM(e,t)]}const U9=new WeakMap;function LZ(e,t){const n=V0(t),r=DZ(n);for(const[a,i]of e)(!r.has(a)||t!=null&&t.dangerouslyForceHydrate)&&(r.add(a),n.set(a,i))}const DZ=e=>{let t=U9.get(e);return t||(t=new WeakSet,U9.set(e,t)),t};function jc(){return jc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jc.apply(this,arguments)}function gM(){const e=_.createContext(null);function t({store:l,initialValues:s=[],children:d}){const u=_.useRef(l);return u.current||(u.current=S8()),LZ(s,{store:u.current}),p.jsx(e.Provider,{value:u.current,children:d})}const n=l=>{const s=_.useContext(e);if(!s)throw new Error("Missing Provider from createIsolation");return V0(jc({store:s},l))};return{Provider:t,useStore:n,useAtom:(l,s)=>{const d=n();return jZ(l,jc({store:d},s))},useAtomValue:(l,s)=>{const d=n();return mM(l,jc({store:d},s))},useSetAtom:(l,s)=>{const d=n();return UM(l,jc({store:d},s))}}}const{read:ese,write:tse}=Hn(null);_.createContext({scope:void 0,baseStore:void 0});var $n=yw();const PZ=_i($n);function ps(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function g9(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function bM(...e){return t=>{let n=!1;const r=e.map(a=>{const i=g9(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():g9(e[a],null)}}}}function ks(...e){return _.useCallback(bM(...e),e)}function vM(e,t=[]){let n=[];function r(i,l){const s=_.createContext(l),d=n.length;n=[...n,l];const u=f=>{var w;const{scope:m,children:U,...g}=f,v=((w=m==null?void 0:m[e])==null?void 0:w[d])||s,y=_.useMemo(()=>g,Object.values(g));return p.jsx(v.Provider,{value:y,children:U})};u.displayName=i+"Provider";function o(f,m){var v;const U=((v=m==null?void 0:m[e])==null?void 0:v[d])||s,g=_.useContext(U);if(g)return g;if(l!==void 0)return l;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,o]}const a=()=>{const i=n.map(l=>_.createContext(l));return function(s){const d=(s==null?void 0:s[e])||i;return _.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return a.scopeName=e,[r,NZ(a,...t)]}function NZ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((s,{useScope:d,scopeName:u})=>{const f=d(i)[`__scope${u}`];return{...s,...f}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var k8=_.forwardRef((e,t)=>{const{children:n,...r}=e,a=_.Children.toArray(n),i=a.find($Z);if(i){const l=i.props.children,s=a.map(d=>d===i?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:d);return p.jsx(I6,{...r,ref:t,children:_.isValidElement(l)?_.cloneElement(l,void 0,s):null})}return p.jsx(I6,{...r,ref:t,children:n})});k8.displayName="Slot";var I6=_.forwardRef((e,t)=>{const{children:n,...r}=e;if(_.isValidElement(n)){const a=FZ(n),i=zZ(r,n.props);return n.type!==_.Fragment&&(i.ref=t?bM(t,a):a),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});I6.displayName="SlotClone";var OZ=({children:e})=>p.jsx(p.Fragment,{children:e});function $Z(e){return _.isValidElement(e)&&e.type===OZ}function zZ(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...s)=>{i(...s),a(...s)}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function FZ(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var BZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],vl=BZ.reduce((e,t)=>{const n=_.forwardRef((r,a)=>{const{asChild:i,...l}=r,s=i?k8:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(s,{...l,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function HZ(e,t){e&&$n.flushSync(()=>e.dispatchEvent(t))}function vs(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function WZ(e,t=globalThis==null?void 0:globalThis.document){const n=vs(e);_.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var XZ="DismissableLayer",_6="dismissableLayer.update",VZ="dismissableLayer.pointerDownOutside",GZ="dismissableLayer.focusOutside",b9,yM=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xM=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:s,...d}=e,u=_.useContext(yM),[o,f]=_.useState(null),m=(o==null?void 0:o.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,U]=_.useState({}),g=ks(t,M=>f(M)),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf(y),E=o?v.indexOf(o):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,k=E>=w,I=KZ(M=>{const j=M.target,D=[...u.branches].some(P=>P.contains(j));!k||D||(a==null||a(M),l==null||l(M),M.defaultPrevented||s==null||s())},m),T=qZ(M=>{const j=M.target;[...u.branches].some(P=>P.contains(j))||(i==null||i(M),l==null||l(M),M.defaultPrevented||s==null||s())},m);return WZ(M=>{E===u.layers.size-1&&(r==null||r(M),!M.defaultPrevented&&s&&(M.preventDefault(),s()))},m),_.useEffect(()=>{if(o)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(b9=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(o)),u.layers.add(o),v9(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=b9)}},[o,m,n,u]),_.useEffect(()=>()=>{o&&(u.layers.delete(o),u.layersWithOutsidePointerEventsDisabled.delete(o),v9())},[o,u]),_.useEffect(()=>{const M=()=>U({});return document.addEventListener(_6,M),()=>document.removeEventListener(_6,M)},[]),p.jsx(vl.div,{...d,ref:g,style:{pointerEvents:S?k?"auto":"none":void 0,...e.style},onFocusCapture:ps(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ps(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ps(e.onPointerDownCapture,I.onPointerDownCapture)})});xM.displayName=XZ;var YZ="DismissableLayerBranch",ZZ=_.forwardRef((e,t)=>{const n=_.useContext(yM),r=_.useRef(null),a=ks(t,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),p.jsx(vl.div,{...e,ref:a})});ZZ.displayName=YZ;function KZ(e,t=globalThis==null?void 0:globalThis.document){const n=vs(e),r=_.useRef(!1),a=_.useRef(()=>{});return _.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let d=function(){wM(VZ,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function qZ(e,t=globalThis==null?void 0:globalThis.document){const n=vs(e),r=_.useRef(!1);return _.useEffect(()=>{const a=i=>{i.target&&!r.current&&wM(GZ,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function v9(){const e=new CustomEvent(_6);document.dispatchEvent(e)}function wM(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?HZ(a,i):a.dispatchEvent(i)}var J2=0;function QZ(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??y9()),document.body.insertAdjacentElement("beforeend",e[1]??y9()),J2++,()=>{J2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),J2--}},[])}function y9(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var eg="focusScope.autoFocusOnMount",tg="focusScope.autoFocusOnUnmount",x9={bubbles:!1,cancelable:!0},JZ="FocusScope",EM=_.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[s,d]=_.useState(null),u=vs(a),o=vs(i),f=_.useRef(null),m=ks(t,v=>d(v)),U=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let v=function(S){if(U.paused||!s)return;const k=S.target;s.contains(k)?f.current=k:Jl(f.current,{select:!0})},y=function(S){if(U.paused||!s)return;const k=S.relatedTarget;k!==null&&(s.contains(k)||Jl(f.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const I of S)I.removedNodes.length>0&&Jl(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const E=new MutationObserver(w);return s&&E.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),E.disconnect()}}},[r,s,U.paused]),_.useEffect(()=>{if(s){E9.add(U);const v=document.activeElement;if(!s.contains(v)){const w=new CustomEvent(eg,x9);s.addEventListener(eg,u),s.dispatchEvent(w),w.defaultPrevented||(eK(iK(SM(s)),{select:!0}),document.activeElement===v&&Jl(s))}return()=>{s.removeEventListener(eg,u),setTimeout(()=>{const w=new CustomEvent(tg,x9);s.addEventListener(tg,o),s.dispatchEvent(w),w.defaultPrevented||Jl(v??document.body,{select:!0}),s.removeEventListener(tg,o),E9.remove(U)},0)}}},[s,u,o,U]);const g=_.useCallback(v=>{if(!n&&!r||U.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(y&&w){const E=v.currentTarget,[S,k]=tK(E);S&&k?!v.shiftKey&&w===k?(v.preventDefault(),n&&Jl(S,{select:!0})):v.shiftKey&&w===S&&(v.preventDefault(),n&&Jl(k,{select:!0})):w===E&&v.preventDefault()}},[n,r,U.paused]);return p.jsx(vl.div,{tabIndex:-1,...l,ref:m,onKeyDown:g})});EM.displayName=JZ;function eK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Jl(r,{select:t}),document.activeElement!==n)return}function tK(e){const t=SM(e),n=w9(t,e),r=w9(t.reverse(),e);return[n,r]}function SM(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function w9(e,t){for(const n of e)if(!nK(n,{upTo:t}))return n}function nK(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function rK(e){return e instanceof HTMLInputElement&&"select"in e}function Jl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rK(e)&&t&&e.select()}}var E9=aK();function aK(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=S9(e,t),e.unshift(t)},remove(t){var n;e=S9(e,t),(n=e[0])==null||n.resume()}}}function S9(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function iK(e){return e.filter(t=>t.tagName!=="A")}var To=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},lK=r5.useId||(()=>{}),sK=0;function oK(e){const[t,n]=_.useState(lK());return To(()=>{n(r=>r??String(sK++))},[e]),e||(t?`radix-${t}`:"")}const cK=["top","right","bottom","left"],ys=Math.min,Fr=Math.max,r0=Math.round,_1=Math.floor,yi=e=>({x:e,y:e}),dK={left:"right",right:"left",bottom:"top",top:"bottom"},uK={start:"end",end:"start"};function T6(e,t,n){return Fr(e,ys(t,n))}function pl(e,t){return typeof e=="function"?e(t):e}function ml(e){return e.split("-")[0]}function pd(e){return e.split("-")[1]}function C8(e){return e==="x"?"y":"x"}function M8(e){return e==="y"?"height":"width"}const fK=new Set(["top","bottom"]);function gi(e){return fK.has(ml(e))?"y":"x"}function I8(e){return C8(gi(e))}function hK(e,t,n){n===void 0&&(n=!1);const r=pd(e),a=I8(e),i=M8(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=a0(l)),[l,a0(l)]}function pK(e){const t=a0(e);return[A6(e),t,A6(t)]}function A6(e){return e.replace(/start|end/g,t=>uK[t])}const k9=["left","right"],C9=["right","left"],mK=["top","bottom"],UK=["bottom","top"];function gK(e,t,n){switch(e){case"top":case"bottom":return n?t?C9:k9:t?k9:C9;case"left":case"right":return t?mK:UK;default:return[]}}function bK(e,t,n,r){const a=pd(e);let i=gK(ml(e),n==="start",r);return a&&(i=i.map(l=>l+"-"+a),t&&(i=i.concat(i.map(A6)))),i}function a0(e){return e.replace(/left|right|bottom|top/g,t=>dK[t])}function vK(e){return{top:0,right:0,bottom:0,left:0,...e}}function kM(e){return typeof e!="number"?vK(e):{top:e,right:e,bottom:e,left:e}}function i0(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function M9(e,t,n){let{reference:r,floating:a}=e;const i=gi(t),l=I8(t),s=M8(l),d=ml(t),u=i==="y",o=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,m=r[s]/2-a[s]/2;let U;switch(d){case"top":U={x:o,y:r.y-a.height};break;case"bottom":U={x:o,y:r.y+r.height};break;case"right":U={x:r.x+r.width,y:f};break;case"left":U={x:r.x-a.width,y:f};break;default:U={x:r.x,y:r.y}}switch(pd(t)){case"start":U[l]-=m*(n&&u?-1:1);break;case"end":U[l]+=m*(n&&u?-1:1);break}return U}const yK=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:o,y:f}=M9(u,r,d),m=r,U={},g=0;for(let v=0;v<s.length;v++){const{name:y,fn:w}=s[v],{x:E,y:S,data:k,reset:I}=await w({x:o,y:f,initialPlacement:r,placement:m,strategy:a,middlewareData:U,rects:u,platform:l,elements:{reference:e,floating:t}});o=E??o,f=S??f,U={...U,[y]:{...U[y],...k}},I&&g<=50&&(g++,typeof I=="object"&&(I.placement&&(m=I.placement),I.rects&&(u=I.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):I.rects),{x:o,y:f}=M9(u,m,d)),v=-1)}return{x:o,y:f,placement:m,strategy:a,middlewareData:U}};async function wf(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:l,elements:s,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:o="viewport",elementContext:f="floating",altBoundary:m=!1,padding:U=0}=pl(t,e),g=kM(U),y=s[m?f==="floating"?"reference":"floating":f],w=i0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:o,strategy:d})),E=f==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),k=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},I=i0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:S,strategy:d}):E);return{top:(w.top-I.top+g.top)/k.y,bottom:(I.bottom-w.bottom+g.bottom)/k.y,left:(w.left-I.left+g.left)/k.x,right:(I.right-w.right+g.right)/k.x}}const xK=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:l,elements:s,middlewareData:d}=t,{element:u,padding:o=0}=pl(e,t)||{};if(u==null)return{};const f=kM(o),m={x:n,y:r},U=I8(a),g=M8(U),v=await l.getDimensions(u),y=U==="y",w=y?"top":"left",E=y?"bottom":"right",S=y?"clientHeight":"clientWidth",k=i.reference[g]+i.reference[U]-m[U]-i.floating[g],I=m[U]-i.reference[U],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let M=T?T[S]:0;(!M||!await(l.isElement==null?void 0:l.isElement(T)))&&(M=s.floating[S]||i.floating[g]);const j=k/2-I/2,D=M/2-v[g]/2-1,P=ys(f[w],D),N=ys(f[E],D),$=P,z=M-v[g]-N,Z=M/2-v[g]/2+j,K=T6($,Z,z),Q=!d.arrow&&pd(a)!=null&&Z!==K&&i.reference[g]/2-(Z<$?P:N)-v[g]/2<0,W=Q?Z<$?Z-$:Z-z:0;return{[U]:m[U]+W,data:{[U]:K,centerOffset:Z-K-W,...Q&&{alignmentOffset:W}},reset:Q}}}),wK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:l,initialPlacement:s,platform:d,elements:u}=t,{mainAxis:o=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:U="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...y}=pl(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=ml(a),E=gi(s),S=ml(s)===s,k=await(d.isRTL==null?void 0:d.isRTL(u.floating)),I=m||(S||!v?[a0(s)]:pK(s)),T=g!=="none";!m&&T&&I.push(...bK(s,v,g,k));const M=[s,...I],j=await wf(t,y),D=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(o&&D.push(j[w]),f){const Z=hK(a,l,k);D.push(j[Z[0]],j[Z[1]])}if(P=[...P,{placement:a,overflows:D}],!D.every(Z=>Z<=0)){var N,$;const Z=(((N=i.flip)==null?void 0:N.index)||0)+1,K=M[Z];if(K&&(!(f==="alignment"?E!==gi(K):!1)||P.every(q=>gi(q.placement)===E?q.overflows[0]>0:!0)))return{data:{index:Z,overflows:P},reset:{placement:K}};let Q=($=P.filter(W=>W.overflows[0]<=0).sort((W,q)=>W.overflows[1]-q.overflows[1])[0])==null?void 0:$.placement;if(!Q)switch(U){case"bestFit":{var z;const W=(z=P.filter(q=>{if(T){const V=gi(q.placement);return V===E||V==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(V=>V>0).reduce((V,ee)=>V+ee,0)]).sort((q,V)=>q[1]-V[1])[0])==null?void 0:z[0];W&&(Q=W);break}case"initialPlacement":Q=s;break}if(a!==Q)return{reset:{placement:Q}}}return{}}}};function I9(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _9(e){return cK.some(t=>e[t]>=0)}const EK=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=pl(e,t);switch(r){case"referenceHidden":{const i=await wf(t,{...a,elementContext:"reference"}),l=I9(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:_9(l)}}}case"escaped":{const i=await wf(t,{...a,altBoundary:!0}),l=I9(i,n.floating);return{data:{escapedOffsets:l,escaped:_9(l)}}}default:return{}}}}},CM=new Set(["left","top"]);async function SK(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=ml(n),s=pd(n),d=gi(n)==="y",u=CM.has(l)?-1:1,o=i&&d?-1:1,f=pl(t,e);let{mainAxis:m,crossAxis:U,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof g=="number"&&(U=s==="end"?g*-1:g),d?{x:U*o,y:m*u}:{x:m*u,y:U*o}}const kK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:l,middlewareData:s}=t,d=await SK(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:i+d.y,data:{...d,placement:l}}}}},CK=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:y=>{let{x:w,y:E}=y;return{x:w,y:E}}},...d}=pl(e,t),u={x:n,y:r},o=await wf(t,d),f=gi(ml(a)),m=C8(f);let U=u[m],g=u[f];if(i){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",E=U+o[y],S=U-o[w];U=T6(E,U,S)}if(l){const y=f==="y"?"top":"left",w=f==="y"?"bottom":"right",E=g+o[y],S=g-o[w];g=T6(E,g,S)}const v=s.fn({...t,[m]:U,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:i,[f]:l}}}}}},MK=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:l}=t,{offset:s=0,mainAxis:d=!0,crossAxis:u=!0}=pl(e,t),o={x:n,y:r},f=gi(a),m=C8(f);let U=o[m],g=o[f];const v=pl(s,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(d){const S=m==="y"?"height":"width",k=i.reference[m]-i.floating[S]+y.mainAxis,I=i.reference[m]+i.reference[S]-y.mainAxis;U<k?U=k:U>I&&(U=I)}if(u){var w,E;const S=m==="y"?"width":"height",k=CM.has(ml(a)),I=i.reference[f]-i.floating[S]+(k&&((w=l.offset)==null?void 0:w[f])||0)+(k?0:y.crossAxis),T=i.reference[f]+i.reference[S]+(k?0:((E=l.offset)==null?void 0:E[f])||0)-(k?y.crossAxis:0);g<I?g=I:g>T&&(g=T)}return{[m]:U,[f]:g}}}},IK=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:l,elements:s}=t,{apply:d=()=>{},...u}=pl(e,t),o=await wf(t,u),f=ml(a),m=pd(a),U=gi(a)==="y",{width:g,height:v}=i.floating;let y,w;f==="top"||f==="bottom"?(y=f,w=m===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(w=f,y=m==="end"?"top":"bottom");const E=v-o.top-o.bottom,S=g-o.left-o.right,k=ys(v-o[y],E),I=ys(g-o[w],S),T=!t.middlewareData.shift;let M=k,j=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=E),T&&!m){const P=Fr(o.left,0),N=Fr(o.right,0),$=Fr(o.top,0),z=Fr(o.bottom,0);U?j=g-2*(P!==0||N!==0?P+N:Fr(o.left,o.right)):M=v-2*($!==0||z!==0?$+z:Fr(o.top,o.bottom))}await d({...t,availableWidth:j,availableHeight:M});const D=await l.getDimensions(s.floating);return g!==D.width||v!==D.height?{reset:{rects:!0}}:{}}}};function G0(){return typeof window<"u"}function md(e){return MM(e)?(e.nodeName||"").toLowerCase():"#document"}function Hr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ti(e){var t;return(t=(MM(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function MM(e){return G0()?e instanceof Node||e instanceof Hr(e).Node:!1}function Za(e){return G0()?e instanceof Element||e instanceof Hr(e).Element:!1}function Ii(e){return G0()?e instanceof HTMLElement||e instanceof Hr(e).HTMLElement:!1}function T9(e){return!G0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hr(e).ShadowRoot}const _K=new Set(["inline","contents"]);function Yf(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ka(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!_K.has(a)}const TK=new Set(["table","td","th"]);function AK(e){return TK.has(md(e))}const RK=[":popover-open",":modal"];function Y0(e){return RK.some(t=>{try{return e.matches(t)}catch{return!1}})}const jK=["transform","translate","scale","rotate","perspective"],LK=["transform","translate","scale","rotate","perspective","filter"],DK=["paint","layout","strict","content"];function _8(e){const t=T8(),n=Za(e)?Ka(e):e;return jK.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||LK.some(r=>(n.willChange||"").includes(r))||DK.some(r=>(n.contain||"").includes(r))}function PK(e){let t=xs(e);for(;Ii(t)&&!id(t);){if(_8(t))return t;if(Y0(t))return null;t=xs(t)}return null}function T8(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const NK=new Set(["html","body","#document"]);function id(e){return NK.has(md(e))}function Ka(e){return Hr(e).getComputedStyle(e)}function Z0(e){return Za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xs(e){if(md(e)==="html")return e;const t=e.assignedSlot||e.parentNode||T9(e)&&e.host||Ti(e);return T9(t)?t.host:t}function IM(e){const t=xs(e);return id(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ii(t)&&Yf(t)?t:IM(t)}function Ef(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=IM(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),l=Hr(a);if(i){const s=R6(l);return t.concat(l,l.visualViewport||[],Yf(a)?a:[],s&&n?Ef(s):[])}return t.concat(a,Ef(a,[],n))}function R6(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _M(e){const t=Ka(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Ii(e),i=a?e.offsetWidth:n,l=a?e.offsetHeight:r,s=r0(n)!==i||r0(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function A8(e){return Za(e)?e:e.contextElement}function Oc(e){const t=A8(e);if(!Ii(t))return yi(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=_M(t);let l=(i?r0(n.width):n.width)/r,s=(i?r0(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const OK=yi(0);function TM(e){const t=Hr(e);return!T8()||!t.visualViewport?OK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $K(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Hr(e)?!1:t}function Ao(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=A8(e);let l=yi(1);t&&(r?Za(r)&&(l=Oc(r)):l=Oc(e));const s=$K(i,n,r)?TM(i):yi(0);let d=(a.left+s.x)/l.x,u=(a.top+s.y)/l.y,o=a.width/l.x,f=a.height/l.y;if(i){const m=Hr(i),U=r&&Za(r)?Hr(r):r;let g=m,v=R6(g);for(;v&&r&&U!==g;){const y=Oc(v),w=v.getBoundingClientRect(),E=Ka(v),S=w.left+(v.clientLeft+parseFloat(E.paddingLeft))*y.x,k=w.top+(v.clientTop+parseFloat(E.paddingTop))*y.y;d*=y.x,u*=y.y,o*=y.x,f*=y.y,d+=S,u+=k,g=Hr(v),v=R6(g)}}return i0({width:o,height:f,x:d,y:u})}function K0(e,t){const n=Z0(e).scrollLeft;return t?t.left+n:Ao(Ti(e)).left+n}function AM(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-K0(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function zK(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",l=Ti(r),s=t?Y0(t.floating):!1;if(r===l||s&&i)return n;let d={scrollLeft:0,scrollTop:0},u=yi(1);const o=yi(0),f=Ii(r);if((f||!f&&!i)&&((md(r)!=="body"||Yf(l))&&(d=Z0(r)),Ii(r))){const U=Ao(r);u=Oc(r),o.x=U.x+r.clientLeft,o.y=U.y+r.clientTop}const m=l&&!f&&!i?AM(l,d):yi(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+o.x+m.x,y:n.y*u.y-d.scrollTop*u.y+o.y+m.y}}function FK(e){return Array.from(e.getClientRects())}function BK(e){const t=Ti(e),n=Z0(e),r=e.ownerDocument.body,a=Fr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Fr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+K0(e);const s=-n.scrollTop;return Ka(r).direction==="rtl"&&(l+=Fr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:l,y:s}}const A9=25;function HK(e,t){const n=Hr(e),r=Ti(e),a=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,d=0;if(a){i=a.width,l=a.height;const o=T8();(!o||o&&t==="fixed")&&(s=a.offsetLeft,d=a.offsetTop)}const u=K0(r);if(u<=0){const o=r.ownerDocument,f=o.body,m=getComputedStyle(f),U=o.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-U);g<=A9&&(i-=g)}else u<=A9&&(i+=u);return{width:i,height:l,x:s,y:d}}const WK=new Set(["absolute","fixed"]);function XK(e,t){const n=Ao(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=Ii(e)?Oc(e):yi(1),l=e.clientWidth*i.x,s=e.clientHeight*i.y,d=a*i.x,u=r*i.y;return{width:l,height:s,x:d,y:u}}function R9(e,t,n){let r;if(t==="viewport")r=HK(e,n);else if(t==="document")r=BK(Ti(e));else if(Za(t))r=XK(t,n);else{const a=TM(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return i0(r)}function RM(e,t){const n=xs(e);return n===t||!Za(n)||id(n)?!1:Ka(n).position==="fixed"||RM(n,t)}function VK(e,t){const n=t.get(e);if(n)return n;let r=Ef(e,[],!1).filter(s=>Za(s)&&md(s)!=="body"),a=null;const i=Ka(e).position==="fixed";let l=i?xs(e):e;for(;Za(l)&&!id(l);){const s=Ka(l),d=_8(l);!d&&s.position==="fixed"&&(a=null),(i?!d&&!a:!d&&s.position==="static"&&!!a&&WK.has(a.position)||Yf(l)&&!d&&RM(e,l))?r=r.filter(o=>o!==l):a=s,l=xs(l)}return t.set(e,r),r}function GK(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?Y0(t)?[]:VK(t,this._c):[].concat(n),r],s=l[0],d=l.reduce((u,o)=>{const f=R9(t,o,a);return u.top=Fr(f.top,u.top),u.right=ys(f.right,u.right),u.bottom=ys(f.bottom,u.bottom),u.left=Fr(f.left,u.left),u},R9(t,s,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function YK(e){const{width:t,height:n}=_M(e);return{width:t,height:n}}function ZK(e,t,n){const r=Ii(t),a=Ti(t),i=n==="fixed",l=Ao(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const d=yi(0);function u(){d.x=K0(a)}if(r||!r&&!i)if((md(t)!=="body"||Yf(a))&&(s=Z0(t)),r){const U=Ao(t,!0,i,t);d.x=U.x+t.clientLeft,d.y=U.y+t.clientTop}else a&&u();i&&!r&&a&&u();const o=a&&!r&&!i?AM(a,s):yi(0),f=l.left+s.scrollLeft-d.x-o.x,m=l.top+s.scrollTop-d.y-o.y;return{x:f,y:m,width:l.width,height:l.height}}function ng(e){return Ka(e).position==="static"}function j9(e,t){if(!Ii(e)||Ka(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ti(e)===n&&(n=n.ownerDocument.body),n}function jM(e,t){const n=Hr(e);if(Y0(e))return n;if(!Ii(e)){let a=xs(e);for(;a&&!id(a);){if(Za(a)&&!ng(a))return a;a=xs(a)}return n}let r=j9(e,t);for(;r&&AK(r)&&ng(r);)r=j9(r,t);return r&&id(r)&&ng(r)&&!_8(r)?n:r||PK(e)||n}const KK=async function(e){const t=this.getOffsetParent||jM,n=this.getDimensions,r=await n(e.floating);return{reference:ZK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qK(e){return Ka(e).direction==="rtl"}const QK={convertOffsetParentRelativeRectToViewportRelativeRect:zK,getDocumentElement:Ti,getClippingRect:GK,getOffsetParent:jM,getElementRects:KK,getClientRects:FK,getDimensions:YK,getScale:Oc,isElement:Za,isRTL:qK};function LM(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function JK(e,t){let n=null,r;const a=Ti(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,d){s===void 0&&(s=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:o,top:f,width:m,height:U}=u;if(s||t(),!m||!U)return;const g=_1(f),v=_1(a.clientWidth-(o+m)),y=_1(a.clientHeight-(f+U)),w=_1(o),S={rootMargin:-g+"px "+-v+"px "+-y+"px "+-w+"px",threshold:Fr(0,ys(1,d))||1};let k=!0;function I(T){const M=T[0].intersectionRatio;if(M!==d){if(!k)return l();M?l(!1,M):r=setTimeout(()=>{l(!1,1e-7)},1e3)}M===1&&!LM(u,e.getBoundingClientRect())&&l(),k=!1}try{n=new IntersectionObserver(I,{...S,root:a.ownerDocument})}catch{n=new IntersectionObserver(I,S)}n.observe(e)}return l(!0),i}function eq(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,u=A8(e),o=a||i?[...u?Ef(u):[],...Ef(t)]:[];o.forEach(w=>{a&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const f=u&&s?JK(u,n):null;let m=-1,U=null;l&&(U=new ResizeObserver(w=>{let[E]=w;E&&E.target===u&&U&&(U.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=U)==null||S.observe(t)})),n()}),u&&!d&&U.observe(u),U.observe(t));let g,v=d?Ao(e):null;d&&y();function y(){const w=Ao(e);v&&!LM(v,w)&&n(),v=w,g=requestAnimationFrame(y)}return n(),()=>{var w;o.forEach(E=>{a&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),f==null||f(),(w=U)==null||w.disconnect(),U=null,d&&cancelAnimationFrame(g)}}const tq=kK,nq=CK,rq=wK,aq=IK,iq=EK,L9=xK,lq=MK,sq=(e,t,n)=>{const r=new Map,a={platform:QK,...n},i={...a.platform,_c:r};return yK(e,t,{...a,platform:i})};var oq=typeof document<"u",cq=function(){},fp=oq?_.useLayoutEffect:cq;function l0(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!l0(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!l0(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function DM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function D9(e,t){const n=DM(e);return Math.round(t*n)/n}function rg(e){const t=_.useRef(e);return fp(()=>{t.current=e}),t}function dq(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:d,open:u}=e,[o,f]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,U]=_.useState(r);l0(m,r)||U(r);const[g,v]=_.useState(null),[y,w]=_.useState(null),E=_.useCallback(q=>{q!==T.current&&(T.current=q,v(q))},[]),S=_.useCallback(q=>{q!==M.current&&(M.current=q,w(q))},[]),k=i||g,I=l||y,T=_.useRef(null),M=_.useRef(null),j=_.useRef(o),D=d!=null,P=rg(d),N=rg(a),$=rg(u),z=_.useCallback(()=>{if(!T.current||!M.current)return;const q={placement:t,strategy:n,middleware:m};N.current&&(q.platform=N.current),sq(T.current,M.current,q).then(V=>{const ee={...V,isPositioned:$.current!==!1};Z.current&&!l0(j.current,ee)&&(j.current=ee,$n.flushSync(()=>{f(ee)}))})},[m,t,n,N,$]);fp(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[u]);const Z=_.useRef(!1);fp(()=>(Z.current=!0,()=>{Z.current=!1}),[]),fp(()=>{if(k&&(T.current=k),I&&(M.current=I),k&&I){if(P.current)return P.current(k,I,z);z()}},[k,I,z,P,D]);const K=_.useMemo(()=>({reference:T,floating:M,setReference:E,setFloating:S}),[E,S]),Q=_.useMemo(()=>({reference:k,floating:I}),[k,I]),W=_.useMemo(()=>{const q={position:n,left:0,top:0};if(!Q.floating)return q;const V=D9(Q.floating,o.x),ee=D9(Q.floating,o.y);return s?{...q,transform:"translate("+V+"px, "+ee+"px)",...DM(Q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:ee}},[n,s,Q.floating,o.x,o.y]);return _.useMemo(()=>({...o,update:z,refs:K,elements:Q,floatingStyles:W}),[o,z,K,Q,W])}const uq=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?L9({element:r.current,padding:a}).fn(n):{}:r?L9({element:r,padding:a}).fn(n):{}}}},fq=(e,t)=>({...tq(e),options:[e,t]}),hq=(e,t)=>({...nq(e),options:[e,t]}),pq=(e,t)=>({...lq(e),options:[e,t]}),mq=(e,t)=>({...rq(e),options:[e,t]}),Uq=(e,t)=>({...aq(e),options:[e,t]}),gq=(e,t)=>({...iq(e),options:[e,t]}),bq=(e,t)=>({...uq(e),options:[e,t]});var vq="Arrow",PM=_.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return p.jsx(vl.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});PM.displayName=vq;var yq=PM;function xq(e){const[t,n]=_.useState(void 0);return To(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,s;if("borderBoxSize"in i){const d=i.borderBoxSize,u=Array.isArray(d)?d[0]:d;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var R8="Popper",[NM,OM]=vM(R8),[wq,$M]=NM(R8),zM=e=>{const{__scopePopper:t,children:n}=e,[r,a]=_.useState(null);return p.jsx(wq,{scope:t,anchor:r,onAnchorChange:a,children:n})};zM.displayName=R8;var FM="PopperAnchor",BM=_.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=$M(FM,n),l=_.useRef(null),s=ks(t,l);return _.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:p.jsx(vl.div,{...a,ref:s})});BM.displayName=FM;var j8="PopperContent",[Eq,Sq]=NM(j8),HM=_.forwardRef((e,t)=>{var re,te,de,me,fe,Ue;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:o=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:U="optimized",onPlaced:g,...v}=e,y=$M(j8,n),[w,E]=_.useState(null),S=ks(t,Te=>E(Te)),[k,I]=_.useState(null),T=xq(k),M=(T==null?void 0:T.width)??0,j=(T==null?void 0:T.height)??0,D=r+(i!=="center"?"-"+i:""),P=typeof o=="number"?o:{top:0,right:0,bottom:0,left:0,...o},N=Array.isArray(u)?u:[u],$=N.length>0,z={padding:P,boundary:N.filter(Cq),altBoundary:$},{refs:Z,floatingStyles:K,placement:Q,isPositioned:W,middlewareData:q}=dq({strategy:"fixed",placement:D,whileElementsMounted:(...Te)=>eq(...Te,{animationFrame:U==="always"}),elements:{reference:y.anchor},middleware:[fq({mainAxis:a+j,alignmentAxis:l}),d&&hq({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?pq():void 0,...z}),d&&mq({...z}),Uq({...z,apply:({elements:Te,rects:it,availableWidth:mt,availableHeight:Be})=>{const{width:Mt,height:on}=it.reference,ze=Te.floating.style;ze.setProperty("--radix-popper-available-width",`${mt}px`),ze.setProperty("--radix-popper-available-height",`${Be}px`),ze.setProperty("--radix-popper-anchor-width",`${Mt}px`),ze.setProperty("--radix-popper-anchor-height",`${on}px`)}}),k&&bq({element:k,padding:s}),Mq({arrowWidth:M,arrowHeight:j}),m&&gq({strategy:"referenceHidden",...z})]}),[V,ee]=VM(Q),X=vs(g);To(()=>{W&&(X==null||X())},[W,X]);const se=(re=q.arrow)==null?void 0:re.x,ge=(te=q.arrow)==null?void 0:te.y,_e=((de=q.arrow)==null?void 0:de.centerOffset)!==0,[Y,H]=_.useState();return To(()=>{w&&H(window.getComputedStyle(w).zIndex)},[w]),p.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:W?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(me=q.transformOrigin)==null?void 0:me.x,(fe=q.transformOrigin)==null?void 0:fe.y].join(" "),...((Ue=q.hide)==null?void 0:Ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Eq,{scope:n,placedSide:V,onArrowChange:I,arrowX:se,arrowY:ge,shouldHideArrow:_e,children:p.jsx(vl.div,{"data-side":V,"data-align":ee,...v,ref:S,style:{...v.style,animation:W?void 0:"none"}})})})});HM.displayName=j8;var WM="PopperArrow",kq={top:"bottom",right:"left",bottom:"top",left:"right"},XM=_.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=Sq(WM,r),l=kq[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(yq,{...a,ref:n,style:{...a.style,display:"block"}})})});XM.displayName=WM;function Cq(e){return e!==null}var Mq=e=>({name:"transformOrigin",options:e,fn(t){var y,w,E;const{placement:n,rects:r,middlewareData:a}=t,l=((y=a.arrow)==null?void 0:y.centerOffset)!==0,s=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[u,o]=VM(n),f={start:"0%",center:"50%",end:"100%"}[o],m=(((w=a.arrow)==null?void 0:w.x)??0)+s/2,U=(((E=a.arrow)==null?void 0:E.y)??0)+d/2;let g="",v="";return u==="bottom"?(g=l?f:`${m}px`,v=`${-d}px`):u==="top"?(g=l?f:`${m}px`,v=`${r.floating.height+d}px`):u==="right"?(g=`${-d}px`,v=l?f:`${U}px`):u==="left"&&(g=`${r.floating.width+d}px`,v=l?f:`${U}px`),{data:{x:g,y:v}}}});function VM(e){const[t,n="center"]=e.split("-");return[t,n]}var Iq=zM,GM=BM,_q=HM,Tq=XM,Aq="Portal",YM=_.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[a,i]=_.useState(!1);To(()=>i(!0),[]);const l=n||a&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?PZ.createPortal(p.jsx(vl.div,{...r,ref:t}),l):null});YM.displayName=Aq;function Rq(e,t){return _.useReducer((n,r)=>t[n][r]??n,e)}var L8=e=>{const{present:t,children:n}=e,r=jq(t),a=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=ks(r.ref,Lq(a));return typeof n=="function"||r.isPresent?_.cloneElement(a,{ref:i}):null};L8.displayName="Presence";function jq(e){const[t,n]=_.useState(),r=_.useRef({}),a=_.useRef(e),i=_.useRef("none"),l=e?"mounted":"unmounted",[s,d]=Rq(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=T1(r.current);i.current=s==="mounted"?u:"none"},[s]),To(()=>{const u=r.current,o=a.current;if(o!==e){const m=i.current,U=T1(u);e?d("MOUNT"):U==="none"||(u==null?void 0:u.display)==="none"?d("UNMOUNT"):d(o&&m!==U?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),To(()=>{if(t){let u;const o=t.ownerDocument.defaultView??window,f=U=>{const v=T1(r.current).includes(U.animationName);if(U.target===t&&v&&(d("ANIMATION_END"),!a.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=o.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=U=>{U.target===t&&(i.current=T1(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{o.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function T1(e){return(e==null?void 0:e.animationName)||"none"}function Lq(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Dq({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=Pq({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,s=vs(n),d=_.useCallback(u=>{if(i){const f=typeof u=="function"?u(e):u;f!==e&&s(f)}else a(u)},[i,e,a,s]);return[l,d]}function Pq({defaultProp:e,onChange:t}){const n=_.useState(e),[r]=n,a=_.useRef(r),i=vs(t);return _.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),n}var Nq=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Uc=new WeakMap,A1=new WeakMap,R1={},ag=0,ZM=function(e){return e&&(e.host||ZM(e.parentNode))},Oq=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ZM(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},$q=function(e,t,n,r){var a=Oq(t,Array.isArray(e)?e:[e]);R1[n]||(R1[n]=new WeakMap);var i=R1[n],l=[],s=new Set,d=new Set(a),u=function(f){!f||s.has(f)||(s.add(f),u(f.parentNode))};a.forEach(u);var o=function(f){!f||d.has(f)||Array.prototype.forEach.call(f.children,function(m){if(s.has(m))o(m);else try{var U=m.getAttribute(r),g=U!==null&&U!=="false",v=(Uc.get(m)||0)+1,y=(i.get(m)||0)+1;Uc.set(m,v),i.set(m,y),l.push(m),v===1&&g&&A1.set(m,!0),y===1&&m.setAttribute(n,"true"),g||m.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",m,w)}})};return o(t),s.clear(),ag++,function(){l.forEach(function(f){var m=Uc.get(f)-1,U=i.get(f)-1;Uc.set(f,m),i.set(f,U),m||(A1.has(f)||f.removeAttribute(r),A1.delete(f)),U||f.removeAttribute(n)}),ag--,ag||(Uc=new WeakMap,Uc=new WeakMap,A1=new WeakMap,R1={})}},zq=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Nq(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),$q(r,a,n,"aria-hidden")):function(){return null}},Ui=function(){return Ui=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ui.apply(this,arguments)};function KM(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function Fq(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var hp="right-scroll-bar-position",pp="width-before-scroll-bar",Bq="with-scroll-bars-hidden",Hq="--removed-body-scroll-bar-size";function ig(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Wq(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var Xq=typeof window<"u"?_.useLayoutEffect:_.useEffect,P9=new WeakMap;function Vq(e,t){var n=Wq(null,function(r){return e.forEach(function(a){return ig(a,r)})});return Xq(function(){var r=P9.get(n);if(r){var a=new Set(r),i=new Set(e),l=n.current;a.forEach(function(s){i.has(s)||ig(s,null)}),i.forEach(function(s){a.has(s)||ig(s,l)})}P9.set(n,e)},[e]),n}function Gq(e){return e}function Yq(e,t){t===void 0&&(t=Gq);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var l=t(i,r);return n.push(l),function(){n=n.filter(function(s){return s!==l})}},assignSyncMedium:function(i){for(r=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var l=[];if(n.length){var s=n;n=[],s.forEach(i),l=n}var d=function(){var o=l;l=[],o.forEach(i)},u=function(){return Promise.resolve().then(d)};u(),n={push:function(o){l.push(o),u()},filter:function(o){return l=l.filter(o),n}}}};return a}function Zq(e){e===void 0&&(e={});var t=Yq(null);return t.options=Ui({async:!0,ssr:!1},e),t}var qM=function(e){var t=e.sideCar,n=KM(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return _.createElement(r,Ui({},n))};qM.isSideCarExport=!0;function Kq(e,t){return e.useMedium(t),qM}var QM=Zq(),lg=function(){},q0=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:lg,onWheelCapture:lg,onTouchMoveCapture:lg}),a=r[0],i=r[1],l=e.forwardProps,s=e.children,d=e.className,u=e.removeScrollBar,o=e.enabled,f=e.shards,m=e.sideCar,U=e.noRelative,g=e.noIsolation,v=e.inert,y=e.allowPinchZoom,w=e.as,E=w===void 0?"div":w,S=e.gapMode,k=KM(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=m,T=Vq([n,t]),M=Ui(Ui({},k),a);return _.createElement(_.Fragment,null,o&&_.createElement(I,{sideCar:QM,removeScrollBar:u,shards:f,noRelative:U,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:S}),l?_.cloneElement(_.Children.only(s),Ui(Ui({},M),{ref:T})):_.createElement(E,Ui({},M,{className:d,ref:T}),s))});q0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};q0.classNames={fullWidth:pp,zeroRight:hp};var qq=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Qq(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=qq();return t&&e.setAttribute("nonce",t),e}function Jq(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eQ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tQ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Qq())&&(Jq(t,n),eQ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nQ=function(){var e=tQ();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},JM=function(){var e=nQ(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},rQ={left:0,top:0,right:0,gap:0},sg=function(e){return parseInt(e||"",10)||0},aQ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[sg(n),sg(r),sg(a)]},iQ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rQ;var t=aQ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},lQ=JM(),$c="data-scroll-locked",sQ=function(e,t,n,r){var a=e.left,i=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
92
|
+
.`.concat(Bq,` {
|
|
93
|
+
overflow: hidden `).concat(r,`;
|
|
94
|
+
padding-right: `).concat(s,"px ").concat(r,`;
|
|
95
|
+
}
|
|
96
|
+
body[`).concat($c,`] {
|
|
97
|
+
overflow: hidden `).concat(r,`;
|
|
98
|
+
overscroll-behavior: contain;
|
|
99
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
100
|
+
padding-left: `.concat(a,`px;
|
|
101
|
+
padding-top: `).concat(i,`px;
|
|
102
|
+
padding-right: `).concat(l,`px;
|
|
103
|
+
margin-left:0;
|
|
104
|
+
margin-top:0;
|
|
105
|
+
margin-right: `).concat(s,"px ").concat(r,`;
|
|
106
|
+
`),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.`).concat(hp,` {
|
|
110
|
+
right: `).concat(s,"px ").concat(r,`;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.`).concat(pp,` {
|
|
114
|
+
margin-right: `).concat(s,"px ").concat(r,`;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.`).concat(hp," .").concat(hp,` {
|
|
118
|
+
right: 0 `).concat(r,`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.`).concat(pp," .").concat(pp,` {
|
|
122
|
+
margin-right: 0 `).concat(r,`;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
body[`).concat($c,`] {
|
|
126
|
+
`).concat(Hq,": ").concat(s,`px;
|
|
127
|
+
}
|
|
128
|
+
`)},N9=function(){var e=parseInt(document.body.getAttribute($c)||"0",10);return isFinite(e)?e:0},oQ=function(){_.useEffect(function(){return document.body.setAttribute($c,(N9()+1).toString()),function(){var e=N9()-1;e<=0?document.body.removeAttribute($c):document.body.setAttribute($c,e.toString())}},[])},cQ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;oQ();var i=_.useMemo(function(){return iQ(a)},[a]);return _.createElement(lQ,{styles:sQ(i,!t,a,n?"":"!important")})},j6=!1;if(typeof window<"u")try{var j1=Object.defineProperty({},"passive",{get:function(){return j6=!0,!0}});window.addEventListener("test",j1,j1),window.removeEventListener("test",j1,j1)}catch{j6=!1}var gc=j6?{passive:!1}:!1,dQ=function(e){return e.tagName==="TEXTAREA"},eI=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dQ(e)&&n[t]==="visible")},uQ=function(e){return eI(e,"overflowY")},fQ=function(e){return eI(e,"overflowX")},O9=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=tI(e,r);if(a){var i=nI(e,r),l=i[1],s=i[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hQ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},pQ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},tI=function(e,t){return e==="v"?uQ(t):fQ(t)},nI=function(e,t){return e==="v"?hQ(t):pQ(t)},mQ=function(e,t){return e==="h"&&t==="rtl"?-1:1},UQ=function(e,t,n,r,a){var i=mQ(e,window.getComputedStyle(t).direction),l=i*r,s=n.target,d=t.contains(s),u=!1,o=l>0,f=0,m=0;do{if(!s)break;var U=nI(e,s),g=U[0],v=U[1],y=U[2],w=v-y-i*g;(g||w)&&tI(e,s)&&(f+=w,m+=g);var E=s.parentNode;s=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!d&&s!==document.body||d&&(t.contains(s)||t===s));return(o&&Math.abs(f)<1||!o&&Math.abs(m)<1)&&(u=!0),u},L1=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$9=function(e){return[e.deltaX,e.deltaY]},z9=function(e){return e&&"current"in e?e.current:e},gQ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bQ=function(e){return`
|
|
129
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
130
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
131
|
+
`)},vQ=0,bc=[];function yQ(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),a=_.useState(vQ++)[0],i=_.useState(JM)[0],l=_.useRef(e);_.useEffect(function(){l.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=Fq([e.lockRef.current],(e.shards||[]).map(z9),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var s=_.useCallback(function(v,y){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var w=L1(v),E=n.current,S="deltaX"in v?v.deltaX:E[0]-w[0],k="deltaY"in v?v.deltaY:E[1]-w[1],I,T=v.target,M=Math.abs(S)>Math.abs(k)?"h":"v";if("touches"in v&&M==="h"&&T.type==="range")return!1;var j=window.getSelection(),D=j&&j.anchorNode,P=D?D===T||D.contains(T):!1;if(P)return!1;var N=O9(M,T);if(!N)return!0;if(N?I=M:(I=M==="v"?"h":"v",N=O9(M,T)),!N)return!1;if(!r.current&&"changedTouches"in v&&(S||k)&&(r.current=I),!I)return!0;var $=r.current||I;return UQ($,y,v,$==="h"?S:k)},[]),d=_.useCallback(function(v){var y=v;if(!(!bc.length||bc[bc.length-1]!==i)){var w="deltaY"in y?$9(y):L1(y),E=t.current.filter(function(I){return I.name===y.type&&(I.target===y.target||y.target===I.shadowParent)&&gQ(I.delta,w)})[0];if(E&&E.should){y.cancelable&&y.preventDefault();return}if(!E){var S=(l.current.shards||[]).map(z9).filter(Boolean).filter(function(I){return I.contains(y.target)}),k=S.length>0?s(y,S[0]):!l.current.noIsolation;k&&y.cancelable&&y.preventDefault()}}},[]),u=_.useCallback(function(v,y,w,E){var S={name:v,delta:y,target:w,should:E,shadowParent:xQ(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(k){return k!==S})},1)},[]),o=_.useCallback(function(v){n.current=L1(v),r.current=void 0},[]),f=_.useCallback(function(v){u(v.type,$9(v),v.target,s(v,e.lockRef.current))},[]),m=_.useCallback(function(v){u(v.type,L1(v),v.target,s(v,e.lockRef.current))},[]);_.useEffect(function(){return bc.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",d,gc),document.addEventListener("touchmove",d,gc),document.addEventListener("touchstart",o,gc),function(){bc=bc.filter(function(v){return v!==i}),document.removeEventListener("wheel",d,gc),document.removeEventListener("touchmove",d,gc),document.removeEventListener("touchstart",o,gc)}},[]);var U=e.removeScrollBar,g=e.inert;return _.createElement(_.Fragment,null,g?_.createElement(i,{styles:bQ(a)}):null,U?_.createElement(cQ,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xQ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wQ=Kq(QM,yQ);var rI=_.forwardRef(function(e,t){return _.createElement(q0,Ui({},e,{ref:t,sideCar:wQ}))});rI.classNames=q0.classNames;var D8="Popover",[aI]=vM(D8,[OM]),Zf=OM(),[EQ,Cs]=aI(D8),iI=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,s=Zf(t),d=_.useRef(null),[u,o]=_.useState(!1),[f=!1,m]=Dq({prop:r,defaultProp:a,onChange:i});return p.jsx(Iq,{...s,children:p.jsx(EQ,{scope:t,contentId:oK(),triggerRef:d,open:f,onOpenChange:m,onOpenToggle:_.useCallback(()=>m(U=>!U),[m]),hasCustomAnchor:u,onCustomAnchorAdd:_.useCallback(()=>o(!0),[]),onCustomAnchorRemove:_.useCallback(()=>o(!1),[]),modal:l,children:n})})};iI.displayName=D8;var lI="PopoverAnchor",SQ=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Cs(lI,n),i=Zf(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:s}=a;return _.useEffect(()=>(l(),()=>s()),[l,s]),p.jsx(GM,{...i,...r,ref:t})});SQ.displayName=lI;var sI="PopoverTrigger",oI=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Cs(sI,n),i=Zf(n),l=ks(t,a.triggerRef),s=p.jsx(vl.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":pI(a.open),...r,ref:l,onClick:ps(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?s:p.jsx(GM,{asChild:!0,...i,children:s})});oI.displayName=sI;var P8="PopoverPortal",[kQ,CQ]=aI(P8,{forceMount:void 0}),cI=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Cs(P8,t);return p.jsx(kQ,{scope:t,forceMount:n,children:p.jsx(L8,{present:n||i.open,children:p.jsx(YM,{asChild:!0,container:a,children:r})})})};cI.displayName=P8;var ld="PopoverContent",dI=_.forwardRef((e,t)=>{const n=CQ(ld,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Cs(ld,e.__scopePopover);return p.jsx(L8,{present:r||i.open,children:i.modal?p.jsx(MQ,{...a,ref:t}):p.jsx(IQ,{...a,ref:t})})});dI.displayName=ld;var MQ=_.forwardRef((e,t)=>{const n=Cs(ld,e.__scopePopover),r=_.useRef(null),a=ks(t,r),i=_.useRef(!1);return _.useEffect(()=>{const l=r.current;if(l)return zq(l)},[]),p.jsx(rI,{as:k8,allowPinchZoom:!0,children:p.jsx(uI,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ps(e.onCloseAutoFocus,l=>{var s;l.preventDefault(),i.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:ps(e.onPointerDownOutside,l=>{const s=l.detail.originalEvent,d=s.button===0&&s.ctrlKey===!0,u=s.button===2||d;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ps(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),IQ=_.forwardRef((e,t)=>{const n=Cs(ld,e.__scopePopover),r=_.useRef(!1),a=_.useRef(!1);return p.jsx(uI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),uI=_.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:s,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:o,...f}=e,m=Cs(ld,n),U=Zf(n);return QZ(),p.jsx(EM,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:p.jsx(xM,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:o,onEscapeKeyDown:s,onPointerDownOutside:d,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:p.jsx(_q,{"data-state":pI(m.open),role:"dialog",id:m.contentId,...U,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),fI="PopoverClose",_Q=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Cs(fI,n);return p.jsx(vl.button,{type:"button",...r,ref:t,onClick:ps(e.onClick,()=>a.onOpenChange(!1))})});_Q.displayName=fI;var TQ="PopoverArrow",hI=_.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Zf(n);return p.jsx(Tq,{...a,...r,ref:t})});hI.displayName=TQ;function pI(e){return e?"open":"closed"}var Q0=iI,J0=oI,AQ=cI,N8=dI,mI=hI,og={exports:{}},F9;function RQ(){return F9||(F9=1,(function(e,t){(function(){var n={};e.exports=n,n.simpleFilter=function(r,a){return a.filter(function(i){return n.test(r,i)})},n.test=function(r,a){return n.match(r,a)!==null},n.match=function(r,a,i){i=i||{};var l=0,s=[],d=a.length,u=0,o=0,f=i.pre||"",m=i.post||"",U=i.caseSensitive&&a||a.toLowerCase(),g;r=i.caseSensitive&&r||r.toLowerCase();for(var v=0;v<d;v++)g=a[v],U[v]===r[l]?(g=f+g+m,l+=1,o+=1+o):o=0,u+=o,s[s.length]=g;return l===r.length?(u=U===r?1/0:u,{rendered:s.join(""),score:u}):null},n.filter=function(r,a,i){return!a||a.length===0?[]:typeof r!="string"?a:(i=i||{},a.reduce(function(l,s,d,u){var o=s;i.extract&&(o=i.extract(s));var f=n.match(r,o,i);return f!=null&&(l[l.length]={string:f.rendered,score:f.score,index:d,original:s}),l},[]).sort(function(l,s){var d=s.score-l.score;return d||l.index-s.index}))}})()})(og)),og.exports}var jQ=RQ();const LQ=_i(jQ),DQ={},B9=e=>{let t;const n=new Set,r=(o,f)=>{const m=typeof o=="function"?o(t):o;if(!Object.is(m,t)){const U=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(g=>g(t,U))}},a=()=>t,d={setState:r,getState:a,getInitialState:()=>u,subscribe:o=>(n.add(o),()=>n.delete(o)),destroy:()=>{(DQ?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,a,d);return d},PQ=e=>e?B9(e):B9;var cg={exports:{}},dg={},ug={exports:{}},fg={};/**
|
|
132
|
+
* @license React
|
|
133
|
+
* use-sync-external-store-shim.production.js
|
|
134
|
+
*
|
|
135
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the MIT license found in the
|
|
138
|
+
* LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/var H9;function NQ(){if(H9)return fg;H9=1;var e=If();function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function s(f,m){var U=m(),g=r({inst:{value:U,getSnapshot:m}}),v=g[0].inst,y=g[1];return i(function(){v.value=U,v.getSnapshot=m,d(v)&&y({inst:v})},[f,U,m]),a(function(){return d(v)&&y({inst:v}),f(function(){d(v)&&y({inst:v})})},[f]),l(U),U}function d(f){var m=f.getSnapshot;f=f.value;try{var U=m();return!n(f,U)}catch{return!0}}function u(f,m){return m()}var o=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return fg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:o,fg}var W9;function OQ(){return W9||(W9=1,ug.exports=NQ()),ug.exports}/**
|
|
140
|
+
* @license React
|
|
141
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
142
|
+
*
|
|
143
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the MIT license found in the
|
|
146
|
+
* LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/var X9;function $Q(){if(X9)return dg;X9=1;var e=If(),t=OQ();function n(u,o){return u===o&&(u!==0||1/u===1/o)||u!==u&&o!==o}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,s=e.useMemo,d=e.useDebugValue;return dg.useSyncExternalStoreWithSelector=function(u,o,f,m,U){var g=i(null);if(g.current===null){var v={hasValue:!1,value:null};g.current=v}else v=g.current;g=s(function(){function w(T){if(!E){if(E=!0,S=T,T=m(T),U!==void 0&&v.hasValue){var M=v.value;if(U(M,T))return k=M}return k=T}if(M=k,r(S,T))return M;var j=m(T);return U!==void 0&&U(M,j)?(S=T,M):(S=T,k=j)}var E=!1,S,k,I=f===void 0?null:f;return[function(){return w(o())},I===null?void 0:function(){return w(I())}]},[o,f,m,U]);var y=a(u,g[0],g[1]);return l(function(){v.hasValue=!0,v.value=y},[y]),d(y),y},dg}var V9;function zQ(){return V9||(V9=1,cg.exports=$Q()),cg.exports}var FQ=zQ();const BQ=_i(FQ),UI={},{useDebugValue:HQ}=we,{useSyncExternalStoreWithSelector:WQ}=BQ;let G9=!1;const XQ=e=>e;function VQ(e,t=XQ,n){(UI?"production":void 0)!=="production"&&n&&!G9&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),G9=!0);const r=WQ(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return HQ(r),r}const Y9=e=>{(UI?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?PQ(e):e,n=(r,a)=>VQ(t,r,a);return Object.assign(n,t),n},GQ=e=>e?Y9(e):Y9;var Z9,K9;const q9=typeof window<"u"&&((Z9=window.document)!=null&&Z9.createElement||((K9=window.navigator)==null?void 0:K9.product)==="ReactNative")?we.useLayoutEffect:we.useEffect;function li(){const e=GQ(t=>({current:new Array,version:0,set:t}));return{In:({children:t})=>{const n=e(a=>a.set),r=e(a=>a.version);return q9(()=>{n(a=>({version:a.version+1}))},[]),q9(()=>(n(({current:a})=>({current:[...a,t]})),()=>n(({current:a})=>({current:a.filter(i=>i!==t)}))),[t,r]),null},Out:()=>{const t=e(n=>n.current);return we.createElement(we.Fragment,null,t)}}}function An(){return An=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},An.apply(null,arguments)}function hg(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function YQ(e,t=[]){let n=[];function r(i,l){const s=_.createContext(l),d=n.length;n=[...n,l];function u(f){const{scope:m,children:U,...g}=f,v=(m==null?void 0:m[e][d])||s,y=_.useMemo(()=>g,Object.values(g));return _.createElement(v.Provider,{value:y},U)}function o(f,m){const U=(m==null?void 0:m[e][d])||s,g=_.useContext(U);if(g)return g;if(l!==void 0)return l;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,o]}const a=()=>{const i=n.map(l=>_.createContext(l));return function(s){const d=(s==null?void 0:s[e])||i;return _.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return a.scopeName=e,[r,ZQ(a,...t)]}function ZQ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((s,{useScope:d,scopeName:u})=>{const f=d(i)[`__scope${u}`];return{...s,...f}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function zc(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function KQ(e,t=[]){let n=[];function r(i,l){const s=_.createContext(l),d=n.length;n=[...n,l];function u(f){const{scope:m,children:U,...g}=f,v=(m==null?void 0:m[e][d])||s,y=_.useMemo(()=>g,Object.values(g));return _.createElement(v.Provider,{value:y},U)}function o(f,m){const U=(m==null?void 0:m[e][d])||s,g=_.useContext(U);if(g)return g;if(l!==void 0)return l;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,o]}const a=()=>{const i=n.map(l=>_.createContext(l));return function(s){const d=(s==null?void 0:s[e])||i;return _.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return a.scopeName=e,[r,qQ(a,...t)]}function qQ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((s,{useScope:d,scopeName:u})=>{const f=d(i)[`__scope${u}`];return{...s,...f}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function QQ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function gI(...e){return t=>e.forEach(n=>QQ(n,t))}function Q9(...e){return _.useCallback(gI(...e),e)}const L6=_.forwardRef((e,t)=>{const{children:n,...r}=e,a=_.Children.toArray(n),i=a.find(eJ);if(i){const l=i.props.children,s=a.map(d=>d===i?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:d);return _.createElement(D6,An({},r,{ref:t}),_.isValidElement(l)?_.cloneElement(l,void 0,s):null)}return _.createElement(D6,An({},r,{ref:t}),n)});L6.displayName="Slot";const D6=_.forwardRef((e,t)=>{const{children:n,...r}=e;return _.isValidElement(n)?_.cloneElement(n,{...tJ(r,n.props),ref:gI(t,n.ref)}):_.Children.count(n)>1?_.Children.only(null):null});D6.displayName="SlotClone";const JQ=({children:e})=>_.createElement(_.Fragment,null,e);function eJ(e){return _.isValidElement(e)&&e.type===JQ}function tJ(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...s)=>{i(...s),a(...s)}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function nJ(e){const t=e+"CollectionProvider",[n,r]=KQ(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=U=>{const{scope:g,children:v}=U,y=we.useRef(null),w=we.useRef(new Map).current;return we.createElement(a,{scope:g,itemMap:w,collectionRef:y},v)},s=e+"CollectionSlot",d=we.forwardRef((U,g)=>{const{scope:v,children:y}=U,w=i(s,v),E=Q9(g,w.collectionRef);return we.createElement(L6,{ref:E},y)}),u=e+"CollectionItemSlot",o="data-radix-collection-item",f=we.forwardRef((U,g)=>{const{scope:v,children:y,...w}=U,E=we.useRef(null),S=Q9(g,E),k=i(u,v);return we.useEffect(()=>(k.itemMap.set(E,{ref:E,...w}),()=>void k.itemMap.delete(E))),we.createElement(L6,{[o]:"",ref:S},y)});function m(U){const g=i(e+"CollectionConsumer",U);return we.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${o}]`));return Array.from(g.itemMap.values()).sort((k,I)=>w.indexOf(k.ref.current)-w.indexOf(I.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:l,Slot:d,ItemSlot:f},m,r]}function rJ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function bI(...e){return t=>e.forEach(n=>rJ(n,t))}function aJ(...e){return _.useCallback(bI(...e),e)}function iJ(e,t=[]){let n=[];function r(i,l){const s=_.createContext(l),d=n.length;n=[...n,l];function u(f){const{scope:m,children:U,...g}=f,v=(m==null?void 0:m[e][d])||s,y=_.useMemo(()=>g,Object.values(g));return _.createElement(v.Provider,{value:y},U)}function o(f,m){const U=(m==null?void 0:m[e][d])||s,g=_.useContext(U);if(g)return g;if(l!==void 0)return l;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,o]}const a=()=>{const i=n.map(l=>_.createContext(l));return function(s){const d=(s==null?void 0:s[e])||i;return _.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return a.scopeName=e,[r,lJ(a,...t)]}function lJ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=r.reduce((s,{useScope:d,scopeName:u})=>{const f=d(i)[`__scope${u}`];return{...s,...f}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}const sJ=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},oJ=r5.useId||(()=>{});let cJ=0;function dJ(e){const[t,n]=_.useState(oJ());return sJ(()=>{n(r=>r??String(cJ++))},[e]),t?`radix-${t}`:""}const vI=_.forwardRef((e,t)=>{const{children:n,...r}=e,a=_.Children.toArray(n),i=a.find(fJ);if(i){const l=i.props.children,s=a.map(d=>d===i?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:d);return _.createElement(P6,An({},r,{ref:t}),_.isValidElement(l)?_.cloneElement(l,void 0,s):null)}return _.createElement(P6,An({},r,{ref:t}),n)});vI.displayName="Slot";const P6=_.forwardRef((e,t)=>{const{children:n,...r}=e;return _.isValidElement(n)?_.cloneElement(n,{...hJ(r,n.props),ref:bI(t,n.ref)}):_.Children.count(n)>1?_.Children.only(null):null});P6.displayName="SlotClone";const uJ=({children:e})=>_.createElement(_.Fragment,null,e);function fJ(e){return _.isValidElement(e)&&e.type===uJ}function hJ(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...s)=>{i(...s),a(...s)}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}const pJ=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],yI=pJ.reduce((e,t)=>{const n=_.forwardRef((r,a)=>{const{asChild:i,...l}=r,s=i?vI:t;return _.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),_.createElement(s,An({},l,{ref:a}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function O8(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function mJ({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=UJ({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,s=O8(n),d=_.useCallback(u=>{if(i){const f=typeof u=="function"?u(e):u;f!==e&&s(f)}else a(u)},[i,e,a,s]);return[l,d]}function UJ({defaultProp:e,onChange:t}){const n=_.useState(e),[r]=n,a=_.useRef(r),i=O8(t);return _.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),n}const gJ=_.createContext(void 0);function xI(e){const t=_.useContext(gJ);return e||t||"ltr"}const pg="rovingFocusGroup.onEntryFocus",bJ={bubbles:!1,cancelable:!0},$8="RovingFocusGroup",[N6,wI,vJ]=nJ($8),[yJ,EI]=iJ($8,[vJ]),[xJ,wJ]=yJ($8),EJ=_.forwardRef((e,t)=>_.createElement(N6.Provider,{scope:e.__scopeRovingFocusGroup},_.createElement(N6.Slot,{scope:e.__scopeRovingFocusGroup},_.createElement(SJ,An({},e,{ref:t}))))),SJ=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:d,onEntryFocus:u,...o}=e,f=_.useRef(null),m=aJ(t,f),U=xI(i),[g=null,v]=mJ({prop:l,defaultProp:s,onChange:d}),[y,w]=_.useState(!1),E=O8(u),S=wI(n),k=_.useRef(!1),[I,T]=_.useState(0);return _.useEffect(()=>{const M=f.current;if(M)return M.addEventListener(pg,E),()=>M.removeEventListener(pg,E)},[E]),_.createElement(xJ,{scope:n,orientation:r,dir:U,loop:a,currentTabStopId:g,onItemFocus:_.useCallback(M=>v(M),[v]),onItemShiftTab:_.useCallback(()=>w(!0),[]),onFocusableItemAdd:_.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:_.useCallback(()=>T(M=>M-1),[])},_.createElement(yI.div,An({tabIndex:y||I===0?-1:0,"data-orientation":r},o,{ref:m,style:{outline:"none",...e.style},onMouseDown:zc(e.onMouseDown,()=>{k.current=!0}),onFocus:zc(e.onFocus,M=>{const j=!k.current;if(M.target===M.currentTarget&&j&&!y){const D=new CustomEvent(pg,bJ);if(M.currentTarget.dispatchEvent(D),!D.defaultPrevented){const P=S().filter(K=>K.focusable),N=P.find(K=>K.active),$=P.find(K=>K.id===g),Z=[N,$,...P].filter(Boolean).map(K=>K.ref.current);SI(Z)}}k.current=!1}),onBlur:zc(e.onBlur,()=>w(!1))})))}),kJ="RovingFocusGroupItem",CJ=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,...l}=e,s=dJ(),d=i||s,u=wJ(kJ,n),o=u.currentTabStopId===d,f=wI(n),{onFocusableItemAdd:m,onFocusableItemRemove:U}=u;return _.useEffect(()=>{if(r)return m(),()=>U()},[r,m,U]),_.createElement(N6.ItemSlot,{scope:n,id:d,focusable:r,active:a},_.createElement(yI.span,An({tabIndex:o?0:-1,"data-orientation":u.orientation},l,{ref:t,onMouseDown:zc(e.onMouseDown,g=>{r?u.onItemFocus(d):g.preventDefault()}),onFocus:zc(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:zc(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const v=_J(g,u.orientation,u.dir);if(v!==void 0){g.preventDefault();let w=f().filter(E=>E.focusable).map(E=>E.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const E=w.indexOf(g.currentTarget);w=u.loop?TJ(w,E+1):w.slice(E+1)}setTimeout(()=>SI(w))}})})))}),MJ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function IJ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _J(e,t,n){const r=IJ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return MJ[r]}function SI(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function TJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const AJ=EJ,RJ=CJ;function jJ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function LJ(...e){return t=>e.forEach(n=>jJ(n,t))}function DJ(...e){return _.useCallback(LJ(...e),e)}const J9=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{};function PJ(e,t){return _.useReducer((n,r)=>{const a=t[n][r];return a??n},e)}const kI=e=>{const{present:t,children:n}=e,r=NJ(t),a=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=DJ(r.ref,a.ref);return typeof n=="function"||r.isPresent?_.cloneElement(a,{ref:i}):null};kI.displayName="Presence";function NJ(e){const[t,n]=_.useState(),r=_.useRef({}),a=_.useRef(e),i=_.useRef("none"),l=e?"mounted":"unmounted",[s,d]=PJ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=D1(r.current);i.current=s==="mounted"?u:"none"},[s]),J9(()=>{const u=r.current,o=a.current;if(o!==e){const m=i.current,U=D1(u);e?d("MOUNT"):U==="none"||(u==null?void 0:u.display)==="none"?d("UNMOUNT"):d(o&&m!==U?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),J9(()=>{if(t){const u=f=>{const U=D1(r.current).includes(f.animationName);f.target===t&&U&&$n.flushSync(()=>d("ANIMATION_END"))},o=f=>{f.target===t&&(i.current=D1(r.current))};return t.addEventListener("animationstart",o),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",o),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function D1(e){return(e==null?void 0:e.animationName)||"none"}function OJ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function $J(...e){return t=>e.forEach(n=>OJ(n,t))}const CI=_.forwardRef((e,t)=>{const{children:n,...r}=e,a=_.Children.toArray(n),i=a.find(FJ);if(i){const l=i.props.children,s=a.map(d=>d===i?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:d);return _.createElement(O6,An({},r,{ref:t}),_.isValidElement(l)?_.cloneElement(l,void 0,s):null)}return _.createElement(O6,An({},r,{ref:t}),n)});CI.displayName="Slot";const O6=_.forwardRef((e,t)=>{const{children:n,...r}=e;return _.isValidElement(n)?_.cloneElement(n,{...BJ(r,n.props),ref:$J(t,n.ref)}):_.Children.count(n)>1?_.Children.only(null):null});O6.displayName="SlotClone";const zJ=({children:e})=>_.createElement(_.Fragment,null,e);function FJ(e){return _.isValidElement(e)&&e.type===zJ}function BJ(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...s)=>{i(...s),a(...s)}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}const HJ=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],em=HJ.reduce((e,t)=>{const n=_.forwardRef((r,a)=>{const{asChild:i,...l}=r,s=i?CI:t;return _.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),_.createElement(s,An({},l,{ref:a}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function MI(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function WJ({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=XJ({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,s=MI(n),d=_.useCallback(u=>{if(i){const f=typeof u=="function"?u(e):u;f!==e&&s(f)}else a(u)},[i,e,a,s]);return[l,d]}function XJ({defaultProp:e,onChange:t}){const n=_.useState(e),[r]=n,a=_.useRef(r),i=MI(t);return _.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),n}const VJ=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},GJ=r5.useId||(()=>{});let YJ=0;function ZJ(e){const[t,n]=_.useState(GJ());return VJ(()=>{n(r=>r??String(YJ++))},[e]),e||(t?`radix-${t}`:"")}const II="Tabs",[KJ]=YQ(II,[EI]),_I=EI(),[qJ,z8]=KJ(II),QJ=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:l="horizontal",dir:s,activationMode:d="automatic",...u}=e,o=xI(s),[f,m]=WJ({prop:r,onChange:a,defaultProp:i});return _.createElement(qJ,{scope:n,baseId:ZJ(),value:f,onValueChange:m,orientation:l,dir:o,activationMode:d},_.createElement(em.div,An({dir:o,"data-orientation":l},u,{ref:t})))}),JJ="TabsList",eee=_.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=z8(JJ,n),l=_I(n);return _.createElement(AJ,An({asChild:!0},l,{orientation:i.orientation,dir:i.dir,loop:r}),_.createElement(em.div,An({role:"tablist","aria-orientation":i.orientation},a,{ref:t})))}),tee="TabsTrigger",nee=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,l=z8(tee,n),s=_I(n),d=TI(l.baseId,r),u=AI(l.baseId,r),o=r===l.value;return _.createElement(RJ,An({asChild:!0},s,{focusable:!a,active:o}),_.createElement(em.button,An({type:"button",role:"tab","aria-selected":o,"aria-controls":u,"data-state":o?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d},i,{ref:t,onMouseDown:hg(e.onMouseDown,f=>{!a&&f.button===0&&f.ctrlKey===!1?l.onValueChange(r):f.preventDefault()}),onKeyDown:hg(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&l.onValueChange(r)}),onFocus:hg(e.onFocus,()=>{const f=l.activationMode!=="manual";!o&&!a&&f&&l.onValueChange(r)})})))}),ree="TabsContent",aee=_.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...l}=e,s=z8(ree,n),d=TI(s.baseId,r),u=AI(s.baseId,r),o=r===s.value,f=_.useRef(o);return _.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),_.createElement(kI,{present:a||o},({present:m})=>_.createElement(em.div,An({"data-state":o?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":d,hidden:!m,id:u,tabIndex:0},l,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),m&&i))});function TI(e,t){return`${e}-trigger-${t}`}function AI(e,t){return`${e}-content-${t}`}const RI=QJ,jI=eee,LI=nee,DI=aee;var mg,ex;function iee(){if(ex)return mg;ex=1;var e="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt,d=typeof rs=="object"&&rs&&rs.Object===Object&&rs,u=typeof self=="object"&&self&&self.Object===Object&&self,o=d||u||Function("return this")(),f=Object.prototype,m=f.toString,U=Math.max,g=Math.min,v=function(){return o.Date.now()};function y(I,T,M){var j,D,P,N,$,z,Z=0,K=!1,Q=!1,W=!0;if(typeof I!="function")throw new TypeError(e);T=k(T)||0,w(M)&&(K=!!M.leading,Q="maxWait"in M,P=Q?U(k(M.maxWait)||0,T):P,W="trailing"in M?!!M.trailing:W);function q(re){var te=j,de=D;return j=D=void 0,Z=re,N=I.apply(de,te),N}function V(re){return Z=re,$=setTimeout(se,T),K?q(re):N}function ee(re){var te=re-z,de=re-Z,me=T-te;return Q?g(me,P-de):me}function X(re){var te=re-z,de=re-Z;return z===void 0||te>=T||te<0||Q&&de>=P}function se(){var re=v();if(X(re))return ge(re);$=setTimeout(se,ee(re))}function ge(re){return $=void 0,W&&j?q(re):(j=D=void 0,N)}function _e(){$!==void 0&&clearTimeout($),Z=0,j=z=D=$=void 0}function Y(){return $===void 0?N:ge(v())}function H(){var re=v(),te=X(re);if(j=arguments,D=this,z=re,te){if($===void 0)return V(z);if(Q)return $=setTimeout(se,T),q(z)}return $===void 0&&($=setTimeout(se,T)),N}return H.cancel=_e,H.flush=Y,H}function w(I){var T=typeof I;return!!I&&(T=="object"||T=="function")}function E(I){return!!I&&typeof I=="object"}function S(I){return typeof I=="symbol"||E(I)&&m.call(I)==n}function k(I){if(typeof I=="number")return I;if(S(I))return t;if(w(I)){var T=typeof I.valueOf=="function"?I.valueOf():I;I=w(T)?T+"":T}if(typeof I!="string")return I===0?I:+I;I=I.replace(r,"");var M=i.test(I);return M||l.test(I)?s(I.slice(2),M?2:8):a.test(I)?t:+I}return mg=y,mg}var lee=iee();const see=_i(lee);function oee(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var cee={};oee(cee,"LaserPointer",()=>o0);function un([e,t,n],[r,a,i]){return[e+r,t+a,n+i]}function Tu([e,t,n],[r,a,i]){return[e-r,t-a,n-i]}function yn([e,t,n],r){return[e*r,t*r,n*r]}function vc([e,t,n]){return[e/Math.sqrt(e**2+t**2),t/Math.sqrt(e**2+t**2),n]}function er([e,t,n],r){return[Math.cos(r)*e-Math.sin(r)*t,Math.sin(r)*e+Math.cos(r)*t,n]}function dee(e,t,n){return un(e,yn(Tu(t,e),n))}function tx(e,t,n){return Math.atan2(n[1]-e[1],n[0]-e[0])-Math.atan2(t[1]-e[1],t[0]-e[0])}function nx(e){return Math.atan2(Math.sin(e),Math.cos(e))}function rx([e,t]){return Math.sqrt(e**2+t**2)}function Fc([e,t],[n,r]){return Math.sqrt((n-e)**2+(r-t)**2)}function uee(e){if(e.length<2)return 0;let t=0;for(let n=1;n<=e.length-1;n++)t+=Fc(e[n-1],e[n]);return t+=Fc(e[e.length-2],e[e.length-1]),t}const fee=(e,t,n)=>Math.max(t,Math.min(n,e));function hee(e,t,n){const r=Fc(t,n);if(r===0)return Fc(e,t);const a=fee(((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r**2,0,1),i=[t[0]+a*(n[0]-t[0]),t[1]+a*(n[1]-t[1]),e[2]];return Fc(i,e)}function s0(e,t){if(t===0||e.length<=2)return e;const n=e[0],r=e[e.length-1],[a,i]=e.reduce(([l,s],d,u)=>{const o=hee(d,n,r);return o>l?[o,u]:[l,s]},[0,-1]);if(a>=t){const l=e[i];return[...s0([n,...e.slice(1,i),l],t).slice(0,-1),l,...s0([l,...e.slice(i,-1),r],t).slice(1)]}else return[n,r]}const ts=class ts{constructor(t){this.originalPoints=[],this.stablePoints=[],this.tailPoints=[],this.isFresh=!0,this.options=Object.assign({},ts.defaults,t)}get lastPoint(){return this.tailPoints[this.tailPoints.length-1]??this.stablePoints[this.stablePoints.length-1]}addPoint(t){const n=this.originalPoints[this.originalPoints.length-1];if(!(n&&n[0]===t[0]&&n[1]===t[1])){if(this.originalPoints.push(t),this.isFresh){this.isFresh=!1,this.stablePoints.push(t);return}this.options.streamline>0&&(t=dee(this.lastPoint,t,1-this.options.streamline)),this.tailPoints.push(t),uee(this.tailPoints)>ts.constants.maxTailLength&&this.stabilizeTail()}}close(){this.stabilizeTail()}stabilizeTail(){if(this.options.simplify>0&&this.options.simplifyPhase=="tail")throw new Error("Not implemented yet");this.stablePoints.push(...this.tailPoints),this.tailPoints=[]}getSize(t,n,r,a,i){return(t??this.options.size)*this.options.sizeMapping({pressure:n,runningLength:i,currentIndex:r,totalLength:a})}getStrokeOutline(t){if(this.isFresh)return[];let n=[...this.stablePoints,...this.tailPoints];this.options.simplify>0&&this.options.simplifyPhase==="input"&&(n=s0(n,this.options.simplify));const r=n.length;if(r===0)return[];if(r===1){const M=n[0],j=this.getSize(t,M[2],0,r,0);if(j<.5)return[];const D=[];for(let P=0;P<=Math.PI*2;P+=Math.PI/16)D.push(un(M,yn(er([1,0,0],P),j)));return D.push(un(M,yn([1,0,0],this.getSize(t,M[2],0,r,0)))),D}if(r===2){const M=n[0],j=n[1],D=this.getSize(t,M[2],0,r,0),P=this.getSize(t,j[2],0,r,0);if(D<.5||P<.5)return[];const N=[],$=tx(M,[M[0],M[1]-100,M[2]],j);for(let z=$;z<=Math.PI+$;z+=Math.PI/16)N.push(un(M,yn(er([1,0,0],z),D)));for(let z=Math.PI+$;z<=Math.PI*2+$;z+=Math.PI/16)N.push(un(j,yn(er([1,0,0],z),P)));return N.push(N[0]),N}const a=[],i=[];let l=0,s=0,d=0,u=0;for(let M=1;M<r-1;M++){const j=n[M-1],D=n[M],P=n[M+1];let N=D[2];const $=Fc(j,D);u+=$,l=s+($-s)*.2;const z=this.getSize(t,N,M,r,u);if(z===0){d=M+1;continue}const Z=vc(Tu(j,D)),K=vc(Tu(P,D)),Q=er(Z,Math.PI/2),W=er(Z,-Math.PI/2),q=er(K,Math.PI/2),V=er(K,-Math.PI/2),ee=un(D,yn(Q,z)),X=un(D,yn(W,z)),se=un(D,yn(q,z)),ge=un(D,yn(V,z)),_e=un(Q,V),Y=un(W,q),H=un(D,yn(rx(_e)===0?Z:vc(_e),z)),re=un(D,yn(rx(Y)===0?K:vc(Y),z)),te=nx(tx(D,j,P)),de=ts.constants.cornerDetectionMaxAngle/180*Math.PI*ts.constants.cornerDetectionVariance(l);if(Math.abs(te)<de){const me=Math.abs(nx(Math.PI-te));if(me===0)continue;if(te<0){i.push(X,re);for(let fe=0;fe<=me;fe+=me/4)a.push(un(D,er(yn(Q,z),fe)));for(let fe=me;fe>=0;fe-=me/4)i.push(un(D,er(yn(Q,z),fe)));i.push(re,se)}else{a.push(ee,H);for(let fe=0;fe<=me;fe+=me/4)i.push(un(D,er(yn(Q,-z),-fe)));for(let fe=me;fe>=0;fe-=me/4)a.push(un(D,er(yn(Q,-z),-fe)));a.push(H,ge)}}else a.push(H),i.push(re);s=l}if(d>=r-2)if(this.options.keepHead){const M=n[r-1],j=[];for(let D=0;D<=Math.PI*2;D+=Math.PI/16)j.push(un(M,yn(er([1,0,0],D),this.options.size)));return j.push(un(M,yn([1,0,0],this.options.size))),j}else return[];const o=n[d],f=n[d+1],m=n[r-2],U=n[r-1],g=vc(Tu(f,o)),v=vc(Tu(m,U)),y=er(g,-Math.PI/2),w=er(v,Math.PI/2),E=this.getSize(t,o[2],0,r,0),S=[],k=this.options.keepHead?this.options.size:this.getSize(t,m[2],r-2,r,u),I=[];if(E>1){for(let M=0;M<=Math.PI;M+=Math.PI/16)S.unshift(un(o,er(yn(y,E),-M)));S.unshift(un(o,yn(y,-E)))}else S.push(o);for(let M=0;M<=Math.PI*3;M+=Math.PI/16)I.push(un(U,er(yn(w,-k),-M)));const T=[...S,...a,...I.reverse(),...i.reverse()];return S.length>0&&T.push(S[0]),this.options.simplify>0&&this.options.simplifyPhase==="output"?s0(T,this.options.simplify):T}};ts.defaults={size:2,streamline:.45,simplify:.1,simplifyPhase:"output",keepHead:!1,sizeMapping:()=>1},ts.constants={cornerDetectionMaxAngle:75,cornerDetectionVariance:t=>t>35?.5:1,maxTailLength:50};let o0=ts;var PI=gM(),{useAtom:sn,useSetAtom:tm,useAtomValue:NI,useStore:nse}=PI,pee=PI.Provider,$a=S8(),mee=aj({"./locales/ar-SA.json":()=>Re(()=>import("./ar-SA-G6X2FPQ2-DrFZc17I.js"),[]),"./locales/az-AZ.json":()=>Re(()=>import("./az-AZ-76LH7QW2-DgHo0c8x.js"),[]),"./locales/bg-BG.json":()=>Re(()=>import("./bg-BG-XCXSNQG7-D6Qfq7sN.js"),[]),"./locales/bn-BD.json":()=>Re(()=>import("./bn-BD-2XOGV67Q-DtD_GeTA.js"),[]),"./locales/ca-ES.json":()=>Re(()=>import("./ca-ES-6MX7JW3Y-pqblEVH2.js"),[]),"./locales/cs-CZ.json":()=>Re(()=>import("./cs-CZ-2BRQDIVT-CybzkHZt.js"),[]),"./locales/da-DK.json":()=>Re(()=>import("./da-DK-5WZEPLOC-pqELhXiQ.js"),[]),"./locales/de-DE.json":()=>Re(()=>import("./de-DE-XR44H4JA-ZL76WiIL.js"),[]),"./locales/el-GR.json":()=>Re(()=>import("./el-GR-BZB4AONW-rKEdKItN.js"),[]),"./locales/en.json":()=>Re(()=>Promise.resolve().then(()=>Yle),void 0),"./locales/es-ES.json":()=>Re(()=>import("./es-ES-U4NZUMDT-BB6riLIk.js"),[]),"./locales/eu-ES.json":()=>Re(()=>import("./eu-ES-A7QVB2H4-ChqJNrpA.js"),[]),"./locales/fa-IR.json":()=>Re(()=>import("./fa-IR-HGAKTJCU--KEd62Xu.js"),[]),"./locales/fi-FI.json":()=>Re(()=>import("./fi-FI-Z5N7JZ37-CdB0adCJ.js"),[]),"./locales/fr-FR.json":()=>Re(()=>import("./fr-FR-RHASNOE6-LEJbMD3b.js"),[]),"./locales/gl-ES.json":()=>Re(()=>import("./gl-ES-HMX3MZ6V-Bi3P3M7W.js"),[]),"./locales/he-IL.json":()=>Re(()=>import("./he-IL-6SHJWFNN-DE7_aRwg.js"),[]),"./locales/hi-IN.json":()=>Re(()=>import("./hi-IN-IWLTKZ5I-CjARmJ8i.js"),[]),"./locales/hu-HU.json":()=>Re(()=>import("./hu-HU-A5ZG7DT2-d79urL5L.js"),[]),"./locales/id-ID.json":()=>Re(()=>import("./id-ID-SAP4L64H-bxo8Q0Jv.js"),[]),"./locales/it-IT.json":()=>Re(()=>import("./it-IT-JPQ66NNP-D41R3uEK.js"),[]),"./locales/ja-JP.json":()=>Re(()=>import("./ja-JP-DBVTYXUO-zK8NUJnS.js"),[]),"./locales/kaa.json":()=>Re(()=>import("./kaa-6HZHGXH3-CbGIc6V6.js"),[]),"./locales/kab-KAB.json":()=>Re(()=>import("./kab-KAB-ZGHBKWFO-BweHPuX1.js"),[]),"./locales/kk-KZ.json":()=>Re(()=>import("./kk-KZ-P5N5QNE5-DSokMm7h.js"),[]),"./locales/km-KH.json":()=>Re(()=>import("./km-KH-HSX4SM5Z-LYiEs3ge.js"),[]),"./locales/ko-KR.json":()=>Re(()=>import("./ko-KR-MTYHY66A-BzgMEtcU.js"),[]),"./locales/ku-TR.json":()=>Re(()=>import("./ku-TR-6OUDTVRD-D1FtjbSs.js"),[]),"./locales/lt-LT.json":()=>Re(()=>import("./lt-LT-XHIRWOB4-BPrhIUrC.js"),[]),"./locales/lv-LV.json":()=>Re(()=>import("./lv-LV-5QDEKY6T-CXJse_rs.js"),[]),"./locales/mr-IN.json":()=>Re(()=>import("./mr-IN-CRQNXWMA-Clab-bAO.js"),[]),"./locales/my-MM.json":()=>Re(()=>import("./my-MM-5M5IBNSE-Dp08JzEw.js"),[]),"./locales/nb-NO.json":()=>Re(()=>import("./nb-NO-T6EIAALU-CiaXJA-W.js"),[]),"./locales/nl-NL.json":()=>Re(()=>import("./nl-NL-IS3SIHDZ-D-9KUTnx.js"),[]),"./locales/nn-NO.json":()=>Re(()=>import("./nn-NO-6E72VCQL-Bg5gsQ4h.js"),[]),"./locales/oc-FR.json":()=>Re(()=>import("./oc-FR-POXYY2M6-G4iqllhL.js"),[]),"./locales/pa-IN.json":()=>Re(()=>import("./pa-IN-N4M65BXN-l6Lk41uX.js"),[]),"./locales/percentages.json":()=>Re(()=>Promise.resolve().then(()=>Zle),void 0),"./locales/pl-PL.json":()=>Re(()=>import("./pl-PL-T2D74RX3-BZPbB8S3.js"),[]),"./locales/pt-BR.json":()=>Re(()=>import("./pt-BR-5N22H2LF-CIC4vRyd.js"),[]),"./locales/pt-PT.json":()=>Re(()=>import("./pt-PT-UZXXM6DQ-rkGTBEI0.js"),[]),"./locales/ro-RO.json":()=>Re(()=>import("./ro-RO-JPDTUUEW-GDhpTKBO.js"),[]),"./locales/ru-RU.json":()=>Re(()=>import("./ru-RU-B4JR7IUQ-BzHvMwjC.js"),[]),"./locales/si-LK.json":()=>Re(()=>import("./si-LK-N5RQ5JYF-D3P3TNDH.js"),[]),"./locales/sk-SK.json":()=>Re(()=>import("./sk-SK-C5VTKIMK-CM8yTXlZ.js"),[]),"./locales/sl-SI.json":()=>Re(()=>import("./sl-SI-NN7IZMDC-CxoGm3aM.js"),[]),"./locales/sv-SE.json":()=>Re(()=>import("./sv-SE-XGPEYMSR-CnVZlafq.js"),[]),"./locales/ta-IN.json":()=>Re(()=>import("./ta-IN-2NMHFXQM-Bl-eCjzL.js"),[]),"./locales/th-TH.json":()=>Re(()=>import("./th-TH-HPSO5L25-CNIGPjSR.js"),[]),"./locales/tr-TR.json":()=>Re(()=>import("./tr-TR-DEFEU3FU-Cx7HbGIA.js"),[]),"./locales/uk-UA.json":()=>Re(()=>import("./uk-UA-QMV73CPH-BxcA50Ze.js"),[]),"./locales/vi-VN.json":()=>Re(()=>import("./vi-VN-M7AON7JQ-BvGuRh0c.js"),[]),"./locales/zh-CN.json":()=>Re(()=>import("./zh-CN-LNUGB5OW-SQH8i3l5.js"),[]),"./locales/zh-HK.json":()=>Re(()=>import("./zh-HK-E62DVLB3-COWoLNur.js"),[]),"./locales/zh-TW.json":()=>Re(()=>import("./zh-TW-RAJ6MFWO-Cm5B69ig.js"),[])}),Uee=85,Oo={code:"en",label:"English"},nm=[Oo,...[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"cs-CZ",label:"Česky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"eu-ES",label:"Euskara"},{code:"fa-IR",label:"فارسی",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Français"},{code:"gl-ES",label:"Galego"},{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:"kk-KZ",label:"Қазақ тілі"},{code:"ko-KR",label:"한국어"},{code:"ku-TR",label:"Kurdî"},{code:"lt-LT",label:"Lietuvių"},{code:"lv-LV",label:"Latviešu"},{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:"sl-SI",label:"Slovenščina"},{code:"tr-TR",label:"Türkçe"},{code:"uk-UA",label:"Українська"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"},{code:"vi-VN",label:"Tiếng Việt"},{code:"mr-IN",label:"मराठी"}].filter(e=>dM[e.code]>=Uee).sort((e,t)=>e.label>t.label?1:-1)],c0="__test__";et.DEV&&nm.unshift({code:c0,label:"test language"},{code:`${c0}.rtl`,label:"test language (rtl)",rtl:!0});var Lc=Oo,mp={},OI=async e=>{if(Lc=e,document.documentElement.dir=Lc.rtl?"rtl":"ltr",document.documentElement.lang=Lc.code,e.code.startsWith(c0))mp={};else try{mp=await mee(`./locales/${Lc.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),mp=E8}$a.set($I,e.code)},Sf=()=>Lc,ax=(e,t)=>{for(let n=0;n<t.length;++n){let r=t[n];if(e[r]===void 0)return;e=e[r]}if(typeof e=="string")return e},L=(e,t,n)=>{if(Lc.code.startsWith(c0))return`[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]`;let r=e.split("."),a=ax(mp,r)||ax(E8,r)||n;if(a===void 0){let i=`Can't find translation for ${e}`;return console.warn(i),""}if(t)for(let i in t)a=a.replace(`{{${i}}}`,String(t[i]));return a},$I=Hn(Oo.code),Zn=()=>{let e=NI($I);return{t:L,langCode:e}},gee=({size:e="1em",circleWidth:t=8,synchronized:n=!1,className:r=""})=>{let a=-(we.useRef(Date.now()).current%1600);return p.jsx("div",{className:`Spinner ${r}`,children:p.jsx("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":n?`${a}ms`:0},children:p.jsx("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},Ul=gee,zI=({delay:e,theme:t})=>{let[n,r]=_.useState(!!e);return _.useEffect(()=>{if(!e)return;let a=setTimeout(()=>{r(!1)},e);return()=>clearTimeout(a)},[e]),n?null:p.jsxs("div",{className:Ae("LoadingMessage",{"LoadingMessage--dark":t===ot.DARK}),children:[p.jsx("div",{children:p.jsx(Ul,{})}),p.jsx("div",{className:"LoadingMessage-text",children:L("labels.loadingScene")})]})},bee=e=>{let[t,n]=_.useState(!0);return _.useEffect(()=>{let r=async()=>{await OI(a),n(!1)},a=nm.find(i=>i.code===e.langCode)||Oo;r()},[e.langCode]),t?p.jsx(zI,{theme:e.theme}):e.children},dt=we.forwardRef(({size:e="medium",visible:t=!0,className:n="",...r},a)=>{let{id:i}=ji(),l=we.useRef(null);we.useImperativeHandle(a,()=>l.current);let s=`ToolIcon_size_${e}`,[d,u]=_.useState(!1),o=_.useRef(!0),f=async U=>{var v;let g="onClick"in r&&((v=r.onClick)==null?void 0:v.call(r,U));if(Pf(g))try{u(!0),await g}catch(y){if(y instanceof T0)console.warn(y);else throw y}finally{o.current&&u(!1)}};_.useEffect(()=>(o.current=!0,()=>{o.current=!1}),[]);let m=_.useRef(null);if(r.type==="button"||r.type==="icon"||r.type==="submit"){let U=r.type==="icon"?"button":r.type;return p.jsxs("button",{className:Ae("ToolIcon_type_button",s,n,t&&!r.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!r.hidden,"ToolIcon--selected":r.selected,"ToolIcon--plain":r.type==="icon"}),style:r.style,"data-testid":r["data-testid"],hidden:r.hidden,title:r.title,"aria-label":r["aria-label"],type:U,onClick:f,ref:l,disabled:d||r.isLoading||!!r.disabled,children:[(r.icon||r.label)&&p.jsxs("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!r.disabled,children:[r.icon||r.label,r.keyBindingLabel&&p.jsx("span",{className:"ToolIcon__keybinding",children:r.keyBindingLabel}),r.isLoading&&p.jsx(Ul,{})]}),r.showAriaLabel&&p.jsxs("div",{className:"ToolIcon__label",children:[r["aria-label"]," ",d&&p.jsx(Ul,{})]}),r.children]})}return p.jsxs("label",{className:Ae("ToolIcon",n),title:r.title,onPointerDown:U=>{var g;m.current=U.pointerType||null,(g=r.onPointerDown)==null||g.call(r,{pointerType:U.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{m.current=null})},children:[p.jsx("input",{className:`ToolIcon_type_radio ${s}`,type:"radio",name:r.name,"aria-label":r["aria-label"],"aria-keyshortcuts":r["aria-keyshortcuts"],"data-testid":r["data-testid"],id:`${i}-${r.id}`,onChange:()=>{var U;(U=r.onChange)==null||U.call(r,{pointerType:m.current})},checked:r.checked,ref:l}),p.jsxs("div",{className:"ToolIcon__icon",children:[r.icon,r.keyBindingLabel&&p.jsx("span",{className:"ToolIcon__keybinding",children:r.keyBindingLabel})]})]})});dt.displayName="ToolButton";var vee=(e,t,n)=>{let r=new Set(tt(e.filter(o=>He(o)),t).map(o=>o.id)),a={},i=n.scene.getNonDeletedElementsMap(),l=new Set;for(let o of r){let f=Mi(e,o);for(let m of f)if(!l.has(m.id)){if(Ft(m)){let U=Bn(m,i);U&&(a[U.id]=!0)}else a[m.id]=!0;l.add(m.id)}}let s=!0,d=e.map(o=>{if(t.selectedElementIds[o.id]){let f=Ft(o)?Bn(o,i):null;return o.frameId&&r.has(o.frameId)?(s=!1,a[o.id]=!0,o):f!=null&&f.frameId&&r.has(f==null?void 0:f.frameId)?o:(o.boundElements&&o.boundElements.forEach(m=>{var g,v;let U=n.scene.getNonDeletedElementsMap().get(m.id);U&&Me(U)&&(pe(U,{startBinding:o.id===((g=U.startBinding)==null?void 0:g.elementId)?null:U.startBinding,endBinding:o.id===((v=U.endBinding)==null?void 0:v.elementId)?null:U.endBinding}),pe(U,{points:U.points}))}),Ke(o,{isDeleted:!0}))}return o.frameId&&r.has(o.frameId)?(s=!1,Ft(o)||(a[o.id]=!0),Ke(o,{frameId:null})):Ft(o)&&t.selectedElementIds[o.containerId]?Ke(o,{isDeleted:!0}):o}),u=t.editingGroupId;if(s&&t.editingGroupId){let o=zt(d,t.editingGroupId).filter(f=>!f.isDeleted);if(o.length>1)o[0]&&(a[o[0].id]=!0);else{u=null,o[0]&&(a[o[0].id]=!0);let f=o[0];if(f){let m=f.groupIds.findIndex(g=>g===t.editingGroupId),U=f.groupIds[m+1];if(U){let g=zt(d,U).filter(v=>!v.isDeleted);g.length>1&&(u=U,g.forEach(v=>{a[v.id]=!0}))}}}}return{elements:d,appState:{...t,...fr({selectedElementIds:a,editingGroupId:u},d,t,null)}}},ix=(e,t)=>{if(e.editingGroupId){let n=zt(Rt(t),e.editingGroupId);if(n.length)return{...e,selectedElementIds:{[n[0].id]:!0}}}return e},FI=xe({name:"deleteSelectedElements",label:"labels.delete",icon:So,trackEvent:{category:"element",action:"delete"},perform:(e,t,n,r)=>{if(t.editingLinearElement){let{elementId:l,selectedPointsIndices:s,startBindingElement:d,endBindingElement:u}=t.editingLinearElement,o=r.scene.getNonDeletedElementsMap(),f=Ce.getElement(l,o);if(!f||s==null)return!1;if(f.points.length<2){let U=e.map(v=>v.id===f.id?Ke(v,{isDeleted:!0}):v),g=ix(t,U);return{elements:U,appState:{...g,editingLinearElement:null},captureUpdate:ie.IMMEDIATELY}}let m={startBindingElement:s!=null&&s.includes(0)?null:d,endBindingElement:s!=null&&s.includes(f.points.length-1)?null:u};return Ce.deletePoints(f,s),{elements:e,appState:{...t,editingLinearElement:{...t.editingLinearElement,...m,selectedPointsIndices:(s==null?void 0:s[0])>0?[s[0]-1]:[0]}},captureUpdate:ie.IMMEDIATELY}}let{elements:a,appState:i}=vee(e,t,r);return ek(a,a.filter(l=>l.isDeleted)),i=ix(i,a),{elements:a,appState:{...i,activeTool:gn(t,{type:"selection"}),multiElement:null,activeEmbeddable:null},captureUpdate:En(Rt(e),t)?ie.IMMEDIATELY:ie.EVENTUALLY}},keyTest:(e,t,n)=>(e.key===B.BACKSPACE||e.key===B.DELETE)&&!e[B.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:n})=>p.jsx(dt,{type:"button",icon:So,title:L("labels.delete"),"aria-label":L("labels.delete"),onClick:()=>n(null),visible:En(Rt(e),t)})}),$6=(e,t)=>e.frameId===t||e.id===t,BI=(e,t,n)=>{let r=[],a=[],i=null,l=-1,s=We(n||tt(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0}));for(;++l<e.length;){let d=e[l];s.get(d.id)?(a.length&&(r=r.concat(a),a=[]),r.push(l),i=l+1):d.isDeleted&&i===l?(i=l+1,a.push(l)):a=[]}return r},yee=e=>{let t=0;return e.reduce((n,r,a)=>(a>0&&e[a-1]!==r-1&&(t=++t),(n[t]||(n[t]=[])).push(r),n),[])},lx=(e,t,n)=>{var r,a;if("containerId"in e&&e.containerId){let i=fl.getScene(e).getElement(e.containerId);if(i)return n==="left"?Math.min(t.indexOf(i),t.indexOf(e)):Math.max(t.indexOf(i),t.indexOf(e))}else{let i=(a=(r=e.boundElements)==null?void 0:r.find(l=>l.type!=="arrow"))==null?void 0:a.id;if(i){let l=fl.getScene(e).getElement(i);if(l)return n==="left"?Math.min(t.indexOf(l),t.indexOf(e)):Math.max(t.indexOf(l),t.indexOf(e))}}},xee=(e,t)=>{let n=-1,r=-1;return e.forEach((a,i)=>{$6(a,t)&&(n===-1&&(n=i),r=i)}),n===-1?[]:e.slice(n,r+1)},wee=(e,t,n,r,a)=>{let i=t[n],l=f=>f.isDeleted?!1:a?f.frameId===a:e.editingGroupId?f.groupIds.includes(e.editingGroupId):!0,s=r==="left"?Js(t,f=>l(f),Math.max(0,n-1)):zE(t,f=>l(f),n+1),d=t[s];if(!d)return-1;if(e.editingGroupId){if((i==null?void 0:i.groupIds.join(""))===(d==null?void 0:d.groupIds.join("")))return lx(d,t,r)??s;if(!(d!=null&&d.groupIds.includes(e.editingGroupId)))return-1}if(!a&&(d.frameId||He(d))){let f=xee(t,d.frameId||d.id);return r==="left"?t.indexOf(f[0]):t.indexOf(f[f.length-1])}if(!d.groupIds.length)return lx(d,t,r)??s;let u=e.editingGroupId?d.groupIds[d.groupIds.indexOf(e.editingGroupId)-1]:d.groupIds[d.groupIds.length-1],o=zt(t,u);return o.length?r==="left"?t.indexOf(o[0]):t.indexOf(o[o.length-1]):s},HI=(e,t)=>t.reduce((n,r)=>{let a=e[r];return n.set(a.id,a),n},new Map),WI=(e,t,n)=>{let r=BI(e,t),a=HI(e,r),i=yee(r);n==="right"&&(i=i.reverse());let l=new Set(r.filter(s=>He(e[s])).map(s=>e[s].id));return i.forEach((s,d)=>{var E;let u=s[0],o=s[s.length-1],f=n==="left"?u:o,m=s.some(S=>{let k=e[S];return k.frameId&&l.has(k.frameId)})?null:(E=e[f])==null?void 0:E.frameId,U=wee(t,e,f,n,m);if(U===-1||f===U)return;let g=n==="left"?e.slice(0,U):e.slice(0,u),v=e.slice(u,o+1),y=n==="left"?e.slice(U,u):e.slice(o+1,U+1),w=n==="left"?e.slice(o+1):e.slice(U+1);e=n==="left"?[...g,...v,...y,...w]:[...g,...y,...v,...w]}),Ci(e,a),e},XI=(e,t,n,r,a)=>{let i=BI(e,t,a),l=HI(e,i),s=[],d,u;if(n==="left"){if(r)d=zE(e,g=>$6(g,r));else if(t.editingGroupId){let g=zt(e,t.editingGroupId);if(!g.length)return e;d=e.indexOf(g[0])}else d=0;u=i[i.length-1]}else{if(r)u=Js(e,g=>$6(g,r));else if(t.editingGroupId){let g=zt(e,t.editingGroupId);if(!g.length)return e;u=e.indexOf(g[g.length-1])}else u=e.length-1;d=i[0]}d===-1&&(d=0);for(let g=d;g<u+1;g++)i.includes(g)||s.push(e[g]);let o=Array.from(l.values()),f=e.slice(0,d),m=e.slice(u+1),U=n==="left"?[...f,...o,...s,...m]:[...f,...s,...o,...m];return Ci(U,l),U};function VI(e,t,n,r){let a=We(tt(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),i={regularElements:[],frameChildren:new Map},l=new Set;for(let u of e)a.has(u.id)&&He(u)&&l.add(u.id);for(let u of e)if(a.has(u.id))if(He(u)||u.frameId&&l.has(u.frameId))i.regularElements.push(u);else if(!u.frameId)i.regularElements.push(u);else{let o=i.frameChildren.get(u.frameId)||[];o.push(u),i.frameChildren.set(u.frameId,o)}let s=e,d=Array.from(i.frameChildren.entries());for(let[u,o]of d)s=r(e,t,n,u,o);return r(s,t,n,null,i.regularElements)}var Eee=(e,t)=>WI(e,t,"left"),See=(e,t)=>WI(e,t,"right"),kee=(e,t)=>VI(e,t,"left",XI),Cee=(e,t)=>VI(e,t,"right",XI),Mee=xe({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:Hv,trackEvent:{category:"element"},perform:(e,t)=>({elements:Eee(e,t),appState:t,captureUpdate:ie.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[B.CTRL_OR_CMD]&&!e.shiftKey&&e.code===ft.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>p.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${L("labels.sendBackward")} — ${he("CtrlOrCmd+[")}`,children:Hv})}),Iee=xe({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:Bv,trackEvent:{category:"element"},perform:(e,t)=>({elements:See(e,t),appState:t,captureUpdate:ie.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[B.CTRL_OR_CMD]&&!e.shiftKey&&e.code===ft.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>p.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${L("labels.bringForward")} — ${he("CtrlOrCmd+]")}`,children:Bv})}),_ee=xe({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:Xv,trackEvent:{category:"element"},perform:(e,t)=>({elements:kee(e,t),appState:t,captureUpdate:ie.IMMEDIATELY}),keyTest:e=>xi?e[B.CTRL_OR_CMD]&&e.altKey&&e.code===ft.BRACKET_LEFT:e[B.CTRL_OR_CMD]&&e.shiftKey&&e.code===ft.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>p.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${L("labels.sendToBack")} — ${he(xi?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")}`,children:Xv})}),Tee=xe({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:Wv,trackEvent:{category:"element"},perform:(e,t)=>({elements:Cee(e,t),appState:t,captureUpdate:ie.IMMEDIATELY}),keyTest:e=>xi?e[B.CTRL_OR_CMD]&&e.altKey&&e.code===ft.BRACKET_RIGHT:e[B.CTRL_OR_CMD]&&e.shiftKey&&e.code===ft.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>p.jsx("button",{type:"button",className:"zIndexButton",onClick:n=>e(null),title:`${L("labels.bringToFront")} — ${he(xi?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")}`,children:Wv})}),Aee=xe({name:"selectAll",label:"labels.selectAll",icon:Sz,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,n,r)=>{if(t.editingLinearElement)return!1;let a=e.filter(i=>!i.isDeleted&&!(ke(i)&&i.containerId)&&!i.locked).reduce((i,l)=>(i[l.id]=!0,i),{});return{appState:{...t,...fr({editingGroupId:null,selectedElementIds:a},Rt(e),t,r),selectedLinearElement:Object.keys(a).length===1&&Ge(e[0])?new Ce(e[0]):null},captureUpdate:ie.IMMEDIATELY}},keyTest:e=>e[B.CTRL_OR_CMD]&&e.key===B.A}),Ree=e=>{let t=e.slice(),n=new Set,r=i=>{var u,o,f;let l=(o=(u=i[0])==null?void 0:u.groupIds)==null?void 0:o.join(""),s=[i[0]],d=[];for(let m of i.slice(1))((f=m.groupIds)==null?void 0:f.join(""))===l?s.push(m):d.push(m);return d.length?[...s,...r(d)]:s},a=new Map;return t.forEach((i,l)=>{var s;if(!a.has(i.id))if((s=i.groupIds)!=null&&s.length){let d=i.groupIds[i.groupIds.length-1],u=t.slice(l).filter(o=>{var m;let f=(m=o==null?void 0:o.groupIds)==null?void 0:m.some(U=>U===d);return f&&a.set(o.id,!0),f});for(let o of r(u))n.add(o)}else n.add(i)}),n.size!==e.length?(console.error("normalizeGroupElementOrder: lost some elements... bailing!"),e):[...n]},jee=e=>{let t=MO(e),n=e.slice(),r=new Set;return n.forEach((a,i)=>{var l,s,d;a&&((l=a.boundElements)!=null&&l.length?(r.add(a),n[i]=null,a.boundElements.forEach(u=>{let o=t.get(u.id);o&&u.type==="text"&&(r.add(o[0]),n[o[1]]=null)})):a.type==="text"&&a.containerId&&((d=(s=t.get(a.containerId))==null?void 0:s[0].boundElements)!=null&&d.find(u=>u.id===a.id))||(r.add(a),n[i]=null))}),r.size!==e.length?(console.error("normalizeBoundElementsOrder: lost some elements... bailing!"),e):[...r]},Lee=e=>jee(Ree(e)),Dee=xe({name:"duplicateSelection",label:"labels.duplicateSelection",icon:Qg,trackEvent:{category:"element"},perform:(e,t,n,r)=>{if(t.editingLinearElement)try{let i=Ce.duplicateSelectedPoints(t,r.scene.getNonDeletedElementsMap());return{elements:e,appState:i,captureUpdate:ie.IMMEDIATELY}}catch{return!1}let a=Pee(e,t);if(r.props.onDuplicate&&a.elements){let i=r.props.onDuplicate(a.elements,e);i&&(a.elements=i)}return{...a,captureUpdate:ie.IMMEDIATELY}},keyTest:e=>e[B.CTRL_OR_CMD]&&e.key===B.D,PanelComponent:({elements:e,appState:t,updateData:n})=>p.jsx(dt,{type:"button",icon:Qg,title:`${L("labels.duplicateSelection")} — ${he("CtrlOrCmd+D")}`,"aria-label":L("labels.duplicateSelection"),onClick:()=>n(null),visible:En(Rt(e),t)})}),Pee=(e,t)=>{let n=new Map,r=[],a=[],i=new Map,l=new Map,s=We(e),d=v=>{let y=Pv(v).reduce((w,E)=>{if(o.has(E.id))return w;o.set(E.id,!0);let S=xk(t.editingGroupId,n,E,{x:E.x+_p/2,y:E.y+_p/2});return o.set(S.id,!0),l.set(S.id,S),i.set(E.id,S.id),a.push(E),r.push(S),w.push(S),w},[]);return Array.isArray(v)?y:y[0]||null};e=Lee(e);let u=We(tt(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),o=new Map,f=e.slice(),m=(v,y)=>{lr(v!==-1,"targetIndex === -1 "),!(!Array.isArray(y)&&!y)&&f.splice(v+1,0,...Pv(y))},U=new Set(e.filter(v=>u.has(v.id)&&He(v)).map(v=>v.id));for(let v of e){if(o.has(v.id)||!u.has(v.id))continue;let y=ik(t,v);if(y){let w=zt(e,y).flatMap(S=>He(S)?[...Mi(e,S.id),S]:[S]),E=Js(f,S=>{var k;return(k=S.groupIds)==null?void 0:k.includes(y)});m(E,d(w));continue}if(!(v.frameId&&U.has(v.frameId))){if(He(v)){let w=v.id,E=Mi(e,w),S=Js(f,k=>k.frameId===w||k.id===w);m(S,d([...E,v]));continue}if(Ua(v)){let w=Je(v,s),E=Js(f,S=>S.id===v.id||"containerId"in S&&S.containerId===v.id);w?m(E,d([v,w])):m(E,d(v));continue}if(Ft(v)){let w=Bn(v,s),E=Js(f,S=>S.id===v.id||S.id===(w==null?void 0:w.id));w?m(E,d([w,v])):m(E,d(v));continue}m(Js(f,w=>w.id===v.id),d(v))}}dk(f,a,i),JS(f,a,i),Qk(f,a,i);let g=f8(r);return{elements:f,appState:{...t,...fr({editingGroupId:t.editingGroupId,selectedElementIds:g.reduce((v,y)=>(Ft(y)||(v[y.id]=!0),v),{})},Rt(f),t,null)}}},Nee=new Set(["command_palette","export"]),Nt=(e,t,n,r)=>{try{if(typeof window>"u"||et.VITE_WORKER_ID||et.VITE_APP_ENABLE_TRACKING!=="true"||!Nee.has(e)||et.DEV)return;et.PROD||console.info("trackEvent",{category:e,action:t,label:n,value:r}),window.sa_event&&window.sa_event(t,{category:e,label:n,value:r})}catch(a){console.error("error during analytics",a)}},GI=_.forwardRef((e,t)=>{let{title:n,className:r,testId:a,active:i,standalone:l,icon:s,onClick:d}=e;return p.jsx("button",{type:"button",ref:t,title:n,"data-testid":a,className:Ae(r,{standalone:l,active:i}),onClick:d,children:s},n)}),Ai=e=>p.jsx("div",{className:"buttonList",children:e.options.map(t=>e.type==="button"?p.jsx(GI,{icon:t.icon,title:t.text,testId:t.testId,active:t.active??e.value===t.value,onClick:n=>e.onClick(t.value,n)},t.text):p.jsxs("label",{className:Ae({active:e.value===t.value}),title:t.text,children:[p.jsx("input",{type:"radio",name:e.group,onChange:()=>e.onChange(t.value),checked:e.value===t.value,"data-testid":t.testId}),t.icon]},t.text))}),Oee=({onChange:e,type:t,activeColor:n,topPicks:r})=>{let a;return t==="elementStroke"&&(a=yE),t==="elementBackground"&&(a=xE),t==="canvasBackground"&&(a=wE),r&&(a=r),a?p.jsx("div",{className:"color-picker__top-picks",children:a.map(i=>p.jsx("button",{className:Ae("color-picker__button",{active:i===n,"is-transparent":i==="transparent"||!i}),style:{"--swatch-color":i},type:"button",title:i,onClick:()=>e(i),"data-testid":`color-top-pick-${i}`,children:p.jsx("div",{className:"color-picker__button-outline"})},i))}):(console.error("Invalid type for TopPicks"),null)},YI=()=>p.jsx("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}}),rm=({palette:e,color:t})=>{for(let[n,r]of Object.entries(e))if(Array.isArray(r)){let a=r.indexOf(t);if(a>-1)return{colorName:n,shade:a}}else if(r===t)return{colorName:n,shade:null};return null},z6=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),ZI=({color:e,palette:t})=>!Object.values(t).flat().includes(e),$ee=(e,t,n)=>{let r={elementBackground:"backgroundColor",elementStroke:"strokeColor"},a=e.filter(l=>{if(l.isDeleted)return!1;let s=l[r[t]];return ZI({color:s,palette:n})}),i=new Map;return a.forEach(l=>{let s=l[r[t]];i.has(s)?i.set(s,i.get(s)+1):i.set(s,1)}),[...i.entries()].sort((l,s)=>s[1]-l[1]).map(l=>l[0]).slice(0,xN)},Ud=Hn(null),sx=(e,t,n)=>(e*299+t*587+n*114)/1e3>=160?"black":"white",zee=(e,t)=>{if(t){let i=new Option().style;if(i.color=e,i.color){let l=i.color.replace(/^(rgb|rgba)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(","),s=parseInt(l[0]),d=parseInt(l[1]),u=parseInt(l[2]);return sx(s,d,u)}}if(e==="transparent")return"black";let n=parseInt(e.substring(1,3),16),r=parseInt(e.substring(3,5),16),a=parseInt(e.substring(5,7),16);return sx(n,r,a)},Fee=({color:e,keyLabel:t,isCustomColor:n=!1,isShade:r=!1})=>p.jsxs("div",{className:"color-picker__button__hotkey-label",style:{color:zee(e,n)},children:[r&&"⇧",t]}),F8=Fee,Bee=({hex:e,onChange:t,palette:n})=>{let r=rm({color:e||"transparent",palette:n}),[a,i]=sn(Ud),l=_.useRef(null);if(_.useEffect(()=>{l.current&&a==="shades"&&l.current.focus()},[r,a]),r){let{colorName:s,shade:d}=r,u=n[s];if(Array.isArray(u))return p.jsx("div",{className:"color-picker-content--default shades",children:u.map((o,f)=>p.jsxs("button",{ref:f===d&&a==="shades"?l:void 0,tabIndex:-1,type:"button",className:Ae("color-picker__button color-picker__button--large",{active:f===d}),"aria-label":"Shade",title:`${s} - ${f+1}`,style:o?{"--swatch-color":o}:void 0,onClick:()=>{t(o),i("shades")},children:[p.jsx("div",{className:"color-picker__button-outline"}),p.jsx(F8,{color:o,keyLabel:f+1,isShade:!0})]},f))})}return p.jsxs("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[p.jsx("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),p.jsx("div",{tabIndex:-1,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:"0.75rem"},children:L("colorPicker.noShades")})]})},Hee=({palette:e,color:t,onChange:n,label:r,activeShade:a})=>{let i=rm({color:t||"transparent",palette:e}),[l,s]=sn(Ud),d=_.useRef(null);return _.useEffect(()=>{d.current&&l==="baseColors"&&d.current.focus()},[i==null?void 0:i.colorName,l]),p.jsx("div",{className:"color-picker-content--default",children:Object.entries(e).map(([u,o],f)=>{let m=(Array.isArray(o)?o[a]:o)||"transparent",U=z6[f],g=L(`colors.${u.replace(/\d+/,"")}`,null,"");return p.jsxs("button",{ref:(i==null?void 0:i.colorName)===u?d:void 0,tabIndex:-1,type:"button",className:Ae("color-picker__button color-picker__button--large",{active:(i==null?void 0:i.colorName)===u,"is-transparent":m==="transparent"||!m}),onClick:()=>{n(m),s("baseColors")},title:`${g}${m.startsWith("#")?` ${m}`:""} — ${U}`,"aria-label":`${g} — ${U}`,style:{"--swatch-color":m},"data-testid":`color-${u}`,children:[p.jsx("div",{className:"color-picker__button-outline"}),p.jsx(F8,{color:m,keyLabel:U})]},u)})})},Wee=Hee,Xee=({colors:e,color:t,onChange:n,label:r})=>{let[a,i]=sn(Ud),l=_.useRef(null);return _.useEffect(()=>{l.current&&l.current.focus()},[t,a]),p.jsx("div",{className:"color-picker-content--default",children:e.map((s,d)=>p.jsxs("button",{ref:t===s?l:void 0,tabIndex:-1,type:"button",className:Ae("color-picker__button color-picker__button--large",{active:t===s,"is-transparent":s==="transparent"||!s}),onClick:()=>{n(s),i("custom")},title:s,"aria-label":r,style:{"--swatch-color":s},children:[p.jsx("div",{className:"color-picker__button-outline"}),p.jsx(F8,{color:s,keyLabel:d+1,isCustomColor:!0})]},d))})},Ug=(e,t,n)=>{let r=Math.ceil(n/Ec);switch(t=t??-1,e){case"ArrowLeft":{let a=t-1;return a<0?n-1:a}case"ArrowRight":return(t+1)%n;case"ArrowDown":{let a=t+Ec;return a>=n?t%Ec:a}case"ArrowUp":{let a=t-Ec,i=a<0?Ec*r+a:a;return i>=n?void 0:i}}},Vee=({e,colorObj:t,onChange:n,palette:r,customColors:a,setActiveColorPickerSection:i,activeShade:l})=>{if((t==null?void 0:t.shade)!=null&&["Digit1","Digit2","Digit3","Digit4","Digit5"].includes(e.code)&&e.shiftKey){let s=Number(e.code.slice(-1))-1;return n(r[t.colorName][s]),i("shades"),!0}if(["1","2","3","4","5"].includes(e.key)&&a[Number(e.key)-1])return n(a[Number(e.key)-1]),i("custom"),!0;if(z6.includes(e.key)){let s=z6.indexOf(e.key),d=Object.keys(r)[s],u=r[d],o=Array.isArray(u)?u[l]:u;return n(o),i("baseColors"),!0}return!1},Gee=({event:e,activeColorPickerSection:t,palette:n,color:r,onChange:a,customColors:i,setActiveColorPickerSection:l,updateData:s,activeShade:d,onEyeDropperToggle:u,onEscape:o})=>{if(e[B.CTRL_OR_CMD])return!1;if(e.key===B.ESCAPE)return o(e),!0;if(e.key===B.ALT)return u(!0),!0;if(e.key===B.I)return u(),!0;let f=rm({color:r,palette:n});if(e.key===B.TAB){let m={custom:!!i.length,baseColors:!0,shades:(f==null?void 0:f.shade)!=null,hex:!0},U=Object.entries(m).reduce((E,[S,k])=>(k&&E.push(S),E),[]),g=U.indexOf(t),v=e.shiftKey?-1:1,y=g+v>U.length-1?0:g+v<0?U.length-1:g+v,w=U[y];return w&&l(w),w==="custom"?a(i[0]):w==="baseColors"&&(Object.entries(n).find(([E,S])=>Array.isArray(S)?S.includes(r):S===r?E:null)||a(at.black)),e.preventDefault(),e.stopPropagation(),!0}if(Vee({e,colorObj:f,onChange:a,palette:n,customColors:i,setActiveColorPickerSection:l,activeShade:d}))return!0;if(t==="shades"&&f){let{shade:m}=f,U=Ug(e.key,m,Ec);if(U!==void 0)return a(n[f.colorName][U]),!0}if(t==="baseColors"&&f){let{colorName:m}=f,U=Object.keys(n),g=U.indexOf(m),v=Ug(e.key,g,U.length);if(v!==void 0){let y=U[v],w=n[y];return a(Array.isArray(w)?w[d]:w),!0}}if(t==="custom"){let m=i.indexOf(r),U=Ug(e.key,m,i.length);if(U!==void 0){let g=i[U];return a(g),!0}}return!1},Yee=({children:e})=>p.jsx("div",{className:"color-picker__heading",children:e}),Up=Yee,Zee=({color:e,onChange:t,label:n,type:r,elements:a,palette:i,updateData:l,children:s,onEyeDropperToggle:d,onEscape:u})=>{let[o]=we.useState(()=>r==="canvasBackground"?[]:$ee(a,r,i)),[f,m]=sn(Ud),U=rm({color:e,palette:i});_.useEffect(()=>{if(!f){let w=ZI({color:e,palette:i}),E=w&&!o.includes(e);m(E?"hex":w?"custom":(U==null?void 0:U.shade)!=null?"shades":"baseColors")}},[f,e,i,m,U,o]);let[g,v]=_.useState((U==null?void 0:U.shade)??(r==="elementBackground"?Su:Eu));_.useEffect(()=>{(U==null?void 0:U.shade)!=null&&v(U.shade);let w=E=>{E.key===B.ALT&&d(!1)};return document.addEventListener("keyup",w,{capture:!0}),()=>{document.removeEventListener("keyup",w,{capture:!0})}},[U,d]);let y=we.useRef(null);return p.jsx("div",{role:"dialog","aria-modal":"true","aria-label":L("labels.colorPicker"),children:p.jsxs("div",{ref:y,onKeyDown:w=>{Gee({event:w,activeColorPickerSection:f,palette:i,color:e,onChange:t,onEyeDropperToggle:d,customColors:o,setActiveColorPickerSection:m,updateData:l,activeShade:g,onEscape:u})&&(w.preventDefault(),w.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[!!o.length&&p.jsxs("div",{children:[p.jsx(Up,{children:L("colorPicker.mostUsedCustomColors")}),p.jsx(Xee,{colors:o,color:e,label:L("colorPicker.mostUsedCustomColors"),onChange:t})]}),p.jsxs("div",{children:[p.jsx(Up,{children:L("colorPicker.colors")}),p.jsx(Wee,{color:e,label:n,palette:i,onChange:t,activeShade:g})]}),p.jsxs("div",{children:[p.jsx(Up,{children:L("colorPicker.shades")}),p.jsx(Bee,{hex:e,onChange:t,palette:i})]}),s]})})},KI=we.createContext(null),Ur=()=>we.useContext(KI),qI=e=>{let[t,n]=_.useState(null),r=Sn(),{theme:a}=Ur(),{container:i}=ji();return _.useLayoutEffect(()=>{var l;t&&(t.className="",t.classList.add("excalidraw",...((l=e==null?void 0:e.className)==null?void 0:l.split(/\s+/))||[]),t.classList.toggle("excalidraw--mobile",r.editor.isMobile),t.classList.toggle("theme--dark",a===ot.DARK))},[t,a,r.editor.isMobile,e==null?void 0:e.className]),_.useLayoutEffect(()=>{let l=e!=null&&e.parentSelector?i==null?void 0:i.querySelector(e.parentSelector):document.body;if(!l)return;let s=document.createElement("div");return l.appendChild(s),n(s),()=>{l.removeChild(s)}},[i,e==null?void 0:e.parentSelector]),t};function B8(e,t,n){_.useEffect(()=>{function r(a){let i=a;if(!e.current)return;let l=n==null?void 0:n(i,e.current);if(l!==!0){if(l===!1)return t(i);e.current.contains(i.target)||!document.documentElement.contains(i.target)||i.target.closest("[data-radix-portal]")||i.target===document.documentElement&&document.body.style.pointerEvents==="none"||i.target.closest("[data-prevent-outside-click]")||t(i)}}return document.addEventListener("pointerdown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("pointerdown",r),document.removeEventListener("touchstart",r)}},[e,t,n])}var am=e=>{let t=_.useRef(e);return Object.assign(t.current,e),t.current},im=Hn(null),Kee=({onCancel:e,onChange:t,onSelect:n,colorPickerType:r})=>{let a=qI({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),i=Ur(),l=hm(),s=Ri(),d=tt(l,i),u=am({app:s,onCancel:e,onChange:t,onSelect:n,selectedElements:d}),{container:o}=ji();_.useEffect(()=>{let m=f.current;if(!m||!s.canvas||!a)return;let U=!1,g=s.canvas.getContext("2d"),v=({clientX:T,clientY:M})=>{let j=g.getImageData((T-i.offsetLeft)*window.devicePixelRatio,(M-i.offsetTop)*window.devicePixelRatio,1,1).data;return CN(j[0],j[1],j[2])},y=({clientX:T,clientY:M,altKey:j})=>{m.style.top=`${M+20}px`,m.style.left=`${T+20}px`;let D=v({clientX:T,clientY:M});U&&u.onChange(r,D,u.selectedElements,{altKey:j}),m.style.background=D},w=()=>{u.onCancel()},E=(T,M)=>{u.onSelect(T,M)},S=T=>{U=!0,T.stopImmediatePropagation()},k=T=>{U=!1,o==null||o.focus(),T.stopImmediatePropagation(),T.preventDefault(),E(v(T),T)},I=T=>{T.key===B.ESCAPE&&(T.preventDefault(),T.stopImmediatePropagation(),w())};return a.tabIndex=-1,a.focus(),y({clientX:u.app.lastViewportPosition.x,clientY:u.app.lastViewportPosition.y,altKey:!1}),a.addEventListener("keydown",I),a.addEventListener("pointerdown",S),a.addEventListener("pointerup",k),window.addEventListener("pointermove",y,{passive:!0}),window.addEventListener("blur",w),()=>{U=!1,a.removeEventListener("keydown",I),a.removeEventListener("pointerdown",S),a.removeEventListener("pointerup",k),window.removeEventListener("pointermove",y),window.removeEventListener("blur",w)}},[u,s.canvas,a,r,o,i.offsetLeft,i.offsetTop]);let f=_.useRef(null);return B8(f,()=>{e()},m=>!!m.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),a?$n.createPortal(p.jsx("div",{ref:f,className:"excalidraw-eye-dropper-preview"}),a):null},qee=({color:e,onChange:t,label:n,colorPickerType:r})=>{let a=Sn(),[i,l]=_.useState(e),[s,d]=sn(Ud);_.useEffect(()=>{l(e)},[e]);let u=_.useCallback(g=>{let v=g.toLowerCase(),y=Qee(v);y&&t(y),l(v)},[t]),o=_.useRef(null),f=_.useRef(null);_.useEffect(()=>{o.current&&o.current.focus()},[s]);let[m,U]=sn(im);return _.useEffect(()=>()=>{U(null)},[U]),p.jsxs("div",{className:"color-picker__input-label",children:[p.jsx("div",{className:"color-picker__input-hash",children:"#"}),p.jsx("input",{ref:s==="hex"?o:void 0,style:{border:0,padding:0},spellCheck:!1,className:"color-picker-input","aria-label":n,onChange:g=>{u(g.target.value)},value:(i||"").replace(/^#/,""),onBlur:()=>{l(e)},tabIndex:-1,onFocus:()=>d("hex"),onKeyDown:g=>{var v;g.key!==B.TAB&&(g.key===B.ESCAPE&&((v=f.current)==null||v.focus()),g.stopPropagation())}}),!a.editor.isMobile&&p.jsxs(p.Fragment,{children:[p.jsx("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),p.jsx("div",{ref:f,className:Ae("excalidraw-eye-dropper-trigger",{selected:m}),onClick:()=>U(g=>g?null:{keepOpenOnAlt:!1,onSelect:v=>t(v),colorPickerType:r}),title:`${L("labels.eyeDropper")} — ${B.I.toLocaleUpperCase()} or ${he("Alt")} `,children:Uz})]})]})},Wa=we.forwardRef(({children:e,padding:t,className:n,style:r},a)=>p.jsx("div",{className:Ae("Island",n),style:{"--padding":t,...r},ref:a,children:e})),QI=we.forwardRef(({className:e,container:t,children:n,style:r,onClose:a,onKeyDown:i,onFocusOutside:l,onPointerLeave:s,onPointerDownOutside:d},u)=>{let o=Sn();return p.jsx(AQ,{container:t,children:p.jsxs(N8,{ref:u,className:Ae("focus-visible-none",e),"data-prevent-outside-click":!0,side:o.editor.isMobile&&!o.viewport.isLandscape?"bottom":"right",align:o.editor.isMobile&&!o.viewport.isLandscape?"center":"start",alignOffset:-16,sideOffset:20,style:{zIndex:"var(--zIndex-popup)"},onPointerLeave:s,onKeyDown:i,onFocusOutside:l,onPointerDownOutside:d,onCloseAutoFocus:f=>{f.stopPropagation(),f.preventDefault(),t&&!gO(document.activeElement)&&t.focus(),a()},children:[p.jsx(Wa,{padding:3,style:r,children:n}),p.jsx(mI,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})}),ox=e=>{let t=new Option().style;return t.color=e,!!t.color},Qee=e=>Na(e)?e:ox(`#${e}`)?`#${e}`:ox(e)?e:null,Jee=({type:e,color:t,onChange:n,label:r,elements:a,palette:i=at,updateData:l})=>{let{container:s}=ji(),[,d]=sn(Ud),[u,o]=sn(im),f=p.jsxs("div",{children:[p.jsx(Up,{children:L("colorPicker.hexCode")}),p.jsx(qee,{color:t,label:r,onChange:g=>{n(g)},colorPickerType:e})]}),m=_.useRef(null),U=()=>{var g,v;(v=(g=m.current)==null?void 0:g.querySelector(".color-picker-content"))==null||v.focus()};return p.jsx(QI,{container:s,style:{maxWidth:"13rem"},onFocusOutside:g=>{U(),g.preventDefault()},onPointerDownOutside:g=>{u&&g.preventDefault()},onClose:()=>{l({openPopup:null}),d(null)},children:i?p.jsx(Zee,{palette:i,color:t,onChange:g=>{n(g)},onEyeDropperToggle:g=>{o(v=>g?(v=v||{keepOpenOnAlt:!0,onSelect:n,colorPickerType:e},v.keepOpenOnAlt=!0,v):g===!1||v?null:{keepOpenOnAlt:!1,onSelect:n,colorPickerType:e})},onEscape:g=>{u?o(null):l({openPopup:null})},label:r,type:e,elements:a,updateData:l,children:f}):f})},ete=({label:e,color:t,type:n})=>p.jsx(J0,{type:"button",className:Ae("color-picker__button active-color properties-trigger",{"is-transparent":t==="transparent"||!t}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:L(n==="elementStroke"?"labels.showStroke":"labels.showBackground"),children:p.jsx("div",{className:"color-picker__button-outline"})}),H8=({type:e,color:t,onChange:n,label:r,elements:a,palette:i=at,topPicks:l,updateData:s,appState:d})=>p.jsx("div",{children:p.jsxs("div",{role:"dialog","aria-modal":"true",className:"color-picker-container",children:[p.jsx(Oee,{activeColor:t,onChange:n,type:e,topPicks:l}),p.jsx(YI,{}),p.jsxs(Q0,{open:d.openPopup===e,onOpenChange:u=>{s({openPopup:u?e:null})},children:[p.jsx(ete,{color:t,label:r,type:e}),d.openPopup===e&&p.jsx(Jee,{type:e,color:t,onChange:n,label:r,elements:a,palette:i,updateData:s})]})]})}),lm=({icon:e})=>p.jsx("span",{style:{width:"1em",margin:"0 0.5ex 0 0.5ex",display:"inline-block",lineHeight:0,verticalAlign:"middle"},children:e}),tte=({label:e,open:t,openTrigger:n,children:r,className:a})=>p.jsxs(p.Fragment,{children:[p.jsxs("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:a,onClick:n,children:[e,p.jsx(lm,{icon:t?$z:mS})]}),t&&p.jsx("div",{style:{display:"flex",flexDirection:"column"},children:r})]}),F6=tte,nte=Hn(!1);function rte({options:e,value:t,label:n,onChange:r,onClose:a,numberOfOptionsToAlwaysShow:i=e.length}){let l=Sn(),s=U=>{let g=e.find(v=>v.keyBinding===U.key.toLowerCase());if(!(U.metaKey||U.altKey||U.ctrlKey)&&g)r(g.value),U.preventDefault();else if(U.key===B.TAB){let v=e.findIndex(w=>w.value===t),y=U.shiftKey?(e.length+v-1)%e.length:(v+1)%e.length;r(e[y].value)}else if(ku(U.key)){let v=Sf().rtl,y=e.findIndex(w=>w.value===t);if(y!==-1){let w=e.length,E=y;switch(U.key){case(v?B.ARROW_LEFT:B.ARROW_RIGHT):E=(y+1)%w;break;case(v?B.ARROW_RIGHT:B.ARROW_LEFT):E=(w+y-1)%w;break;case B.ARROW_DOWN:{E=(y+(i??1))%w;break}case B.ARROW_UP:{E=(w+y-(i??1))%w;break}}r(e[E].value)}U.preventDefault()}else(U.key===B.ESCAPE||U.key===B.ENTER)&&(U.preventDefault(),a());U.nativeEvent.stopImmediatePropagation(),U.stopPropagation()},[d,u]=sn(nte),o=we.useMemo(()=>e.slice(0,i),[e,i]),f=we.useMemo(()=>e.slice(i),[e,i]);_.useEffect(()=>{o.some(U=>U.value===t)||u(!0)},[t,o,u]);let m=U=>p.jsx("div",{className:"picker-content",children:U.map((g,v)=>p.jsxs("button",{type:"button",className:Ae("picker-option",{active:t===g.value}),onClick:y=>{r(g.value)},title:`${g.text} ${g.keyBinding&&`— ${g.keyBinding.toUpperCase()}`}`,"aria-label":g.text||"none","aria-keyshortcuts":g.keyBinding||void 0,ref:y=>{t===g.value&&setTimeout(()=>{y==null||y.focus()},0)},children:[g.icon,g.keyBinding&&p.jsx("span",{className:"picker-keybinding",children:g.keyBinding})]},g.text))});return p.jsx(N8,{side:l.editor.isMobile&&!l.viewport.isLandscape?"top":"bottom",align:"start",sideOffset:12,style:{zIndex:"var(--zIndex-popup)"},onKeyDown:s,children:p.jsxs("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":n,children:[m(o),f.length>0&&p.jsx(F6,{label:L("labels.more_options"),open:d,openTrigger:()=>{u(U=>!U)},className:"picker-collapsible",children:m(f)})]})})}function cx({value:e,label:t,options:n,onChange:r,group:a="",numberOfOptionsToAlwaysShow:i}){var u;let[l,s]=we.useState(!1),d=we.useRef(null);return p.jsx("div",{children:p.jsxs(Q0,{open:l,onOpenChange:o=>s(o),children:[p.jsx(J0,{name:a,type:"button","aria-label":t,onClick:()=>s(!l),ref:d,className:l?"active":"",children:(u=n.find(o=>o.value===e))==null?void 0:u.icon}),l&&p.jsx(rte,{options:n,value:e,label:t,onChange:r,onClose:()=>{s(!1)},numberOfOptionsToAlwaysShow:i})]})})}var JI=we.forwardRef(({className:e,placeholder:t,onChange:n},r)=>p.jsxs("div",{className:Ae("QuickSearch__wrapper",e),children:[ko,p.jsx("input",{ref:r,className:"QuickSearch__input",type:"text",placeholder:t,onChange:a=>n(a.target.value.trim().toLowerCase())})]})),e_=({className:e,placeholder:t,children:n})=>{let r=!_.Children.count(n);return p.jsx("div",{className:Ae("ScrollableList__wrapper",e),role:"menu",children:r?p.jsx("div",{className:"empty",children:t}):n})},t_=({children:e,className:t="",style:n,title:r})=>p.jsxs("div",{className:`dropdown-menu-group ${t}`,style:n,children:[r&&p.jsx("p",{className:"dropdown-menu-group-title",children:r}),e]}),B6=t_;t_.displayName="DropdownMenuGroup";var n_=we.createContext({}),r_=(e="",t=!1,n=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e}
|
|
148
|
+
${t?"dropdown-menu-item--selected":""} ${n?"dropdown-menu-item--hovered":""}`.trim(),a_=(e,t)=>{let n=_.useContext(n_);return k0(e,r=>{var i;let a=new CustomEvent("menu.itemSelect",{bubbles:!0,cancelable:!0});t==null||t(a),a.defaultPrevented||((i=n.onSelect)==null||i.call(n,a))})},ate=({textStyle:e,icon:t,shortcut:n,children:r})=>{let a=Sn();return p.jsxs(p.Fragment,{children:[t&&p.jsx("div",{className:"dropdown-menu-item__icon",children:t}),p.jsx("div",{style:e,className:"dropdown-menu-item__text",children:r}),n&&!a.editor.isMobile&&p.jsx("div",{className:"dropdown-menu-item__shortcut",children:n})]})},i_=ate,W8=({icon:e,value:t,order:n,children:r,shortcut:a,className:i,hovered:l,selected:s,textStyle:d,onSelect:u,onClick:o,...f})=>{let m=a_(o,u),U=_.useRef(null);return _.useEffect(()=>{var g,v;l&&(n===0?(g=U.current)==null||g.scrollIntoView({block:"end"}):(v=U.current)==null||v.scrollIntoView({block:"nearest"}))},[l,n]),p.jsx("button",{...f,ref:U,value:t,onClick:m,className:r_(i,s,l),title:f.title??f["aria-label"],children:p.jsx(i_,{textStyle:d,icon:e,shortcut:a,children:r})})};W8.displayName="DropdownMenuItem";var Au={GREEN:"green",RED:"red",BLUE:"blue"},X8=({type:e=Au.BLUE,children:t})=>{let{theme:n}=Jf(),r={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:n===ot.LIGHT?"1.5px solid white":"none"};switch(e){case Au.GREEN:Object.assign(r,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case Au.RED:Object.assign(r,{backgroundColor:"pink",color:"darkred"});break;case Au.BLUE:default:Object.assign(r,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return p.jsx("div",{className:"DropDownMenuItemBadge",style:r,children:t})};X8.displayName="DropdownMenuItemBadge";W8.Badge=X8;var ba=W8,ite=({event:e,inputRef:t,hoveredFont:n,filteredFonts:r,onClose:a,onSelect:i,onHover:l})=>{var s,d,u;if(!e[B.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===B.F)return(s=t.current)==null||s.focus(),!0;if(e.key===B.ESCAPE)return a(),!0;if(e.key===B.ENTER)return n!=null&&n.value&&i(n.value),!0;if(e.key===B.ARROW_DOWN)return n!=null&&n.next?l(n.next.value):(d=r[0])!=null&&d.value&&l(r[0].value),!0;if(e.key===B.ARROW_UP)return n!=null&&n.prev?l(n.prev.value):(u=r[r.length-1])!=null&&u.value&&l(r[r.length-1].value),!0},lte=we.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:n,onHover:r,onLeave:a,onOpen:i,onClose:l})=>{let{container:s}=ji(),{fonts:d}=Ri(),{showDeprecatedFonts:u}=Qf(),[o,f]=_.useState(""),m=_.useRef(null),U=_.useMemo(()=>Array.from(al.registered.entries()).filter(([j,{metadata:D}])=>!D.serverSide&&!D.fallback).map(([j,{metadata:D,fontFaces:P}])=>{var $,z;let N={value:j,icon:D.icon??$p,text:((z=($=P[0])==null?void 0:$.fontFace)==null?void 0:z.family)??"Unknown"};return D.deprecated&&Object.assign(N,{deprecated:D.deprecated,badge:{type:Au.RED,placeholder:L("fontList.badge.old")}}),N}).sort((j,D)=>j.text.toLowerCase()>D.text.toLowerCase()?1:-1),[]),g=_.useMemo(()=>new Set(d.getSceneFamilies()),[e]),v=_.useMemo(()=>U.filter(j=>g.has(j.value)),[U,g]),y=_.useMemo(()=>U.filter(j=>!g.has(j.value)&&(u||!j.deprecated)),[U,g,u]),w=_.useMemo(()=>IO([...v,...y].filter(j=>{var D;return(D=j.text)==null?void 0:D.toLowerCase().includes(o)})),[v,y,o]),E=_.useMemo(()=>{var D;let j;return t?j=w.find(P=>P.value===t):e&&(j=w.find(P=>P.value===e)),!j&&o&&((D=w[0])!=null&&D.value?r(w[0].value):a()),j},[t,e,o,w,r,a]),S=_.useCallback(j=>{ite({event:j,inputRef:m,hoveredFont:E,filteredFonts:w,onSelect:n,onHover:r,onClose:l})&&(j.preventDefault(),j.stopPropagation())},[E,w,n,r,l]);_.useEffect(()=>(i(),()=>{l()}),[]);let k=_.useMemo(()=>w.filter(j=>g.has(j.value)),[w,g]),I=_.useMemo(()=>w.filter(j=>!g.has(j.value)),[w,g]),T=(j,D)=>p.jsxs(ba,{icon:j.icon,value:j.value,order:D,textStyle:{fontFamily:Gc({fontFamily:j.value})},hovered:j.value===(E==null?void 0:E.value),selected:j.value===e,tabIndex:j.value===e?0:-1,onClick:P=>{n(Number(P.currentTarget.value))},onMouseMove:()=>{(E==null?void 0:E.value)!==j.value&&r(j.value)},children:[j.text,j.badge&&p.jsx(X8,{type:j.badge.type,children:j.badge.placeholder})]},j.value),M=[];return k.length&&M.push(p.jsx(B6,{title:L("fontList.sceneFonts"),children:k.map(T)},"group_1")),I.length&&M.push(p.jsx(B6,{title:L("fontList.availableFonts"),children:I.map((j,D)=>T(j,D+k.length))},"group_2")),p.jsxs(QI,{className:"properties-content",container:s,style:{width:"15rem"},onClose:l,onPointerLeave:a,onKeyDown:S,children:[p.jsx(JI,{ref:m,placeholder:L("quickSearch.placeholder"),onChange:Yc(f,20)}),p.jsx(e_,{className:"dropdown-menu fonts manual-hover",placeholder:L("fontList.empty"),children:M.length?M:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),ste=({selectedFontFamily:e})=>{let t=_.useMemo(()=>!!(e&&!cte(e)),[e]);return p.jsx(J0,{asChild:!0,children:p.jsx("div",{children:p.jsx(GI,{standalone:!0,icon:JE,title:L("labels.showFonts"),className:"properties-trigger",testId:"font-family-show-fonts",active:t,onClick:()=>{}})})})},l_=[{value:Xt.Excalifont,icon:uf,text:L("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:Xt.Nunito,icon:$p,text:L("labels.normal"),testId:"font-family-normal"},{value:Xt["Comic Shanns"],icon:n6,text:L("labels.code"),testId:"font-family-code"}],ote=new Set(l_.map(e=>e.value)),cte=e=>e?ote.has(e):!1,dte=we.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:n,onSelect:r,onHover:a,onLeave:i,onPopupChange:l})=>{let s=_.useMemo(()=>l_,[]),d=_.useCallback(u=>{u&&r(u)},[r]);return p.jsxs("div",{role:"dialog","aria-modal":"true",className:"FontPicker__container",children:[p.jsx(Ai,{type:"button",options:s,value:t,onClick:d}),p.jsx(YI,{}),p.jsxs(Q0,{open:e,onOpenChange:l,children:[p.jsx(ste,{selectedFontFamily:t}),e&&p.jsx(lte,{selectedFontFamily:t,hoveredFontFamily:n,onSelect:d,onHover:a,onLeave:i,onOpen:()=>l(!0),onClose:()=>l(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),ute=({updateData:e,appState:t,elements:n,testId:r})=>{let a=we.useRef(null),i=we.useRef(null),l=mr(n,t,s=>s.opacity,!0,t.currentItemOpacity);return _.useEffect(()=>{if(a.current&&i.current){let s=a.current,d=i.current,u=s.offsetWidth,o=15,f=l/100*(u-o)+o/2;d.style.left=`${f}px`,s.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${l}%, var(--button-bg) ${l}%, var(--button-bg) 100%)`}},[l]),p.jsxs("label",{className:"control-label",children:[L("labels.opacity"),p.jsxs("div",{className:"range-wrapper",children:[p.jsx("input",{ref:a,type:"range",min:"0",max:"100",step:"10",onChange:s=>{e(+s.target.value)},value:l,className:"range-input","data-testid":r}),p.jsx("div",{className:"value-bubble",ref:i,children:l!==0?l:null}),p.jsx("div",{className:"zero-label",children:"0"})]})]})},s_=.1,pr=(e,t,n,r=!1)=>{let a=We(tt(e,t,{includeBoundTextElement:r}));return e.map(i=>{var l;return a.get(i.id)||i.id===((l=t.editingTextElement)==null?void 0:l.id)?n(i):i})},mr=function(e,t,n,r,a){let i=t.editingTextElement,l=Rt(e),s=null;return i&&(s=n(i)),s||(En(l,t)?s=XY(r===!0?l:l.filter(d=>r(d)),t,n)??(typeof a=="function"?a(!0):a):s=typeof a=="function"?a(!1):a),s},fte=(e,t)=>Ft(t)||!t.autoResize?t:pe(t,{x:e.textAlign==="left"?e.x:e.x+(e.width-t.width)/(e.textAlign==="center"?2:1),y:e.y+(e.height-t.height)/2},!1),V8=(e,t,n,r,a)=>{let i=new Set,l=pr(e,t,d=>{if(ke(d)){let u=r(d);i.add(u);let o=Ke(d,{fontSize:u});return hr(o,n.scene.getContainerElement(d),n.scene.getNonDeletedElementsMap()),o=fte(d,o),o}return d},!0),s=We(l);return tt(e,t,{includeBoundTextElement:!0}).forEach(d=>{ke(d)&&Ar(d,s)}),{elements:l,appState:{...t,currentItemFontSize:i.size===1?[...i][0]:a??t.currentItemFontSize},captureUpdate:ie.IMMEDIATELY}};xe({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,n)=>({...n.currentItemStrokeColor&&{elements:pr(e,t,r=>s6(r.type)?Ke(r,{strokeColor:n.currentItemStrokeColor}):r,!0)},appState:{...t,...n},captureUpdate:n.currentItemStrokeColor?ie.IMMEDIATELY:ie.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r})=>p.jsxs(p.Fragment,{children:[p.jsx("h3",{"aria-hidden":"true",children:L("labels.stroke")}),p.jsx(H8,{topPicks:yE,palette:EN,type:"elementStroke",label:L("labels.stroke"),color:mr(e,t,a=>a.strokeColor,!0,t.currentItemStrokeColor),onChange:a=>n({currentItemStrokeColor:a}),elements:e,appState:t,updateData:n})]})});xe({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,n)=>({...n.currentItemBackgroundColor&&{elements:pr(e,t,r=>Ke(r,{backgroundColor:n.currentItemBackgroundColor}))},appState:{...t,...n},captureUpdate:n.currentItemBackgroundColor?ie.IMMEDIATELY:ie.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r})=>p.jsxs(p.Fragment,{children:[p.jsx("h3",{"aria-hidden":"true",children:L("labels.background")}),p.jsx(H8,{topPicks:xE,palette:SN,type:"elementBackground",label:L("labels.background"),color:mr(e,t,a=>a.backgroundColor,!0,t.currentItemBackgroundColor),onChange:a=>n({currentItemBackgroundColor:a}),elements:e,appState:t,updateData:n})]})});xe({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,n,r)=>(Nt("element","changeFillStyle",`${n} (${r.device.editor.isMobile?"mobile":"desktop"})`),{elements:pr(e,t,a=>Ke(a,{fillStyle:n})),appState:{...t,currentItemFillStyle:n},captureUpdate:ie.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=tt(e,t),a=r.length>0&&r.every(i=>i.fillStyle==="zigzag");return p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.fill")}),p.jsx(Ai,{type:"button",options:[{value:"hachure",text:`${L(a?"labels.zigzag":"labels.hachure")} (${he("Alt-Click")})`,icon:a?_$:T$,active:a?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:L("labels.crossHatch"),icon:A$,testId:"fill-cross-hatch"},{value:"solid",text:L("labels.solid"),icon:R$,testId:"fill-solid"}],value:mr(e,t,i=>i.fillStyle,i=>i.hasOwnProperty("fillStyle"),i=>i?null:t.currentItemFillStyle),onClick:(i,l)=>{let s=l.altKey&&i==="hachure"&&r.every(d=>d.fillStyle==="hachure")?"zigzag":i;n(s)}})]})}});xe({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,n)=>({elements:pr(e,t,r=>Ke(r,{strokeWidth:n})),appState:{...t,currentItemStrokeWidth:n},captureUpdate:ie.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.strokeWidth")}),p.jsx(Ai,{group:"stroke-width",options:[{value:R2.thin,text:L("labels.thin"),icon:lS,testId:"strokeWidth-thin"},{value:R2.bold,text:L("labels.bold"),icon:j$,testId:"strokeWidth-bold"},{value:R2.extraBold,text:L("labels.extraBold"),icon:L$,testId:"strokeWidth-extraBold"}],value:mr(e,t,r=>r.strokeWidth,r=>r.hasOwnProperty("strokeWidth"),r=>r?null:t.currentItemStrokeWidth),onChange:r=>n(r)})]})});xe({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,n)=>({elements:pr(e,t,r=>Ke(r,{seed:Si(),roughness:n})),appState:{...t,currentItemRoughness:n},captureUpdate:ie.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.sloppiness")}),p.jsx(Ai,{group:"sloppiness",options:[{value:0,text:L("labels.architect"),icon:N$},{value:1,text:L("labels.artist"),icon:O$},{value:2,text:L("labels.cartoonist"),icon:$$}],value:mr(e,t,r=>r.roughness,r=>r.hasOwnProperty("roughness"),r=>r?null:t.currentItemRoughness),onChange:r=>n(r)})]})});xe({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,n)=>({elements:pr(e,t,r=>Ke(r,{strokeStyle:n})),appState:{...t,currentItemStrokeStyle:n},captureUpdate:ie.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.strokeStyle")}),p.jsx(Ai,{group:"strokeStyle",options:[{value:"solid",text:L("labels.strokeStyle_solid"),icon:lS},{value:"dashed",text:L("labels.strokeStyle_dashed"),icon:D$},{value:"dotted",text:L("labels.strokeStyle_dotted"),icon:P$}],value:mr(e,t,r=>r.strokeStyle,r=>r.hasOwnProperty("strokeStyle"),r=>r?null:t.currentItemStrokeStyle),onChange:r=>n(r)})]})});xe({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,n)=>({elements:pr(e,t,r=>Ke(r,{opacity:n}),!0),appState:{...t,currentItemOpacity:n},captureUpdate:ie.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>p.jsx(ute,{updateData:n,elements:e,appState:t,testId:"opacity"})});xe({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,n,r)=>V8(e,t,r,()=>n,n),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.fontSize")}),p.jsx(Ai,{group:"font-size",options:[{value:16,text:L("labels.small"),icon:ez,testId:"fontSize-small"},{value:20,text:L("labels.medium"),icon:tz,testId:"fontSize-medium"},{value:28,text:L("labels.large"),icon:nz,testId:"fontSize-large"},{value:36,text:L("labels.veryLarge"),icon:rz,testId:"fontSize-veryLarge"}],value:mr(e,t,a=>{if(ke(a))return a.fontSize;let i=Je(a,r.scene.getNonDeletedElementsMap());return i?i.fontSize:null},a=>ke(a)||Je(a,r.scene.getNonDeletedElementsMap())!==null,a=>a?null:t.currentItemFontSize||bl),onChange:a=>n(a)})]})});var dx=xe({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:_0,trackEvent:!1,perform:(e,t,n,r)=>V8(e,t,r,a=>Math.round(1/(1+s_)*a.fontSize)),keyTest:e=>e[B.CTRL_OR_CMD]&&e.shiftKey&&(e.key===B.CHEVRON_LEFT||e.key===B.COMMA)}),ux=xe({name:"increaseFontSize",label:"labels.increaseFontSize",icon:_0,trackEvent:!1,perform:(e,t,n,r)=>V8(e,t,r,a=>Math.round(a.fontSize*(1+s_))),keyTest:e=>e[B.CTRL_OR_CMD]&&e.shiftKey&&(e.key===B.CHEVRON_RIGHT||e.key===B.PERIOD)});xe({name:"changeFontFamily",label:"labels.fontFamily",trackEvent:!1,perform:(e,t,n,r)=>{var g;let{cachedElements:a,resetAll:i,resetContainers:l,...s}=n;if(i)return{elements:pr(e,t,v=>{let y=a==null?void 0:a.get(v.id);return y?Ke(v,{...y}):v},!0),appState:{...t,...s},captureUpdate:ie.NEVER};let{currentItemFontFamily:d,currentHoveredFontFamily:u}=n,o=ie.EVENTUALLY,f,m=!1;if(d)f=d,o=ie.IMMEDIATELY;else if(u){f=u,o=ie.EVENTUALLY;let v=tt(e,t,{includeBoundTextElement:!0}).filter(y=>ke(y));if(v.length>200)m=!0;else{let y=0,w=0;for(;y<v.length&&w<5e3;){let E=v[y];w+=(E==null?void 0:E.originalText.length)||0,y++}w>5e3&&(m=!0)}}let U={appState:{...t,...s},captureUpdate:o};if(f&&!m){let v=new Map,y=new Set,w=!1,E=Array.from(al.loadedFontsCache.values()),S=(g=Object.entries(Xt).find(([T,M])=>M===f))==null?void 0:g[0];u&&S&&E.some(T=>T.startsWith(S))&&(w=!0),Object.assign(U,{elements:pr(e,t,T=>{if(ke(T)&&(T.fontFamily!==f||d)){let M=Ke(T,{fontFamily:f,lineHeight:Co(f)}),j=(a==null?void 0:a.get(T.containerId||""))||{},D=r.scene.getContainerElement(T);return l&&D&&j&&pe(D,{...j},!1),w||(y=new Set([...y,...Array.from(M.originalText)])),v.set(M,D),M}return T},!0)});let k=`10px ${Gc({fontFamily:f})}`,I=Array.from(y.values()).join();if(w||window.document.fonts.check(k,I))for(let[T,M]of v)hr(T,M,r.scene.getNonDeletedElementsMap(),!1);else window.document.fonts.load(k,I).then(T=>{for(let[M,j]of v){let D=r.scene.getElement(M.id),P=j?r.scene.getElement(j.id):null;D&&hr(D,P,r.scene.getNonDeletedElementsMap(),!1)}r.fonts.onLoaded(T)})}return U},PanelComponent:({elements:e,appState:t,app:n,updateData:r})=>{let a=_.useRef(new Map),i=_.useRef(null),[l,s]=_.useState({}),d=_.useRef(!0),u=_.useMemo(()=>{var f;let o=(m,U)=>mr(m,t,g=>{if(ke(g))return g.fontFamily;let v=Je(g,U);return v?v.fontFamily:null},g=>ke(g)||Je(g,U)!==null,g=>g?null:t.currentItemFontFamily||Es);return l.openPopup==="fontFamily"&&t.openPopup==="fontFamily"?o(Array.from(((f=a.current)==null?void 0:f.values())??[]),a.current):!l.openPopup&&t.openPopup!=="fontFamily"?o(e,n.scene.getNonDeletedElementsMap()):i.current},[l.openPopup,t,e,n.scene]);return _.useEffect(()=>{i.current=u},[u]),_.useEffect(()=>{Object.keys(l).length&&(r(l),s({}))},[l]),_.useEffect(()=>(d.current=!1,()=>{d.current=!0}),[]),p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.fontFamily")}),p.jsx(dte,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:u,hoveredFontFamily:t.currentHoveredFontFamily,onSelect:o=>{s({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:o}),a.current.clear()},onHover:o=>{s({currentHoveredFontFamily:o,cachedElements:new Map(a.current),resetContainers:!0})},onLeave:()=>{s({currentHoveredFontFamily:null,cachedElements:new Map(a.current),resetAll:!0})},onPopupChange:o=>{if(o){a.current.clear();let{editingTextElement:f}=t;if((f==null?void 0:f.type)==="text"){let m=n.scene.getElement(f.id);a.current.set(f.id,Ke(m||f,{},!0))}else{let m=tt(e,t,{includeBoundTextElement:!0});for(let U of m)a.current.set(U.id,Ke(U,{},!0))}s({openPopup:"fontFamily"})}else{let f={openPopup:null,currentHoveredFontFamily:null,cachedElements:new Map(a.current),resetAll:!0};d.current?r({...l,...f}):s(f),a.current.clear()}}})]})}});xe({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,n,r)=>({elements:pr(e,t,a=>{if(ke(a)){let i=Ke(a,{textAlign:n});return hr(i,r.scene.getContainerElement(a),r.scene.getNonDeletedElementsMap()),i}return a},!0),appState:{...t,currentItemTextAlign:n},captureUpdate:ie.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>{let a=r.scene.getNonDeletedElementsMap();return p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.textAlign")}),p.jsx(Ai,{group:"text-align",options:[{value:"left",text:L("labels.left"),icon:iz,testId:"align-left"},{value:"center",text:L("labels.center"),icon:lz,testId:"align-horizontal-center"},{value:"right",text:L("labels.right"),icon:sz,testId:"align-right"}],value:mr(e,t,i=>{if(ke(i))return i.textAlign;let l=Je(i,a);return l?l.textAlign:null},i=>ke(i)||Je(i,a)!==null,i=>i?null:t.currentItemTextAlign),onChange:i=>n(i)})]})}});xe({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:pr(e,t,a=>{if(ke(a)){let i=Ke(a,{verticalAlign:n});return hr(i,r.scene.getContainerElement(a),r.scene.getNonDeletedElementsMap()),i}return a},!0),appState:{...t},captureUpdate:ie.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>p.jsx("fieldset",{children:p.jsx(Ai,{group:"text-align",options:[{value:Br.TOP,text:L("labels.alignTop"),icon:p.jsx(oz,{theme:t.theme}),testId:"align-top"},{value:Br.MIDDLE,text:L("labels.centerVertically"),icon:p.jsx(dz,{theme:t.theme}),testId:"align-middle"},{value:Br.BOTTOM,text:L("labels.alignBottom"),icon:p.jsx(cz,{theme:t.theme}),testId:"align-bottom"}],value:mr(e,t,a=>{if(ke(a)&&a.containerId)return a.verticalAlign;let i=Je(a,r.scene.getNonDeletedElementsMap());return i?i.verticalAlign:null},a=>ke(a)||Je(a,r.scene.getNonDeletedElementsMap())!==null,a=>a?null:Br.MIDDLE),onChange:a=>n(a)})})});xe({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,n)=>({elements:pr(e,t,r=>Me(r)?r:Ke(r,{roundness:n==="round"?{type:fd(r.type)?bn.ADAPTIVE_RADIUS:bn.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:n},captureUpdate:ie.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=iC(Rt(e),t).some(a=>{var i;return((i=a.roundness)==null?void 0:i.type)===bn.LEGACY});return p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.edges")}),p.jsx(Ai,{group:"edges",options:[{value:"sharp",text:L("labels.sharp"),icon:z$},{value:"round",text:L("labels.round"),icon:F$}],value:mr(e,t,a=>r?null:a.roundness?"round":"sharp",a=>!nt(a)&&a.hasOwnProperty("roundness"),a=>a?null:t.currentItemRoundness),onChange:a=>n(a)})]})}});var fx=e=>[{value:null,text:L("labels.arrowhead_none"),keyBinding:"q",icon:B$},{value:"arrow",text:L("labels.arrowhead_arrow"),keyBinding:"w",icon:p.jsx(H$,{flip:e})},{value:"triangle",text:L("labels.arrowhead_triangle"),icon:p.jsx(G$,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:L("labels.arrowhead_triangle_outline"),icon:p.jsx(Y$,{flip:e}),keyBinding:"r"},{value:"circle",text:L("labels.arrowhead_circle"),keyBinding:"a",icon:p.jsx(W$,{flip:e})},{value:"circle_outline",text:L("labels.arrowhead_circle_outline"),keyBinding:"s",icon:p.jsx(X$,{flip:e})},{value:"diamond",text:L("labels.arrowhead_diamond"),icon:p.jsx(Z$,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:L("labels.arrowhead_diamond_outline"),icon:p.jsx(K$,{flip:e}),keyBinding:"f"},{value:"bar",text:L("labels.arrowhead_bar"),keyBinding:"z",icon:p.jsx(V$,{flip:e})},{value:"crowfoot_one",text:L("labels.arrowhead_crowfoot_one"),icon:p.jsx(Q$,{flip:e}),keyBinding:"c"},{value:"crowfoot_many",text:L("labels.arrowhead_crowfoot_many"),icon:p.jsx(q$,{flip:e}),keyBinding:"x"},{value:"crowfoot_one_or_many",text:L("labels.arrowhead_crowfoot_one_or_many"),icon:p.jsx(J$,{flip:e}),keyBinding:"v"}];xe({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,n)=>({elements:pr(e,t,r=>{if(Ge(r)){let{position:a,type:i}=n;if(a==="start")return Ke(r,{startArrowhead:i});if(a==="end")return Ke(r,{endArrowhead:i})}return r}),appState:{...t,[n.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:n.type},captureUpdate:ie.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=Sf().rtl;return p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.arrowheads")}),p.jsxs("div",{className:"iconSelectList buttonList",children:[p.jsx(cx,{label:"arrowhead_start",options:fx(!r),value:mr(e,t,a=>Ge(a)&&Bp(a.type)?a.startArrowhead:t.currentItemStartArrowhead,!0,t.currentItemStartArrowhead),onChange:a=>n({position:"start",type:a}),numberOfOptionsToAlwaysShow:4}),p.jsx(cx,{label:"arrowhead_end",group:"arrowheads",options:fx(!!r),value:mr(e,t,a=>Ge(a)&&Bp(a.type)?a.endArrowhead:t.currentItemEndArrowhead,!0,t.currentItemEndArrowhead),onChange:a=>n({position:"end",type:a}),numberOfOptionsToAlwaysShow:4})]})]})}});xe({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,n,r)=>{var s;let a=pr(e,t,d=>{if(!nt(d))return d;let u=Ke(d,{roundness:n===On.round?{type:bn.PROPORTIONAL_RADIUS}:null,elbowed:n===On.elbow,points:n===On.elbow||d.elbowed?[d.points[0],d.points[d.points.length-1]]:d.points});if(Me(u)){let o=r.scene.getNonDeletedElementsMap();r.dismissLinearEditor();let f=Ce.getPointAtIndexGlobalCoordinates(u,0,o),m=Ce.getPointAtIndexGlobalCoordinates(u,-1,o),U=!u.startBinding&&Oa(Pa(f),e,o,t.zoom,!1,!0),g=!u.endBinding&&Oa(Pa(m),e,o,t.zoom,!1,!0),v=U||u.startBinding&&o.get(u.startBinding.elementId),y=g||u.endBinding&&o.get(u.endBinding.elementId),w=U?hf(u,U,"start"):f,E=g?hf(u,g,"end"):m;U&&Ei(u,U,"start",o),g&&Ei(u,g,"end",o),pe(u,{points:[w,E].map(S=>A(S[0]-u.x,S[1]-u.y)),...v&&u.startBinding?{startBinding:{...u.startBinding,...Xp(u,v,"start")}}:{},...y&&u.endBinding?{endBinding:{...u.endBinding,...Xp(u,y,"end")}}:{}}),Ce.updateEditorMidPointsCache(u,o,r.state)}return u}),i={...t,currentItemArrowType:n},l=(s=t.selectedLinearElement)==null?void 0:s.elementId;if(l){let d=a.find(u=>u.id===l);d&&(i.selectedLinearElement=new Ce(d))}return{elements:a,appState:i,captureUpdate:ie.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:n})=>p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.arrowtypes")}),p.jsx(Ai,{group:"arrowtypes",options:[{value:On.sharp,text:L("labels.arrowtype_sharp"),icon:Pz,testId:"sharp-arrow"},{value:On.round,text:L("labels.arrowtype_round"),icon:Oz,testId:"round-arrow"},{value:On.elbow,text:L("labels.arrowtype_elbowed"),icon:Nz,testId:"elbow-arrow"}],value:mr(e,t,r=>nt(r)?r.elbowed?On.elbow:r.roundness?On.round:On.sharp:null,r=>nt(r),r=>r?null:t.currentItemArrowType),onChange:r=>n(r)})]})});var so=({viewportX:e,viewportY:t,nextZoom:n},r)=>{let a=e-r.offsetLeft,i=t-r.offsetTop,l=r.zoom.value,s=r.scrollX+(a-a/l),d=r.scrollY+(i-i/l),u=-(a-a/n),o=-(i-i/n);return{scrollX:s+u,scrollY:d+o,zoom:{value:n}}},Vu=()=>{let e=document.querySelector(".excalidraw-tooltip");if(e)return e;let t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},o_=(e,t,n="bottom")=>{let r=e.getBoundingClientRect(),a=window.innerWidth,i=window.innerHeight,l=5,s=t.left+t.width/2-r.width/2;s<0?s=l:s+r.width>=a&&(s=a-r.width-l);let d;n==="bottom"?(d=t.top+t.height+l,d+r.height>=i&&(d=t.top-r.height-l)):(d=t.top-r.height-l,d<0&&(d=t.top+t.height+l)),Object.assign(e.style,{top:`${d}px`,left:`${s}px`})},hte=(e,t,n,r)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=r?"50ch":"10ch",t.style.maxWidth=r?"50ch":"15ch",t.textContent=n;let a=e.getBoundingClientRect();o_(t,a)},Ro=({children:e,label:t,long:n=!1,style:r,disabled:a})=>(_.useEffect(()=>()=>Vu().classList.remove("excalidraw-tooltip--visible"),[]),a?null:p.jsx("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:i=>hte(i.currentTarget,Vu(),t,n),onPointerLeave:()=>Vu().classList.remove("excalidraw-tooltip--visible"),style:r,children:e}));xe({name:"changeViewBackgroundColor",label:"labels.canvasBackground",paletteName:"Change canvas background color",trackEvent:!1,predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,n)=>({appState:{...t,...n},captureUpdate:n.viewBackgroundColor?ie.IMMEDIATELY:ie.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:r})=>p.jsx(H8,{palette:null,topPicks:wE,label:L("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:a=>n({viewBackgroundColor:a}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:n})});var Gu=xe({name:"clearCanvas",label:"labels.clearCanvas",paletteName:"Clear canvas",icon:So,trackEvent:{category:"canvas"},predicate:(e,t,n,r)=>{var a;return!!r.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&((a=t.openDialog)==null?void 0:a.name)!=="elementLinkSelector"},perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map(a=>Ke(a,{isDeleted:!0})),appState:{...wi(),files:{},theme:t.theme,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,gridStep:t.gridStep,gridModeEnabled:t.gridModeEnabled,stats:t.stats,pasteDialog:t.pasteDialog,activeTool:t.activeTool.type==="image"?{...t.activeTool,type:"selection"}:t.activeTool},captureUpdate:ie.IMMEDIATELY})}),hx=xe({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:Nv,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:{...t,...so({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:nl(t.zoom.value+w0)},t),userToFollow:null},captureUpdate:ie.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>p.jsx(dt,{type:"button",className:"zoom-in-button zoom-button",icon:Nv,title:`${L("buttons.zoomIn")} — ${he("CtrlOrCmd++")}`,"aria-label":L("buttons.zoomIn"),disabled:t.zoom.value>=p5,onClick:()=>{e(null)}}),keyTest:e=>(e.code===ft.EQUAL||e.code===ft.NUM_ADD)&&(e[B.CTRL_OR_CMD]||e.shiftKey)}),px=xe({name:"zoomOut",label:"buttons.zoomOut",icon:Ov,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:{...t,...so({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:nl(t.zoom.value-w0)},t),userToFollow:null},captureUpdate:ie.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>p.jsx(dt,{type:"button",className:"zoom-out-button zoom-button",icon:Ov,title:`${L("buttons.zoomOut")} — ${he("CtrlOrCmd+-")}`,"aria-label":L("buttons.zoomOut"),disabled:t.zoom.value<=h5,onClick:()=>{e(null)}}),keyTest:e=>(e.code===ft.MINUS||e.code===ft.NUM_SUBTRACT)&&(e[B.CTRL_OR_CMD]||e.shiftKey)}),mx=xe({name:"resetZoom",label:"buttons.resetZoom",icon:m$,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:{...t,...so({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:nl(1)},t),userToFollow:null},captureUpdate:ie.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>p.jsx(Ro,{label:L("buttons.resetZoom"),style:{height:"100%"},children:p.jsxs(dt,{type:"button",className:"reset-zoom-button zoom-button",title:L("buttons.resetZoom"),"aria-label":L("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===ft.ZERO||e.code===ft.NUM_ZERO)&&(e[B.CTRL_OR_CMD]||e.shiftKey)}),pte=(e,t,n=1)=>{let[r,a,i,l]=e,s=i-r,d=t.width/s,u=l-a,o=t.height/u,f=Math.min(d,o)*lt(n,.1,1);return Math.min(f,1)},c_=({bounds:e,appState:t,canvasOffsets:n,fitToViewport:r=!1,viewportZoomFactor:a=1,minZoom:i=-1/0,maxZoom:l=1/0})=>{a=lt(a,h5,p5);let[s,d,u,o]=e,f=(s+u)/2,m=(d+o)/2,U=(n==null?void 0:n.left)??0,g=(n==null?void 0:n.top)??0,v=(n==null?void 0:n.right)??0,y=(n==null?void 0:n.bottom)??0,w=t.width-U-v,E=t.height-g-y,S;if(r){let T=u-s,M=o-d;S=Math.min(w/T,E/M)*a}else S=pte(e,{width:w,height:E},a);let k=nl(lt(aO(S,w0,"floor"),i,l)),I=tk({scenePoint:{x:f,y:m},viewportDimensions:{width:t.width,height:t.height},offsets:n,zoom:{value:k}});return{appState:{...t,scrollX:I.scrollX,scrollY:I.scrollY,zoom:{value:k}},captureUpdate:ie.EVENTUALLY}},sm=({canvasOffsets:e,targetElements:t,appState:n,fitToViewport:r,viewportZoomFactor:a,minZoom:i,maxZoom:l})=>{let s=xt(Rt(t));return c_({canvasOffsets:e,bounds:s,appState:n,fitToViewport:r,viewportZoomFactor:a,minZoom:i,maxZoom:l})};xe({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:T5,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t);return sm({targetElements:a.length?a:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:r.getEditorUIOffsets()})},keyTest:e=>e.code===ft.TWO&&e.shiftKey&&!e.altKey&&!e[B.CTRL_OR_CMD]});xe({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:T5,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t);return sm({targetElements:a.length?a:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:r.getEditorUIOffsets()})},keyTest:e=>e.code===ft.THREE&&e.shiftKey&&!e.altKey&&!e[B.CTRL_OR_CMD]});xe({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:T5,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,r)=>sm({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:r.getEditorUIOffsets()}),keyTest:e=>e.code===ft.ONE&&e.shiftKey&&!e.altKey&&!e[B.CTRL_OR_CMD]});var d0=xe({name:"toggleTheme",label:(e,t)=>t.theme===ot.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:e=>e.theme===ot.LIGHT?Jg:e6,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n)=>({appState:{...t,theme:n||(t.theme===ot.LIGHT?ot.DARK:ot.LIGHT)},captureUpdate:ie.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===ft.D,predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.toggleTheme});xe({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t)=>{let n;return ci(t)?n=gn(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):n=gn(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:n},captureUpdate:ie.IMMEDIATELY}},keyTest:e=>e.key===B.E});var mte=xe({name:"toggleHandTool",label:"toolBar.hand",paletteName:"Toggle hand tool",trackEvent:{category:"toolbar"},icon:oS,viewMode:!1,perform:(e,t,n,r)=>{let a;return Vc(t)?a=gn(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(a=gn(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),It(r.interactiveCanvas,kt.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:a},captureUpdate:ie.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[B.CTRL_OR_CMD]&&e.key===B.H}),Ia=xe({name:"finalize",label:"",trackEvent:!1,perform:(e,t,n,r)=>{var m;let{interactiveCanvas:a,focusContainer:i,scene:l}=r,s=l.getNonDeletedElementsMap();if(t.editingLinearElement){let{elementId:U,startBindingElement:g,endBindingElement:v}=t.editingLinearElement,y=Ce.getElement(U,s);if(y)return mi(y)&&L0(y,g,v,s,l),{elements:y.points.length<2||_o(y)?e.filter(w=>w.id!==y.id):void 0,appState:{...t,cursorButton:"up",editingLinearElement:null},captureUpdate:ie.IMMEDIATELY}}let d=e,u=t.pendingImageElementId&&l.getElement(t.pendingImageElementId);u&&pe(u,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&i();let o=t.multiElement?t.multiElement:((m=t.newElement)==null?void 0:m.type)==="freedraw"?t.newElement:null;if(o){if(o.type!=="freedraw"&&t.lastPointerDownWith!=="touch"){let{points:g,lastCommittedPoint:v}=o;(!v||g[g.length-1]!==v)&&pe(o,{points:o.points.slice(0,-1)})}_o(o)&&(d=d.filter(g=>g.id!==o.id));let U=sl(o.points,t.zoom.value);if((o.type==="line"||o.type==="freedraw")&&U){let g=o.points,v=g[0];pe(o,{points:g.map((y,w)=>w===g.length-1?A(v[0],v[1]):y)})}if(mi(o)&&!U&&o.points.length>1){let[g,v]=Ce.getPointAtIndexGlobalCoordinates(o,-1,We(e));c6(o,t,{x:g,y:v},s,e)}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!o)&&Ta(a);let f;return t.activeTool.type==="eraser"?f=gn(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):f=gn(t,{type:"selection"}),{elements:d,appState:{...t,cursorButton:"up",activeTool:(t.activeTool.locked||t.activeTool.type==="freedraw")&&o?t.activeTool:f,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:o&&!t.activeTool.locked&&t.activeTool.type!=="freedraw"?{...t.selectedElementIds,[o.id]:!0}:t.selectedElementIds,selectedLinearElement:o&&Ge(o)?new Ce(o):t.selectedLinearElement,pendingImageElementId:null},captureUpdate:ie.IMMEDIATELY}},keyTest:(e,t)=>e.key===B.ESCAPE&&(t.editingLinearElement!==null||!t.newElement&&t.multiElement===null)||(e.key===B.ESCAPE||e.key===B.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:n})=>p.jsx(dt,{type:"button",icon:k$,title:L("buttons.done"),"aria-label":L("buttons.done"),onClick:t,visible:e.multiElement!=null,size:(n==null?void 0:n.size)||"medium",style:{pointerEvents:"all"}})}),Ute=e=>{let{id:t}=ji(),[n,r]=_.useState(e.value),a=l=>{e.ignoreFocus||kO(l.target);let s=l.target.value;s!==e.value&&e.onChange(s)},i=l=>{if(l.key===B.ENTER){if(l.preventDefault(),l.nativeEvent.isComposing||l.keyCode===229)return;l.currentTarget.blur()}};return p.jsxs("div",{className:"ProjectName",children:[p.jsx("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),p.jsx("input",{type:"text",className:"TextInput",onBlur:a,onKeyDown:i,id:`${t}-filename`,value:n,onChange:l=>r(l.target.value)})]})},gte=e=>{let t=e.title||(e.value===ot.DARK?L("buttons.lightMode"):L("buttons.darkMode"));return p.jsx(dt,{type:"icon",icon:e.value===ot.LIGHT?Ux.MOON:Ux.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===ot.DARK?ot.LIGHT:ot.DARK),"data-testid":"toggle-dark-mode"})},Ux={SUN:p.jsx("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:p.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:p.jsx("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:p.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"})})},om=(e,{selectedElementIds:t},n)=>{e=Rt(e);let r=n&&En(e,{selectedElementIds:t}),a=null,i=r?tt(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return r&&(i.length===1&&He(i[0])?(a=i[0],i=u8(e,a)):i.length>1&&(i=tt(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:a,exportedElements:rl(i)}},cm=async(e,t,n,r,{exportBackground:a,exportPadding:i=dd,viewBackgroundColor:l,name:s=n.name||TE,fileHandle:d=null,exportingFrame:u=null})=>{if(t.length===0)throw new Error(L("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let f=Z5(t,{exportBackground:a,exportWithDarkMode:n.exportWithDarkMode,viewBackgroundColor:l,exportPadding:i,exportScale:n.exportScale,exportEmbedScene:n.exportEmbedScene&&e==="svg"},r,{exportingFrame:u});if(e==="svg")return Kp(f.then(m=>new Blob([m.outerHTML],{type:De.svg})),{description:"Export to SVG",name:s,extension:n.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[Xc.svg],fileHandle:d});if(e==="clipboard-svg"){let m=await f.then(U=>U.outerHTML);try{await Wf(m)}catch{throw new Error(L("errors.copyToSystemClipboardFailed"))}return}}let o=Fk(t,n,r,{exportBackground:a,viewBackgroundColor:l,exportPadding:i,exportingFrame:u});if(e==="png"){let f=xf(o);return n.exportEmbedScene&&(f=f.then(m=>Re(async()=>{const{encodePngMetadata:U}=await Promise.resolve().then(()=>KT);return{encodePngMetadata:U}},void 0).then(({encodePngMetadata:U})=>U({blob:m,metadata:Ff(t,n,r)})))),Kp(f,{description:"Export to PNG",name:s,extension:n.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[Xc.png],fileHandle:d})}else if(e==="clipboard")try{let f=xf(o);await jY(f)}catch(f){throw console.warn(f),f.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(L("canvasError.canvasTooBig")):lf&&f.name==="TypeError"?new Error(`${L("alerts.couldNotCopyToClipboard")}
|
|
149
|
+
|
|
150
|
+
${L("hints.firefox_clipboard_write")}`):new Error(L("alerts.couldNotCopyToClipboard"))}else throw new Error("Unsupported export type")},bte=async(e,t,n,r)=>{let{exportBackground:a,viewBackgroundColor:i,fileHandle:l}=t,s=mC(l);if(!l||!hZ(s))throw new Error("fileHandle should exist and should be of type svg or png when resaving");t={...t,exportEmbedScene:!0};let{exportedElements:d,exportingFrame:u}=om(e,t,!1);return await cm(s,d,t,n,{exportBackground:a,viewBackgroundColor:i,name:r,fileHandle:l,exportingFrame:u}),{fileHandle:l}},G8=({children:e,checked:t,onChange:n,className:r})=>p.jsxs("div",{className:Ae("Checkbox",r,{"is-checked":t}),onClick:a=>{n(!t,a),a.currentTarget.querySelector(".Checkbox-box").focus()},children:[p.jsx("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:y$}),p.jsx("div",{className:"Checkbox-label",children:e})]}),vte=xe({name:"changeProjectName",label:"labels.fileTitle",trackEvent:!1,perform:(e,t,n)=>({appState:{...t,name:n},captureUpdate:ie.EVENTUALLY}),PanelComponent:({appState:e,updateData:t,appProps:n,data:r,app:a})=>p.jsx(Ute,{label:L("labels.fileTitle"),value:a.getName(),onChange:i=>t(i),ignoreFocus:(r==null?void 0:r.ignoreFocus)??!1})}),yte=xe({name:"changeExportScale",label:"imageExportDialog.scale",trackEvent:{category:"export",action:"scale"},perform:(e,t,n)=>({appState:{...t,exportScale:n},captureUpdate:ie.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=Rt(e),a=En(r,t)?tt(r,t):r;return p.jsx(p.Fragment,{children:U5.map(i=>{let[l,s]=qG(a,dd,i),d=`${L("imageExportDialog.label.scale")} ${i}x (${l}x${s})`;return p.jsx(dt,{size:"small",type:"radio",icon:`${i}x`,name:"export-canvas-scale",title:d,"aria-label":d,id:"export-canvas-scale",checked:i===t.exportScale,onChange:()=>n(i)},i)})})}}),xte=xe({name:"changeExportBackground",label:"imageExportDialog.label.withBackground",trackEvent:{category:"export",action:"toggleBackground"},perform:(e,t,n)=>({appState:{...t,exportBackground:n},captureUpdate:ie.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>p.jsx(G8,{checked:e.exportBackground,onChange:n=>t(n),children:L("imageExportDialog.label.withBackground")})}),d_=xe({name:"changeExportEmbedScene",label:"imageExportDialog.tooltip.embedScene",trackEvent:{category:"export",action:"embedScene"},perform:(e,t,n)=>({appState:{...t,exportEmbedScene:n},captureUpdate:ie.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>p.jsxs(G8,{checked:e.exportEmbedScene,onChange:n=>t(n),children:[L("imageExportDialog.label.embedScene"),p.jsx(Ro,{label:L("imageExportDialog.tooltip.embedScene"),long:!0,children:p.jsx("div",{className:"excalidraw-tooltip-icon",children:C$})})]})}),gx=xe({name:"saveToActiveFile",label:"buttons.save",icon:I0,trackEvent:{category:"export"},predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.saveToActiveFile&&!!t.fileHandle&&!t.viewModeEnabled,perform:async(e,t,n,r)=>{let a=!!t.fileHandle;try{let{fileHandle:i}=v8(t.fileHandle)?await bte(e,t,r.files,r.getName()):await Ck(e,t,r.files,r.getName());return{captureUpdate:ie.EVENTUALLY,appState:{...t,fileHandle:i,toast:a?{message:i!=null&&i.name?L("toast.fileSavedToFilename").replace("{filename}",`"${i.name}"`):L("toast.fileSaved")}:null}}}catch(i){return(i==null?void 0:i.name)!=="AbortError"?console.error(i):console.warn(i),{captureUpdate:ie.EVENTUALLY}}},keyTest:e=>e.key===B.S&&e[B.CTRL_OR_CMD]&&!e.shiftKey}),u_=xe({name:"saveFileToDisk",label:"exportDialog.disk_title",icon:I0,viewMode:!0,trackEvent:{category:"export"},perform:async(e,t,n,r)=>{try{let{fileHandle:a}=await Ck(e,{...t,fileHandle:null},r.files,r.getName());return{captureUpdate:ie.EVENTUALLY,appState:{...t,openDialog:null,fileHandle:a,toast:{message:L("toast.fileSaved")}}}}catch(a){return(a==null?void 0:a.name)!=="AbortError"?console.error(a):console.warn(a),{captureUpdate:ie.EVENTUALLY}}},keyTest:e=>e.key===B.S&&e.shiftKey&&e[B.CTRL_OR_CMD],PanelComponent:({updateData:e})=>p.jsx(dt,{type:"button",icon:w$,title:L("buttons.saveAs"),"aria-label":L("buttons.saveAs"),showAriaLabel:Sn().editor.isMobile,hidden:!Do,onClick:()=>e(null),"data-testid":"save-as-button"})}),H6=xe({name:"loadScene",label:"buttons.load",trackEvent:{category:"export"},predicate:(e,t,n,r)=>!!r.props.UIOptions.canvasActions.loadScene&&!t.viewModeEnabled,perform:async(e,t,n,r)=>{try{let{elements:a,appState:i,files:l}=await FG(t,e);return{elements:a,appState:i,files:l,captureUpdate:ie.IMMEDIATELY}}catch(a){return(a==null?void 0:a.name)==="AbortError"?(console.warn(a),!1):{elements:e,appState:{...t,errorMessage:a.message},files:r.files,captureUpdate:ie.EVENTUALLY}}},keyTest:e=>e[B.CTRL_OR_CMD]&&e.key===B.O}),wte=xe({name:"exportWithDarkMode",label:"imageExportDialog.label.darkMode",trackEvent:{category:"export",action:"toggleTheme"},perform:(e,t,n)=>({appState:{...t,exportWithDarkMode:n},captureUpdate:ie.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>p.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:p.jsx(gte,{value:e.exportWithDarkMode?ot.DARK:ot.LIGHT,onChange:n=>{t(n===ot.DARK)},title:L("imageExportDialog.label.darkMode")})})}),f_="{}",Ete=xe({name:"copyStyles",label:"labels.copyStyles",icon:pS,trackEvent:{category:"element"},perform:(e,t,n,r)=>{let a=[],i=e.find(l=>t.selectedElementIds[l.id]);if(a.push(i),i&&Ua(i)){let l=Je(i,r.scene.getNonDeletedElementsMap());a.push(l)}return i&&(f_=JSON.stringify(a)),{appState:{...t,toast:{message:L("toast.copyStyles")}},captureUpdate:ie.EVENTUALLY}},keyTest:e=>e[B.CTRL_OR_CMD]&&e.altKey&&e.code===ft.C}),Ste=xe({name:"pasteStyles",label:"labels.pasteStyles",icon:pS,trackEvent:{category:"element"},perform:(e,t,n,r)=>{let a=JSON.parse(f_),i=a[0],l=a[1];if(!GE(i))return{elements:e,captureUpdate:ie.EVENTUALLY};let s=tt(e,t,{includeBoundTextElement:!0}),d=s.map(u=>u.id);return{elements:e.map(u=>{if(d.includes(u.id)){let o=i;if(ke(u)&&u.containerId&&(o=l),!o)return u;let f=Ke(u,{backgroundColor:o==null?void 0:o.backgroundColor,strokeWidth:o==null?void 0:o.strokeWidth,strokeColor:o==null?void 0:o.strokeColor,strokeStyle:o==null?void 0:o.strokeStyle,fillStyle:o==null?void 0:o.fillStyle,opacity:o==null?void 0:o.opacity,roughness:o==null?void 0:o.roughness,roundness:o.roundness?PO(o.roundness.type,u)?o.roundness:NO(u):null});if(ke(f)){let m=o.fontSize||bl,U=o.fontFamily||Es;f=Ke(f,{fontSize:m,fontFamily:U,textAlign:o.textAlign||jf,lineHeight:o.lineHeight||Co(U)});let g=null;f.containerId&&(g=s.find(v=>ke(f)&&v.id===f.containerId)||null),hr(f,g,r.scene.getNonDeletedElementsMap())}return f.type==="arrow"&&nt(o)&&(f=Ke(f,{startArrowhead:o.startArrowhead,endArrowhead:o.endArrowhead})),He(u)&&(f=Ke(f,{roundness:null,backgroundColor:"transparent"})),f}return u}),captureUpdate:ie.IMMEDIATELY}},keyTest:e=>e[B.CTRL_OR_CMD]&&e.altKey&&e.code===ft.V});xe({name:"toggleCanvasMenu",label:"buttons.menu",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="canvas"?null:"canvas"},captureUpdate:ie.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>p.jsx(dt,{type:"button",icon:eS,"aria-label":L("buttons.menu"),onClick:t,selected:e.openMenu==="canvas"})});xe({name:"toggleEditMenu",label:"buttons.edit",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="shape"?null:"shape"},captureUpdate:ie.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>p.jsx(dt,{visible:b8(t,Rt(e)),type:"button",icon:E$,"aria-label":L("buttons.edit"),onClick:n,selected:t.openMenu==="shape"})});var Y8=xe({name:"toggleShortcuts",label:"welcomeScreen.defaults.helpHint",icon:g$,viewMode:!0,trackEvent:{category:"menu",action:"toggleHelpDialog"},perform:(e,t,n,{focusContainer:r})=>{var a,i;return((a=t.openDialog)==null?void 0:a.name)==="help"&&r(),{appState:{...t,openDialog:((i=t.openDialog)==null?void 0:i.name)==="help"?null:{name:"help"}},captureUpdate:ie.EVENTUALLY}},keyTest:e=>e.key===B.QUESTION_MARK}),kte=e=>{if(e.length>=2){let t=e[0].groupIds;for(let n of t)if(e.reduce((r,a)=>r&&Uf(a,n),!0))return!0}return!1},bx=(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});return r.length>=2&&!kte(r)&&!rC(r)},Cte=xe({name:"group",label:"labels.group",icon:e=>p.jsx(Qv,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,n,r)=>{let a=d8(r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}));if(a.length<2)return{appState:t,elements:e,captureUpdate:ie.EVENTUALLY};let i=fo(t);if(i.length===1){let v=i[0],y=new Set(zt(e,v).map(E=>E.id)),w=new Set(a.map(E=>E.id));if(new Set([...Array.from(y),...Array.from(w)]).size===y.size)return{appState:t,elements:e,captureUpdate:ie.EVENTUALLY}}let l=[...e];new Set(a.map(v=>v.frameId)).size>1&&FY(a).forEach((v,y)=>{W0(v,r.scene.getNonDeletedElementsMap())});let s=ga(),d=We(a);l=l.map(v=>d.get(v.id)?Ke(v,{groupIds:YV(v.groupIds,s,t.editingGroupId)}):v);let u=zt(l,s),o=u[u.length-1],f=l.lastIndexOf(o),m=l.slice(f+1),U=l.slice(0,f).filter(v=>!Uf(v,s)),g=Ci([...U,...u,...m],We(u));return{appState:{...t,...rk(s,{...t,selectedGroupIds:{}},Rt(l))},elements:g,captureUpdate:ie.IMMEDIATELY}},predicate:(e,t,n,r)=>bx(e,t,r),keyTest:e=>!e.shiftKey&&e[B.CTRL_OR_CMD]&&e.key===B.G,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>p.jsx(dt,{hidden:!bx(e,t,r),type:"button",icon:p.jsx(Qv,{theme:t.theme}),onClick:()=>n(null),title:`${L("labels.group")} — ${he("CtrlOrCmd+G")}`,"aria-label":L("labels.group"),visible:En(Rt(e),t)})}),Mte=xe({name:"ungroup",label:"labels.ungroup",icon:e=>p.jsx(Jv,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,n,r)=>{let a=fo(t),i=We(e);if(a.length===0)return{appState:t,elements:e,captureUpdate:ie.EVENTUALLY};let l=[...e],s=[];l=l.map(f=>{Ft(f)&&s.push(f.id);let m=ZV(f.groupIds,t.selectedGroupIds);return m.length===f.groupIds.length?f:Ke(f,{groupIds:m})});let d=fr(t,Rt(l),t,null),u=r.scene.getSelectedElements(t),o=new Set(u.filter(f=>f.frameId).map(f=>f.frameId));return c8(e).filter(f=>o.has(f.id)).forEach(f=>{f&&(l=tC(l,cp(l,f,t,i),f,r))}),d.selectedElementIds=Object.entries(d.selectedElementIds).reduce((f,[m,U])=>(U&&!s.includes(m)&&(f[m]=!0),f),{}),{appState:{...t,...d},elements:l,captureUpdate:ie.IMMEDIATELY}},keyTest:e=>e.shiftKey&&e[B.CTRL_OR_CMD]&&e.key===B.G.toUpperCase(),predicate:(e,t)=>fo(t).length>0,PanelComponent:({elements:e,appState:t,updateData:n})=>p.jsx(dt,{type:"button",hidden:fo(t).length===0,icon:p.jsx(Jv,{theme:t.theme}),onClick:()=>n(null),title:`${L("labels.ungroup")} — ${he("CtrlOrCmd+Shift+G")}`,"aria-label":L("labels.ungroup"),visible:En(Rt(e),t)})}),h_=(e,t,n,r,a,i,l)=>{e.beginPath(),e.moveTo(t+i,n),e.lineTo(t+r-i,n),e.quadraticCurveTo(t+r,n,t+r,n+i),e.lineTo(t+r,n+a-i),e.quadraticCurveTo(t+r,n+a,t+r-i,n+a),e.lineTo(t+i,n+a),e.quadraticCurveTo(t,n+a,t,n+a-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath(),e.fill(),l&&(e.strokeStyle=l),e.stroke()};function Ite(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r}return t}var dm=(e,t)=>`hsl(${Math.abs(Ite((t==null?void 0:t.id)||e))%37*10}, 100%, 83%)`,_te=e=>{var n;let t=(n=e==null?void 0:e.trim())==null?void 0:n.codePointAt(0);return(t?String.fromCodePoint(t):"?").toUpperCase()},Tte=({context:e,renderConfig:t,appState:n,normalizedWidth:r,normalizedHeight:a})=>{for(let[i,l]of t.remotePointerViewportCoords){let{x:s,y:d}=l,u=n.collaborators.get(i);s-=n.offsetLeft,d-=n.offsetTop;let o=11,f=14,m=s<0||s>r-o||d<0||d>a-f;s=Math.max(s,0),s=Math.min(s,r-o),d=Math.max(d,0),d=Math.min(d,a-f);let U=dm(i,u);e.save(),e.strokeStyle=U,e.fillStyle=U;let g=t.remotePointerUserStates.get(i),v=m||g==="idle"||g==="away";v&&(e.globalAlpha=.3),t.remotePointerButton.get(i)==="down"&&(e.beginPath(),e.arc(s,d,15,0,2*Math.PI,!1),e.lineWidth=3,e.strokeStyle="#ffffff88",e.stroke(),e.closePath(),e.beginPath(),e.arc(s,d,15,0,2*Math.PI,!1),e.lineWidth=1,e.strokeStyle=U,e.stroke(),e.closePath());let y=n.theme===ot.DARK?"#2f6330":ON,w=u==null?void 0:u.isSpeaking;w&&(e.fillStyle=y,e.strokeStyle=y,e.lineWidth=10,e.lineJoin="round",e.beginPath(),e.moveTo(s,d),e.lineTo(s+0,d+14),e.lineTo(s+4,d+9),e.lineTo(s+11,d+8),e.closePath(),e.stroke(),e.fill()),e.fillStyle=y1,e.strokeStyle=y1,e.lineWidth=6,e.lineJoin="round",e.beginPath(),e.moveTo(s,d),e.lineTo(s+0,d+14),e.lineTo(s+4,d+9),e.lineTo(s+11,d+8),e.closePath(),e.stroke(),e.fill(),e.fillStyle=U,e.strokeStyle=U,e.lineWidth=2,e.lineJoin="round",e.beginPath(),v?(e.moveTo(s-1,d-1),e.lineTo(s-1,d+15),e.lineTo(s+5,d+10),e.lineTo(s+12,d+9),e.closePath(),e.fill()):(e.moveTo(s,d),e.lineTo(s+0,d+14),e.lineTo(s+4,d+9),e.lineTo(s+11,d+8),e.closePath(),e.fill(),e.stroke());let E=t.remotePointerUsernames.get(i)||"";if(!m&&E){e.font="600 12px sans-serif";let S=(w?s+0:s)+o/2,k=(w?d+0:d)+f+2,I=5,T=3,M=e.measureText(E),j=M.actualBoundingBoxDescent+M.actualBoundingBoxAscent,D=Math.max(j,12),P=S-1,N=k-1,$=M.width+2+I*2+2,z=D+2+T*2+2;if(e.roundRect?(e.beginPath(),e.roundRect(P,N,$,z,8),e.fillStyle=U,e.fill(),e.strokeStyle=y1,e.stroke(),w&&(e.beginPath(),e.roundRect(P-2,N-2,$+4,z+4,8),e.strokeStyle=y,e.stroke())):h_(e,P,N,$,z,8,y1),e.fillStyle=NN,e.fillText(E,S+I+1,k+T+M.actualBoundingBoxAscent+Math.floor((D-j)/2)+2),w){e.fillStyle=y;let Z=8,K=8,Q=5;e.fillRect(P+$+K,N+(z/2-Z/2),2,Z),e.fillRect(P+$+K+Q,N+(z/2-Z*2/2),2,Z*2),e.fillRect(P+$+K+Q*2,N+(z/2-Z/2),2,Z)}}e.restore(),e.closePath()}},vx=({color:e,onClick:t,name:n,src:r,className:a})=>{let i=_te(n),[l,s]=_.useState(!1),d=!l&&r,u=d?void 0:{background:e};return p.jsx("div",{className:Ae("Avatar",a),style:u,onClick:t,children:d?p.jsx("img",{className:"Avatar-img",src:r,alt:i,referrerPolicy:"no-referrer",onError:()=>s(!0)}):i})};xe({name:"goToCollaborator",label:"Go to a collaborator",viewMode:!0,trackEvent:{category:"collab"},perform:(e,t,n)=>{var r;return!n.socketId||((r=t.userToFollow)==null?void 0:r.socketId)===n.socketId||n.isCurrentUser?{appState:{...t,userToFollow:null},captureUpdate:ie.EVENTUALLY}:{appState:{...t,userToFollow:{socketId:n.socketId,username:n.username||""},openMenu:t.openMenu==="canvas"?null:t.openMenu},captureUpdate:ie.EVENTUALLY}},PanelComponent:({updateData:e,data:t,appState:n})=>{let{socketId:r,collaborator:a,withName:i,isBeingFollowed:l}=t,s=dm(r,a),d=Ae({"is-followed":l,"is-current-user":a.isCurrentUser===!0,"is-speaking":a.isSpeaking,"is-in-call":a.isInCall,"is-muted":a.isMuted}),u=a.isInCall?a.isSpeaking?p.jsxs("div",{className:"UserList__collaborator-status-icon-speaking-indicator",title:L("userList.hint.isSpeaking"),children:[p.jsx("div",{}),p.jsx("div",{}),p.jsx("div",{})]}):a.isMuted?p.jsx("div",{className:"UserList__collaborator-status-icon-microphone-muted",title:L("userList.hint.micMuted"),children:Ez}):p.jsx("div",{title:L("userList.hint.inCall"),children:wz}):null;return i?p.jsxs("div",{className:`dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${d}`,style:{"--avatar-size":"1.5rem"},onClick:()=>e(a),children:[p.jsx(vx,{color:s,onClick:()=>{},name:a.username||"",src:a.avatarUrl,className:d}),p.jsx("div",{className:"UserList__collaborator-name",children:a.username}),p.jsxs("div",{className:"UserList__collaborator-status-icons","aria-hidden":!0,children:[l&&p.jsx("div",{className:"UserList__collaborator-status-icon-is-followed",title:L("userList.hint.followStatus"),children:_5}),u]})]}):p.jsxs("div",{className:`UserList__collaborator UserList__collaborator--avatar-only ${d}`,children:[p.jsx(vx,{color:s,onClick:()=>{e(a)},name:a.username||"",src:a.avatarUrl,className:d}),u&&p.jsx("div",{className:"UserList__collaborator-status-icon",children:u})]})}});var Ate=xe({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});for(let i of _E)if(a.some(l=>l.type===i))return{captureUpdate:ie.EVENTUALLY,appState:{...t,errorMessage:L(`errors.libraryElementTypeError.${i}`)}};return r.library.getLatestLibrary().then(i=>r.library.setLibrary([{id:ga(),status:"unpublished",elements:a.map(No),created:Date.now()},...i])).then(()=>({captureUpdate:ie.EVENTUALLY,appState:{...t,toast:{message:L("toast.addedToLibrary")}}})).catch(i=>({captureUpdate:ie.EVENTUALLY,appState:{...t,errorMessage:i.message}}))},label:"labels.addToLibrary"}),Rte=(e,t,n,r)=>{let a=O0(e,t),i=Ha(e);return a.flatMap(l=>{let s=jte(l,i,n);return l.map(d=>{let u=pe(d,{x:d.x+s.x,y:d.y+s.y});return Ar(d,r.getNonDeletedElementsMap(),{simultaneouslyUpdated:l}),u})})},jte=(e,t,{axis:n,position:r})=>{let a=Ha(e),[i,l]=n==="x"?["minX","maxX"]:["minY","maxY"],s={x:0,y:0};return r==="start"?{...s,[n]:t[i]-a[i]}:r==="end"?{...s,[n]:t[l]-a[l]}:{...s,[n]:(t[i]+t[l])/2-(a[i]+a[l])/2}},Xr=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length>1&&!n.some(r=>He(r))},gd=(e,t,n,r)=>{let a=n.scene.getSelectedElements(t),i=We(e),l=Rte(a,i,r,n.scene),s=We(l);return ad(e.map(d=>s.get(d.id)||d),t,n)};xe({name:"alignTop",label:"labels.alignTop",icon:Vv,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Xr(t,r),perform:(e,t,n,r)=>({appState:t,elements:gd(e,t,r,{position:"start",axis:"y"}),captureUpdate:ie.IMMEDIATELY}),keyTest:e=>e[B.CTRL_OR_CMD]&&e.shiftKey&&e.key===B.ARROW_UP,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>p.jsx(dt,{hidden:!Xr(t,r),type:"button",icon:Vv,onClick:()=>n(null),title:`${L("labels.alignTop")} — ${he("CtrlOrCmd+Shift+Up")}`,"aria-label":L("labels.alignTop"),visible:En(Rt(e),t)})});xe({name:"alignBottom",label:"labels.alignBottom",icon:Gv,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Xr(t,r),perform:(e,t,n,r)=>({appState:t,elements:gd(e,t,r,{position:"end",axis:"y"}),captureUpdate:ie.IMMEDIATELY}),keyTest:e=>e[B.CTRL_OR_CMD]&&e.shiftKey&&e.key===B.ARROW_DOWN,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>p.jsx(dt,{hidden:!Xr(t,r),type:"button",icon:Gv,onClick:()=>n(null),title:`${L("labels.alignBottom")} — ${he("CtrlOrCmd+Shift+Down")}`,"aria-label":L("labels.alignBottom"),visible:En(Rt(e),t)})});xe({name:"alignLeft",label:"labels.alignLeft",icon:Yv,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Xr(t,r),perform:(e,t,n,r)=>({appState:t,elements:gd(e,t,r,{position:"start",axis:"x"}),captureUpdate:ie.IMMEDIATELY}),keyTest:e=>e[B.CTRL_OR_CMD]&&e.shiftKey&&e.key===B.ARROW_LEFT,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>p.jsx(dt,{hidden:!Xr(t,r),type:"button",icon:Yv,onClick:()=>n(null),title:`${L("labels.alignLeft")} — ${he("CtrlOrCmd+Shift+Left")}`,"aria-label":L("labels.alignLeft"),visible:En(Rt(e),t)})});xe({name:"alignRight",label:"labels.alignRight",icon:Zv,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Xr(t,r),perform:(e,t,n,r)=>({appState:t,elements:gd(e,t,r,{position:"end",axis:"x"}),captureUpdate:ie.IMMEDIATELY}),keyTest:e=>e[B.CTRL_OR_CMD]&&e.shiftKey&&e.key===B.ARROW_RIGHT,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>p.jsx(dt,{hidden:!Xr(t,r),type:"button",icon:Zv,onClick:()=>n(null),title:`${L("labels.alignRight")} — ${he("CtrlOrCmd+Shift+Right")}`,"aria-label":L("labels.alignRight"),visible:En(Rt(e),t)})});xe({name:"alignVerticallyCentered",label:"labels.centerVertically",icon:Kv,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Xr(t,r),perform:(e,t,n,r)=>({appState:t,elements:gd(e,t,r,{position:"center",axis:"y"}),captureUpdate:ie.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>p.jsx(dt,{hidden:!Xr(t,r),type:"button",icon:Kv,onClick:()=>n(null),title:L("labels.centerVertically"),"aria-label":L("labels.centerVertically"),visible:En(Rt(e),t)})});xe({name:"alignHorizontallyCentered",label:"labels.centerHorizontally",icon:qv,trackEvent:{category:"element"},predicate:(e,t,n,r)=>Xr(t,r),perform:(e,t,n,r)=>({appState:t,elements:gd(e,t,r,{position:"center",axis:"x"}),captureUpdate:ie.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>p.jsx(dt,{hidden:!Xr(t,r),type:"button",icon:qv,onClick:()=>n(null),title:L("labels.centerHorizontally"),"aria-label":L("labels.centerHorizontally"),visible:En(Rt(e),t)})});var Lte=(e,t,n)=>{let[r,a,i,l]=n.axis==="x"?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],s=Ha(e),d=O0(e,t).map(m=>[m,Ha(m)]).sort((m,U)=>m[1][a]-U[1][a]),u=0;for(let m of d)u+=m[1][l];let o=(s[l]-u)/(d.length-1);if(o<0){let m=d.findIndex(y=>y[1][r]===s[r]),U=d.findIndex(y=>y[1][i]===s[i]),g=(d[U][1][a]-d[m][1][a])/(d.length-1),v=d[m][1][a];return d.flatMap(([y,w],E)=>{let S={x:0,y:0};return E!==m&&E!==U&&(v+=g,S[n.axis]=v-w[a]),y.map(k=>Ke(k,{x:k.x+S.x,y:k.y+S.y}))})}let f=s[r];return d.flatMap(([m,U])=>{let g={x:0,y:0};return g[n.axis]=f-U[r],f+=o,f+=U[l],m.map(v=>Ke(v,{x:v.x+g.x,y:v.y+g.y}))})},p_=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length>1&&!n.some(r=>He(r))},m_=(e,t,n,r)=>{let a=n.scene.getSelectedElements(t),i=Lte(a,n.scene.getNonDeletedElementsMap(),r),l=We(i);return ad(e.map(s=>l.get(s.id)||s),t,n)};xe({name:"distributeHorizontally",label:"labels.distributeHorizontally",trackEvent:{category:"element"},perform:(e,t,n,r)=>({appState:t,elements:m_(e,t,r,{axis:"x"}),captureUpdate:ie.IMMEDIATELY}),keyTest:e=>!e[B.CTRL_OR_CMD]&&e.altKey&&e.code===ft.H,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>p.jsx(dt,{hidden:!p_(t,r),type:"button",icon:M$,onClick:()=>n(null),title:`${L("labels.distributeHorizontally")} — ${he("Alt+H")}`,"aria-label":L("labels.distributeHorizontally"),visible:En(Rt(e),t)})});xe({name:"distributeVertically",label:"labels.distributeVertically",trackEvent:{category:"element"},perform:(e,t,n,r)=>({appState:t,elements:m_(e,t,r,{axis:"y"}),captureUpdate:ie.IMMEDIATELY}),keyTest:e=>!e[B.CTRL_OR_CMD]&&e.altKey&&e.code===ft.V,PanelComponent:({elements:e,appState:t,updateData:n,app:r})=>p.jsx(dt,{hidden:!p_(t,r),type:"button",icon:I$,onClick:()=>n(null),title:`${L("labels.distributeVertically")} — ${he("Alt+V")}`,"aria-label":L("labels.distributeVertically"),visible:En(Rt(e),t)})});var Dte=xe({name:"flipHorizontal",label:"labels.flipHorizontal",icon:Mz,trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:ad(U_(e,r.scene.getNonDeletedElementsMap(),t,"horizontal",r),t,r),appState:t,captureUpdate:ie.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===ft.H}),Pte=xe({name:"flipVertical",label:"labels.flipVertical",icon:Cz,trackEvent:{category:"element"},perform:(e,t,n,r)=>({elements:ad(U_(e,r.scene.getNonDeletedElementsMap(),t,"vertical",r),t,r),appState:t,captureUpdate:ie.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===ft.V&&!e[B.CTRL_OR_CMD]}),U_=(e,t,n,r,a)=>{let i=tt(Rt(e),n,{includeBoundTextElement:!0,includeElementsInFrames:!0}),l=Nte(i,t,n,r,a),s=We(l);return e.map(d=>s.get(d.id)||d)},Nte=(e,t,n,r,a)=>{if(e.every(U=>nt(U)&&(U.startBinding||U.endBinding)))return e.map(U=>{let g=U;return Ke(g,{startArrowhead:g.endArrowhead,endArrowhead:g.startArrowhead})});let{midX:i,midY:l}=Ha(e);uC(e,t,"nw",a.scene,new Map(Array.from(t.values()).map(U=>[U.id,No(U)])),{flipByX:r==="horizontal",flipByY:r==="vertical",shouldResizeFromCenter:!0,shouldMaintainAspectRatio:!0}),Wp(e.filter(Ge),t,a.scene.getNonDeletedElements(),a.scene,io(n),[],n.zoom);let{elbowArrows:s,otherElements:d}=e.reduce((U,g)=>Me(g)?{...U,elbowArrows:U.elbowArrows.concat(g)}:{...U,otherElements:U.otherElements.concat(g)},{elbowArrows:[],otherElements:[]}),{midX:u,midY:o}=Ha(e),[f,m]=[i-u,l-o];return d.forEach(U=>pe(U,{x:U.x+f,y:U.y+m})),s.forEach(U=>pe(U,{x:U.x+f,y:U.y+m})),e},gp=xe({name:"copy",label:"labels.copy",icon:Qg,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});try{await IY(a,r.files,n)}catch(i){return{captureUpdate:ie.EVENTUALLY,appState:{...t,errorMessage:i.message}}}return{captureUpdate:ie.EVENTUALLY}},keyTest:void 0}),yx=xe({name:"paste",label:"labels.paste",trackEvent:{category:"element"},perform:async(e,t,n,r)=>{let a;try{a=await AY()}catch(i){return i.name==="AbortError"||i.name==="NotAllowedError"?!1:(console.error(`actionPaste ${i.name}: ${i.message}`),lf?{captureUpdate:ie.EVENTUALLY,appState:{...t,errorMessage:L("hints.firefox_clipboard_write")}}:{captureUpdate:ie.EVENTUALLY,appState:{...t,errorMessage:L("errors.asyncPasteFailedOnRead")}})}try{r.pasteFromClipboard(CY({types:a}))}catch(i){return console.error(i),{captureUpdate:ie.EVENTUALLY,appState:{...t,errorMessage:L("errors.asyncPasteFailedOnParse")}}}return{captureUpdate:ie.EVENTUALLY}},keyTest:void 0}),xx=xe({name:"cut",label:"labels.cut",icon:fz,trackEvent:{category:"element"},perform:(e,t,n,r)=>(gp.perform(e,t,n,r),FI.perform(e,t,null,r)),keyTest:e=>e[B.CTRL_OR_CMD]&&e.key===B.X}),wx=xe({name:"copyAsSvg",label:"labels.copyAsSvg",icon:Iz,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{captureUpdate:ie.EVENTUALLY};let{exportedElements:a,exportingFrame:i}=om(e,t,!0);try{await cm("clipboard-svg",a,t,r.files,{...t,exportingFrame:i,name:r.getName()});let l=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});return{appState:{toast:{message:L("toast.copyToClipboardAsSvg",{exportSelection:l.length?L("toast.selection"):L("toast.canvas"),exportColorScheme:t.exportWithDarkMode?L("buttons.darkMode"):L("buttons.lightMode")})}},captureUpdate:ie.EVENTUALLY}}catch(l){return console.error(l),{appState:{errorMessage:l.message},captureUpdate:ie.EVENTUALLY}}},predicate:e=>a8&&e.length>0,keywords:["svg","clipboard","copy"]}),Ex=xe({name:"copyAsPng",label:"labels.copyAsPng",icon:_z,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{captureUpdate:ie.EVENTUALLY};let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),{exportedElements:i,exportingFrame:l}=om(e,t,!0);try{return await cm("clipboard",i,t,r.files,{...t,exportingFrame:l,name:r.getName()}),{appState:{...t,toast:{message:L("toast.copyToClipboardAsPng",{exportSelection:a.length?L("toast.selection"):L("toast.canvas"),exportColorScheme:t.exportWithDarkMode?L("buttons.darkMode"):L("buttons.lightMode")})}},captureUpdate:ie.EVENTUALLY}}catch(s){return console.error(s),{appState:{...t,errorMessage:s.message},captureUpdate:ie.EVENTUALLY}}},predicate:e=>i8&&e.length>0,keyTest:e=>e.code===ft.C&&e.altKey&&e.shiftKey,keywords:["png","clipboard","copy"]}),Sx=xe({name:"copyText",label:"labels.copyText",trackEvent:{category:"element"},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});try{Wf(uk(a))}catch{throw new Error(L("errors.copyToSystemClipboardFailed"))}return{captureUpdate:ie.EVENTUALLY}},predicate:(e,t,n,r)=>a8&&r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}).some(ke),keywords:["text","clipboard","copy"]}),kx=xe({name:"gridMode",icon:Lz,keywords:["snap"],label:"labels.toggleGrid",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>e.gridModeEnabled},perform(e,t){return{appState:{...t,gridModeEnabled:!this.checked(t),objectsSnapModeEnabled:!1},captureUpdate:ie.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[B.CTRL_OR_CMD]&&e.code===ft.QUOTE}),W6=xe({name:"zenMode",label:"buttons.zenMode",icon:Az,paletteName:"Toggle zen mode",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.zenModeEnabled},perform(e,t){return{appState:{...t,zenModeEnabled:!this.checked(t)},captureUpdate:ie.EVENTUALLY}},checked:e=>e.zenModeEnabled,predicate:(e,t,n)=>typeof n.zenModeEnabled>"u",keyTest:e=>!e[B.CTRL_OR_CMD]&&e.altKey&&e.code===ft.Z}),Ote=xe({name:"objectsSnapMode",label:"buttons.objectsSnapMode",icon:Tz,viewMode:!1,trackEvent:{category:"canvas",predicate:e=>!e.objectsSnapModeEnabled},perform(e,t){return{appState:{...t,objectsSnapModeEnabled:!this.checked(t),gridModeEnabled:!1},captureUpdate:ie.EVENTUALLY}},checked:e=>e.objectsSnapModeEnabled,predicate:(e,t,n)=>typeof n.objectsSnapModeEnabled>"u",keyTest:e=>!e[B.CTRL_OR_CMD]&&e.altKey&&e.code===ft.S}),X6=xe({name:"stats",label:"stats.fullTitle",icon:kz,paletteName:"Toggle stats",viewMode:!0,trackEvent:{category:"menu"},keywords:["edit","attributes","customize"],perform(e,t){return{appState:{...t,stats:{...t.stats,open:!this.checked(t)}},captureUpdate:ie.EVENTUALLY}},checked:e=>e.stats.open,keyTest:e=>!e[B.CTRL_OR_CMD]&&e.altKey&&e.code===ft.SLASH}),$te=xe({name:"unbindText",label:"labels.unbindText",trackEvent:{category:"element"},predicate:(e,t,n,r)=>r.scene.getSelectedElements(t).some(a=>Ua(a)),perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t),i=r.scene.getNonDeletedElementsMap();return a.forEach(l=>{var d;let s=Je(l,i);if(s){let{width:u,height:o}=sr(s.originalText,_t(s),s.lineHeight),f=oG(l.id);ck(l.id);let{x:m,y:U}=z0(l,s,i);pe(s,{containerId:null,width:u,height:o,text:s.originalText,x:m,y:U}),pe(l,{boundElements:(d=l.boundElements)==null?void 0:d.filter(g=>g.id!==s.id),height:f||l.height})}}),{elements:e,appState:t,captureUpdate:ie.IMMEDIATELY}}}),zte=xe({name:"bindText",label:"labels.bindText",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t);if(a.length===2){let i=ke(a[0])||ke(a[1]),l;if(uo(a[0])?l=a[0]:uo(a[1])&&(l=a[1]),i&&l&&Je(l,r.scene.getNonDeletedElementsMap())===null)return!0}return!1},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t),i,l;ke(a[0])&&uo(a[1])?(i=a[0],l=a[1]):(i=a[1],l=a[0]),pe(i,{containerId:l.id,verticalAlign:Br.MIDDLE,textAlign:of.CENTER,autoResize:!0}),pe(l,{boundElements:(l.boundElements||[]).concat({type:"text",id:i.id})});let s=l.height;return hr(i,l,r.scene.getNonDeletedElementsMap()),Vp(l.id,s),{elements:Fte(e,l,i),appState:{...t,selectedElementIds:{[l.id]:!0}},captureUpdate:ie.IMMEDIATELY}}}),Fte=(e,t,n)=>{let r=e.slice(),a=r.findIndex(l=>l.id===n.id);r.splice(a,1);let i=r.findIndex(l=>l.id===t.id);return r.splice(i+1,0,n),Ci(r,We([t,n])),r},Bte=(e,t,n)=>{let r=e.slice(),a=r.findIndex(l=>l.id===t.id);r.splice(a,1);let i=r.findIndex(l=>l.id===n.id);return r.splice(i,0,t),Ci(r,We([t,n])),r},Hte=xe({name:"wrapTextInContainer",label:"labels.createContainerFromText",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t),i=a.every(l=>ke(l));return a.length>0&&i},perform:(e,t,n,r)=>{var s;let a=r.scene.getSelectedElements(t),i=e.slice(),l={};for(let d of a)if(ke(d)){let u=ki({type:"rectangle",backgroundColor:t.currentItemBackgroundColor,boundElements:[...d.boundElements||[],{id:d.id,type:"text"}],angle:d.angle,fillStyle:t.currentItemFillStyle,strokeColor:t.currentItemStrokeColor,roughness:t.currentItemRoughness,strokeWidth:t.currentItemStrokeWidth,strokeStyle:t.currentItemStrokeStyle,roundness:t.currentItemRoundness==="round"?{type:fd("rectangle")?bn.ADAPTIVE_RADIUS:bn.PROPORTIONAL_RADIUS}:null,opacity:100,locked:!1,x:d.x-wn,y:d.y-wn,width:Io(d.width,"rectangle"),height:Io(d.height,"rectangle"),groupIds:d.groupIds,frameId:d.frameId});if((s=d.boundElements)!=null&&s.length){let o=d.boundElements.filter(f=>f.type==="arrow").map(f=>f.id);i.filter(f=>o.includes(f.id)).forEach(f=>{let m=f.startBinding,U=f.endBinding;(m==null?void 0:m.elementId)===d.id&&(m={...m,elementId:u.id}),(U==null?void 0:U.elementId)===d.id&&(U={...U,elementId:u.id}),(m||U)&&pe(f,{startBinding:m,endBinding:U},!1)})}pe(d,{containerId:u.id,verticalAlign:Br.MIDDLE,boundElements:null,textAlign:of.CENTER,autoResize:!0},!1),hr(d,u,r.scene.getNonDeletedElementsMap()),i=Bte([...i,u],u,d),l[u.id]=!0}return{elements:i,appState:{...t,selectedElementIds:l},captureUpdate:ie.IMMEDIATELY}}}),Z8=380,Wte=42,V6=5,g_=85,Xte=500,G6=!1,P1=new Map,Vte=({element:e,elementsMap:t,setAppState:n,onLinkOpen:r,setToast:a,updateEmbedValidationStatus:i})=>{let l=Jf(),s=Qf(),d=Sn(),u=e.link||"",[o,f]=_.useState(u),m=_.useRef(null),U=l.showHyperlinkPopup==="editor",g=_.useCallback(()=>{var k;if(!m.current)return;let S=Rr(m.current.value)||null;if(!e.link&&S&&Nt("hyperlink","create"),Cr(e)){if(((k=l.activeEmbeddable)==null?void 0:k.element)===e&&n({activeEmbeddable:null}),!S){pe(e,{link:null}),i(e,!1);return}if(!sp(S,s.validateEmbeddable))S&&a({message:L("toast.unableToEmbed"),closable:!0}),e.link&&P1.set(e.id,e.link),pe(e,{link:S}),i(e,!1);else{let{width:I,height:T}=e,M=Rc(S);(M==null?void 0:M.error)instanceof URIError&&a({message:L("toast.unrecognizedLinkFormat"),closable:!0});let j=M?M.intrinsicSize.w/M.intrinsicSize.h:1,D=P1.get(e.id)!==e.link;pe(e,{...D?{width:(M==null?void 0:M.type)==="video"?I>T?I:T*j:I,height:(M==null?void 0:M.type)==="video"&&I>T?I/j:T}:{},link:S}),i(e,!0),P1.has(e.id)&&P1.delete(e.id)}}else pe(e,{link:S})},[e,a,s.validateEmbeddable,l.activeEmbeddable,n,i]);_.useLayoutEffect(()=>()=>{g()},[g]),_.useEffect(()=>{U&&(m!=null&&m.current)&&!(d.viewport.isMobile||d.isTouchScreen)&&m.current.select()},[U,d.viewport.isMobile,d.isTouchScreen]),_.useEffect(()=>{let S=null,k=I=>{U||(S&&clearTimeout(S),Zte(e,t,l,A(I.clientX,I.clientY))&&(S=window.setTimeout(()=>{n({showHyperlinkPopup:!1})},Xte)))};return window.addEventListener("pointermove",k,!1),()=>{window.removeEventListener("pointermove",k,!1),S&&clearTimeout(S)}},[l,e,U,n,t]);let v=_.useCallback(()=>{Nt("hyperlink","delete"),pe(e,{link:null}),n({showHyperlinkPopup:!1})},[n,e]),y=()=>{Nt("hyperlink","edit","popup-ui"),n({showHyperlinkPopup:"editor"})},{x:w,y:E}=b_(e,l,t);return l.contextMenu||l.selectedElementsAreBeingDragged||l.resizingElement||l.isRotating||l.openMenu||l.viewModeEnabled?null:p.jsxs("div",{className:"excalidraw-hyperlinkContainer",style:{top:`${E}px`,left:`${w}px`,width:Z8,padding:V6},children:[U?p.jsx("input",{className:Ae("excalidraw-hyperlinkContainer-input"),placeholder:L("labels.link.hint"),ref:m,value:o,onChange:S=>f(S.target.value),autoFocus:!0,onKeyDown:S=>{S.stopPropagation(),S[B.CTRL_OR_CMD]&&S.key===B.K&&S.preventDefault(),(S.key===B.ENTER||S.key===B.ESCAPE)&&(g(),n({showHyperlinkPopup:"info"}))}}):e.link?p.jsx("a",{href:Rr(e.link||""),className:"excalidraw-hyperlinkContainer-link",target:fk(e.link)?"_self":"_blank",onClick:S=>{if(e.link&&r){let k=BE("excalidraw-link",S.nativeEvent);r({...e,link:Rr(e.link)},k),k.defaultPrevented&&S.preventDefault()}},rel:"noopener noreferrer",children:e.link}):p.jsx("div",{className:"excalidraw-hyperlinkContainer-link",children:L("labels.link.empty")}),p.jsxs("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!U&&p.jsx(dt,{type:"button",title:L("buttons.edit"),"aria-label":L("buttons.edit"),label:L("buttons.edit"),onClick:y,className:"excalidraw-hyperlinkContainer--edit",icon:uf}),p.jsx(dt,{type:"button",title:L("labels.linkToElement"),"aria-label":L("labels.linkToElement"),label:L("labels.linkToElement"),onClick:()=>{n({openDialog:{name:"elementLinkSelector",sourceElementId:e.id}})},icon:US}),u&&!Cr(e)&&p.jsx(dt,{type:"button",title:L("buttons.remove"),"aria-label":L("buttons.remove"),label:L("buttons.remove"),onClick:v,className:"excalidraw-hyperlinkContainer--remove",icon:So})]})]})},b_=(e,t,n)=>{let[r,a]=Ze(e,n),{x:i,y:l}=oa({sceneX:r+e.width/2,sceneY:a},t),s=i-t.offsetLeft-Z8/2,d=l-t.offsetTop-g_;return{x:s,y:d}},Cx=(e,t)=>{var r;let n=tt(e,t);return Cr(n[0])?"labels.link.editEmbed":(r=n[0])!=null&&r.link?"labels.link.edit":"labels.link.create"},Yu=null,Gte=(e,t,n)=>{Yu&&clearTimeout(Yu),Yu=window.setTimeout(()=>Yte(e,t,n),WN)},Yte=(e,t,n)=>{if(!e.link)return;let r=Vu();r.classList.add("excalidraw-tooltip--visible"),r.style.maxWidth="20rem",r.textContent=Nc(e.link)?L("labels.link.goToElement"):e.link;let[a,i,l,s]=Ze(e,n),[d,u,o,f]=V5([a,i,l,s],e.angle,t),m=oa({sceneX:d,sceneY:u},t);o_(r,{left:m.x,top:m.y,width:o,height:f},"top"),Nt("hyperlink","tooltip","link-icon"),G6=!0},Mx=()=>{Yu&&clearTimeout(Yu),G6&&(G6=!1,Vu().classList.remove("excalidraw-tooltip--visible"))},Zte=(e,t,n,[r,a])=>{let{x:i,y:l}=jt({clientX:r,clientY:a},n),s=15/n.zoom.value;if(R5(i,l,e,t))return!1;let[d,u,o]=Ze(e,t);if(i>=d&&i<=o&&l>=u-g_&&l<=u)return!1;let{x:f,y:m}=b_(e,n,t);return!(r>=f-s&&r<=f+Z8+V6*2+s&&a>=m-s&&a<=m+s+V6*2+Wte)},v_=xe({name:"hyperlink",label:(e,t)=>Cx(e,t),icon:t6,perform:(e,t)=>t.showHyperlinkPopup==="editor"?!1:{elements:e,appState:{...t,showHyperlinkPopup:"editor",openMenu:null},captureUpdate:ie.IMMEDIATELY},trackEvent:{category:"hyperlink",action:"click"},keyTest:e=>e[B.CTRL_OR_CMD]&&e.key===B.K,predicate:(e,t)=>tt(e,t).length===1,PanelComponent:({elements:e,appState:t,updateData:n})=>{let r=tt(e,t);return p.jsx(dt,{type:"button",icon:t6,"aria-label":L(Cx(e,t)),title:`${Cr(e[0])?L("labels.link.labelEmbed"):L("labels.link.label")} - ${he("CtrlOrCmd+K")}`,onClick:()=>n(null),selected:r.length===1&&!!r[0].link})}}),gg=e=>e.every(t=>!t.locked),Kte=xe({name:"toggleElementLock",label:(e,t,n)=>{let r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1});return r.length===1&&!He(r[0])?r[0].locked?"labels.elementLock.unlock":"labels.elementLock.lock":gg(r)?"labels.elementLock.lockAll":"labels.elementLock.unlockAll"},icon:(e,t)=>{let n=tt(t,e);return gg(n)?k5:M0},trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t);return a.length>0&&!a.some(i=>i.locked&&i.frameId)},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});if(!a.length)return!1;let i=gg(a),l=We(a);return{elements:e.map(s=>l.has(s.id)?Ke(s,{locked:i}):s),appState:{...t,selectedLinearElement:i?null:t.selectedLinearElement},captureUpdate:ie.IMMEDIATELY}},keyTest:(e,t,n,r)=>e.key.toLocaleLowerCase()===B.L&&e[B.CTRL_OR_CMD]&&e.shiftKey&&r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}).length>0}),qte=xe({name:"unlockAllElements",paletteName:"Unlock all elements",trackEvent:{category:"canvas"},viewMode:!1,icon:M0,predicate:(e,t)=>tt(e,t).length===0&&e.some(n=>n.locked),perform:(e,t)=>{let n=e.filter(r=>r.locked);return{elements:e.map(r=>r.locked?Ke(r,{locked:!1}):r),appState:{...t,selectedElementIds:Object.fromEntries(n.map(r=>[r.id,!0]))},captureUpdate:ie.IMMEDIATELY}},label:"labels.elementLock.unlockAll"}),Qte=()=>{let[e,t]=_.useState(null),n=_.useCallback(r=>t(r),[]);return[e,n]},Jte=e=>{let{closeOnClickOutside:t=!0}=e,n=qI({className:"excalidraw-modal-container"}),r=_.useRef(document.body.classList.contains("excalidraw-animations-disabled"));if(!n)return null;let a=i=>{i.key===B.ESCAPE&&(i.nativeEvent.stopImmediatePropagation(),i.stopPropagation(),e.onCloseRequest())};return $n.createPortal(p.jsxs("div",{className:Ae("Modal",e.className,{"animations-disabled":r.current}),role:"dialog","aria-modal":"true",onKeyDown:a,"aria-labelledby":e.labelledBy,"data-prevent-outside-click":!0,children:[p.jsx("div",{className:"Modal__background",onClick:t?e.onCloseRequest:void 0}),p.jsx("div",{className:"Modal__content",style:{"--max-width":`${e.maxWidth}px`},tabIndex:0,children:e.children})]}),n)},y_=Hn(new Map),Ix=async e=>await l8({elements:e,appState:{exportBackground:!1,viewBackgroundColor:at.white},files:null,renderEmbeddables:!1,skipInliningFonts:!0}),ene=(e,t,n)=>{let[r,a]=_.useState();return _.useEffect(()=>{if(t)if(e){let i=n.get(e);i?a(i):(async()=>{var s;let l=await Ix(t);(s=l.querySelector(".style-fonts"))==null||s.remove(),l&&(n.set(e,l),a(l))})()}else(async()=>{let i=await Ix(t);a(i)})()},[e,t,n,a]),r},x_=()=>{let[e]=sn(y_);return{clearLibraryCache:()=>e.clear(),deleteItemsFromLibraryCache:t=>{t.forEach(n=>e.delete(n))},svgCache:e}},tne=class{constructor(){F(this,"jobs",[]),F(this,"running",!1)}tick(){if(this.running)return;let e=this.jobs.shift();e?(this.running=!0,e.promise.resolve(Zc(e.jobFactory,...e.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(e,...t){let n=EO();return this.jobs.push({jobFactory:e,promise:n,args:t}),this.tick(),n}},nne=new di,kf=Hn({status:"loaded",isInitialized:!1,libraryItems:[]}),mu=e=>rl(e),rne=(e,t)=>!e.find(n=>n.elements.length!==t.elements.length?!1:n.elements.every((r,a)=>r.id===t.elements[a].id&&r.versionNonce===t.elements[a].versionNonce)),w_=(e,t)=>{let n=[];for(let r of t)rne(e,r)&&n.push(r);return[...n,...e]},ane=(e,t)=>{let n=We(t),r={deletedItems:new Map,addedItems:new Map};for(let i of e)n.has(i.id)||r.deletedItems.set(i.id,i);let a=We(e);for(let i of t)a.has(i.id)||r.addedItems.set(i.id,i);return r},ine=class{constructor(e){F(this,"currLibraryItems",[]),F(this,"prevLibraryItems",mu(this.currLibraryItems)),F(this,"app"),F(this,"updateQueue",[]),F(this,"getLastUpdateTask",()=>this.updateQueue[this.updateQueue.length-1]),F(this,"notifyListeners",()=>{var t,n;if(this.updateQueue.length>0)$a.set(kf,r=>({status:"loading",libraryItems:this.currLibraryItems,isInitialized:r.isInitialized}));else{$a.set(kf,{status:"loaded",libraryItems:this.currLibraryItems,isInitialized:!0});try{let r=this.prevLibraryItems;this.prevLibraryItems=mu(this.currLibraryItems);let a=mu(this.currLibraryItems);(n=(t=this.app.props).onLibraryChange)==null||n.call(t,a),nne.trigger(ane(r,a),a)}catch(r){console.error(r)}}}),F(this,"destroy",()=>{this.updateQueue=[],this.currLibraryItems=[],$a.set(y_,new Map)}),F(this,"resetLibrary",()=>this.setLibrary([])),F(this,"getLatestLibrary",()=>new Promise(async t=>{try{let n=await(this.getLastUpdateTask()||this.currLibraryItems);this.updateQueue.length>0?t(this.getLatestLibrary()):t(mu(n))}catch{return t(this.currLibraryItems)}})),F(this,"updateLibrary",async({libraryItems:t,prompt:n=!1,merge:r=!1,openLibraryMenu:a=!1,defaultStatus:i="unpublished"})=>(a&&this.app.setState({openSidebar:{name:Fa.name,tab:Tp}}),this.setLibrary(()=>new Promise(async(l,s)=>{try{let d=await(typeof t=="function"&&!(t instanceof Blob)?t(this.currLibraryItems):t),u;d instanceof Blob?u=await bC(d,i):u=H0(d,i),!n||window.confirm(L("alerts.confirmAddLibrary",{numShapes:u.length}))?(n&&this.app.focusContainer(),l(r?w_(this.currLibraryItems,u):u)):s(new T0)}catch(d){s(d)}})))),F(this,"setLibrary",t=>{let n=new Promise(async(r,a)=>{try{await this.getLastUpdateTask(),typeof t=="function"&&(t=t(this.currLibraryItems)),this.currLibraryItems=mu(await t),r(this.currLibraryItems)}catch(i){a(i)}}).catch(r=>{if(r.name==="AbortError")return console.warn("Library update aborted by user"),this.currLibraryItems;throw r}).finally(()=>{this.updateQueue=this.updateQueue.filter(r=>r!==n),this.notifyListeners()});return this.updateQueue.push(n),this.notifyListeners(),n}),this.app=e}},lne=ine,E_=e=>{let t=Math.ceil(Math.sqrt(e.length)),n=[],r=m=>e.slice(m*t,m*t+t).reduce((U,g)=>{let{height:v}=Ha(g.elements);return Math.max(U,v)},0),a=m=>{let U=0,g=0,v=0;for(let y of e){if(U%t===0&&(g=0),g===m){let{width:w}=Ha(y.elements);v=Math.max(v,w)}U++,g++}return v},i=0,l=0,s=0,d=0,u=0,o=0,f=0;for(let m of e){u&&u%t===0&&(l+=s+50,i=0,o=0,f++),o===0&&(s=r(f)),d=a(o);let{minX:U,minY:g,width:v,height:y}=Ha(m.elements),w=(d-v)/2,E=(s-y)/2;n.push(...m.elements.map(S=>({...S,x:S.x+i+w-U,y:S.y+l+E-g}))),i+=d+50,u++,o++}return n},N1=class Y6{constructor(t){F(this,"adapter"),this.adapter=t}static async getLibraryItems(t,n,r=!0){let a=()=>new Promise(async(i,l)=>{try{let s=await t.load({source:n});i(H0((s==null?void 0:s.libraryItems)||[],"published"))}catch(s){l(s)}});return r?Y6.queue.push(a):a()}getLibraryItems(t){return Y6.getLibraryItems(this.adapter,t,!1)}};F(N1,"queue",new tne),F(N1,"run",async(e,t)=>{let n=new N1(e);return N1.queue.push(()=>t(n))});var sne=_.forwardRef(({children:e,gap:t,align:n,justifyContent:r,className:a,style:i},l)=>p.jsx("div",{className:Ae("Stack Stack_horizontal",a),style:{"--gap":t,alignItems:n,justifyContent:r,...i},ref:l,children:e})),one=_.forwardRef(({children:e,gap:t,align:n,justifyContent:r,className:a,style:i},l)=>p.jsx("div",{className:Ae("Stack Stack_vertical",a),style:{"--gap":t,justifyItems:n,justifyContent:r,...i},ref:l,children:e})),ca={Row:sne,Col:one},cne=({theme:e,id:t,libraryReturnUrl:n})=>{let r=n||window.location.origin+window.location.pathname;return p.jsx("a",{className:"library-menu-browse-button",href:`${et.VITE_APP_LIBRARY_URL}?target=${window.name||"_blank"}&referrer=${r}&useHash=true&token=${t}&theme=${e}&version=${E0.excalidrawLibrary}`,target:"_excalidraw_libraries",children:L("labels.libraries")})},dne=cne,S_=({libraryReturnUrl:e,theme:t,id:n,style:r,children:a,className:i})=>p.jsxs("div",{className:Ae("library-menu-control-buttons",i),style:r,children:[p.jsx(dne,{id:n,libraryReturnUrl:e,theme:t}),a]}),une=/({{[\w-]+}})|(<[\w-]+>)|(<\/[\w-]+>)/g,fne=/{{([\w-]+)}}/,hne=/<([\w-]+)>/,pne=/<\/([\w-]+)>/,mne=(e,t)=>{let n=[{name:"",children:[]}];return e.split(une).filter(Boolean).forEach(r=>{let a=r.match(hne),i=r.match(pne),l=r.match(fne);if(a!==null){let s=a[1];t.hasOwnProperty(s)?n.push({name:s,children:[]}):console.warn(`Trans: missed to pass in prop ${s} for interpolating ${e}`)}else if(i!==null)if(i[1]===n[n.length-1].name){let s=n.pop(),d=we.createElement(we.Fragment,{},...s.children),u=t[s.name];typeof u=="function"&&n[n.length-1].children.push(u(d))}else console.warn(`Trans: unexpected end tag ${r} for interpolating ${e}`);else if(l!==null){let s=l[1];t.hasOwnProperty(s)?n[n.length-1].children.push(t[s]):console.warn(`Trans: key ${s} not in props for interpolating ${e}`)}else n[n.length-1].children.push(r)}),n.length!==1&&console.warn(`Trans: stack not empty for interpolating ${e}`),n[0].children},Une=({i18nKey:e,children:t,...n})=>{let{t:r}=Zn();return we.createElement(we.Fragment,{},...mne(r(e),n))},bi=Une,gne=({label:e,onClick:t,className:n,children:r,actionType:a,type:i="button",isLoading:l,...s})=>{let d=a?`Dialog__action-button--${a}`:"";return p.jsxs("button",{className:Ae("Dialog__action-button",d,n),type:i,"aria-label":e,onClick:t,...s,children:[r&&p.jsx("div",{style:l?{visibility:"hidden"}:{},children:r}),p.jsx("div",{style:l?{visibility:"hidden"}:{},children:e}),l&&p.jsx("div",{style:{position:"absolute",inset:0},children:p.jsx(Ul,{})})]})},sd=gne,bne=e=>{let{onConfirm:t,onCancel:n,children:r,confirmText:a=L("buttons.confirm"),cancelText:i=L("buttons.cancel"),className:l="",...s}=e,d=Rn(),u=tm(K8),{container:o}=ji();return p.jsxs(qa,{onCloseRequest:n,size:"small",...s,className:`confirm-dialog ${l}`,children:[r,p.jsxs("div",{className:"confirm-dialog-buttons",children:[p.jsx(sd,{label:i,onClick:()=>{d({openMenu:null}),u(!1),$n.flushSync(()=>{n()}),o==null||o.focus()}}),p.jsx(sd,{label:a,onClick:()=>{d({openMenu:null}),u(!1),$n.flushSync(()=>{t()}),o==null||o.focus()},actionType:"danger"})]})]})},k_=bne,mo=class{static has(e){try{return!!window.localStorage.getItem(e)}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),!1}}static get(e){try{let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),null}}};F(mo,"set",(e,t)=>{try{return window.localStorage.setItem(e,JSON.stringify(t)),!0}catch(n){return console.warn(`localStorage.setItem error: ${n.message}`),!1}}),F(mo,"delete",e=>{try{window.localStorage.removeItem(e)}catch(t){console.warn(`localStorage.removeItem error: ${t.message}`)}});var vne=async e=>{let t=Math.round(8),n=Math.max(Math.round(128/64),2),r=vO(e,6),a=document.createElement("canvas");a.width=r[0].length*128+(r[0].length+1)*(t*2)-t*2,a.height=r.length*128+(r.length+1)*(t*2)-t*2;let i=a.getContext("2d");i.fillStyle=Fn.white,i.fillRect(0,0,a.width,a.height);for(let[l,s]of e.entries()){let d=await Xf({elements:s.elements,files:null,maxWidthOrHeight:128}),{width:u,height:o}=d,f=Math.floor(l/6)*(128+t*2),m=l%6*(128+t*2);i.drawImage(d,m+(128-u)/2+t,f+(128-o)/2+t),i.lineWidth=n,i.strokeStyle=Fn.gray[4],i.strokeRect(m+t/2,f+t/2,128+t,128+t)}return await E6(new File([await xf(a)],"preview",{type:De.png}),{outputType:De.jpg,maxWidthOrHeight:5e3})},yne=({libItem:e,appState:t,index:n,onChange:r,onRemove:a})=>{let i=_.useRef(null),l=_.useRef(null);return _.useEffect(()=>{let s=i.current;s&&(async()=>{let d=await l8({elements:e.elements,appState:{...t,viewBackgroundColor:Fn.white,exportBackground:!0},files:null,skipInliningFonts:!0});s.innerHTML=d.outerHTML})()},[e.elements,t]),p.jsxs("div",{className:"single-library-item",children:[e.status==="published"&&p.jsx("span",{className:"single-library-item-status",children:L("labels.statusPublished")}),p.jsx("div",{ref:i,className:"single-library-item__svg"}),p.jsx(dt,{"aria-label":L("buttons.remove"),type:"button",icon:hd,className:"single-library-item--remove",onClick:a.bind(null,e.id),title:L("buttons.remove")}),p.jsxs("div",{style:{display:"flex",margin:"0.8rem 0",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[p.jsxs("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[p.jsxs("div",{style:{padding:"0.5em 0"},children:[p.jsx("span",{style:{fontWeight:500,color:Fn.gray[6]},children:L("publishDialog.itemName")}),p.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),p.jsx("input",{type:"text",ref:l,style:{width:"80%",padding:"0.2rem"},defaultValue:e.name,placeholder:"Item name",onChange:s=>{r(s.target.value,n)}})]}),p.jsx("span",{className:"error",children:e.error})]})]})},xne=({onClose:e,libraryItems:t,appState:n,onSuccess:r,onError:a,updateItemsInStorage:i,onRemove:l})=>{let[s,d]=_.useState({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[u,o]=_.useState(!1);_.useEffect(()=>{let S=mo.get(Nu.PUBLISH_LIBRARY);S&&d(S)},[]);let[f,m]=_.useState(t.slice());_.useEffect(()=>{m(t.slice())},[t]);let U=S=>{d({...s,[S.target.name]:S.target.value})},g=async S=>{S.preventDefault(),o(!0);let k=[],I=!1;if(f.forEach(N=>{let $="";N.name||($=L("publishDialog.errors.required"),I=!0),k.push({...N,error:$})}),I){m(k),o(!1);return}let T=await vne(f),M={type:ua.excalidrawLibrary,version:E0.excalidrawLibrary,source:f5,libraryItems:f},j=JSON.stringify(M,null,2),D=new Blob([j],{type:"application/json"}),P=new FormData;P.append("excalidrawLib",D),P.append("previewImage",T),P.append("previewImageType",T.type),P.append("title",s.name),P.append("authorName",s.authorName),P.append("githubHandle",s.githubHandle),P.append("name",s.name),P.append("description",s.description),P.append("twitterHandle",s.twitterHandle),P.append("website",s.website),fetch(`${et.VITE_APP_LIBRARY_BACKEND}/submit`,{method:"post",body:P}).then(N=>N.ok?N.json().then(({url:$})=>{mo.delete(Nu.PUBLISH_LIBRARY),r({url:$,authorName:s.authorName,items:f})}):N.json().catch(()=>{throw new Error(N.statusText||"something went wrong")}).then($=>{throw new Error($.message||N.statusText||"something went wrong")}),N=>{console.error(N),a(N),o(!1)}).catch(N=>{console.error(N),a(N),o(!1)})},v=()=>{let S=[];return f.forEach((k,I)=>{S.push(p.jsx("div",{className:"single-library-item-wrapper",children:p.jsx(yne,{libItem:k,appState:n,index:I,onChange:(T,M)=>{let j=f.slice();j[M].name=T,m(j)},onRemove:l})},I))}),p.jsx("div",{className:"selected-library-items",children:S})},y=_.useCallback(()=>{i(f),mo.set(Nu.PUBLISH_LIBRARY,s),e()},[f,e,i,s]),w=!!t.length,E=t.some(S=>S.status==="published");return p.jsx(qa,{onCloseRequest:y,title:L("publishDialog.title"),className:"publish-library",children:w?p.jsxs("form",{onSubmit:g,children:[p.jsx("div",{className:"publish-library-note",children:p.jsx(bi,{i18nKey:"publishDialog.noteDescription",link:S=>p.jsx("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:S})})}),p.jsx("span",{className:"publish-library-note",children:p.jsx(bi,{i18nKey:"publishDialog.noteGuidelines",link:S=>p.jsx("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:S})})}),p.jsx("div",{className:"publish-library-note",children:L("publishDialog.noteItems")}),E&&p.jsx("span",{className:"publish-library-note publish-library-warning",children:L("publishDialog.republishWarning")}),v(),p.jsxs("div",{className:"publish-library__fields",children:[p.jsxs("label",{children:[p.jsxs("div",{children:[p.jsx("span",{children:L("publishDialog.libraryName")}),p.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),p.jsx("input",{type:"text",name:"name",required:!0,value:s.name,onChange:U,placeholder:L("publishDialog.placeholder.libraryName")})]}),p.jsxs("label",{style:{alignItems:"flex-start"},children:[p.jsxs("div",{children:[p.jsx("span",{children:L("publishDialog.libraryDesc")}),p.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),p.jsx("textarea",{name:"description",rows:4,required:!0,value:s.description,onChange:U,placeholder:L("publishDialog.placeholder.libraryDesc")})]}),p.jsxs("label",{children:[p.jsxs("div",{children:[p.jsx("span",{children:L("publishDialog.authorName")}),p.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),p.jsx("input",{type:"text",name:"authorName",required:!0,value:s.authorName,onChange:U,placeholder:L("publishDialog.placeholder.authorName")})]}),p.jsxs("label",{children:[p.jsx("span",{children:L("publishDialog.githubUsername")}),p.jsx("input",{type:"text",name:"githubHandle",value:s.githubHandle,onChange:U,placeholder:L("publishDialog.placeholder.githubHandle")})]}),p.jsxs("label",{children:[p.jsx("span",{children:L("publishDialog.twitterUsername")}),p.jsx("input",{type:"text",name:"twitterHandle",value:s.twitterHandle,onChange:U,placeholder:L("publishDialog.placeholder.twitterHandle")})]}),p.jsxs("label",{children:[p.jsx("span",{children:L("publishDialog.website")}),p.jsx("input",{type:"text",name:"website",pattern:"https?://.+",title:L("publishDialog.errors.website"),value:s.website,onChange:U,placeholder:L("publishDialog.placeholder.website")})]}),p.jsx("span",{className:"publish-library-note",children:p.jsx(bi,{i18nKey:"publishDialog.noteLicense",link:S=>p.jsx("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:S})})})]}),p.jsxs("div",{className:"publish-library__buttons",children:[p.jsx(sd,{label:L("buttons.cancel"),onClick:y,"data-testid":"cancel-clear-canvas-button"}),p.jsx(sd,{type:"submit",label:L("buttons.submit"),actionType:"primary",isLoading:u})]})]}):p.jsx("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:L("publishDialog.atleastOneLibItem")})})},wne=xne,C_=({className:e="",children:t,onToggle:n,title:r,...a})=>{let i=Sn(),l=Ae(`dropdown-menu-button ${e}`,"zen-mode-transition",{"dropdown-menu-button--mobile":i.editor.isMobile}).trim();return p.jsx("button",{"data-prevent-outside-click":!0,className:l,onClick:n,type:"button","data-testid":"dropdown-menu-button",title:r,...a,children:t})},Ene=C_;C_.displayName="DropdownMenuTrigger";var M_=()=>p.jsx("div",{style:{height:"1px",backgroundColor:"var(--default-border-color)",margin:".5rem 0"}}),Sne=M_;M_.displayName="DropdownMenuSeparator";var I_=({children:e,onClickOutside:t,className:n="",onSelect:r,style:a})=>{let i=Sn(),l=_.useRef(null),s=am({onClickOutside:t});B8(l,()=>{var u;(u=s.onClickOutside)==null||u.call(s)}),_.useEffect(()=>{let u=f=>{var m;f.key===B.ESCAPE&&(f.stopImmediatePropagation(),(m=s.onClickOutside)==null||m.call(s))},o={capture:!0};return document.addEventListener("keydown",u,o),()=>{document.removeEventListener("keydown",u,o)}},[s]);let d=Ae(`dropdown-menu ${n}`,{"dropdown-menu--mobile":i.editor.isMobile}).trim();return p.jsx(n_.Provider,{value:{onSelect:r},children:p.jsx("div",{ref:l,className:d,style:a,"data-testid":"dropdown-menu",children:i.editor.isMobile?p.jsx(ca.Col,{className:"dropdown-menu-container",children:e}):p.jsx(Wa,{className:"dropdown-menu-container",padding:2,style:{zIndex:2},children:e})})})};I_.displayName="DropdownMenuContent";var kne=I_,__=({icon:e,shortcut:t,href:n,children:r,onSelect:a,className:i="",selected:l,rel:s="noreferrer",...d})=>{let u=a_(d.onClick,a);return p.jsx("a",{...d,href:n,target:"_blank",rel:"noreferrer",className:r_(i,l),title:d.title??d["aria-label"],onClick:u,children:p.jsx(i_,{icon:e,shortcut:t,children:r})})},bp=__;__.displayName="DropdownMenuItemLink";var Cne=({children:e,className:t="",selected:n,...r})=>p.jsx("div",{...r,className:`dropdown-menu-item-base dropdown-menu-item-custom ${t} ${n?"dropdown-menu-item--selected":""}`.trim(),children:e}),Mne=Cne,Ine=e=>we.Children.toArray(e).find(n=>we.isValidElement(n)&&typeof n.type!="string"&&(n==null?void 0:n.type.displayName)&&n.type.displayName==="DropdownMenuTrigger")||null,_ne=e=>we.Children.toArray(e).find(n=>we.isValidElement(n)&&typeof n.type!="string"&&(n==null?void 0:n.type.displayName)&&n.type.displayName==="DropdownMenuContent")||null,yl=({children:e,open:t})=>{let n=Ine(e),r=_ne(e);return p.jsxs(p.Fragment,{children:[n,t&&r]})};yl.Trigger=Ene;yl.Content=kne;yl.Item=ba;yl.ItemLink=bp;yl.ItemCustom=Mne;yl.Group=B6;yl.Separator=Sne;var Wt=yl;yl.displayName="DropdownMenu";var Tne=(e,t)=>e.filter(n=>t.includes(n.id)),Ane=({setAppState:e,selectedItems:t,library:n,onRemoveFromLibrary:r,resetLibrary:a,onSelectItems:i,appState:l,className:s})=>{let[d]=sn(kf),[u,o]=sn(K8),f=()=>{let P=t.length?L("alerts.removeItemsFromsLibrary",{count:t.length}):L("alerts.resetLibrary"),N=t.length?L("confirmDialog.removeItemsFromLib"):L("confirmDialog.resetLibrary");return p.jsx(k_,{onConfirm:()=>{t.length?r():a(),U(!1)},onCancel:()=>{U(!1)},title:N,children:p.jsx("p",{children:P})})},[m,U]=_.useState(!1),g=!!t.length,v=g?d.libraryItems.filter(P=>t.includes(P.id)):d.libraryItems,y=L(g?"buttons.remove":"buttons.resetLibrary"),[w,E]=_.useState(!1),[S,k]=_.useState(null),I=_.useCallback(()=>p.jsxs(qa,{onCloseRequest:()=>k(null),title:L("publishSuccessDialog.title"),className:"publish-library-success",size:"small",children:[p.jsx("p",{children:p.jsx(bi,{i18nKey:"publishSuccessDialog.content",authorName:S.authorName,link:P=>p.jsx("a",{href:S==null?void 0:S.url,target:"_blank",rel:"noopener noreferrer",children:P})})}),p.jsx(dt,{type:"button",title:L("buttons.close"),"aria-label":L("buttons.close"),label:L("buttons.close"),onClick:()=>k(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]}),[k,S]),T=(P,N)=>{E(!1),k({url:P.url,authorName:P.authorName});let $=N.slice();$.forEach(z=>{t.includes(z.id)&&(z.status="published")}),n.setLibrary($)},M=async()=>{try{await n.updateLibrary({libraryItems:W5({description:"Excalidraw library files"}),merge:!0,openLibraryMenu:!0})}catch(P){if((P==null?void 0:P.name)==="AbortError"){console.warn(P);return}e({errorMessage:L("errors.importLibraryError")})}},j=async()=>{let P=g?v:await n.getLatestLibrary();HG(P).catch($E).catch(N=>{e({errorMessage:N.message})})},D=()=>p.jsxs(Wt,{open:u,children:[p.jsx(Wt.Trigger,{onToggle:()=>o(!u),children:t$}),p.jsxs(Wt.Content,{onClickOutside:()=>o(!1),onSelect:()=>o(!1),className:"library-menu",children:[!g&&p.jsx(Wt.Item,{onSelect:M,icon:M5,"data-testid":"lib-dropdown--load",children:L("buttons.load")}),!!v.length&&p.jsx(Wt.Item,{onSelect:j,icon:I0,"data-testid":"lib-dropdown--export",children:L("buttons.export")}),!!v.length&&p.jsx(Wt.Item,{onSelect:()=>U(!0),icon:So,children:y}),g&&p.jsx(Wt.Item,{icon:uz,onSelect:()=>E(!0),"data-testid":"lib-dropdown--remove",children:L("buttons.publishLibrary")})]})]});return p.jsxs("div",{className:Ae("library-menu-dropdown-container",s),children:[D(),t.length>0&&p.jsx("div",{className:"library-actions-counter",children:t.length}),m&&f(),w&&p.jsx(wne,{onClose:()=>E(!1),libraryItems:Tne(d.libraryItems,t),appState:l,onSuccess:P=>T(P,d.libraryItems),onError:P=>window.alert(P),updateItemsInStorage:()=>n.setLibrary(d.libraryItems),onRemove:P=>i(t.filter(N=>N!==P))}),S&&I()]})},_x=({selectedItems:e,onSelectItems:t,className:n})=>{let{library:r}=Ri(),{clearLibraryCache:a,deleteItemsFromLibraryCache:i}=x_(),l=Ur(),s=Rn(),[d]=sn(kf),u=async o=>{let f=o.filter(m=>!e.includes(m.id));r.setLibrary(f).catch(()=>{s({errorMessage:L("alerts.errorRemovingFromLibrary")})}),i(e),t([])};return p.jsx(Ane,{appState:l,setAppState:s,selectedItems:e,onSelectItems:t,library:r,onRemoveFromLibrary:()=>u(d.libraryItems),resetLibrary:()=>{r.resetLibrary(),a()},className:n})},Rne=_.memo(({id:e,elements:t,isPending:n,onClick:r,selected:a,onToggle:i,onDrag:l,svgCache:s})=>{let d=_.useRef(null),u=ene(e,t,s);_.useEffect(()=>{let g=d.current;if(g)return u&&(g.innerHTML=u.outerHTML),()=>{g.innerHTML=""}},[u]);let[o,f]=_.useState(!1),m=Sn().editor.isMobile,U=n&&p.jsx("div",{className:"library-unit__adder",children:e$});return p.jsxs("div",{className:Ae("library-unit",{"library-unit__active":t,"library-unit--hover":t&&o,"library-unit--selected":a,"library-unit--skeleton":!u}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[p.jsx("div",{className:Ae("library-unit__dragger",{"library-unit__pulse":!!n}),ref:d,draggable:!!t,onClick:t||n?g=>{e&&g.shiftKey?i(e,g):r(e)}:void 0,onDragStart:g=>{if(!e){g.preventDefault();return}f(!1),l(e,g)}}),U,e&&t&&(o||m||a)&&p.jsx(G8,{checked:a,onChange:(g,v)=>i(e,v),className:"library-unit__checkbox"})]})}),jne=()=>p.jsx("div",{className:"library-unit library-unit--skeleton"});function Lne(){return[!1,_.useCallback(e=>e(),[])]}var Dne=we.useTransition||Lne,Tx=({children:e})=>p.jsx("div",{className:"library-menu-items-container__grid",children:e}),bg=_.memo(({items:e,onItemSelectToggle:t,onItemDrag:n,isItemSelected:r,onClick:a,svgCache:i,itemsRenderedPerBatch:l})=>{let[,s]=Dne(),[d,u]=_.useState(0);return _.useEffect(()=>{d<e.length&&s(()=>{u(d+l)})},[d,e.length,s,l]),p.jsx(p.Fragment,{children:e.map((o,f)=>f<d?p.jsx(Rne,{elements:o==null?void 0:o.elements,isPending:!(o!=null&&o.id)&&!!(o!=null&&o.elements),onClick:a,svgCache:i,id:o==null?void 0:o.id,selected:r(o.id),onToggle:t,onDrag:n},(o==null?void 0:o.id)??f):p.jsx(jne,{},f))})}),Pne=Hn(0),Nne=e=>{let[t,n]=sn(Pne);return _.useEffect(()=>{let{current:r}=e;if(!r)return;let a=Af(()=>{let{scrollTop:i}=r;n(i)},200);return r.addEventListener("scroll",a),()=>{a.cancel(),r.removeEventListener("scroll",a)}},[e,n]),t},One=17,$ne=64;function zne({isLoading:e,libraryItems:t,onAddToLibrary:n,onInsertLibraryItems:r,pendingElements:a,theme:i,id:l,libraryReturnUrl:s,onSelectItems:d,selectedItems:u}){let o=_.useRef(null),f=Nne(o);_.useEffect(()=>{var P;f>0&&((P=o.current)==null||P.scrollTo(0,f))},[]);let{svgCache:m}=x_(),U=_.useMemo(()=>t.filter(P=>P.status!=="published"),[t]),g=_.useMemo(()=>t.filter(P=>P.status==="published"),[t]),v=!t.length&&!a.length,y=!a.length&&!U.length&&!g.length,[w,E]=_.useState(null),S=_.useCallback((P,N)=>{let $=!u.includes(P),z=[...U,...g];if($){if(N.shiftKey&&w){let Z=z.findIndex(q=>q.id===w),K=z.findIndex(q=>q.id===P);if(Z===-1||K===-1){d([...u,P]);return}let Q=We(u),W=z.reduce((q,V,ee)=>((ee>=Z&&ee<=K||Q.has(V.id))&&q.push(V.id),q),[]);d(W)}else d([...u,P]);E(P)}else E(null),d(u.filter(Z=>Z!==P))},[w,d,g,u,U]),k=_.useCallback(P=>{let N;return u.includes(P)?N=t.filter($=>u.includes($.id)):N=t.filter($=>$.id===P),N.map($=>({...$,elements:wk($.elements,{randomizeSeed:!0})}))},[t,u]),I=_.useCallback((P,N)=>{N.dataTransfer.setData(De.excalidrawlib,X5(k(P)))},[k]),T=_.useCallback(P=>P?u.includes(P):!1,[u]),M=_.useCallback(()=>{n(a)},[a,n]),j=_.useCallback(P=>{P&&r(k(P))},[k,r]),D=m.size>=t.length?$ne:One;return p.jsxs("div",{className:"library-menu-items-container",style:a.length||U.length||g.length?{justifyContent:"flex-start"}:{borderBottom:0},children:[!y&&p.jsx(_x,{selectedItems:u,onSelectItems:d,className:"library-menu-dropdown-container--in-heading"}),p.jsxs(ca.Col,{className:"library-menu-items-container__items",align:"start",gap:1,style:{flex:g.length>0?1:"0 1 auto",marginBottom:0},ref:o,children:[p.jsxs(p.Fragment,{children:[!y&&p.jsx("div",{className:"library-menu-items-container__header",children:L("labels.personalLib")}),e&&p.jsx("div",{style:{position:"absolute",top:"var(--container-padding-y)",right:"var(--container-padding-x)",transform:"translateY(50%)"},children:p.jsx(Ul,{})}),!a.length&&!U.length?p.jsxs("div",{className:"library-menu-items__no-items",children:[p.jsx("div",{className:"library-menu-items__no-items__label",children:L("library.noItems")}),p.jsx("div",{className:"library-menu-items__no-items__hint",children:g.length>0?L("library.hint_emptyPrivateLibrary"):L("library.hint_emptyLibrary")})]}):p.jsxs(Tx,{children:[a.length>0&&p.jsx(bg,{itemsRenderedPerBatch:D,items:[{id:null,elements:a}],onItemSelectToggle:S,onItemDrag:I,onClick:M,isItemSelected:T,svgCache:m}),p.jsx(bg,{itemsRenderedPerBatch:D,items:U,onItemSelectToggle:S,onItemDrag:I,onClick:j,isItemSelected:T,svgCache:m})]})]}),p.jsxs(p.Fragment,{children:[(g.length>0||a.length>0||U.length>0)&&p.jsx("div",{className:"library-menu-items-container__header library-menu-items-container__header--excal",children:L("labels.excalidrawLib")}),g.length>0?p.jsx(Tx,{children:p.jsx(bg,{itemsRenderedPerBatch:D,items:g,onItemSelectToggle:S,onItemDrag:I,onClick:j,isItemSelected:T,svgCache:m})}):U.length>0?p.jsx("div",{style:{margin:"1rem 0",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",fontSize:".9rem"},children:L("library.noItems")}):null]}),v&&p.jsx(S_,{style:{padding:"16px 0",width:"100%"},id:l,libraryReturnUrl:s,theme:i,children:p.jsx(_x,{selectedItems:u,onSelectItems:d})})]})]})}var K8=Hn(!1),Ax=({children:e})=>p.jsx("div",{className:"layer-ui__library",children:e}),Fne=_.memo(({onInsertLibraryItems:e,pendingElements:t,onAddToLibrary:n,setAppState:r,libraryReturnUrl:a,library:i,id:l,theme:s,selectedItems:d,onSelectItems:u})=>{let[o]=sn(kf),f=_.useCallback(g=>{(async(v,y)=>{Nt("element","addToLibrary","ui");for(let E of _E)if(v.some(S=>S.type===E))return r({errorMessage:L(`errors.libraryElementTypeError.${E}`)});let w=[{status:"unpublished",elements:v,id:ga(),created:Date.now()},...y];n(),i.setLibrary(w).catch(()=>{r({errorMessage:L("alerts.errorAddingToLibrary")})})})(g,o.libraryItems)},[n,i,r,o.libraryItems]),m=_.useMemo(()=>o.libraryItems,[o]);if(o.status==="loading"&&!o.isInitialized)return p.jsx(Ax,{children:p.jsx("div",{className:"layer-ui__library-message",children:p.jsxs("div",{children:[p.jsx(Ul,{size:"2em"}),p.jsx("span",{children:L("labels.libraryLoadingMessage")})]})})});let U=o.libraryItems.length>0||t.length>0;return p.jsxs(Ax,{children:[p.jsx(zne,{isLoading:o.status==="loading",libraryItems:m,onAddToLibrary:f,onInsertLibraryItems:e,pendingElements:t,id:l,libraryReturnUrl:a,theme:s,onSelectItems:u,selectedItems:d}),U&&p.jsx(S_,{className:"library-menu-control-buttons--at-bottom",style:{padding:"16px 12px 0 12px"},id:l,libraryReturnUrl:a,theme:s})]})}),vg=(e,t)=>({elements:e,pending:tt(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}),selectedElementIds:t}),Bne=(e,t)=>{let n=hm(),[r,a]=_.useState(()=>vg(n,e.selectedElementIds)),i=_.useRef(new Map);return _.useEffect(()=>{for(let l of r.pending)i.current.set(l.id,l.version)},[r.pending]),_.useEffect(()=>{t.state.cursorButton==="up"&&t.state.activeTool.type==="selection"&&a(l=>{var d;if(!Yn(l.selectedElementIds,e.selectedElementIds))return i.current.clear(),vg(n,e.selectedElementIds);let s=t.scene.getNonDeletedElementsMap();for(let u of Object.keys(e.selectedElementIds)){let o=(d=s.get(u))==null?void 0:d.version;if(o&&o!==i.current.get(u))return vg(n,e.selectedElementIds)}return l})},[t,t.state.cursorButton,t.state.activeTool.type,e.selectedElementIds,n]),r.pending},Hne=_.memo(()=>{let e=Ri(),{onInsertElements:t}=e,n=Qf(),r=Ur(),a=Rn(),[i,l]=_.useState([]),s=_.useMemo(()=>e.library,[e.library]),d=Bne(r,e),u=_.useCallback(f=>{t(E_(f))},[t]),o=_.useCallback(()=>{a({selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null})},[a]);return p.jsx(Fne,{pendingElements:d,onInsertLibraryItems:u,onAddToLibrary:o,setAppState:a,libraryReturnUrl:n.libraryReturnUrl,library:s,id:e.id,theme:r.theme,selectedItems:i,onSelectItems:l})});function Wne(e){if(e&&typeof e=="number")return e;switch(e){case"small":return 550;case"wide":return 1024;case"regular":default:return 800}}var qa=e=>{let[t,n]=Qte(),[r]=_.useState(document.activeElement),{id:a}=ji(),i=Sn().viewport.isMobile;_.useEffect(()=>{if(!t)return;let u=qg(t);setTimeout(()=>{u.length>0&&e.autofocus!==!1&&(u[1]||u[0]).focus()});let o=f=>{if(f.key===B.TAB){let m=qg(t),{activeElement:U}=document,g=m.findIndex(v=>v===U);g===0&&f.shiftKey?(m[m.length-1].focus(),f.preventDefault()):g===m.length-1&&!f.shiftKey&&(m[0].focus(),f.preventDefault())}};return t.addEventListener("keydown",o),()=>t.removeEventListener("keydown",o)},[t,e.autofocus]);let l=Rn(),s=tm(K8),d=()=>{l({openMenu:null}),s(!1),r.focus(),e.onCloseRequest()};return p.jsx(Jte,{className:Ae("Dialog",e.className,{"Dialog--fullscreen":i}),labelledBy:"dialog-title",maxWidth:Wne(e.size),onCloseRequest:d,closeOnClickOutside:e.closeOnClickOutside,children:p.jsxs(Wa,{ref:n,children:[e.title&&p.jsx("h2",{id:`${a}-dialog-title`,className:"Dialog__title",children:p.jsx("span",{className:"Dialog__titleContent",children:e.title})}),i&&p.jsx("button",{className:"Dialog__close",onClick:d,title:L("buttons.close"),"aria-label":L("buttons.close"),type:"button",children:hd}),p.jsx("div",{className:"Dialog__content",children:e.children})]})})},jo=({type:e="button",onSelect:t,selected:n,children:r,className:a="",...i})=>p.jsx("button",{onClick:k0(i.onClick,l=>{t()}),type:e,className:Ae("excalidraw-button",a,{selected:n}),...i,children:r}),q8=_.forwardRef(({onChange:e,label:t,fullWidth:n,placeholder:r,readonly:a,selectOnRender:i,onKeyDown:l,isRedacted:s=!1,icon:d,className:u,...o},f)=>{let m=_.useRef(null);_.useImperativeHandle(f,()=>m.current),_.useLayoutEffect(()=>{var v,y;i&&((v=m.current)==null||v.focus(),(y=m.current)==null||y.select())},[i]);let[U,g]=_.useState(!1);return p.jsxs("div",{className:Ae("ExcTextField",u,{"ExcTextField--fullWidth":n,"ExcTextField--hasIcon":!!d}),onClick:()=>{var v;(v=m.current)==null||v.focus()},children:[d,t&&p.jsx("div",{className:"ExcTextField__label",children:t}),p.jsxs("div",{className:Ae("ExcTextField__input",{"ExcTextField__input--readonly":a}),children:[p.jsx("input",{className:Ae({"is-redacted":"value"in o&&o.value&&s&&!U}),readOnly:a,value:"value"in o?o.value:void 0,defaultValue:"defaultValue"in o?o.defaultValue:void 0,placeholder:r,ref:m,onChange:v=>e==null?void 0:e(v.target.value),onKeyDown:l}),s&&p.jsx(jo,{onSelect:()=>g(!U),style:{border:0,userSelect:"none"},children:U?vz:_5})]})]})}),Xne={toggleTheme:[he("Shift+Alt+D")],saveScene:[he("CtrlOrCmd+S")],loadScene:[he("CtrlOrCmd+O")],clearCanvas:[he("CtrlOrCmd+Delete")],imageExport:[he("CtrlOrCmd+Shift+E")],commandPalette:[he("CtrlOrCmd+/"),he("CtrlOrCmd+Shift+P")],cut:[he("CtrlOrCmd+X")],copy:[he("CtrlOrCmd+C")],paste:[he("CtrlOrCmd+V")],copyStyles:[he("CtrlOrCmd+Alt+C")],pasteStyles:[he("CtrlOrCmd+Alt+V")],selectAll:[he("CtrlOrCmd+A")],deleteSelectedElements:[he("Delete")],duplicateSelection:[he("CtrlOrCmd+D"),he(`Alt+${L("helpDialog.drag")}`)],sendBackward:[he("CtrlOrCmd+[")],bringForward:[he("CtrlOrCmd+]")],sendToBack:[he(xi?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[he(xi?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[he("Shift+Alt+C")],group:[he("CtrlOrCmd+G")],ungroup:[he("CtrlOrCmd+Shift+G")],gridMode:[he("CtrlOrCmd+'")],zenMode:[he("Alt+Z")],objectsSnapMode:[he("Alt+S")],stats:[he("Alt+/")],addToLibrary:[],flipHorizontal:[he("Shift+H")],flipVertical:[he("Shift+V")],viewMode:[he("Alt+R")],hyperlink:[he("CtrlOrCmd+K")],toggleElementLock:[he("CtrlOrCmd+Shift+L")],resetZoom:[he("CtrlOrCmd+0")],zoomOut:[he("CtrlOrCmd+-")],zoomIn:[he("CtrlOrCmd++")],zoomToFitSelection:[he("Shift+3")],zoomToFit:[he("Shift+1")],zoomToFitSelectionInViewport:[he("Shift+2")],toggleEraserTool:[he("E")],toggleHandTool:[he("H")],setFrameAsActiveTool:[he("F")],saveFileToDisk:[he("CtrlOrCmd+S")],saveToActiveFile:[he("CtrlOrCmd+S")],toggleShortcuts:[he("?")],searchMenu:[he("CtrlOrCmd+F")],wrapSelectionInFrame:[]},ir=(e,t=0)=>{let n=Xne[e];return n&&n.length>0?n[t]||n[0]:""},Vne="\\u0300-\\u036f",Gne="\\ufe20-\\ufe2f",Yne="\\u20d0-\\u20ff",Zne=Vne+Gne+Yne,Kne=`[${Zne}]`,qne=RegExp(Kne,"g"),Qne=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jne={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"E",æ:"e",Þ:"T",þ:"t",ß:"s",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"I",ij:"i",Œ:"E",œ:"e",ʼn:"n",ſ:"s"},Rx=e=>e.replace(Qne,t=>Jne[t]||t).replace(qne,""),T_=we.createContext(null),Vr=()=>we.useContext(T_),ere=gM(),tre=()=>we.useMemo(()=>({MainMenuTunnel:li(),WelcomeScreenMenuHintTunnel:li(),WelcomeScreenToolbarHintTunnel:li(),WelcomeScreenHelpHintTunnel:li(),WelcomeScreenCenterTunnel:li(),FooterCenterTunnel:li(),DefaultSidebarTriggerTunnel:li(),DefaultSidebarTabTriggersTunnel:li(),OverwriteConfirmDialogTunnel:li(),TTDDialogTriggerTunnel:li(),tunnelsJotai:ere}),[]),A_=(e,t)=>{var r;let n=((r=t[0])==null?void 0:r.type)||null;for(let a of t)if(a.type!==n){n=null;break}return s6(e.activeTool.type)&&e.activeTool.type!=="image"&&n!=="image"&&n!=="frame"&&n!=="magicframe"||t.some(a=>s6(a.type))},R_=(e,t)=>Qc(e.activeTool.type)||t.some(n=>Qc(n.type)),j_=({appState:e,elementsMap:t,renderAction:n,app:r})=>{let a=iC(t,e),i=!1;a.length===2&&(Ua(a[0])||Ua(a[1]))&&(i=!0);let l=!!(e.editingTextElement||e.newElement),s=Sn(),d=document.documentElement.getAttribute("dir")==="rtl",u=Qc(e.activeTool.type)&&!Na(e.currentItemBackgroundColor)||a.some(g=>Qc(g.type)&&!Na(g.backgroundColor)),o=a.length===1||i,f=!e.editingLinearElement&&a.length===1&&Ge(a[0])&&!Me(a[0]),m=!e.croppingElementId&&a.length===1&&vt(a[0]),U=!i&&Xr(e,r);return p.jsxs("div",{className:"panelColumn",children:[p.jsx("div",{children:A_(e,a)&&n("changeStrokeColor")}),R_(e,a)&&p.jsx("div",{children:n("changeBackgroundColor")}),u&&n("changeFillStyle"),(ly(e.activeTool.type)||a.some(g=>ly(g.type)))&&n("changeStrokeWidth"),(e.activeTool.type==="freedraw"||a.some(g=>g.type==="freedraw"))&&n("changeStrokeShape"),(sy(e.activeTool.type)||a.some(g=>sy(g.type)))&&p.jsxs(p.Fragment,{children:[n("changeStrokeStyle"),n("changeSloppiness")]}),(o6(e.activeTool.type)||a.some(g=>o6(g.type)))&&p.jsx(p.Fragment,{children:n("changeRoundness")}),(oy(e.activeTool.type)||a.some(g=>oy(g.type)))&&p.jsx(p.Fragment,{children:n("changeArrowType")}),(e.activeTool.type==="text"||a.some(ke))&&p.jsxs(p.Fragment,{children:[n("changeFontFamily"),n("changeFontSize"),(e.activeTool.type==="text"||fG(a,t))&&n("changeTextAlign")]}),uG(a,t)&&n("changeVerticalAlign"),(Bp(e.activeTool.type)||a.some(g=>Bp(g.type)))&&p.jsx(p.Fragment,{children:n("changeArrowhead")}),n("changeOpacity"),p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.layers")}),p.jsxs("div",{className:"buttonList",children:[n("sendToBack"),n("sendBackward"),n("bringForward"),n("bringToFront")]})]}),U&&!i&&p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.align")}),p.jsxs("div",{className:"buttonList",children:[d?p.jsxs(p.Fragment,{children:[n("alignRight"),n("alignHorizontallyCentered"),n("alignLeft")]}):p.jsxs(p.Fragment,{children:[n("alignLeft"),n("alignHorizontallyCentered"),n("alignRight")]}),a.length>2&&n("distributeHorizontally"),p.jsx("div",{style:{flexBasis:"100%",height:0}}),p.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[n("alignTop"),n("alignVerticallyCentered"),n("alignBottom"),a.length>2&&n("distributeVertically")]})]})]}),!l&&a.length>0&&p.jsxs("fieldset",{children:[p.jsx("legend",{children:L("labels.actions")}),p.jsxs("div",{className:"buttonList",children:[!s.editor.isMobile&&n("duplicateSelection"),!s.editor.isMobile&&n("deleteSelectedElements"),n("group"),n("ungroup"),o&&n("hyperlink"),m&&n("cropEditor"),f&&n("toggleLinearEditor")]})]})]})},L_=({activeTool:e,appState:t,app:n,UIOptions:r})=>{let[a,i]=_.useState(!1),l=e.type==="frame",s=e.type==="laser",d=e.type==="embeddable",{TTDDialogTriggerTunnel:u}=Vr();return p.jsxs(p.Fragment,{children:[j5.map(({value:o,icon:f,key:m,numericKey:U,fillable:g},v)=>{var S;if(((S=r.tools)==null?void 0:S[o])===!1)return null;let y=L(`toolBar.${o}`),w=m&&zu(typeof m=="string"?m:m[0]),E=w?`${w} ${L("helpDialog.or")} ${U}`:`${U}`;return p.jsx(dt,{className:Ae("Shape",{fillable:g}),type:"radio",icon:f,checked:e.type===o,name:"editor-current-shape",title:`${zu(y)} — ${E}`,keyBindingLabel:U||w,"aria-label":zu(y),"aria-keyshortcuts":E,"data-testid":`toolbar-${o}`,onPointerDown:({pointerType:k})=>{!t.penDetected&&k==="pen"&&n.togglePenMode(!0)},onChange:({pointerType:k})=>{t.activeTool.type!==o&&Nt("toolbar",o,"ui"),o==="image"?n.setActiveTool({type:o,insertOnCanvasDirectly:k!=="mouse"}):n.setActiveTool({type:o})}},o)}),p.jsx("div",{className:"App-toolbar__divider"}),p.jsxs(Wt,{open:a,children:[p.jsx(Wt.Trigger,{className:Ae("App-toolbar__extra-tools-trigger",{"App-toolbar__extra-tools-trigger--selected":l||d||s&&!n.props.isCollaborating}),onToggle:()=>i(!a),title:L("toolBar.extraTools"),children:gz}),p.jsxs(Wt.Content,{onClickOutside:()=>i(!1),onSelect:()=>i(!1),className:"App-toolbar__extra-tools-dropdown",children:[p.jsx(Wt.Item,{onSelect:()=>n.setActiveTool({type:"frame"}),icon:cS,shortcut:B.F.toLocaleUpperCase(),"data-testid":"toolbar-frame",selected:l,children:L("toolBar.frame")}),p.jsx(Wt.Item,{onSelect:()=>n.setActiveTool({type:"embeddable"}),icon:U$,"data-testid":"toolbar-embeddable",selected:d,children:L("toolBar.embeddable")}),p.jsx(Wt.Item,{onSelect:()=>n.setActiveTool({type:"laser"}),icon:uS,"data-testid":"toolbar-laser",selected:s,shortcut:B.K.toLocaleUpperCase(),children:L("toolBar.laser")}),p.jsx("div",{style:{margin:"6px 0",fontSize:14,fontWeight:600},children:"Generate"}),n.props.aiEnabled!==!1&&p.jsx(u.Out,{}),p.jsx(Wt.Item,{onSelect:()=>n.setOpenDialog({name:"ttd",tab:"mermaid"}),icon:dS,"data-testid":"toolbar-embeddable",children:L("toolBar.mermaidToExcalidraw")}),n.props.aiEnabled!==!1&&n.plugins.diagramToCode&&p.jsx(p.Fragment,{children:p.jsxs(Wt.Item,{onSelect:()=>n.onMagicframeToolSelect(),icon:fS,"data-testid":"toolbar-magicframe",children:[L("toolBar.magicframe"),p.jsx(Wt.Item.Badge,{children:"AI"})]})})]})]})]})},nre=({renderAction:e,zoom:t})=>p.jsx(ca.Col,{gap:1,className:Wc.ZOOM_ACTIONS,children:p.jsxs(ca.Row,{align:"center",children:[e("zoomOut"),e("resetZoom"),e("zoomIn")]})}),rre=({renderAction:e,className:t})=>p.jsxs("div",{className:`undo-redo-buttons ${t}`,children:[p.jsx("div",{className:"undo-button-container",children:p.jsx(Ro,{label:L("buttons.undo"),children:e("undo")})}),p.jsx("div",{className:"redo-button-container",children:p.jsxs(Ro,{label:L("buttons.redo"),children:[" ",e("redo")]})})]}),are=({actionManager:e,showExitZenModeBtn:t})=>p.jsx("button",{type:"button",className:Ae("disable-zen-mode",{"disable-zen-mode--visible":t}),onClick:()=>e.executeAction(W6),children:L("buttons.exitZenMode")}),ire=({renderAction:e,className:t})=>p.jsx("div",{className:`finalize-button ${t}`,children:e("finalize",{size:"small"})}),jx=e=>{let t=_.useRef({userFn:e});return t.current.userFn=e,t.current.stableFn||(t.current.stableFn=(...n)=>t.current.userFn(...n)),t.current.stableFn},um=Hn(null),lre=()=>{let[e,t]=sn(um),n=Lr();return e&&e==="clearCanvas"?p.jsx(k_,{onConfirm:()=>{n.executeAction(Gu),t(null)},onCancel:()=>t(null),title:L("clearCanvasDialog.title"),children:p.jsxs("p",{className:"clear-canvas__content",children:[" ",L("alerts.clearReset")]})}):null},D_={};ww(D_,{toggleTheme:()=>sre});var sre={...d0,category:"App",label:"Toggle theme",perform:({actionManager:e})=>{e.executeAction(d0,"commandPalette")}},P_=xe({name:"copyElementLink",label:"labels.copyElementLink",icon:I5,trackEvent:{category:"element"},perform:async(e,t,n,r)=>{let a=tt(e,t);try{if(window.location){let i=Dk(a,t);return i?(await Wf(r.props.generateLinkForSelection?r.props.generateLinkForSelection(i.id,i.type):Lk(i.id,i.type)),{appState:{toast:{message:L("toast.elementLinkCopied"),closable:!0}},captureUpdate:ie.EVENTUALLY}):{appState:t,elements:e,app:r,captureUpdate:ie.EVENTUALLY}}}catch(i){console.error(i)}return{appState:t,elements:e,app:r,captureUpdate:ie.EVENTUALLY}},predicate:(e,t)=>qp(tt(e,t))}),ore=xe({name:"linkToElement",label:"labels.linkToElement",icon:US,perform:(e,t,n,r)=>{let a=tt(e,t);return a.length!==1||!qp(a)?{elements:e,appState:t,app:r,captureUpdate:ie.EVENTUALLY}:{appState:{...t,openDialog:{name:"elementLinkSelector",sourceElementId:tt(e,t)[0].id}},captureUpdate:ie.IMMEDIATELY}},predicate:(e,t,n,r)=>{var i;let a=tt(e,t);return((i=t.openDialog)==null?void 0:i.name)!=="elementLinkSelector"&&a.length===1&&qp(a)},trackEvent:!1}),cre=Hn(null),fn={app:"App",export:"Export",tools:"Tools",editor:"Editor",elements:"Elements",links:"Links"},dre=e=>{switch(e){case fn.app:return 1;case fn.export:return 2;case fn.editor:return 3;case fn.tools:return 4;case fn.elements:return 5;case fn.links:return 6;default:return 10}},vp=({shortcut:e,className:t,children:n})=>{let r=e.replace("++","+$").split("+");return p.jsxs("div",{className:Ae("shortcut",t),children:[r.map((a,i)=>p.jsx("div",{className:"shortcut-wrapper",children:p.jsx("div",{className:"shortcut-key",children:a==="$"?"+":a})},a)),p.jsx("div",{className:"shortcut-desc",children:n})]})},N_=e=>!e.altKey&&e[B.CTRL_OR_CMD]&&(e.shiftKey&&e.key.toLowerCase()===B.P||e.key===B.SLASH);Object.assign(e=>{var r;let t=Ur(),n=Rn();return _.useEffect(()=>{let a=i=>{N_(i)&&(i.preventDefault(),i.stopPropagation(),n(l=>{var d;let s=((d=l.openDialog)==null?void 0:d.name)==="commandPalette"?null:{name:"commandPalette"};return s&&Nt("command_palette","open","shortcut"),{openDialog:s}}))};return window.addEventListener("keydown",a,{capture:!0}),()=>window.removeEventListener("keydown",a,{capture:!0})},[n]),((r=t.openDialog)==null?void 0:r.name)!=="commandPalette"?null:p.jsx(ure,{...e})},{defaultItems:D_});function ure({customCommandPaletteItems:e}){let t=Ri(),n=Ur(),r=Rn(),a=Qf(),i=Lr(),[l,s]=sn(cre),[d,u]=_.useState(null),o=_.useRef(null),f=am({uiAppState:n,customCommandPaletteItems:e,appProps:a});_.useEffect(()=>{let{uiAppState:T,customCommandPaletteItems:M,appProps:j}=f,D=z=>{let Z="";return z.label&&(typeof z.label=="function"?Z=L(z.label(t.scene.getNonDeletedElements(),T,t)):Z=L(z.label)),Z},P=z=>typeof z.icon=="function"?z.icon(T,t.scene.getNonDeletedElements()):z.icon,N=[],$=(z,Z,K)=>{let Q={label:D(z),icon:P(z),category:Z,shortcut:ir(z.name),keywords:z.keywords,predicate:z.predicate,viewMode:z.viewMode,perform:()=>{i.executeAction(z,"commandPalette")}};return K?K(Q,z):Q};if(T&&t.scene&&i){let z=[i.actions.group,i.actions.ungroup,i.actions.cut,i.actions.copy,i.actions.deleteSelectedElements,i.actions.wrapSelectionInFrame,i.actions.copyStyles,i.actions.pasteStyles,i.actions.bringToFront,i.actions.bringForward,i.actions.sendBackward,i.actions.sendToBack,i.actions.alignTop,i.actions.alignBottom,i.actions.alignLeft,i.actions.alignRight,i.actions.alignVerticallyCentered,i.actions.alignHorizontallyCentered,i.actions.duplicateSelection,i.actions.flipHorizontal,i.actions.flipVertical,i.actions.zoomToFitSelection,i.actions.zoomToFitSelectionInViewport,i.actions.increaseFontSize,i.actions.decreaseFontSize,i.actions.toggleLinearEditor,i.actions.cropEditor,v_,P_,ore].map(V=>$(V,fn.elements,(ee,X)=>({...ee,predicate:X.predicate?X.predicate:(se,ge,_e,Y)=>tt(se,ge).length>0}))),Z=[i.actions.toggleHandTool,i.actions.setFrameAsActiveTool].map(V=>$(V,fn.tools)),K=[i.actions.undo,i.actions.redo,i.actions.zoomIn,i.actions.zoomOut,i.actions.resetZoom,i.actions.zoomToFit,i.actions.zenMode,i.actions.viewMode,i.actions.gridMode,i.actions.objectsSnapMode,i.actions.toggleShortcuts,i.actions.selectAll,i.actions.toggleElementLock,i.actions.unlockAllElements,i.actions.stats].map(V=>$(V,fn.editor)),Q=[i.actions.saveToActiveFile,i.actions.saveFileToDisk,i.actions.copyAsPng,i.actions.copyAsSvg].map(V=>$(V,fn.export));N=[...z,...K,{label:D(Gu),icon:P(Gu),shortcut:ir(Gu.name),category:fn.editor,keywords:["delete","destroy"],viewMode:!1,perform:()=>{$a.set(um,"clearCanvas")}},{label:L("buttons.exportImage"),category:fn.export,icon:nS,shortcut:ir("imageExport"),keywords:["export","image","png","jpeg","svg","clipboard","picture"],perform:()=>{r({openDialog:{name:"imageExport"}})}},...Q];let W=[{label:L("toolBar.library"),category:fn.app,icon:S5,viewMode:!1,perform:()=>{T.openSidebar?r({openSidebar:null}):r({openSidebar:{name:Fa.name,tab:Fa.defaultTab}})}},{label:L("search.title"),category:fn.app,icon:ko,viewMode:!0,perform:()=>{i.executeAction(O_)}},{label:L("labels.changeStroke"),keywords:["color","outline"],category:fn.elements,icon:N2,viewMode:!1,predicate:(V,ee)=>{let X=tt(V,ee);return X.length>0&&A_(ee,X)},perform:()=>{r(V=>({openMenu:V.openMenu==="shape"?null:"shape",openPopup:"elementStroke"}))}},{label:L("labels.changeBackground"),keywords:["color","fill"],icon:N2,category:fn.elements,viewMode:!1,predicate:(V,ee)=>{let X=tt(V,ee);return X.length>0&&R_(ee,X)},perform:()=>{r(V=>({openMenu:V.openMenu==="shape"?null:"shape",openPopup:"elementBackground"}))}},{label:L("labels.canvasBackground"),keywords:["color"],icon:N2,category:fn.editor,viewMode:!1,perform:()=>{r(V=>({openMenu:V.openMenu==="canvas"?null:"canvas",openPopup:"canvasBackground"}))}},...j5.reduce((V,ee)=>{var re;let{value:X,icon:se,key:ge,numericKey:_e}=ee;if(((re=j.UIOptions.tools)==null?void 0:re[X])===!1)return V;let Y=ge&&zu(typeof ge=="string"?ge:ge[0])||_e,H={label:L(`toolBar.${X}`),category:fn.tools,shortcut:Y,icon:se,keywords:["toolbar"],viewMode:!1,perform:({event:te})=>{X==="image"?t.setActiveTool({type:X,insertOnCanvasDirectly:te.type==="keydown"}):t.setActiveTool({type:X})}};return V.push(H),V},[]),...Z,{label:L("toolBar.lock"),category:fn.tools,icon:T.activeTool.locked?k5:M0,shortcut:B.Q.toLocaleUpperCase(),viewMode:!1,perform:()=>{t.toggleLock()}},{label:`${L("labels.textToDiagram")}...`,category:fn.tools,icon:yz,viewMode:!1,predicate:j.aiEnabled,perform:()=>{r(V=>({...V,openDialog:{name:"ttd",tab:"text-to-diagram"}}))}},{label:`${L("toolBar.mermaidToExcalidraw")}...`,category:fn.tools,icon:dS,viewMode:!1,predicate:j.aiEnabled,perform:()=>{r(V=>({...V,openDialog:{name:"ttd",tab:"mermaid"}}))}}],q=[...N,...W,...M||[]].map(V=>{var ee;return{...V,icon:V.icon||hS,order:V.order??dre(V.category),haystack:`${Rx(V.label.toLocaleLowerCase())} ${((ee=V.keywords)==null?void 0:ee.join(" "))||""}`}});u(q),s(q.find(V=>V.label===(l==null?void 0:l.label))??null)}},[f,t,i,u,l==null?void 0:l.label,s,r]);let[m,U]=_.useState(""),[g,v]=_.useState(null),[y,w]=_.useState({}),E=T=>{r({openDialog:null},T),U("")},S=(T,M)=>{var j;((j=n.openDialog)==null?void 0:j.name)==="commandPalette"&&(M.stopPropagation(),M.preventDefault(),document.body.classList.add("excalidraw-animations-disabled"),E(()=>{T.perform({actionManager:i,event:M}),s(T),requestAnimationFrame(()=>{document.body.classList.remove("excalidraw-animations-disabled")})}))},k=jx(T=>T.viewMode===!1&&n.viewModeEnabled?!1:typeof T.predicate=="function"?T.predicate(t.scene.getNonDeletedElements(),n,a,t):T.predicate===void 0||T.predicate),I=jx(T=>{var P;let M=Qs(T.target)||N_(T)||T.key===B.ESCAPE;if(M&&T.key!==B.ARROW_UP&&T.key!==B.ARROW_DOWN&&T.key!==B.ENTER)return;let j=Object.values(y).flat(),D=l&&!m&&k(l);if(T.key===B.ARROW_UP){T.preventDefault();let N=j.findIndex(Z=>Z.label===(g==null?void 0:g.label));if(D){if(N===0){v(l);return}if(g===l){let Z=j[j.length-1];Z&&v(Z);return}}let $;N===-1?$=j.length-1:$=N===0?j.length-1:(N-1)%j.length;let z=j[$];z&&v(z);return}if(T.key===B.ARROW_DOWN){T.preventDefault();let N=j.findIndex(Z=>Z.label===(g==null?void 0:g.label));if(D){if(!g||N===j.length-1){v(l);return}if(g===l){let Z=j[0];Z&&v(Z);return}}let $=(N+1)%j.length,z=j[$];z&&v(z);return}if(T.key===B.ENTER&&g&&setTimeout(()=>{S(g,T)}),!M){if(T.stopPropagation(),/^[a-zA-Z0-9]$/.test(T.key)){(P=o==null?void 0:o.current)==null||P.focus();return}T.preventDefault()}});return _.useEffect(()=>(window.addEventListener("keydown",I,{capture:!0}),()=>window.removeEventListener("keydown",I,{capture:!0})),[I]),_.useEffect(()=>{if(!d)return;let T=P=>{let N={};for(let $ of P)N[$.category]?N[$.category].push($):N[$.category]=[$];return N},M=d.filter(k).sort((P,N)=>P.order-N.order),j=!m&&l&&k(l);if(!m){w(T(j?M.filter(P=>P.label!==(l==null?void 0:l.label)):M)),v(j?l:M[0]||null);return}let D=Rx(m.toLocaleLowerCase().replace(/[<>_| -]/g,""));M=LQ.filter(D,M,{extract:P=>P.haystack}).sort((P,N)=>N.score-P.score).map(P=>P.original),w(T(M)),v(M[0]??null)},[m,d,k,l]),p.jsxs(qa,{onCloseRequest:()=>E(),closeOnClickOutside:!0,title:!1,size:720,autofocus:!0,className:"command-palette-dialog",children:[p.jsx(q8,{value:m,placeholder:L("commandPalette.search.placeholder"),onChange:T=>{U(T)},selectOnRender:!0,ref:o}),!t.device.viewport.isMobile&&p.jsxs("div",{className:"shortcuts-wrapper",children:[p.jsx(vp,{shortcut:"↑↓",children:L("commandPalette.shortcuts.select")}),p.jsx(vp,{shortcut:"↵",children:L("commandPalette.shortcuts.confirm")}),p.jsx(vp,{shortcut:he("Esc"),children:L("commandPalette.shortcuts.close")})]}),p.jsxs("div",{className:"commands",children:[l&&!m&&p.jsxs("div",{className:"command-category",children:[p.jsxs("div",{className:"command-category-title",children:[L("commandPalette.recents"),p.jsx("div",{className:"icon",style:{marginLeft:"6px"},children:xz})]}),p.jsx(Lx,{command:l,isSelected:l.label===(g==null?void 0:g.label),onClick:T=>S(l,T),disabled:!k(l),onMouseMove:()=>v(l),showShortcut:!t.device.viewport.isMobile,appState:n})]}),Object.keys(y).length>0?Object.keys(y).map((T,M)=>p.jsxs("div",{className:"command-category",children:[p.jsx("div",{className:"command-category-title",children:T}),y[T].map(j=>p.jsx(Lx,{command:j,isSelected:j.label===(g==null?void 0:g.label),onClick:D=>S(j,D),onMouseMove:()=>v(j),showShortcut:!t.device.viewport.isMobile,appState:n},j.label))]},T)):d?p.jsxs("div",{className:"no-match",children:[p.jsx("div",{className:"icon",children:ko})," ",L("commandPalette.search.noMatch")]}):null]})]})}var Lx=({command:e,isSelected:t,disabled:n,onMouseMove:r,onClick:a,showShortcut:i,appState:l})=>{let s=()=>{};return p.jsxs("div",{className:Ae("command-item",{"item-selected":t,"item-disabled":n}),ref:d=>{var u;t&&!n&&((u=d==null?void 0:d.scrollIntoView)==null||u.call(d,{block:"nearest"}))},onClick:n?s:a,onMouseMove:n?s:r,title:n?L("commandPalette.itemNotAvailable"):"",children:[p.jsxs("div",{className:"name",children:[e.icon&&p.jsx(lm,{icon:typeof e.icon=="function"?e.icon(l):e.icon}),e.label]}),i&&e.shortcut&&p.jsx(vp,{shortcut:e.shortcut})]})},fre=xe({name:"toggleLinearEditor",category:fn.elements,label:(e,t,n)=>{var r;return((r=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds})[0])==null?void 0:r.type)==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit"},keywords:["line"],trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t);return!!(!t.editingLinearElement&&a.length===1&&Ge(a[0])&&!Me(a[0]))},perform(e,t,n,r){var l;let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0],i=((l=t.editingLinearElement)==null?void 0:l.elementId)===a.id?null:new Ce(a);return{appState:{...t,editingLinearElement:i},captureUpdate:ie.IMMEDIATELY}},PanelComponent:({appState:e,updateData:t,app:n})=>{let r=n.scene.getSelectedElements({selectedElementIds:e.selectedElementIds})[0],a=L(r.type==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit");return p.jsx(dt,{type:"button",icon:Dz,title:a,"aria-label":a,onClick:()=>t(null)})}}),O_=xe({name:"searchMenu",icon:ko,keywords:["search","find"],label:"search.title",viewMode:!0,trackEvent:{category:"search_menu",action:"toggle",predicate:e=>e.gridModeEnabled},perform(e,t,n,r){var a,i;if(((a=t.openSidebar)==null?void 0:a.name)===Fa.name&&t.openSidebar.tab===Pc){let l=(i=r.excalidrawContainerValue.container)==null?void 0:i.querySelector(`.${Wc.SEARCH_MENU_INPUT_WRAPPER} input`);return l!=null&&l.matches(":focus")?{appState:{...t,openSidebar:null},captureUpdate:ie.EVENTUALLY}:(l==null||l.focus(),l==null||l.select(),!1)}return{appState:{...t,openSidebar:{name:Fa.name,tab:Pc},openDialog:null},captureUpdate:ie.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[B.CTRL_OR_CMD]&&e.key===B.F}),hre=xe({name:"cropEditor",label:"helpDialog.cropStart",icon:ty,viewMode:!0,trackEvent:{category:"menu"},keywords:["image","crop"],perform(e,t,n,r){let a=r.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0];return{appState:{...t,isCropping:!1,croppingElementId:a.id},captureUpdate:ie.IMMEDIATELY}},predicate:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t);return!!(!t.croppingElementId&&a.length===1&&vt(a[0]))},PanelComponent:({appState:e,updateData:t,app:n})=>{let r=L("helpDialog.cropStart");return p.jsx(dt,{type:"button",icon:ty,title:r,"aria-label":r,onClick:()=>t(null)})}}),u0=class{constructor(e=!0,t=!0){this.isUndoStackEmpty=e,this.isRedoStackEmpty=t}},Dx=class Ru{constructor(){F(this,"onHistoryChangedEmitter",new di),F(this,"undoStack",[]),F(this,"redoStack",[])}get isUndoStackEmpty(){return this.undoStack.length===0}get isRedoStackEmpty(){return this.redoStack.length===0}clear(){this.undoStack.length=0,this.redoStack.length=0}record(t,n){let r=pre.create(n,t);r.isEmpty()||(this.undoStack.push(r.inverse()),r.elementsChange.isEmpty()||(this.redoStack.length=0),this.onHistoryChangedEmitter.trigger(new u0(this.isUndoStackEmpty,this.isRedoStackEmpty)))}undo(t,n,r){return this.perform(t,n,r,()=>Ru.pop(this.undoStack),a=>Ru.push(this.redoStack,a,t))}redo(t,n,r){return this.perform(t,n,r,()=>Ru.pop(this.redoStack),a=>Ru.push(this.undoStack,a,t))}perform(t,n,r,a,i){try{let l=a();if(l===null)return;let s=t,d=n,u=!1;for(;l;){try{[s,d,u]=l.applyTo(s,d,r)}finally{i(l)}if(u)break;l=a()}return[s,d]}finally{this.onHistoryChangedEmitter.trigger(new u0(this.isUndoStackEmpty,this.isRedoStackEmpty))}}static pop(t){if(!t.length)return null;let n=t.pop();return n!==void 0?n:null}static push(t,n,r){let a=n.inverse().applyLatestChanges(r);return t.push(a)}},pre=class yp{constructor(t,n){this.appStateChange=t,this.elementsChange=n}static create(t,n){return new yp(t,n)}inverse(){return new yp(this.appStateChange.inverse(),this.elementsChange.inverse())}applyTo(t,n,r){let[a,i]=this.elementsChange.applyTo(t,r.elements),[l,s]=this.appStateChange.applyTo(n,a);return[a,l,i||s]}applyLatestChanges(t){let n=this.elementsChange.applyLatestChanges(t);return yp.create(this.appStateChange,n)}isEmpty(){return this.appStateChange.isEmpty()&&this.elementsChange.isEmpty()}},$_=(e,t)=>{let[n,r]=_.useState(t);return _.useEffect(()=>{let a=e.on(i=>{r(i)});return()=>{a()}},[e]),n},z_=(e,t,n)=>{if(!t.multiElement&&!t.resizingElement&&!t.editingTextElement&&!t.newElement&&!t.selectedElementsAreBeingDragged&&!t.selectionElement&&!e.flowChartCreator.isCreatingChart){let r=n();if(!r)return{captureUpdate:ie.EVENTUALLY};let[a,i]=r,l=Array.from(a.values());return{appState:i,elements:l,captureUpdate:ie.NEVER}}return{captureUpdate:ie.EVENTUALLY}},mre=(e,t)=>({name:"undo",label:"buttons.undo",icon:zv,trackEvent:{category:"history"},viewMode:!1,perform:(n,r,a,i)=>z_(i,r,()=>e.undo(We(n),r,t.snapshot)),keyTest:n=>n[B.CTRL_OR_CMD]&&i6(n,B.Z)&&!n.shiftKey,PanelComponent:({updateData:n,data:r})=>{let{isUndoStackEmpty:a}=$_(e.onHistoryChangedEmitter,new u0(e.isUndoStackEmpty,e.isRedoStackEmpty));return p.jsx(dt,{type:"button",icon:zv,"aria-label":L("buttons.undo"),onClick:n,size:(r==null?void 0:r.size)||"medium",disabled:a,"data-testid":"button-undo"})}}),Ure=(e,t)=>({name:"redo",label:"buttons.redo",icon:Fv,trackEvent:{category:"history"},viewMode:!1,perform:(n,r,a,i)=>z_(i,r,()=>e.redo(We(n),r,t.snapshot)),keyTest:n=>n[B.CTRL_OR_CMD]&&n.shiftKey&&i6(n,B.Z)||EE&&n.ctrlKey&&!n.shiftKey&&i6(n,B.Y),PanelComponent:({updateData:n,data:r})=>{let{isRedoStackEmpty:a}=$_(e.onHistoryChangedEmitter,new u0(e.isUndoStackEmpty,e.isRedoStackEmpty));return p.jsx(dt,{type:"button",icon:Fv,"aria-label":L("buttons.redo"),onClick:n,size:(r==null?void 0:r.size)||"medium",disabled:a,"data-testid":"button-redo"})}}),yg=(e,t,n,r,a,i)=>{if(e.trackEvent)try{typeof e.trackEvent=="object"&&(!e.trackEvent.predicate||e.trackEvent.predicate(n,r,i))&&Nt(e.trackEvent.category,e.trackEvent.action||e.name,`${t} (${a.device.editor.isMobile?"mobile":"desktop"})`)}catch(l){console.error("error while logging action:",l)}},gre=class{constructor(e,t,n,r){F(this,"actions",{}),F(this,"updater"),F(this,"getAppState"),F(this,"getElementsIncludingDeleted"),F(this,"app"),F(this,"renderAction",(a,i)=>{let l=this.app.props.UIOptions.canvasActions;if(this.actions[a]&&"PanelComponent"in this.actions[a]&&(!(a in l)||l[a])){let s=this.actions[a],d=s.PanelComponent;d.displayName="PanelComponent";let u=this.getElementsIncludingDeleted(),o=this.getAppState(),f=m=>{yg(s,"ui",o,u,this.app,m),this.updater(s.perform(this.getElementsIncludingDeleted(),this.getAppState(),m,this.app))};return p.jsx(d,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:f,appProps:this.app.props,app:this.app,data:i})}return null}),F(this,"isActionEnabled",a=>{let i=this.getElementsIncludingDeleted(),l=this.getAppState();return!a.predicate||a.predicate(i,l,this.app.props,this.app)}),this.updater=a=>{if(Pf(a))a.then(i=>e(i));else return e(a)},this.getAppState=t,this.getElementsIncludingDeleted=n,this.app=r}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach(t=>this.registerAction(t))}handleKeyDown(e){let t=this.app.props.UIOptions.canvasActions,n=Object.values(this.actions).sort((s,d)=>(d.keyPriority||0)-(s.keyPriority||0)).filter(s=>(s.name in t?t[s.name]:!0)&&s.keyTest&&s.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted(),this.app));if(n.length!==1)return n.length>1&&console.warn("Canceling as multiple actions match this shortcut",n),!1;let r=n[0];if(this.getAppState().viewModeEnabled&&r.viewMode!==!0)return!1;let a=this.getElementsIncludingDeleted(),i=this.getAppState();return yg(r,"keyboard",i,a,this.app,null),e.preventDefault(),e.stopPropagation(),this.updater(n[0].perform(a,i,null,this.app)),!0}executeAction(e,t="api",n=null){let r=this.getElementsIncludingDeleted(),a=this.getAppState();yg(e,t,a,r,this.app,n),this.updater(e.perform(r,a,n,this.app))}},Px=e=>{let t=Array.from(e.values());return{x:Ox(t,n=>n.x)/t.length,y:Ox(t,n=>n.y)/t.length}},Nx=([e,t])=>Math.hypot(e.x-t.x,e.y-t.y),Ox=(e,t)=>e.reduce((n,r)=>n+t(r),0),bre=({children:e,left:t,top:n,onCloseRequest:r,fitInViewport:a=!1,offsetLeft:i=0,offsetTop:l=0,viewportWidth:s=window.innerWidth,viewportHeight:d=window.innerHeight})=>{let u=_.useRef(null);_.useEffect(()=>{let f=u.current;if(!f)return;f.contains(document.activeElement)||f.focus();let m=U=>{var g,v,y;if(U.key===B.TAB){let w=qg(f),{activeElement:E}=document,S=w.findIndex(k=>k===E);E===f?(U.shiftKey?(g=w[w.length-1])==null||g.focus():w[0].focus(),U.preventDefault(),U.stopImmediatePropagation()):S===0&&U.shiftKey?((v=w[w.length-1])==null||v.focus(),U.preventDefault(),U.stopImmediatePropagation()):S===w.length-1&&!U.shiftKey&&((y=w[0])==null||y.focus(),U.preventDefault(),U.stopImmediatePropagation())}};return f.addEventListener("keydown",m),()=>f.removeEventListener("keydown",m)},[]);let o=_.useRef(null);return _.useLayoutEffect(()=>{var f,m;if(a&&u.current&&n!=null&&t!=null){let U=u.current,{width:g,height:v}=U.getBoundingClientRect();if(((f=o.current)==null?void 0:f.top)===n&&((m=o.current)==null?void 0:m.left)===t)return;o.current={top:n,left:t},g>=s?(U.style.width=`${s}px`,U.style.left="0px",U.style.overflowX="scroll"):t+g-i>s?U.style.left=`${s-g-10}px`:U.style.left=`${t}px`,v>=d?(U.style.height=`${d-20}px`,U.style.top="10px",U.style.overflowY="scroll"):n+v-l>d?U.style.top=`${d-v}px`:U.style.top=`${n}px`}},[n,t,a,s,d,i,l]),_.useEffect(()=>{if(r){let f=m=>{var U;(U=u.current)!=null&&U.contains(m.target)||$n.unstable_batchedUpdates(()=>r(m))};return document.addEventListener("pointerdown",f,!1),()=>document.removeEventListener("pointerdown",f,!1)}},[r]),p.jsx("div",{className:"popover",ref:u,tabIndex:-1,children:e})},Mn="separator",vre=we.memo(({actionManager:e,items:t,top:n,left:r,onClose:a})=>{let i=Jf(),l=hm(),s=t.reduce((d,u)=>(u&&(u===Mn||!u.predicate||u.predicate(l,i,e.app.props,e.app))&&d.push(u),d),[]);return p.jsx(bre,{onCloseRequest:()=>{a()},top:n,left:r,fitInViewport:!0,offsetLeft:i.offsetLeft,offsetTop:i.offsetTop,viewportWidth:i.width,viewportHeight:i.height,children:p.jsx("ul",{className:"context-menu",onContextMenu:d=>d.preventDefault(),children:s.map((d,u)=>{var m;if(d===Mn)return!s[u-1]||s[u-1]===Mn?null:p.jsx("hr",{className:"context-menu-item-separator"},u);let o=d.name,f="";return d.label&&(typeof d.label=="function"?f=L(d.label(l,i,e.app)):f=L(d.label)),p.jsx("li",{"data-testid":o,onClick:()=>{a(()=>{e.executeAction(d,"contextMenu")})},children:p.jsxs("button",{type:"button",className:Ae("context-menu-item",{dangerous:o==="deleteSelectedElements",checkmark:(m=d.checked)==null?void 0:m.call(d,i)}),children:[p.jsx("div",{className:"context-menu-item__label",children:f}),p.jsx("kbd",{className:"context-menu-item__shortcut",children:o?ir(o):""})]})},u)})})})}),yre=({children:e,onClose:t})=>{let[n,r]=_.useState(!!e),{container:a}=ji(),i=we.useCallback(()=>{r(!1),t&&t(),a==null||a.focus()},[t,a]);return p.jsx(p.Fragment,{children:n&&p.jsx(qa,{size:"small",onCloseRequest:i,title:L("errorDialog.title"),children:p.jsx("div",{style:{whiteSpace:"pre-wrap"},children:e})})})},F_=function({onChange:e,value:t,choices:n,name:r}){return p.jsx("div",{className:"RadioGroup",children:n.map(a=>p.jsxs("div",{className:Ae("RadioGroup__choice",{active:a.value===t}),title:a.ariaLabel,children:[p.jsx("input",{name:r,type:"radio",checked:a.value===t,onChange:()=>e(a.value),"aria-label":a.ariaLabel}),a.label]},String(a.value)))})},O1=({title:e,name:t,checked:n,onChange:r,disabled:a=!1})=>p.jsx("div",{className:Ae("Switch",{toggled:n,disabled:a}),children:p.jsx("input",{name:t,id:t,title:e,type:"checkbox",checked:n,disabled:a,onChange:()=>r(!n),onKeyDown:i=>{i.key===" "&&r(!n)}})}),Zu=_.forwardRef(({children:e,icon:t,onClick:n,label:r,variant:a="filled",color:i="primary",size:l="medium",fullWidth:s,className:d,status:u},o)=>{let[f,m]=_.useState(!1),U=async v=>{let y=n==null?void 0:n(v);if(Pf(y)){let w=window.setTimeout(()=>{m(!0)},50);try{await y}catch(E){if(E instanceof T0)console.warn(E);else throw E}finally{clearTimeout(w),m(!1)}}},g=f?"loading":u;return i=g==="success"?"success":i,p.jsx("button",{className:Ae("ExcButton",`ExcButton--color-${i}`,`ExcButton--variant-${a}`,`ExcButton--size-${l}`,`ExcButton--status-${g}`,{"ExcButton--fullWidth":s},d),onClick:U,type:"button","aria-label":r,ref:o,disabled:g==="loading"||g==="success",children:p.jsxs("div",{className:"ExcButton__contents",children:[g==="loading"?p.jsx(Ul,{className:"ExcButton__statusIcon"}):g==="success"&&p.jsx("div",{className:"ExcButton__statusIcon",children:pz}),t&&p.jsx("div",{className:"ExcButton__icon","aria-hidden":!0,children:t}),a!=="icon"&&(e??r)]})})}),xre=2e3,wre=()=>{let[e,t]=_.useState(null),n=_.useRef(0),r=()=>{clearTimeout(n.current),t("success"),n.current=window.setTimeout(()=>{t(null)},xre)},a=_.useCallback(()=>{t(null)},[]);return{copyStatus:e,resetCopyStatus:a,onCopy:r}},Ere="filter"in document.createElement("canvas").getContext("2d"),Sre=()=>p.jsxs("div",{children:[p.jsx("h3",{children:L("canvasError.cannotShowPreview")}),p.jsx("p",{children:p.jsx("span",{children:L("canvasError.canvasTooBig")})}),p.jsxs("em",{children:["(",L("canvasError.canvasTooBigTip"),")"]})]}),kre=({appStateSnapshot:e,elementsSnapshot:t,files:n,actionManager:r,onExportImage:a,name:i})=>{let l=En(t,e),[s,d]=_.useState(i),[u,o]=_.useState(l),[f,m]=_.useState(e.exportBackground),[U,g]=_.useState(e.exportWithDarkMode),[v,y]=_.useState(e.exportEmbedScene),[w,E]=_.useState(e.exportScale),S=_.useRef(null),[k,I]=_.useState(null),{onCopy:T,copyStatus:M,resetCopyStatus:j}=wre();_.useEffect(()=>{j()},[s,f,U,w,v,j]);let{exportedElements:D,exportingFrame:P}=om(t,e,u);return _.useEffect(()=>{let N=S.current;if(!N)return;let $=N.offsetWidth,z=N.offsetHeight;$&&Xf({elements:D,appState:{...e,name:s,exportBackground:f,exportWithDarkMode:U,exportScale:w,exportEmbedScene:v},files:n,exportPadding:dd,maxWidthOrHeight:Math.max($,z),exportingFrame:P}).then(Z=>(I(null),xf(Z).then(()=>{N.replaceChildren(Z)}).catch(K=>{throw K.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(L("canvasError.canvasTooBig")):K}))).catch(Z=>{console.error(Z),I(Z)})},[e,n,D,P,s,f,U,w,v]),p.jsxs("div",{className:"ImageExportModal",children:[p.jsx("h3",{children:L("imageExportDialog.header")}),p.jsxs("div",{className:"ImageExportModal__preview",children:[p.jsx("div",{className:"ImageExportModal__preview__canvas",ref:S,children:k&&p.jsx(Sre,{})}),p.jsx("div",{className:"ImageExportModal__preview__filename",children:!Do&&p.jsx("input",{type:"text",className:"TextInput",value:s,style:{width:"30ch"},onChange:N=>{d(N.target.value),r.executeAction(vte,"ui",N.target.value)}})})]}),p.jsxs("div",{className:"ImageExportModal__settings",children:[p.jsx("h3",{children:L("imageExportDialog.header")}),l&&p.jsx(Uu,{label:L("imageExportDialog.label.onlySelected"),name:"exportOnlySelected",children:p.jsx(O1,{name:"exportOnlySelected",checked:u,onChange:N=>{o(N)}})}),p.jsx(Uu,{label:L("imageExportDialog.label.withBackground"),name:"exportBackgroundSwitch",children:p.jsx(O1,{name:"exportBackgroundSwitch",checked:f,onChange:N=>{m(N),r.executeAction(xte,"ui",N)}})}),Ere&&p.jsx(Uu,{label:L("imageExportDialog.label.darkMode"),name:"exportDarkModeSwitch",children:p.jsx(O1,{name:"exportDarkModeSwitch",checked:U,onChange:N=>{g(N),r.executeAction(wte,"ui",N)}})}),p.jsx(Uu,{label:L("imageExportDialog.label.embedScene"),tooltip:L("imageExportDialog.tooltip.embedScene"),name:"exportEmbedSwitch",children:p.jsx(O1,{name:"exportEmbedSwitch",checked:v,onChange:N=>{y(N),r.executeAction(d_,"ui",N)}})}),p.jsx(Uu,{label:L("imageExportDialog.label.scale"),name:"exportScale",children:p.jsx(F_,{name:"exportScale",value:w,onChange:N=>{E(N),r.executeAction(yte,"ui",N)},choices:U5.map(N=>({value:N,label:`${N}×`}))})}),p.jsxs("div",{className:"ImageExportModal__settings__buttons",children:[p.jsx(Zu,{className:"ImageExportModal__settings__buttons__button",label:L("imageExportDialog.title.exportToPng"),onClick:()=>a(T2.png,D,{exportingFrame:P}),icon:ey,children:L("imageExportDialog.button.exportToPng")}),p.jsx(Zu,{className:"ImageExportModal__settings__buttons__button",label:L("imageExportDialog.title.exportToSvg"),onClick:()=>a(T2.svg,D,{exportingFrame:P}),icon:ey,children:L("imageExportDialog.button.exportToSvg")}),(i8||lf)&&p.jsx(Zu,{className:"ImageExportModal__settings__buttons__button",label:L("imageExportDialog.title.copyPngToClipboard"),status:M,onClick:async()=>{await a(T2.clipboard,D,{exportingFrame:P}),T()},icon:I5,children:L("imageExportDialog.button.copyPngToClipboard")})]})]})]})},Uu=({label:e,children:t,tooltip:n,name:r})=>p.jsxs("div",{className:"ImageExportModal__settings__setting",title:e,children:[p.jsxs("label",{htmlFor:r,className:"ImageExportModal__settings__setting__label",children:[e,n&&p.jsx(Ro,{label:n,long:!0,children:hz})]}),p.jsx("div",{className:"ImageExportModal__settings__setting__content",children:t})]}),Cre=({elements:e,appState:t,files:n,actionManager:r,onExportImage:a,onCloseRequest:i,name:l})=>{let[{appStateSnapshot:s,elementsSnapshot:d}]=_.useState(()=>({appStateSnapshot:rl(t),elementsSnapshot:rl(e)}));return p.jsx(qa,{onCloseRequest:i,size:"wide",title:!1,children:p.jsx(kre,{elementsSnapshot:d,appStateSnapshot:s,files:n,actionManager:r,onExportImage:a,name:l})})},B_=({children:e,side:t,className:n})=>p.jsx("div",{className:Ae("FixedSideContainer",`FixedSideContainer_side_${t}`,n),children:e}),Bc=100,Hc=100,$x=e=>{switch(e){case B.ARROW_UP:return"up";case B.ARROW_DOWN:return"down";case B.ARROW_RIGHT:return"right";case B.ARROW_LEFT:return"left";default:return"right"}},H_=(e,t,n,r)=>{let a=[...n.values()].reduce((i,l)=>{var d;let s;if(Me(l)&&(s=l[e==="predecessors"?"startBinding":"endBinding"])&&((d=l[e==="predecessors"?"endBinding":"startBinding"])==null?void 0:d.elementId)===t.id){let u=n.get(s.elementId);if(!u)return i;lr(Va(u),"not an ExcalidrawBindableElement");let o=e==="predecessors"?l.points[l.points.length-1]:[0,0],f=BS(t,fi(t),[o[0]+l.x,o[1]+l.y]);i.push({relative:u,heading:f})}return i},[]);switch(r){case"up":return a.filter(i=>ln(i.heading,Ir)).map(i=>i.relative);case"down":return a.filter(i=>ln(i.heading,zn)).map(i=>i.relative);case"right":return a.filter(i=>ln(i.heading,rn)).map(i=>i.relative);case"left":return a.filter(i=>ln(i.heading,Mr)).map(i=>i.relative)}},Z6=(e,t,n)=>H_("successors",e,t,n),K6=(e,t,n)=>H_("predecessors",e,t,n),Mre=(e,t,n)=>{let r=Hc+e.width;if(n==="up"||n==="down"){let s=Bc+e.height,d=e.x,u=e.x+e.width;if(t.every(o=>o.x+o.width<d||o.x>u))return{x:0,y:s*(n==="up"?-1:1)}}else if(n==="right"||n==="left"){let s=e.y,d=e.y+e.height;if(t.every(u=>u.y+u.height<s||u.y>d))return{x:(Hc+e.width)*(n==="left"?-1:1),y:0}}if(n==="up"||n==="down"){let s=Bc+e.height,d=(t.length,s),u=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*r:t.length/2*r*-1;return n==="up"?{x:u,y:d*-1}:{x:u,y:d}}let a=Bc+e.height,i=(t.length,Hc+e.width),l=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*a:t.length/2*a*-1;return n==="left"?{x:i*-1,y:l}:{x:i,y:l}},Ire=(e,t,n,r)=>{let a=Z6(e,t,r),i=K6(e,t,r),l=Mre(e,[...a,...i],r),s=ki({type:e.type,x:e.x+l.x,y:e.y+l.y,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});lr(C0(s),"not an ExcalidrawFlowchartNodeElement");let d=W_(e,s,t,r,n);return{nextNode:s,bindingArrow:d}},_re=(e,t,n,r,a)=>{let i=[];for(let l=0;l<a;l++){let s,d;if(r==="left"||r==="right"){let f=Bc*(a-1)+a*e.height,m=e.y+e.height/2-f/2,U=Hc+e.width;r==="left"&&(U*=-1),s=e.x+U;let g=(Bc+e.height)*l;d=m+g}else{let f=Hc*(a-1)+a*e.width,m=e.x+e.width/2-f/2,U=Bc+e.height;r==="up"&&(U*=-1),d=e.y+U;let g=(Hc+e.width)*l;s=m+g}let u=ki({type:e.type,x:s,y:d,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});lr(C0(u),"not an ExcalidrawFlowchartNodeElement");let o=W_(e,u,t,r,n);i.push(u),i.push(o)}return i},W_=(e,t,n,r,a)=>{let i,l;switch(r){case"up":{i=e.x+e.width/2,l=e.y-6;break}case"down":{i=e.x+e.width/2,l=e.y+e.height+6;break}case"right":{i=e.x+e.width+6,l=e.y+e.height/2;break}case"left":{i=e.x-6,l=e.y+e.height/2;break}}let s,d;switch(r){case"up":{s=t.x+t.width/2-i,d=t.y+t.height-l+6;break}case"down":{s=t.x+t.width/2-i,d=t.y-l-6;break}case"right":{s=t.x-i-6,d=t.y-l+t.height/2;break}case"left":{s=t.x+t.width-i+6,d=t.y-l+t.height/2;break}}let u=B5({type:"arrow",x:i,y:l,startArrowhead:null,endArrowhead:a.currentItemEndArrowhead,strokeColor:e.strokeColor,strokeStyle:e.strokeStyle,strokeWidth:e.strokeWidth,opacity:e.opacity,roughness:e.roughness,points:[A(0,0),A(s,d)],elbowed:!0});Ei(u,e,"start",n),Ei(u,t,"end",n);let o=new Map;o.set(e.id,e),o.set(t.id,t),o.set(u.id,u),Ce.movePoints(u,[{index:1,point:u.points[1]}]);let f=Q5(u,pa(new Map([...n.entries(),[e.id,e],[t.id,t],[u.id,u]])),{points:u.points});return{...u,...f}},Tre=class{constructor(){F(this,"isExploring",!1),F(this,"sameLevelNodes",[]),F(this,"sameLevelIndex",0),F(this,"direction",null),F(this,"visitedNodes",new Set)}clear(){this.isExploring=!1,this.sameLevelNodes=[],this.sameLevelIndex=0,this.direction=null,this.visitedNodes.clear()}exploreByDirection(e,t,n){if(!Va(e))return null;if(n!==this.direction&&this.clear(),this.visitedNodes.has(e.id)||this.visitedNodes.add(e.id),this.isExploring&&n===this.direction&&this.sameLevelNodes.length>1)return this.sameLevelIndex=(this.sameLevelIndex+1)%this.sameLevelNodes.length,this.sameLevelNodes[this.sameLevelIndex].id;let r=[...Z6(e,t,n),...K6(e,t,n)];if(r.length>0)return this.sameLevelIndex=0,this.isExploring=!0,this.sameLevelNodes=r,this.direction=n,this.visitedNodes.add(r[0].id),r[0].id;if(n===this.direction||!this.isExploring){this.isExploring||this.visitedNodes.add(e.id);let a=["up","right","down","left"].filter(i=>i!==n).map(i=>[...Z6(e,t,i),...K6(e,t,i)]).flat().filter(i=>!this.visitedNodes.has(i.id));for(let i of a)if(!this.visitedNodes.has(i.id))return this.visitedNodes.add(i.id),this.isExploring=!0,this.direction=n,i.id}return null}},Are=class{constructor(){F(this,"isCreatingChart",!1),F(this,"numberOfNodes",0),F(this,"direction","right"),F(this,"pendingNodes",null)}createNodes(e,t,n,r){if(r!==this.direction){let{nextNode:a,bindingArrow:i}=Ire(e,t,n,r);this.numberOfNodes=1,this.isCreatingChart=!0,this.direction=r,this.pendingNodes=[a,i]}else{this.numberOfNodes+=1;let a=_re(e,t,n,r,this.numberOfNodes);this.isCreatingChart=!0,this.direction=r,this.pendingNodes=a}if(e.frameId){let a=t.get(e.frameId);lr(a&&XE(a),"not an ExcalidrawFrameElement"),a&&this.pendingNodes.every(i=>Vf([i],a,t)||bs(i,a,t))&&(this.pendingNodes=this.pendingNodes.map(i=>pe(i,{frameId:e.frameId},!1)))}}clear(){this.isCreatingChart=!1,this.pendingNodes=null,this.direction=null,this.numberOfNodes=0}},Rre=(e,t)=>{var n,r;for(let[,a]of t)if(a.type==="arrow"&&(((n=a.startBinding)==null?void 0:n.elementId)===e.id||((r=a.endBinding)==null?void 0:r.elementId)===e.id))return!0;return!1},jre=({appState:e,isMobile:t,device:n,app:r})=>{var o,f;let{activeTool:a,isResizing:i,isRotating:l,lastPointerDownWith:s}=e,d=e.multiElement!==null;if(((o=e.openSidebar)==null?void 0:o.name)===Fa.name&&e.openSidebar.tab===Pc&&((f=e.searchMatches)!=null&&f.length))return L("hints.dismissSearch");if(e.openSidebar&&!n.editor.canFitSidebar)return null;if(ci(e))return L("hints.eraserRevert");if(a.type==="arrow"||a.type==="line")return d?L("hints.linearElementMulti"):a.type==="arrow"?L("hints.arrowTool",{arrowShortcut:he("A")}):L("hints.linearElement");if(a.type==="freedraw")return L("hints.freeDraw");if(a.type==="text")return L("hints.text");if(a.type==="embeddable")return L("hints.embeddable");if(e.activeTool.type==="image"&&e.pendingImageElementId)return L("hints.placeImage");let u=r.scene.getSelectedElements(e);if(i&&s==="mouse"&&u.length===1){let m=u[0];return Ge(m)&&m.points.length===2?L("hints.lockAngle"):vt(m)?L("hints.resizeImage"):L("hints.resize")}if(l&&s==="mouse")return L("hints.rotate");if(u.length===1&&ke(u[0]))return L("hints.text_selected");if(e.editingTextElement)return L("hints.text_editing");if(e.croppingElementId)return L("hints.leaveCropEditor");if(u.length===1&&vt(u[0]))return L("hints.enterCropEditor");if(a.type==="selection"){if(e.selectionElement&&!u.length&&!e.editingTextElement&&!e.editingLinearElement)return L("hints.deepBoxSelect");if(gf(r)&&e.selectedElementsAreBeingDragged)return L("hints.disableSnapping");if(!u.length&&!t)return L("hints.canvasPanning");if(u.length===1){if(Ge(u[0]))return e.editingLinearElement?e.editingLinearElement.selectedPointsIndices?L("hints.lineEditor_pointSelected"):L("hints.lineEditor_nothingSelected"):L("hints.lineEditor_info");if(!e.newElement&&!e.selectedElementsAreBeingDragged&&uo(u[0]))return C0(u[0])?Rre(u[0],r.scene.getNonDeletedElementsMap())?[L("hints.bindTextToElement"),L("hints.createFlowchart")]:[L("hints.bindTextToElement"),L("hints.createFlowchart")]:L("hints.bindTextToElement")}}return null},X_=({appState:e,isMobile:t,device:n,app:r})=>{let a=jre({appState:e,isMobile:t,device:n,app:r});if(!a)return null;let i=Array.isArray(a)?a.map(l=>he(l).replace(/\. ?$/,"")).join(". "):he(a);return p.jsx("div",{className:"HintViewer",children:p.jsx("span",{children:i})})},Lre="medium",zx={CHECKED:k5,UNCHECKED:M0},V_=e=>p.jsxs("label",{className:Ae("ToolIcon ToolIcon__lock",`ToolIcon_size_${Lre}`,{"is-mobile":e.isMobile}),title:`${e.title} — Q`,children:[p.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-lock"}),p.jsx("div",{className:"ToolIcon__icon",children:e.checked?zx.CHECKED:zx.UNCHECKED})]}),Cf=({heading:e,children:t,...n})=>{let{id:r}=ji(),a=p.jsx("h2",{className:"visually-hidden",id:`${r}-${e}-title`,children:L(`headings.${e}`)});return p.jsx("section",{...n,"aria-labelledby":`${r}-${e}-title`,children:typeof t=="function"?t(a):p.jsxs(p.Fragment,{children:[a,t]})})},ui=4,ss=6,Dre="rgba(0,0,0,0.3)",Pre=(e,t,n,r)=>{if(!e.length)return{horizontal:null,vertical:null};let[a,i,l,s]=xt(e),d=t/r.zoom.value,u=n/r.zoom.value,o=t-d,f=n-u,m={top:parseInt(E1("sat"))||0,bottom:parseInt(E1("sab"))||0,left:parseInt(E1("sal"))||0,right:parseInt(E1("sar"))||0},U=Sf().rtl,g=-r.scrollX+o/2+m.left,v=-r.scrollY+f/2+m.top,y=g+d-m.right,w=v+u-m.bottom,E=Math.min(a,g),S=Math.min(i,v),k=Math.max(l,y),I=Math.max(s,w);return{horizontal:g===E&&y===k?null:{x:Math.max(m.left,ui)+(g-E)/(k-E)*t,y:n-ss-Math.max(ui,m.bottom),width:(y-g)/(k-E)*t-Math.max(ui*2,m.left+m.right),height:ss},vertical:v===S&&w===I?null:{x:U?Math.max(m.left,ui):t-ss-Math.max(m.right,ui),y:(v-S)/(I-S)*n+Math.max(m.top,ui),width:ss,height:(w-v)/(I-S)*n-Math.max(ui*2,m.top+m.bottom)}}},Fx=(e,t,n)=>{let[r,a]=[e.horizontal,e.vertical].map(i=>i!=null&&i.x<=t&&t<=i.x+i.width&&i.y<=n&&n<=i.y+i.height);return{isOverEither:r||a,isOverHorizontal:r,isOverVertical:a}},Nre="medium",G_=e=>e.penDetected?p.jsxs("label",{className:Ae("ToolIcon ToolIcon__penMode",`ToolIcon_size_${Nre}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[p.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),p.jsx("div",{className:"ToolIcon__icon",children:f$})]}):null,Y_=e=>p.jsx(dt,{className:Ae("Shape",{fillable:!1}),type:"radio",icon:oS,name:"editor-current-shape",checked:e.checked,title:`${e.title} — H`,keyBindingLabel:e.isMobile?void 0:B.H.toLocaleUpperCase(),"aria-label":`${e.title} — H`,"aria-keyshortcuts":B.H,"data-testid":"toolbar-hand",onChange:()=>{var t;return(t=e.onChange)==null?void 0:t.call(e)}}),Ore=({appState:e,elements:t,actionManager:n,setAppState:r,onLockToggle:a,onHandToolToggle:i,onPenModeToggle:l,renderTopRightUI:s,renderCustomStats:d,renderSidebars:u,device:o,renderWelcomeScreen:f,UIOptions:m,app:U})=>{var S,k;let{WelcomeScreenCenterTunnel:g,MainMenuTunnel:v,DefaultSidebarTriggerTunnel:y}=Vr(),w=()=>p.jsxs(B_,{side:"top",className:"App-top-bar",children:[f&&p.jsx(g.Out,{}),p.jsx(Cf,{heading:"shapes",children:I=>{var T;return p.jsx(ca.Col,{gap:4,align:"center",children:p.jsxs(ca.Row,{gap:1,className:"App-toolbar-container",children:[p.jsxs(Wa,{padding:1,className:"App-toolbar App-toolbar--mobile",children:[I,p.jsx(ca.Row,{gap:1,children:p.jsx(L_,{appState:e,activeTool:e.activeTool,UIOptions:m,app:U})})]}),s&&s(!0,e),p.jsxs("div",{className:"mobile-misc-tools-container",children:[!e.viewModeEnabled&&((T=e.openDialog)==null?void 0:T.name)!=="elementLinkSelector"&&p.jsx(y.Out,{}),p.jsx(G_,{checked:e.penMode,onChange:()=>l(null),title:L("toolBar.penMode"),isMobile:!0,penDetected:e.penDetected}),p.jsx(V_,{checked:e.activeTool.locked,onChange:a,title:L("toolBar.lock"),isMobile:!0}),p.jsx(Y_,{checked:Vc(e),onChange:()=>i(),title:L("toolBar.hand"),isMobile:!0})]})]})})}}),p.jsx(X_,{appState:e,isMobile:!0,device:o,app:U})]}),E=()=>{var I;return e.viewModeEnabled||((I=e.openDialog)==null?void 0:I.name)==="elementLinkSelector"?p.jsx("div",{className:"App-toolbar-content",children:p.jsx(v.Out,{})}):p.jsxs("div",{className:"App-toolbar-content",children:[p.jsx(v.Out,{}),n.renderAction("toggleEditMenu"),n.renderAction(e.multiElement?"finalize":"duplicateSelection"),n.renderAction("deleteSelectedElements"),p.jsxs("div",{children:[n.renderAction("undo"),n.renderAction("redo")]})]})};return p.jsxs(p.Fragment,{children:[u(),!e.viewModeEnabled&&((S=e.openDialog)==null?void 0:S.name)!=="elementLinkSelector"&&w(),p.jsx("div",{className:"App-bottom-bar",style:{marginBottom:ss+ui*2,marginLeft:ss+ui*2,marginRight:ss+ui*2},children:p.jsxs(Wa,{padding:0,children:[e.openMenu==="shape"&&!e.viewModeEnabled&&((k=e.openDialog)==null?void 0:k.name)!=="elementLinkSelector"&&b8(e,t)?p.jsx(Cf,{className:"App-mobile-menu",heading:"selectedShapeActions",children:p.jsx(j_,{appState:e,elementsMap:U.scene.getNonDeletedElementsMap(),renderAction:n.renderAction,app:U})}):null,p.jsxs("footer",{className:"App-toolbar",children:[E(),e.scrolledOutside&&!e.openMenu&&!e.openSidebar&&p.jsx("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{r(I=>({...mf(t,I)}))},children:L("buttons.scrollBackToContent")})]})]})})]})},Bx=e=>{let t=_.useRef(null),[n,r]=_.useState(null);return _.useLayoutEffect(()=>{if(!e.spreadsheet)return;let a=SY(e.chartType,e.spreadsheet,0,0);r(a);let i,l=t.current;return(async()=>{var s;return i=await Z5(a,{exportBackground:!1,viewBackgroundColor:Fn.white},null,{skipInliningFonts:!0}),(s=i.querySelector(".style-fonts"))==null||s.remove(),l.replaceChildren(),l.appendChild(i),e.selected&&l.parentNode.focus()})(),()=>{l.replaceChildren()}},[e.spreadsheet,e.chartType,e.selected]),p.jsx("button",{type:"button",className:"ChartPreview",onClick:()=>{n&&e.onClick(e.chartType,n)},children:p.jsx("div",{ref:t})})},$re=({setAppState:e,appState:t,onClose:n})=>{let{onInsertElements:r}=Ri(),a=we.useCallback(()=>{n&&n()},[n]),i=(l,s)=>{r(s),Nt("paste","chart",l),e({currentChartType:l,pasteDialog:{shown:!1,data:null}})};return p.jsx(qa,{size:"small",onCloseRequest:a,title:L("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:p.jsxs("div",{className:"container",children:[p.jsx(Bx,{chartType:"bar",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="bar",onClick:i}),p.jsx(Bx,{chartType:"line",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="line",onClick:i})]})})},zre=()=>p.jsxs("div",{className:"HelpDialog__header",children:[p.jsxs("a",{className:"HelpDialog__btn",href:"https://docs.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:[p.jsx("div",{className:"HelpDialog__link-icon",children:$v}),L("helpDialog.documentation")]}),p.jsxs("a",{className:"HelpDialog__btn",href:"https://plus.excalidraw.com/blog",target:"_blank",rel:"noopener noreferrer",children:[p.jsx("div",{className:"HelpDialog__link-icon",children:$v}),L("helpDialog.blog")]}),p.jsxs("a",{className:"HelpDialog__btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:[p.jsx("div",{className:"HelpDialog__link-icon",children:tS}),L("helpDialog.github")]}),p.jsxs("a",{className:"HelpDialog__btn",href:"https://youtube.com/@excalidraw",target:"_blank",rel:"noopener noreferrer",children:[p.jsx("div",{className:"HelpDialog__link-icon",children:jz}),"YouTube"]})]}),Fre=e=>p.jsxs(p.Fragment,{children:[p.jsx("h3",{children:e.title}),p.jsx("div",{className:"HelpDialog__islands-container",children:e.children})]}),xg=e=>p.jsxs("div",{className:`HelpDialog__island ${e.className}`,children:[p.jsx("h4",{className:"HelpDialog__island-title",children:e.caption}),p.jsx("div",{className:"HelpDialog__island-content",children:e.children})]});function*Bre(e,t){let n=!0;for(let r of e)n||(yield t),n=!1,yield r}var Hre=e=>e.replace(/\b[a-z]\b/,t=>t.toUpperCase()),Ie=({label:e,shortcuts:t,isOr:n=!0})=>{let r=t.map(a=>(a.endsWith("++")?[...a.slice(0,-2).split("+"),"+"]:a.split("+")).map(i=>p.jsx(Wre,{children:Hre(i)},i)));return p.jsxs("div",{className:"HelpDialog__shortcut",children:[p.jsx("div",{children:e}),p.jsx("div",{className:"HelpDialog__key-container",children:[...Bre(r,n?L("helpDialog.or"):null)]})]})},Wre=e=>p.jsx("kbd",{className:"HelpDialog__key",...e}),Xre=({onClose:e})=>{let t=we.useCallback(()=>{e&&e()},[e]);return p.jsx(p.Fragment,{children:p.jsxs(qa,{onCloseRequest:t,title:L("helpDialog.title"),className:"HelpDialog",children:[p.jsx(zre,{}),p.jsxs(Fre,{title:L("helpDialog.shortcuts"),children:[p.jsxs(xg,{className:"HelpDialog__island--tools",caption:L("helpDialog.tools"),children:[p.jsx(Ie,{label:L("toolBar.hand"),shortcuts:[B.H]}),p.jsx(Ie,{label:L("toolBar.selection"),shortcuts:[B.V,B[1]]}),p.jsx(Ie,{label:L("toolBar.rectangle"),shortcuts:[B.R,B[2]]}),p.jsx(Ie,{label:L("toolBar.diamond"),shortcuts:[B.D,B[3]]}),p.jsx(Ie,{label:L("toolBar.ellipse"),shortcuts:[B.O,B[4]]}),p.jsx(Ie,{label:L("toolBar.arrow"),shortcuts:[B.A,B[5]]}),p.jsx(Ie,{label:L("toolBar.line"),shortcuts:[B.L,B[6]]}),p.jsx(Ie,{label:L("toolBar.freedraw"),shortcuts:[B.P,B[7]]}),p.jsx(Ie,{label:L("toolBar.text"),shortcuts:[B.T,B[8]]}),p.jsx(Ie,{label:L("toolBar.image"),shortcuts:[B[9]]}),p.jsx(Ie,{label:L("toolBar.eraser"),shortcuts:[B.E,B[0]]}),p.jsx(Ie,{label:L("toolBar.frame"),shortcuts:[B.F]}),p.jsx(Ie,{label:L("toolBar.laser"),shortcuts:[B.K]}),p.jsx(Ie,{label:L("labels.eyeDropper"),shortcuts:[B.I,"Shift+S","Shift+G"]}),p.jsx(Ie,{label:L("helpDialog.editLineArrowPoints"),shortcuts:[he("CtrlOrCmd+Enter")]}),p.jsx(Ie,{label:L("helpDialog.editText"),shortcuts:[he("Enter")]}),p.jsx(Ie,{label:L("helpDialog.textNewLine"),shortcuts:[he("Enter"),he("Shift+Enter")]}),p.jsx(Ie,{label:L("helpDialog.textFinish"),shortcuts:[he("Esc"),he("CtrlOrCmd+Enter")]}),p.jsx(Ie,{label:L("helpDialog.curvedArrow"),shortcuts:["A",L("helpDialog.click"),L("helpDialog.click"),L("helpDialog.click")],isOr:!1}),p.jsx(Ie,{label:L("helpDialog.curvedLine"),shortcuts:["L",L("helpDialog.click"),L("helpDialog.click"),L("helpDialog.click")],isOr:!1}),p.jsx(Ie,{label:L("helpDialog.cropStart"),shortcuts:[L("helpDialog.doubleClick"),he("Enter")],isOr:!0}),p.jsx(Ie,{label:L("helpDialog.cropFinish"),shortcuts:[he("Enter"),he("Escape")],isOr:!0}),p.jsx(Ie,{label:L("toolBar.lock"),shortcuts:[B.Q]}),p.jsx(Ie,{label:L("helpDialog.preventBinding"),shortcuts:[he("CtrlOrCmd")]}),p.jsx(Ie,{label:L("toolBar.link"),shortcuts:[he("CtrlOrCmd+K")]})]}),p.jsxs(xg,{className:"HelpDialog__island--view",caption:L("helpDialog.view"),children:[p.jsx(Ie,{label:L("buttons.zoomIn"),shortcuts:[he("CtrlOrCmd++")]}),p.jsx(Ie,{label:L("buttons.zoomOut"),shortcuts:[he("CtrlOrCmd+-")]}),p.jsx(Ie,{label:L("buttons.resetZoom"),shortcuts:[he("CtrlOrCmd+0")]}),p.jsx(Ie,{label:L("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),p.jsx(Ie,{label:L("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),p.jsx(Ie,{label:L("helpDialog.movePageUpDown"),shortcuts:["PgUp/PgDn"]}),p.jsx(Ie,{label:L("helpDialog.movePageLeftRight"),shortcuts:["Shift+PgUp/PgDn"]}),p.jsx(Ie,{label:L("buttons.zenMode"),shortcuts:[he("Alt+Z")]}),p.jsx(Ie,{label:L("buttons.objectsSnapMode"),shortcuts:[he("Alt+S")]}),p.jsx(Ie,{label:L("labels.toggleGrid"),shortcuts:[he("CtrlOrCmd+'")]}),p.jsx(Ie,{label:L("labels.viewMode"),shortcuts:[he("Alt+R")]}),p.jsx(Ie,{label:L("labels.toggleTheme"),shortcuts:[he("Alt+Shift+D")]}),p.jsx(Ie,{label:L("stats.fullTitle"),shortcuts:[he("Alt+/")]}),p.jsx(Ie,{label:L("search.title"),shortcuts:[ir("searchMenu")]}),p.jsx(Ie,{label:L("commandPalette.title"),shortcuts:lf?[ir("commandPalette")]:[ir("commandPalette"),ir("commandPalette",1)]})]}),p.jsxs(xg,{className:"HelpDialog__island--editor",caption:L("helpDialog.editor"),children:[p.jsx(Ie,{label:L("helpDialog.createFlowchart"),shortcuts:[he("CtrlOrCmd+Arrow Key")],isOr:!0}),p.jsx(Ie,{label:L("helpDialog.navigateFlowchart"),shortcuts:[he("Alt+Arrow Key")],isOr:!0}),p.jsx(Ie,{label:L("labels.moveCanvas"),shortcuts:[he(`Space+${L("helpDialog.drag")}`),he(`Wheel+${L("helpDialog.drag")}`)],isOr:!0}),p.jsx(Ie,{label:L("buttons.clearReset"),shortcuts:[he("CtrlOrCmd+Delete")]}),p.jsx(Ie,{label:L("labels.delete"),shortcuts:[he("Delete")]}),p.jsx(Ie,{label:L("labels.cut"),shortcuts:[he("CtrlOrCmd+X")]}),p.jsx(Ie,{label:L("labels.copy"),shortcuts:[he("CtrlOrCmd+C")]}),p.jsx(Ie,{label:L("labels.paste"),shortcuts:[he("CtrlOrCmd+V")]}),p.jsx(Ie,{label:L("labels.pasteAsPlaintext"),shortcuts:[he("CtrlOrCmd+Shift+V")]}),p.jsx(Ie,{label:L("labels.selectAll"),shortcuts:[he("CtrlOrCmd+A")]}),p.jsx(Ie,{label:L("labels.multiSelect"),shortcuts:[he(`Shift+${L("helpDialog.click")}`)]}),p.jsx(Ie,{label:L("helpDialog.deepSelect"),shortcuts:[he(`CtrlOrCmd+${L("helpDialog.click")}`)]}),p.jsx(Ie,{label:L("helpDialog.deepBoxSelect"),shortcuts:[he(`CtrlOrCmd+${L("helpDialog.drag")}`)]}),(i8||lf)&&p.jsx(Ie,{label:L("labels.copyAsPng"),shortcuts:[he("Shift+Alt+C")]}),p.jsx(Ie,{label:L("labels.copyStyles"),shortcuts:[he("CtrlOrCmd+Alt+C")]}),p.jsx(Ie,{label:L("labels.pasteStyles"),shortcuts:[he("CtrlOrCmd+Alt+V")]}),p.jsx(Ie,{label:L("labels.sendToBack"),shortcuts:[he(xi?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),p.jsx(Ie,{label:L("labels.bringToFront"),shortcuts:[he(xi?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),p.jsx(Ie,{label:L("labels.sendBackward"),shortcuts:[he("CtrlOrCmd+[")]}),p.jsx(Ie,{label:L("labels.bringForward"),shortcuts:[he("CtrlOrCmd+]")]}),p.jsx(Ie,{label:L("labels.alignTop"),shortcuts:[he("CtrlOrCmd+Shift+Up")]}),p.jsx(Ie,{label:L("labels.alignBottom"),shortcuts:[he("CtrlOrCmd+Shift+Down")]}),p.jsx(Ie,{label:L("labels.alignLeft"),shortcuts:[he("CtrlOrCmd+Shift+Left")]}),p.jsx(Ie,{label:L("labels.alignRight"),shortcuts:[he("CtrlOrCmd+Shift+Right")]}),p.jsx(Ie,{label:L("labels.duplicateSelection"),shortcuts:[he("CtrlOrCmd+D"),he(`Alt+${L("helpDialog.drag")}`)]}),p.jsx(Ie,{label:L("helpDialog.toggleElementLock"),shortcuts:[he("CtrlOrCmd+Shift+L")]}),p.jsx(Ie,{label:L("buttons.undo"),shortcuts:[he("CtrlOrCmd+Z")]}),p.jsx(Ie,{label:L("buttons.redo"),shortcuts:EE?[he("CtrlOrCmd+Y"),he("CtrlOrCmd+Shift+Z")]:[he("CtrlOrCmd+Shift+Z")]}),p.jsx(Ie,{label:L("labels.group"),shortcuts:[he("CtrlOrCmd+G")]}),p.jsx(Ie,{label:L("labels.ungroup"),shortcuts:[he("CtrlOrCmd+Shift+G")]}),p.jsx(Ie,{label:L("labels.flipHorizontal"),shortcuts:[he("Shift+H")]}),p.jsx(Ie,{label:L("labels.flipVertical"),shortcuts:[he("Shift+V")]}),p.jsx(Ie,{label:L("labels.showStroke"),shortcuts:[he("S")]}),p.jsx(Ie,{label:L("labels.showBackground"),shortcuts:[he("G")]}),p.jsx(Ie,{label:L("labels.showFonts"),shortcuts:[he("Shift+F")]}),p.jsx(Ie,{label:L("labels.decreaseFontSize"),shortcuts:[he("CtrlOrCmd+Shift+<")]}),p.jsx(Ie,{label:L("labels.increaseFontSize"),shortcuts:[he("CtrlOrCmd+Shift+>")]})]})]})]})})},Vre=4,Gre=8,Yre=({shouldWrap:e,children:t,username:n})=>e?p.jsx(Ro,{label:n||"Unknown user",children:t}):p.jsx(p.Fragment,{children:t}),wg=({actionManager:e,collaborator:t,socketId:n,withName:r=!1,shouldWrapWithTooltip:a=!1,isBeingFollowed:i})=>{let l={socketId:n,collaborator:t,withName:r,isBeingFollowed:i},s=e.renderAction("goToCollaborator",l);return p.jsx(Yre,{username:t.username,shouldWrap:a,children:s},n)},Zre=["avatarUrl","id","socketId","username","isInCall","isSpeaking","isMuted"],Z_=we.memo(({className:e,mobile:t,collaborators:n,userToFollow:r})=>{let a=Lr(),i=new Map;n.forEach((g,v)=>{let y=g.id||v;i.set(y,{...g,socketId:v})});let l=Array.from(i.values()).filter(g=>{var v;return(v=g.username)==null?void 0:v.trim()}),[s,d]=we.useState(""),u=l.filter(g=>{var v;return(v=g.username)==null?void 0:v.toLowerCase().includes(s)}),o=we.useRef(null);_.useLayoutEffect(()=>{if(o.current){let g=y=>{let w=Math.max(1,Math.min(8,Math.floor(y/38)));m(w)};if(g(o.current.clientWidth),!Gg)return;let v=new ResizeObserver(y=>{for(let w of y){let{width:E}=w.contentRect;g(E)}});return v.observe(o.current),()=>{v.disconnect()}}},[]);let[f,m]=we.useState(Vre),U=l.slice(0,f-1).map(g=>wg({actionManager:a,collaborator:g,socketId:g.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:g.socketId===r}));return t?p.jsx("div",{className:Ae("UserList UserList_mobile",e),children:l.map(g=>wg({actionManager:a,collaborator:g,socketId:g.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:g.socketId===r}))}):p.jsx("div",{className:"UserList__wrapper",ref:o,children:p.jsxs("div",{className:Ae("UserList",e),style:{"--max-avatars":f},children:[U,l.length>f-1&&p.jsxs(Q0,{children:[p.jsxs(J0,{className:"UserList__more",children:["+",l.length-f+1]}),p.jsx(N8,{style:{zIndex:2,width:"15rem",textAlign:"left"},align:"end",sideOffset:10,children:p.jsxs(Wa,{padding:2,children:[l.length>=Gre&&p.jsx(JI,{placeholder:L("quickSearch.placeholder"),onChange:d}),p.jsx(e_,{className:"dropdown-menu UserList__collaborators",placeholder:L("userList.empty"),children:u.length>0?[p.jsx("div",{className:"hint",children:L("userList.hint.text")}),u.map(g=>wg({actionManager:a,collaborator:g,socketId:g.socketId,withName:!0,isBeingFollowed:g.socketId===r}))]:[]}),p.jsx(mI,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})]})]})})},(e,t)=>{if(e.collaborators.size!==t.collaborators.size||e.mobile!==t.mobile||e.className!==t.className||e.userToFollow!==t.userToFollow)return!1;let n=t.collaborators.keys();for(let[r,a]of e.collaborators){let i=t.collaborators.get(r);if(!i||r!==n.next().value||!Yn(a,i,Zre))return!1}return!0}),Hx=({children:e,color:t})=>p.jsx("div",{className:"Card",style:{"--card-color":t==="primary"?"var(--color-primary)":Fn[t][7],"--card-color-darker":t==="primary"?"var(--color-primary-darker)":Fn[t][8],"--card-color-darkest":t==="primary"?"var(--color-primary-darkest)":Fn[t][9]},children:e}),Kre=({elements:e,appState:t,setAppState:n,files:r,actionManager:a,exportOpts:i,canvas:l,onCloseRequest:s})=>{let{onExportToBackend:d}=i;return p.jsx("div",{className:"ExportDialog ExportDialog--json",children:p.jsxs("div",{className:"ExportDialog-cards",children:[i.saveFileToDisk&&p.jsxs(Hx,{color:"lime",children:[p.jsx("div",{className:"Card-icon",children:S$}),p.jsx("h2",{children:L("exportDialog.disk_title")}),p.jsxs("div",{className:"Card-details",children:[L("exportDialog.disk_details"),!Do&&a.renderAction("changeProjectName")]}),p.jsx(dt,{className:"Card-button",type:"button",title:L("exportDialog.disk_button"),"aria-label":L("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{a.executeAction(u_,"ui")}})]}),d&&p.jsxs(Hx,{color:"pink",children:[p.jsx("div",{className:"Card-icon",children:t6}),p.jsx("h2",{children:L("exportDialog.link_title")}),p.jsx("div",{className:"Card-details",children:L("exportDialog.link_details")}),p.jsx(dt,{className:"Card-button",type:"button",title:L("exportDialog.link_button"),"aria-label":L("exportDialog.link_button"),showAriaLabel:!0,onClick:async()=>{try{Nt("export","link",`ui (${TO()})`),await d(e,t,r),s()}catch(u){n({errorMessage:u.message})}}})]}),i.renderCustomUI&&i.renderCustomUI(e,t,r,l)]})})},qre=({elements:e,appState:t,files:n,actionManager:r,exportOpts:a,canvas:i,setAppState:l})=>{var d;let s=we.useCallback(()=>{l({openDialog:null})},[l]);return p.jsx(p.Fragment,{children:((d=t.openDialog)==null?void 0:d.name)==="jsonExport"&&p.jsx(qa,{onCloseRequest:s,title:L("buttons.export"),children:p.jsx(Kre,{elements:e,appState:t,setAppState:l,files:n,actionManager:r,onCloseRequest:s,exportOpts:a,canvas:i})})})},Qre=e=>p.jsx("button",{className:"help-icon",onClick:e.onClick,type:"button",title:`${L("helpDialog.title")} — ?`,"aria-label":L("helpDialog.title"),children:C5}),K_=({appState:e,actionManager:t,showExitZenModeBtn:n,renderWelcomeScreen:r})=>{let{FooterCenterTunnel:a,WelcomeScreenHelpHintTunnel:i}=Vr(),l=Sn(),s=!e.viewModeEnabled&&e.multiElement&&l.isTouchScreen;return p.jsxs("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[p.jsx("div",{className:Ae("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled}),children:p.jsx(ca.Col,{gap:2,children:p.jsxs(Cf,{heading:"canvasActions",children:[p.jsx(nre,{renderAction:t.renderAction,zoom:e.zoom}),!e.viewModeEnabled&&p.jsx(rre,{renderAction:t.renderAction,className:Ae("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":e.zenModeEnabled})}),s&&p.jsx(ire,{renderAction:t.renderAction,className:Ae("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled})})]})})}),p.jsx(a.Out,{}),p.jsx("div",{className:Ae("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right":e.zenModeEnabled}),children:p.jsxs("div",{style:{position:"relative"},children:[r&&p.jsx(i.Out,{}),p.jsx(Qre,{onClick:()=>t.executeAction(Y8)})]})}),p.jsx(are,{actionManager:t,showExitZenModeBtn:n})]})},Jre=K_;K_.displayName="Footer";var q_=we.createContext({}),Q_=({children:e,className:t})=>{let n=Sn(),r=_.useContext(q_),a=!!(n.editor.canFitSidebar&&r.shouldRenderDockButton);return p.jsxs("div",{className:Ae("sidebar__header",t),"data-testid":"sidebar-header",children:[e,p.jsxs("div",{className:"sidebar__header__buttons",children:[a&&p.jsx(Ro,{label:L("labels.sidebarLock"),children:p.jsx(jo,{onSelect:()=>{var i;return(i=r.onDock)==null?void 0:i.call(r,!r.docked)},selected:!!r.docked,className:"sidebar__dock","data-testid":"sidebar-dock","aria-label":L("labels.sidebarLock"),children:n$})}),p.jsx(jo,{"data-testid":"sidebar-close",className:"sidebar__close",onSelect:r.onCloseRequest,"aria-label":L("buttons.close"),children:hd})]})]})};Q_.displayName="SidebarHeader";var J_=({name:e,tab:t,icon:n,title:r,children:a,onToggle:i,className:l,style:s})=>{var o;let d=Rn(),u=Ur();return p.jsxs("label",{title:r,className:"sidebar-trigger__label-element",children:[p.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",onChange:f=>{var U;(U=document.querySelector(".layer-ui__wrapper"))==null||U.classList.remove("animate");let m=f.target.checked;d({openSidebar:m?{name:e,tab:t}:null}),i==null||i(m)},checked:((o=u.openSidebar)==null?void 0:o.name)===e,"aria-label":r,"aria-keyshortcuts":"0"}),p.jsxs("div",{className:Ae("sidebar-trigger",l),style:s,children:[n&&p.jsx("div",{children:n}),a&&p.jsx("div",{className:"sidebar-trigger__label",children:a})]})]})};J_.displayName="SidebarTrigger";var eT=({children:e,...t})=>p.jsx(jI,{className:"sidebar-triggers",...t,children:e});eT.displayName="SidebarTabTriggers";var tT=({children:e,tab:t,onSelect:n,...r})=>p.jsx(LI,{value:t,asChild:!0,onSelect:n,children:p.jsx("button",{type:"button",className:"excalidraw-button sidebar-tab-trigger",...r,children:e})});tT.displayName="SidebarTabTrigger";var nT=({children:e,...t})=>{let n=Ur(),r=Rn();if(!n.openSidebar)return null;let{name:a}=n.openSidebar;return p.jsx(RI,{className:"sidebar-tabs-root",value:n.openSidebar.tab,onValueChange:i=>r(l=>({...l,openSidebar:{...l.openSidebar,name:a,tab:i}})),...t,children:e})};nT.displayName="SidebarTabs";var rT=({tab:e,children:t,...n})=>p.jsx(DI,{...n,value:e,"data-testid":e,children:t});rT.displayName="SidebarTab";var Q8=Hn(!1),aT=_.forwardRef(({name:e,children:t,onDock:n,docked:r,className:a,...i},l)=>{et.DEV&&n&&r==null&&console.warn("Sidebar: `docked` must be set when `onDock` is supplied for the sidebar to be user-dockable. To hide this message, either pass `docked` or remove `onDock`");let s=Rn(),d=tm(Q8);_.useLayoutEffect(()=>(d(!!r),()=>{d(!1)}),[d,r]);let u=_.useRef({});u.current.onCloseRequest=()=>{s({openSidebar:null})},u.current.onDock=U=>n==null?void 0:n(U),u.current=J1(u.current,{docked:r,shouldRenderDockButton:!!n&&r!=null});let o=_.useRef(null);_.useImperativeHandle(l,()=>o.current);let f=Sn(),m=_.useCallback(()=>{document.querySelector(".Dialog")||s({openSidebar:null})},[s]);return B8(o,_.useCallback(U=>{U.target.closest(".sidebar-trigger")||(!r||!f.editor.canFitSidebar)&&m()},[m,r,f.editor.canFitSidebar])),_.useEffect(()=>{let U=g=>{g.key===B.ESCAPE&&(!r||!f.editor.canFitSidebar)&&m()};return document.addEventListener("keydown",U),()=>{document.removeEventListener("keydown",U)}},[m,r,f.editor.canFitSidebar]),p.jsx(Wa,{...i,className:Ae("sidebar",{"sidebar--docked":r},a),ref:o,children:p.jsx(q_.Provider,{value:u.current,children:t})})});aT.displayName="SidebarInner";var ja=Object.assign(_.forwardRef((e,t)=>{var s;let n=Ur(),{onStateChange:r}=e,a=_.useRef(n.openSidebar);_.useEffect(()=>{var d,u,o,f,m;(!n.openSidebar&&((d=a==null?void 0:a.current)==null?void 0:d.name)===e.name||((u=n.openSidebar)==null?void 0:u.name)===e.name&&((o=a==null?void 0:a.current)==null?void 0:o.name)!==e.name||((f=a.current)==null?void 0:f.name)===e.name)&&n.openSidebar!==a.current&&(r==null||r(((m=n.openSidebar)==null?void 0:m.name)!==e.name?null:n.openSidebar)),a.current=n.openSidebar},[n.openSidebar,r,e.name]);let[i,l]=_.useState(!1);return _.useLayoutEffect(()=>(l(!0),()=>l(!1)),[]),i&&((s=n.openSidebar)==null?void 0:s.name)===e.name?_.createElement(aT,{...e,ref:t,key:e.name}):null}),{Header:Q_,TabTriggers:eT,TabTrigger:tT,Tabs:nT,Tab:rT,Trigger:J_});ja.displayName="Sidebar";var iT={};ww(iT,{ChangeCanvasBackground:()=>UT,ClearCanvas:()=>pT,CommandPalette:()=>uT,Export:()=>gT,Help:()=>hT,LiveCollaborationTrigger:()=>vT,LoadScene:()=>oT,SaveAsImage:()=>dT,SaveToActiveFile:()=>cT,SearchMenu:()=>fT,Socials:()=>bT,ToggleTheme:()=>mT});var lT=Hn({active:!1});async function eae({title:e,description:t,actionLabel:n,color:r}){return new Promise(a=>{$a.set(lT,{active:!0,onConfirm:()=>a(!0),onClose:()=>a(!1),onReject:()=>a(!1),title:e,description:t,actionLabel:n,color:r})})}var sT=({value:e,shortcut:t,onChange:n,choices:r,children:a,name:i})=>{let l=Sn();return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"dropdown-menu-item-base dropdown-menu-item-bare",children:[p.jsx("label",{className:"dropdown-menu-item__text",htmlFor:i,children:a}),p.jsx(F_,{name:i,value:e,onChange:n,choices:r})]}),t&&!l.editor.isMobile&&p.jsx("div",{className:"dropdown-menu-item__shortcut dropdown-menu-item__shortcut--orphaned",children:t})]})};sT.displayName="DropdownMenuItemContentRadio";var tae=sT,oT=()=>{let{t:e}=Zn(),t=Lr(),n=hm();return t.isActionEnabled(H6)?p.jsx(ba,{icon:M5,onSelect:async()=>{(!n.length||await eae({title:e("overwriteConfirm.modal.loadFromFile.title"),actionLabel:e("overwriteConfirm.modal.loadFromFile.button"),color:"warning",description:p.jsx(bi,{i18nKey:"overwriteConfirm.modal.loadFromFile.description",bold:r=>p.jsx("strong",{children:r}),br:()=>p.jsx("br",{})})}))&&t.executeAction(H6)},"data-testid":"load-button",shortcut:ir("loadScene"),"aria-label":e("buttons.load"),children:e("buttons.load")}):null};oT.displayName="LoadScene";var cT=()=>{let{t:e}=Zn(),t=Lr();return t.isActionEnabled(gx)?p.jsx(ba,{shortcut:ir("saveScene"),"data-testid":"save-button",onSelect:()=>t.executeAction(gx),icon:x$,"aria-label":`${e("buttons.save")}`,children:`${e("buttons.save")}`}):null};cT.displayName="SaveToActiveFile";var dT=()=>{let e=Rn(),{t}=Zn();return p.jsx(ba,{icon:nS,"data-testid":"image-export-button",onSelect:()=>e({openDialog:{name:"imageExport"}}),shortcut:ir("imageExport"),"aria-label":t("buttons.exportImage"),children:t("buttons.exportImage")})};dT.displayName="SaveAsImage";var uT=e=>{let t=Rn(),{t:n}=Zn();return p.jsx(ba,{icon:hS,"data-testid":"command-palette-button",onSelect:()=>{Nt("command_palette","open","menu"),t({openDialog:{name:"commandPalette"}})},shortcut:ir("commandPalette"),"aria-label":n("commandPalette.title"),className:e==null?void 0:e.className,children:n("commandPalette.title")})};uT.displayName="CommandPalette";var fT=e=>{let{t}=Zn(),n=Lr();return p.jsx(ba,{icon:ko,"data-testid":"search-menu-button",onSelect:()=>{n.executeAction(O_)},shortcut:ir("searchMenu"),"aria-label":t("search.title"),className:e==null?void 0:e.className,children:t("search.title")})};fT.displayName="SearchMenu";var hT=()=>{let{t:e}=Zn(),t=Lr();return p.jsx(ba,{"data-testid":"help-menu-item",icon:C5,onSelect:()=>t.executeAction(Y8),shortcut:"?","aria-label":e("helpDialog.title"),children:e("helpDialog.title")})};hT.displayName="Help";var pT=()=>{let{t:e}=Zn(),t=tm(um);return Lr().isActionEnabled(Gu)?p.jsx(ba,{icon:So,onSelect:()=>t("clearCanvas"),"data-testid":"clear-canvas-button","aria-label":e("buttons.clearReset"),children:e("buttons.clearReset")}):null};pT.displayName="ClearCanvas";var mT=e=>{let{t}=Zn(),n=Ur(),r=Lr(),a=ir("toggleTheme");return r.isActionEnabled(d0)?e!=null&&e.allowSystemTheme?p.jsx(tae,{name:"theme",value:e.theme,onChange:i=>e.onSelect(i),choices:[{value:ot.LIGHT,label:e6,ariaLabel:`${t("buttons.lightMode")} - ${a}`},{value:ot.DARK,label:Jg,ariaLabel:`${t("buttons.darkMode")} - ${a}`},{value:"system",label:Rz,ariaLabel:t("buttons.systemMode")}],children:t("labels.theme")}):p.jsx(ba,{onSelect:i=>{if(i.preventDefault(),e==null?void 0:e.onSelect)e.onSelect(n.theme===ot.DARK?ot.LIGHT:ot.DARK);else return r.executeAction(d0)},icon:n.theme===ot.DARK?e6:Jg,"data-testid":"toggle-dark-mode",shortcut:a,"aria-label":n.theme===ot.DARK?t("buttons.lightMode"):t("buttons.darkMode"),children:n.theme===ot.DARK?t("buttons.lightMode"):t("buttons.darkMode")}):null};mT.displayName="ToggleTheme";var UT=()=>{let{t:e}=Zn(),t=Ur(),n=Lr(),r=Qf();return t.viewModeEnabled||!r.UIOptions.canvasActions.changeViewBackgroundColor?null:p.jsxs("div",{style:{marginTop:"0.5rem"},children:[p.jsx("div",{"data-testid":"canvas-background-label",style:{fontSize:".75rem",marginBottom:".5rem"},children:e("labels.canvasBackground")}),p.jsx("div",{style:{padding:"0 0.625rem"},children:n.renderAction("changeViewBackgroundColor")})]})};UT.displayName="ChangeCanvasBackground";var gT=()=>{let{t:e}=Zn(),t=Rn();return p.jsx(ba,{icon:I0,onSelect:()=>{t({openDialog:{name:"jsonExport"}})},"data-testid":"json-export-button","aria-label":e("buttons.export"),children:e("buttons.export")})};gT.displayName="Export";var bT=()=>{let{t:e}=Zn();return p.jsxs(p.Fragment,{children:[p.jsx(bp,{icon:tS,href:"https://github.com/excalidraw/excalidraw","aria-label":"GitHub",children:"GitHub"}),p.jsx(bp,{icon:v$,href:"https://x.com/excalidraw","aria-label":"X",children:e("labels.followUs")}),p.jsx(bp,{icon:b$,href:"https://discord.gg/UexuTaE","aria-label":"Discord",children:e("labels.discordChat")})]})};bT.displayName="Socials";var vT=({onSelect:e,isCollaborating:t})=>{let{t:n}=Zn();return p.jsx(ba,{"data-testid":"collab-button",icon:iS,className:Ae({"active-collab":t}),onSelect:e,children:n("labels.liveCollaboration")})};vT.displayName="LiveCollaborationTrigger";var Kf=(e,t)=>{let n=Hn(0),r=a=>{let{tunnelsJotai:{useAtom:i}}=Vr(),[,l]=i(n),s=_.useRef({preferHost:!1,counter:0});return _.useLayoutEffect(()=>{let d=s.current;return l(u=>{let o=u+1;return d.counter=o,o}),()=>{l(u=>{let o=u-1;return d.counter=o,o||(d.preferHost=!1),o})}},[l]),a.__fallback||(s.current.preferHost=!0),!s.current.counter&&a.__fallback&&s.current.preferHost||s.current.counter>1&&a.__fallback?null:p.jsx(t,{...a})};return r.displayName=e,r},nae=Object.assign(Kf("MainMenu",({children:e,onSelect:t})=>{var s;let{MainMenuTunnel:n}=Vr(),r=Sn(),a=Ur(),i=Rn(),l=r.editor.isMobile?void 0:()=>i({openMenu:null});return p.jsx(n.In,{children:p.jsxs(Wt,{open:a.openMenu==="canvas",children:[p.jsx(Wt.Trigger,{onToggle:()=>{i({openMenu:a.openMenu==="canvas"?null:"canvas"})},"data-testid":"main-menu-trigger",className:"main-menu-trigger",children:eS}),p.jsxs(Wt.Content,{onClickOutside:l,onSelect:k0(t,()=>{i({openMenu:null})}),children:[e,r.editor.isMobile&&a.collaborators.size>0&&p.jsxs("fieldset",{className:"UserList-Wrapper",children:[p.jsx("legend",{children:L("labels.collaborators")}),p.jsx(Z_,{mobile:!0,collaborators:a.collaborators,userToFollow:((s=a.userToFollow)==null?void 0:s.socketId)||null})]})]})]})})}),{Trigger:Wt.Trigger,Item:Wt.Item,ItemLink:Wt.ItemLink,ItemCustom:Wt.ItemCustom,Group:Wt.Group,Separator:Wt.Separator,DefaultItems:iT}),ur=nae,J8=({title:e,children:t,actionLabel:n,onClick:r})=>p.jsxs("div",{className:"OverwriteConfirm__Actions__Action",children:[p.jsx("h4",{children:e}),p.jsx("div",{className:"OverwriteConfirm__Actions__Action__content",children:t}),p.jsx(Zu,{variant:"outlined",color:"muted",label:n,size:"large",fullWidth:!0,onClick:r})]}),rae=()=>{let{t:e}=Zn(),t=Lr(),n=Rn();return p.jsx(J8,{title:e("overwriteConfirm.action.exportToImage.title"),actionLabel:e("overwriteConfirm.action.exportToImage.button"),onClick:()=>{t.executeAction(d_,"ui",!0),n({openDialog:{name:"imageExport"}})},children:e("overwriteConfirm.action.exportToImage.description")})},aae=()=>{let{t:e}=Zn(),t=Lr();return p.jsx(J8,{title:e("overwriteConfirm.action.saveToDisk.title"),actionLabel:e("overwriteConfirm.action.saveToDisk.button"),onClick:()=>{t.executeAction(u_,"ui")},children:e("overwriteConfirm.action.saveToDisk.description")})},Wx=Object.assign(({children:e})=>p.jsx("div",{className:"OverwriteConfirm__Actions",children:e}),{ExportToImage:rae,SaveToDisk:aae}),Eg=Object.assign(Kf("OverwriteConfirmDialog",({children:e})=>{let{OverwriteConfirmDialogTunnel:t}=Vr(),[n,r]=sn(lT);if(!n.active)return null;let a=()=>{n.onClose(),r(l=>({...l,active:!1}))},i=()=>{n.onConfirm(),r(l=>({...l,active:!1}))};return p.jsx(t.In,{children:p.jsx(qa,{onCloseRequest:a,title:!1,size:916,children:p.jsxs("div",{className:"OverwriteConfirm",children:[p.jsx("h3",{children:n.title}),p.jsxs("div",{className:`OverwriteConfirm__Description OverwriteConfirm__Description--color-${n.color}`,children:[p.jsx("div",{className:"OverwriteConfirm__Description__icon",children:mz}),p.jsx("div",{children:n.description}),p.jsx("div",{className:"OverwriteConfirm__Description__spacer"}),p.jsx(Zu,{color:n.color,size:"large",label:n.actionLabel,onClick:i})]}),p.jsx(Wx,{children:e})]})})})}),{Actions:Wx,Action:J8}),iae=Hn(""),yT=Hn(null),lae=350,sae=()=>{let e=Ri(),t=Rn(),n=_.useRef(null),[r,a]=sn(iae),i=r.trim(),[l,s]=_.useState(!1),[d,u]=_.useState({nonce:null,items:[]}),o=_.useRef(null),f=_.useRef(void 0),[m,U]=sn(yT),g=e.scene.getNonDeletedElementsMap();_.useEffect(()=>{l||(i!==o.current||e.scene.getSceneNonce()!==f.current)&&(o.current=null,Xx(i,e,(S,k)=>{u({nonce:Si(),items:S}),o.current=i,f.current=e.scene.getSceneNonce(),t({searchMatches:S.map(I=>({id:I.textElement.id,focus:!1,matchedLines:I.matchedLines}))})}))},[l,i,g,e,t,U,f]);let v=()=>{d.items.length>0&&U(S=>S===null?0:(S+1)%d.items.length)},y=()=>{d.items.length>0&&U(S=>S===null?0:S-1<0?d.items.length-1:S-1)};_.useEffect(()=>{t(S=>({searchMatches:S.searchMatches.map((k,I)=>I===m?{...k,focus:!0}:{...k,focus:!1})}))},[m,t]),_.useEffect(()=>{var S,k,I,T;if(d.items.length>0&&m!==null){let M=d.items[m];if(M){let j=e.state.zoom.value,D=Wr({text:M.searchQuery,x:M.textElement.x+(((S=M.matchedLines[0])==null?void 0:S.offsetX)??0),y:M.textElement.y+(((k=M.matchedLines[0])==null?void 0:k.offsetY)??0),width:(I=M.matchedLines[0])==null?void 0:I.width,height:(T=M.matchedLines[0])==null?void 0:T.height,fontSize:M.textElement.fontSize,fontFamily:M.textElement.fontFamily}),P=14,N=M.textElement.fontSize,$=N*j<P;if(!up([D],e.canvas.width/window.devicePixelRatio,e.canvas.height/window.devicePixelRatio,{offsetLeft:e.state.offsetLeft,offsetTop:e.state.offsetTop,scrollX:e.state.scrollX,scrollY:e.state.scrollY,zoom:e.state.zoom},e.scene.getNonDeletedElementsMap(),e.getEditorUIOffsets())||$){let z;$?N>=P?z={fitToContent:!0}:z={fitToViewport:!0,maxZoom:vi(P/N,1)}:z={fitToContent:!0},e.scrollToContent(D,{animate:!0,duration:300,...z,canvasOffsets:e.getEditorUIOffsets()})}}}},[m,d,e]),_.useEffect(()=>()=>{U(null),o.current=null,f.current=void 0,t({searchMatches:[]}),s(!1)},[t,U]);let w=am({goToNextItem:v,goToPreviousItem:y,searchMatches:d});_.useEffect(()=>Yt(window,"keydown",k=>{var I,T,M;if(k.key===B.ESCAPE&&!e.state.openDialog&&!e.state.openPopup){k.preventDefault(),k.stopPropagation(),t({openSidebar:null});return}k[B.CTRL_OR_CMD]&&k.key===B.F&&(k.preventDefault(),k.stopPropagation(),(I=n.current)!=null&&I.matches(":focus")?t({openSidebar:null}):(e.state.openDialog&&t({openDialog:null}),(T=n.current)==null||T.focus(),(M=n.current)==null||M.select())),k.target instanceof HTMLElement&&k.target.closest(".layer-ui__search")&&w.searchMatches.items.length&&(k.key===B.ENTER&&(k.stopPropagation(),w.goToNextItem()),k.key===B.ARROW_UP?(k.stopPropagation(),w.goToPreviousItem()):k.key===B.ARROW_DOWN&&(k.stopPropagation(),w.goToNextItem()))},{capture:!0,passive:!1}),[t,w,e]);let E=`${d.items.length} ${d.items.length===1?L("search.singleResult"):L("search.multipleResults")}`;return p.jsxs("div",{className:"layer-ui__search",children:[p.jsx("div",{className:"layer-ui__search-header",children:p.jsx(q8,{className:Wc.SEARCH_MENU_INPUT_WRAPPER,value:r,ref:n,placeholder:L("search.placeholder"),icon:ko,onChange:S=>{a(S),s(!0);let k=S.trim();Xx(k,e,(I,T)=>{u({nonce:Si(),items:I}),U(T),o.current=k,f.current=e.scene.getSceneNonce(),t({searchMatches:I.map(M=>({id:M.textElement.id,focus:!1,matchedLines:M.matchedLines}))}),s(!1)})},selectOnRender:!0})}),p.jsxs("div",{className:"layer-ui__search-count",children:[d.items.length>0&&p.jsxs(p.Fragment,{children:[m!==null&&m>-1?p.jsxs("div",{children:[m+1," / ",E]}):p.jsx("div",{children:E}),p.jsxs("div",{className:"result-nav",children:[p.jsx(jo,{onSelect:()=>{v()},className:"result-nav-btn",children:mS}),p.jsx(jo,{onSelect:()=>{y()},className:"result-nav-btn",children:zz})]})]}),d.items.length===0&&i&&o.current&&p.jsx("div",{style:{margin:"1rem auto"},children:L("search.noMatch")})]}),p.jsx(uae,{matches:d,onItemClick:U,focusIndex:m,searchQuery:i})]})},oae=e=>{let t=[e.preview.moreBefore?"...":"",e.preview.previewText.slice(0,e.preview.indexInSearchQuery),e.preview.previewText.slice(e.preview.indexInSearchQuery,e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.previewText.slice(e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.moreAfter?"...":""];return p.jsx("div",{tabIndex:-1,className:Ae("layer-ui__result-item",{active:e.highlighted}),onClick:e.onClick,ref:n=>{e.highlighted&&(n==null||n.scrollIntoView({behavior:"auto",block:"nearest"}))},children:p.jsx("div",{className:"preview-text",children:t.flatMap((n,r)=>p.jsx(_.Fragment,{children:r===2?p.jsx("b",{children:n}):n},r))})})},cae=e=>p.jsx("div",{className:"layer-ui__search-result-container",children:e.matches.items.map((t,n)=>p.jsx(oae,{searchQuery:e.searchQuery,preview:t.preview,highlighted:n===e.focusIndex,onClick:()=>e.onItemClick(n)},t.textElement.id+t.index))}),dae=(e,t)=>e.matches.nonce===t.matches.nonce&&e.focusIndex===t.focusIndex,uae=_.memo(cae,dae),fae=(e,t,n)=>{let r=e.slice(0,t),a=r.split(/\s+/),i=r.endsWith(" "),l=a.length-2-1-(i?0:1),s=a.slice(l<=0?0:l).join(" ")+(i?" ":""),d=20;s=s.length>d?s.slice(-d):s;let u=e.slice(t+n.length),o=u.split(/\s+/),f=!u.startsWith(" "),m=f?6:5,U=(f?"":" ")+o.slice(0,m).join(" ");return{indexInSearchQuery:s.length,previewText:s+n+U,moreBefore:l>0,moreAfter:o.length>m}},hae=(e,t)=>{let n=e.split(`
|
|
151
|
+
`),r=[],a=0;for(let i=0;i<n.length;i++){let l=n[i],s=n[i+1];if(s){let d=t.indexOf(s,a);if(d>l.length+a){let u=d-(l.length+a);for(;u>0;)l+=" ",u--}}r.push(l),a=a+l.length}return r.join(`
|
|
152
|
+
`)},pae=(e,t,n)=>{let r=hae(e.text,e.originalText).split(`
|
|
153
|
+
`),a=[],i=0,l=0;for(let o of r){let f=i,m=f+o.length-1;a.push({line:o,startIndex:f,endIndex:m,lineNumber:l}),i=m+1,l++}let s=n,d=e.originalText.slice(n,n+t.length),u=[];for(let o of a){if(d==="")break;if(s>=o.startIndex&&s<=o.endIndex){let f=o.endIndex+1-s,m=o.line.slice(0,s-o.startIndex),U=d.slice(0,f);d=d.slice(f);let g=sr(m,_t(e),e.lineHeight);if(m===""&&(g.width=0),e.textAlign!=="left"&&o.line.length>0){let S=sr(o.line,_t(e),e.lineHeight),k=e.textAlign==="center"?(e.width-S.width)/2:e.width-S.width;g.width+=k}let{width:v,height:y}=sr(U,_t(e),e.lineHeight),w=g.width,E=o.lineNumber*g.height;u.push({offsetX:w,offsetY:E,width:v,height:y}),s+=f}}return u},mae=e=>e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&"),Xx=see((e,t,n)=>{if(!e||e===""){n([],null);return}let r=t.scene.getNonDeletedElements().filter(d=>ke(d));r.sort((d,u)=>d.y-u.y);let a=[],i=new RegExp(mae(e),"gi");for(let d of r){let u=null,o=d.originalText;for(;(u=i.exec(o))!==null;){let f=fae(o,u.index,e),m=pae(d,e,u.index);m.length>0&&a.push({textElement:d,searchQuery:e,preview:f,index:u.index,matchedLines:m})}}let l=new Set(t.visibleElements.map(d=>d.id)),s=a.findIndex(d=>l.has(d.textElement.id))??null;n(a,s)},lae),xT=Kf("DefaultSidebarTrigger",e=>{let{DefaultSidebarTriggerTunnel:t}=Vr();return p.jsx(t.In,{children:p.jsx(ja.Trigger,{...e,className:"default-sidebar-trigger",name:Fa.name})})});xT.displayName="DefaultSidebarTrigger";var wT=({children:e})=>{let{DefaultSidebarTabTriggersTunnel:t}=Vr();return p.jsx(t.In,{children:e})};wT.displayName="DefaultTabTriggers";var q6=Object.assign(Kf("DefaultSidebar",({children:e,className:t,onDock:n,docked:r,...a})=>{var u;let i=Ur(),l=Rn(),{DefaultSidebarTabTriggersTunnel:s}=Vr(),d=((u=i.openSidebar)==null?void 0:u.tab)===Pc;return _.createElement(ja,{...a,name:"default",key:"default",className:Ae("default-sidebar",t),docked:d||(r??i.defaultSidebarDockedPreference),onDock:d||n===!1||!n&&r!=null?void 0:k0(n,o=>{l({defaultSidebarDockedPreference:o})})},p.jsxs(ja.Tabs,{children:[p.jsx(ja.Header,{children:p.jsxs(ja.TabTriggers,{children:[p.jsx(ja.TabTrigger,{tab:Pc,children:ko}),p.jsx(ja.TabTrigger,{tab:Tp,children:S5}),p.jsx(s.Out,{})]})}),p.jsx(ja.Tab,{tab:Tp,children:p.jsx(Hne,{})}),p.jsx(ja.Tab,{tab:Pc,children:p.jsx(sae,{})}),e]}))}),{Trigger:xT,TabTriggers:wT}),Uae="small",gae=e=>p.jsxs("label",{className:Ae("ToolIcon ToolIcon__LaserPointer",`ToolIcon_size_${Uae}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[p.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-LaserPointer"}),p.jsx("div",{className:"ToolIcon__icon",children:uS})]}),bae=({canvasRef:e,setError:t})=>{let n=e.current;if(!n)return;let r=n.parentElement;r&&(r.style.background="",t(null),n.replaceChildren())},ET=async({canvasRef:e,mermaidToExcalidrawLib:t,mermaidDefinition:n,setError:r,data:a})=>{let i=e.current,l=i==null?void 0:i.parentElement;if(!(!i||!l)){if(!n){bae({canvasRef:e,setError:r});return}try{let s=await t.api,d;try{d=await s.parseMermaidToExcalidraw(n)}catch{d=await s.parseMermaidToExcalidraw(n.replace(/"/g,"'"))}let{elements:u,files:o}=d;r(null),a.current={elements:Ji(u,{regenerateIds:!0}),files:o};let f=await Xf({elements:a.current.elements,files:a.current.files,exportPadding:dd,maxWidthOrHeight:Math.max(l.offsetWidth,l.offsetHeight)*window.devicePixelRatio});try{await xf(f)}catch(m){throw m.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(L("canvasError.canvasTooBig")):m}l.style.background="var(--default-bg-color)",i.replaceChildren(f)}catch(s){throw l.style.background="var(--default-bg-color)",n&&r(s),s}}},eb=e=>{mo.set(Nu.MERMAID_TO_EXCALIDRAW,e)},ST=({app:e,data:t,text:n,shouldSaveMermaidDataToStorage:r})=>{let{elements:a,files:i}=t.current;a.length&&(e.addElementsFromPasteOrLibrary({elements:a,files:i,position:"center",fitToContent:!0}),e.setOpenDialog(null),r&&n&&eb(n))},kT=({children:e})=>p.jsx("div",{className:"ttd-dialog-panels",children:e}),f0=({label:e,children:t,panelAction:n,panelActionDisabled:r=!1,onTextSubmitInProgess:a,renderTopRight:i,renderSubmitShortcut:l,renderBottomRight:s})=>p.jsxs("div",{className:"ttd-dialog-panel",children:[p.jsxs("div",{className:"ttd-dialog-panel__header",children:[p.jsx("label",{children:e}),i==null?void 0:i()]}),t,p.jsxs("div",{className:Ae("ttd-dialog-panel-button-container",{invisible:!n}),style:{display:"flex",alignItems:"center"},children:[p.jsxs(jo,{className:"ttd-dialog-panel-button",onSelect:n?n.action:()=>{},disabled:r||a,children:[p.jsxs("div",{className:Ae({invisible:a}),children:[n==null?void 0:n.label,(n==null?void 0:n.icon)&&p.jsx("span",{children:n.icon})]}),a&&p.jsx(Ul,{})]}),!r&&!a&&(l==null?void 0:l()),s==null?void 0:s()]})]}),CT=({input:e,placeholder:t,onChange:n,onKeyboardSubmit:r})=>{let a=_.useRef(null),i=_.useRef(r);return i.current=r,_.useEffect(()=>{if(!i.current)return;let l=a.current;if(l){let s=d=>{var u;d[B.CTRL_OR_CMD]&&d.key===B.ENTER&&(d.preventDefault(),(u=i.current)==null||u.call(i))};return l.addEventListener("keydown",s),()=>{l.removeEventListener("keydown",s)}}},[]),p.jsx("textarea",{className:"ttd-dialog-input",onChange:n,value:e,placeholder:t,autoFocus:!0,ref:a})},vae=({error:e})=>p.jsxs("div",{"data-testid":"ttd-dialog-output-error",className:"ttd-dialog-output-error",children:["Error! ",p.jsx("p",{children:e})]}),MT=({error:e,canvasRef:t,loaded:n})=>p.jsxs("div",{className:"ttd-dialog-output-wrapper",children:[e&&p.jsx(vae,{error:e.message}),n?p.jsx("div",{ref:t,style:{opacity:e?"0.15":1},className:"ttd-dialog-output-canvas-container"}):p.jsx(Ul,{size:"2rem"})]}),IT=()=>p.jsxs("div",{className:"ttd-dialog-submit-shortcut",children:[p.jsx("div",{className:"ttd-dialog-submit-shortcut__key",children:he("CtrlOrCmd")}),p.jsx("div",{className:"ttd-dialog-submit-shortcut__key",children:he("Enter")})]}),yae=`flowchart TD
|
|
154
|
+
A[Christmas] -->|Get money| B(Go shopping)
|
|
155
|
+
B --> C{Let me think}
|
|
156
|
+
C -->|One| D[Laptop]
|
|
157
|
+
C -->|Two| E[iPhone]
|
|
158
|
+
C -->|Three| F[Car]`,Vx=Yc(eb,300),xae=({mermaidToExcalidrawLib:e})=>{let[t,n]=_.useState(()=>mo.get(Nu.MERMAID_TO_EXCALIDRAW)||yae),r=_.useDeferredValue(t.trim()),[a,i]=_.useState(null),l=_.useRef(null),s=_.useRef({elements:[],files:null}),d=Ri();_.useEffect(()=>{ET({canvasRef:l,data:s,mermaidToExcalidrawLib:e,setError:i,mermaidDefinition:r}).catch(o=>{FE()&&console.error("Failed to parse mermaid definition",o)}),Vx(r)},[r,e]),_.useEffect(()=>()=>{Vx.flush()},[]);let u=()=>{ST({app:d,data:s,text:t,shouldSaveMermaidDataToStorage:!0})};return p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"ttd-dialog-desc",children:p.jsx(bi,{i18nKey:"mermaid.description",flowchartLink:o=>p.jsx("a",{href:"https://mermaid.js.org/syntax/flowchart.html",children:o}),sequenceLink:o=>p.jsx("a",{href:"https://mermaid.js.org/syntax/sequenceDiagram.html",children:o}),classLink:o=>p.jsx("a",{href:"https://mermaid.js.org/syntax/classDiagram.html",children:o})})}),p.jsxs(kT,{children:[p.jsx(f0,{label:L("mermaid.syntax"),children:p.jsx(CT,{input:t,placeholder:"Write Mermaid diagram defintion here...",onChange:o=>n(o.target.value),onKeyboardSubmit:()=>{u()}})}),p.jsx(f0,{label:L("mermaid.preview"),panelAction:{action:()=>{u()},label:L("mermaid.button"),icon:np},renderSubmitShortcut:()=>p.jsx(IT,{}),children:p.jsx(MT,{canvasRef:l,loaded:e.loaded,error:a})})]})]})},wae=xae,_T=e=>{let t=Rn(),n=_.useRef(null),r=_.useRef(0);return p.jsx(RI,{ref:n,className:"ttd-dialog-tabs-root",value:e.tab,onValueChange:a=>{var l;if(!a)return;let i=(l=n.current)==null?void 0:l.closest(".Modal__content");if(i){let s=i.offsetHeight||0;s>r.current&&(r.current=s,i.style.minHeight=`min(${r.current}px, 100%)`)}e.dialog==="ttd"&&HE(["text-to-diagram","mermaid"],a)&&t({openDialog:{name:e.dialog,tab:a}})},children:e.children})};_T.displayName="TTDDialogTabs";var Eae=_T,TT=({children:e,...t})=>p.jsx(jI,{className:"ttd-dialog-triggers",...t,children:e});TT.displayName="TTDDialogTabTriggers";var Q6=({children:e,tab:t,onSelect:n,...r})=>p.jsx(LI,{value:t,asChild:!0,onSelect:n,children:p.jsx("button",{type:"button",className:"ttd-dialog-tab-trigger",...r,children:e})});Q6.displayName="TTDDialogTabTrigger";var J6=({tab:e,children:t,...n})=>p.jsx(DI,{...n,value:e,children:t});J6.displayName="TTDDialogTab";var Sg=3,yc=1e3,Sae=Hn(null),kae=Hn(null),AT=e=>{var n;let t=Ur();return((n=t.openDialog)==null?void 0:n.name)!=="ttd"?null:p.jsx(Cae,{...e,tab:t.openDialog.tab})},Cae=Kf("TTDDialogBase",({tab:e,...t})=>{let n=Ri(),r=Rn(),a=_.useRef(null),[i,l]=sn(kae),[s,d]=_.useState((i==null?void 0:i.prompt)??""),u=s.trim(),o=T=>{d(T.target.value),l(M=>({generatedResponse:(M==null?void 0:M.generatedResponse)??null,prompt:T.target.value}))},[f,m]=_.useState(!1),[U,g]=sn(Sae),v=async()=>{if(u.length>yc||u.length<Sg||f||(U==null?void 0:U.rateLimitRemaining)===0||"__fallback"in t){u.length<Sg&&I(new Error(`Prompt is too short (min ${Sg} characters)`)),u.length>yc&&I(new Error(`Prompt is too long (max ${yc} characters)`));return}try{m(!0),Nt("ai","generate","ttd");let{generatedResponse:T,error:M,rateLimit:j,rateLimitRemaining:D}=await t.onTextSubmit(u);if(typeof T=="string"&&l(P=>({generatedResponse:T,prompt:(P==null?void 0:P.prompt)??null})),Ou(j)&&Ou(D)&&g({rateLimit:j,rateLimitRemaining:D}),M){I(M);return}if(!T){I(new Error("Generation failed"));return}try{await ET({canvasRef:a,data:S,mermaidToExcalidrawLib:w,setError:I,mermaidDefinition:T}),Nt("ai","mermaid parse success","ttd")}catch(P){console.info(`%cTTD mermaid render errror: ${P.message}`,"color: red"),console.info(`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
159
|
+
TTD mermaid definition render errror: ${P.message}`,"color: yellow"),Nt("ai","mermaid parse failed","ttd"),I(new Error("Generated an invalid diagram :(. You may also try a different prompt."))}}catch(T){let M=T.message;(!M||M==="Failed to fetch")&&(M="Request failed"),I(new Error(M))}finally{m(!1)}},y=_.useRef(v);y.current=v;let[w,E]=_.useState({loaded:!1,api:Re(()=>import("./index-BkW4NM9R.js").then(T=>T.b5),[])});_.useEffect(()=>{(async()=>(await w.api,E(T=>({...T,loaded:!0}))))()},[w.api]);let S=_.useRef({elements:[],files:null}),[k,I]=_.useState(null);return p.jsx(qa,{className:"ttd-dialog",onCloseRequest:()=>{n.setOpenDialog(null)},size:1200,title:!1,...t,autofocus:!1,children:p.jsxs(Eae,{dialog:"ttd",tab:e,children:["__fallback"in t&&t.__fallback?p.jsx("p",{className:"dialog-mermaid-title",children:L("mermaid.title")}):p.jsxs(TT,{children:[p.jsx(Q6,{tab:"text-to-diagram",children:p.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[L("labels.textToDiagram"),p.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"1px 6px",marginLeft:"10px",fontSize:10,borderRadius:"12px",background:"var(--color-promo)",color:"var(--color-surface-lowest)"},children:"AI Beta"})]})}),p.jsx(Q6,{tab:"mermaid",children:"Mermaid"})]}),p.jsx(J6,{className:"ttd-dialog-content",tab:"mermaid",children:p.jsx(wae,{mermaidToExcalidrawLib:w})}),!("__fallback"in t)&&p.jsxs(J6,{className:"ttd-dialog-content",tab:"text-to-diagram",children:[p.jsx("div",{className:"ttd-dialog-desc",children:"Currently we use Mermaid as a middle step, so you'll get best results if you describe a diagram, workflow, flow chart, and similar."}),p.jsxs(kT,{children:[p.jsx(f0,{label:L("labels.prompt"),panelAction:{action:v,label:"Generate",icon:np},onTextSubmitInProgess:f,panelActionDisabled:u.length>yc||(U==null?void 0:U.rateLimitRemaining)===0,renderTopRight:()=>U?p.jsxs("div",{className:"ttd-dialog-rate-limit",style:{fontSize:12,marginLeft:"auto",color:U.rateLimitRemaining===0?"var(--color-danger)":void 0},children:[U.rateLimitRemaining," requests left today"]}):null,renderSubmitShortcut:()=>p.jsx(IT,{}),renderBottomRight:()=>{if(typeof(i==null?void 0:i.generatedResponse)=="string")return p.jsxs("div",{className:"excalidraw-link",style:{marginLeft:"auto",fontSize:14},onClick:()=>{typeof(i==null?void 0:i.generatedResponse)=="string"&&(eb(i.generatedResponse),r({openDialog:{name:"ttd",tab:"mermaid"}}))},children:["View as Mermaid",p.jsx(lm,{icon:np})]});let T=u.length/yc;return T>.8?p.jsxs("div",{style:{marginLeft:"auto",fontSize:12,fontFamily:"monospace",color:T>1?"var(--color-danger)":void 0},children:["Length: ",u.length,"/",yc]}):null},children:p.jsx(CT,{onChange:o,input:s,placeholder:"Describe what you want to see...",onKeyboardSubmit:()=>{y.current()}})}),p.jsx(f0,{label:"Preview",panelAction:{action:()=>{console.info("Panel action clicked"),ST({app:n,data:S})},label:"Insert",icon:np},children:p.jsx(MT,{canvasRef:a,error:k,loaded:w.loaded})})]})]})]})})}),Mae=.01,gl=(e,t)=>!(t==="height"&&ke(e)||t==="width"&&ke(e)||t==="angle"&&He(e)),rr=(e,t)=>{let n=e+t/2;return n-n%t},h0=(e,t,n)=>Object.keys(e).map(r=>({original:(n??t).get(r),latest:t.get(r)})).filter(r=>r.original!==void 0&&r.latest!==void 0),Mf=(e,t,n,r,a,i,l,s=!0)=>{let d=r.get(n.id);if(!d)return;let[u,o]=[n.x+n.width/2,n.y+n.height/2],[f,m]=ce(A(n.x,n.y),A(u,o),n.angle),U=e-f,g=t-m,[v,y]=ce(A(e,t),A(u+U,o+g),-n.angle);pe(d,{x:v,y},s),e5(d,r,a,i);let w=Je(n,l);if(w){let E=r.get(w.id);E&&pe(E,{x:w.x+U,y:w.y+g},s)}},tb=(e,t)=>{let n=fo(t).map(r=>zt(e,r).reduce((a,i)=>(a[i.id]=!0,a),{}));return e.filter(r=>!ed(r)).forEach(r=>{n.push({[r.id]:!0})}),n},e5=(e,t,n,r,a)=>{Ge(e)?Wp([e],t,n,r,!0,[],a==null?void 0:a.zoom):Ar(e,t,a)},Iae=({label:e,icon:t,dragInputCallback:n,value:r,elements:a,editable:i=!0,shouldKeepAspectRatio:l,property:s,scene:d,appState:u,sensitivity:o=1})=>{let f=Ri(),m=_.useRef(null),U=_.useRef(null),[g,v]=_.useState(r.toString()),y=_.useRef(null);y.current||(y.current={originalAppState:rl(u),originalElements:a,lastUpdatedValue:g,updatePending:!1}),_.useEffect(()=>{let S=r.toString();v(S),y.current.lastUpdatedValue=S},[r]);let w=(S,k,I)=>{if(!y.current.updatePending)return!1;y.current.updatePending=!1;let T=Number(S);if(isNaN(T)){v(r.toString());return}let M=Number(T.toFixed(2)),j=Number(r);(isNaN(j)||Math.abs(M-j)>=Mae)&&(y.current.lastUpdatedValue=S,n({accumulatedChange:0,instantChange:0,originalElements:k,originalElementsMap:f.scene.getNonDeletedElementsMap(),shouldKeepAspectRatio:l,shouldChangeByStepSize:!1,scene:d,nextValue:M,property:s,originalAppState:I,setInputValue:D=>v(String(D))}),f.syncActionResult({captureUpdate:ie.IMMEDIATELY}))},E=_.useRef({});return E.current.handleInputValue=w,_.useEffect(()=>{let S=m.current,k=E.current;return()=>{var T;let I=S==null?void 0:S.value;I&&((T=k.handleInputValue)==null||T.call(k,I,y.current.originalElements,y.current.originalAppState)),window.removeEventListener("pointermove",k.onPointerMove,!1),window.removeEventListener("pointerup",k.onPointerUp,!1)}},[i]),i?p.jsxs("div",{className:Ae("drag-input-container",!i&&"disabled"),"data-testid":e,children:[p.jsx("div",{className:"drag-input-label",ref:U,onPointerDown:S=>{if(m.current&&i){document.body.classList.add("excalidraw-cursor-resize"),Number(m.current.value);let k=null,I=f.scene.getNonDeletedElements().reduce(($,z)=>($.set(z.id,No(z)),$),new Map),T=a.map($=>I.get($.id)),M=rl(u),j=0,D=0,P=$=>{if(k&&I!==null&&T!==null){let z=$.clientX-k.x;z!==0&&(D+=z,Math.abs(D)>=o&&(D=Math.sign(D)*Math.floor(Math.abs(D)/o),j+=D,n({accumulatedChange:j,instantChange:D,originalElements:T,originalElementsMap:I,shouldKeepAspectRatio:l,shouldChangeByStepSize:$.shiftKey,property:s,scene:d,originalAppState:M,setInputValue:Z=>v(String(Z))}),D=0))}k={x:$.clientX,y:$.clientY}},N=()=>{window.removeEventListener("pointermove",P,!1),f.syncActionResult({captureUpdate:ie.IMMEDIATELY}),k=null,j=0,D=0,T=null,I=null,document.body.classList.remove("excalidraw-cursor-resize"),window.removeEventListener("pointerup",N,!1)};E.current.onPointerMove=P,E.current.onPointerUp=N,window.addEventListener("pointermove",P,!1),window.addEventListener("pointerup",N,!1)}},onPointerEnter:()=>{U.current&&(U.current.style.cursor="ew-resize")},children:t?p.jsx(lm,{icon:t}):e}),p.jsx("input",{className:"drag-input",autoComplete:"off",spellCheck:"false",onKeyDown:S=>{if(i){let k=S.target;k instanceof HTMLInputElement&&S.key===B.ENTER&&(w(k.value,a,u),f.focusContainer())}},ref:m,value:g,onChange:S=>{y.current.updatePending=!0,v(S.target.value)},onFocus:S=>{S.target.select(),y.current.originalElements=a,y.current.originalAppState=rl(u)},onBlur:S=>{g?i&&w(S.target.value,y.current.originalElements,y.current.originalAppState):v(r.toString())},disabled:!i})]}):null},xl=Iae,Gx=10,_ae=e=>e.type==="image",Tae=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldKeepAspectRatio:r,shouldChangeByStepSize:a,nextValue:i,property:l,originalAppState:s,instantChange:d,scene:u})=>{let o=u.getNonDeletedElementsMap(),f=t[0],m=o.get(f.id);if(f&&m){let U=r||_ae(f),g=f.width/f.height;if(s.croppingElementId===f.id){let S=o.get(f.id);if(!S||!vt(S)||!S.crop)return;let k=S.crop,I={...k},T=S.scale[0]===-1,M=S.scale[1]===-1,{width:j,height:D}=ol(S),P=k.naturalWidth/j,N=k.naturalHeight/D,$=T?k.width+k.x:k.naturalWidth-k.x,z=M?k.height+k.y:k.naturalHeight-k.y,Z=Pn*P,K=Pn*N;if(i!==void 0){if(l==="width"){let ee=i*P,X=lt(ee,Z,$);I={...I,width:X,x:T?k.x+k.width-X:k.x}}else if(l==="height"){let ee=i*N,X=lt(ee,K,z);I={...I,height:X,y:M?k.y+k.height-X:k.y}}pe(S,{crop:I,width:I.width/(k.naturalWidth/j),height:I.height/(k.naturalHeight/D)});return}let Q=l==="width"?d:0,W=l==="height"?d:0,q=lt(k.width+Q,Z,$),V=lt(k.height+W,Z,z);I={...k,x:T?k.x+k.width-q:k.x,y:M?k.y+k.height-V:k.y,width:q,height:V},pe(S,{crop:I,width:I.width/(k.naturalWidth/j),height:I.height/(k.naturalHeight/D)});return}if(i!==void 0){let S=Math.max(l==="width"?i:U?i*g:f.width,ia),k=Math.max(l==="height"?i:U?i/g:f.height,ia);yf(S,k,m,f,o,n,l==="width"?"e":"s",{shouldMaintainAspectRatio:U});return}let v=l==="width"?e:0,y=l==="height"?e:0,w=Math.max(0,f.width+v);l==="width"&&(a?w=rr(w,Gx):w=Math.round(w));let E=Math.max(0,f.height+y);l==="height"&&(a?E=rr(E,Gx):E=Math.round(E)),U&&(l==="width"?E=Math.round(w/g*100)/100:w=Math.round(E*g*100)/100),E=Math.max(ia,E),w=Math.max(ia,w),yf(w,E,m,f,o,n,l==="width"?"e":"s",{shouldMaintainAspectRatio:U})}},Aae=({property:e,element:t,scene:n,appState:r})=>{let a=vi(e==="width"?t.width:t.height,2);if(r.croppingElementId&&r.croppingElementId===t.id&&vt(t)&&t.crop){let{width:i,height:l}=ol(t);if(e==="width"){let s=i/t.crop.naturalWidth;a=vi(t.crop.width*s,2)}if(e==="height"){let s=l/t.crop.naturalHeight;a=vi(t.crop.height*s,2)}}return p.jsx(xl,{label:e==="width"?"W":"H",elements:[t],dragInputCallback:Tae,value:a,editable:gl(t,e),scene:n,appState:r,property:e})},Yx=Aae,Rae=15,jae=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:a})=>{let i=a.getNonDeletedElementsMap(),l=a.getNonDeletedElements(),s=t[0];if(s&&!Me(s)){let d=i.get(s.id);if(!d)return;if(r!==void 0){let g=oo(r);pe(d,{angle:g}),e5(d,i,l,a);let v=Je(d,i);v&&!nt(d)&&pe(v,{angle:g});return}let u=Math.round(Lf(s.angle)*100)/100,o=Math.round(e),f=(u+o)%360;n&&(f=rr(f,Rae)),f=f<0?f+360:f;let m=oo(f);pe(d,{angle:m}),e5(d,i,l,a);let U=Je(d,i);U&&!nt(d)&&pe(U,{angle:m})}},Lae=({element:e,scene:t,appState:n,property:r})=>p.jsx(xl,{label:"A",icon:sS,value:Math.round(Lf(e.angle)%360*100)/100,elements:[e],dragInputCallback:jae,editable:gl(e,"angle"),scene:t,appState:n,property:r}),Dae=Lae,Zx=4,Pae=4,Nae=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:a})=>{let i=a.getNonDeletedElementsMap(),l=t[0];if(l){let s=i.get(l.id);if(!s||!ke(s))return;let d;if(r!==void 0)d=Math.max(Math.round(r),Zx);else if(l.type==="text"){let u=Math.round(l.fontSize),o=Math.round(e);d=Math.max(u+o,Zx),n&&(d=rr(d,Pae))}d&&(pe(s,{fontSize:d}),hr(s,a.getContainerElement(s),a.getNonDeletedElementsMap()))}},Oae=({element:e,scene:t,appState:n,property:r})=>{let a=ke(e)?e:Ua(e)?Je(e,t.getNonDeletedElementsMap()):null;return a?p.jsx(xl,{label:"F",value:Math.round(a.fontSize*10)/10,elements:[a],dragInputCallback:Nae,icon:_0,appState:n,scene:t,property:r}):null},$ae=Oae,xc=10,zae=(e,t,n,r)=>{let a=r.x-e,i=r.y-t,l=r.width*n,s=r.height*n,d=e+a*n,u=t+i*n;return{width:l,height:s,x:d,y:u,...U8(r,l,s,!1),...ke(r)?{fontSize:r.fontSize*n}:{}}},Fae=(e,t,n,r,a,i,l,s)=>{let d=zae(e,t,r,i);pe(a,d,!1);let u=Je(i,s);if(u){let o=u.fontSize*r;Ar(a,l,{newSize:{width:d.width,height:d.height}});let f=l.get(u.id);f&&ke(f)&&(pe(f,{fontSize:o},!1),zf(a,l,n==="width"?"e":"s",!0))}},Kx=(e,t,n,r,a,i,l,s,d,u)=>{i==="width"?t=Math.round(e/r*100)/100:e=Math.round(t*r*100)/100;let o=t/n;for(let f=0;f<s.length;f++){let m=s[f],U=l[f];Fae(a[0],a[1],i,o,U,m,d,u)}},Bae=({accumulatedChange:e,originalElements:t,originalElementsMap:n,originalAppState:r,shouldChangeByStepSize:a,nextValue:i,scene:l,property:s})=>{let d=l.getNonDeletedElementsMap(),u=tb(t,r);if(i!==void 0){for(let m of u){let U=h0(m,d,n);if(U.length>1){let g=U.map(D=>D.latest),v=U.map(D=>D.original),[y,w,E,S]=xt(v),k=E-y,I=S-w,T=k/I,M=Math.max(ia,s==="width"?Math.max(0,i):k),j=Math.max(ia,s==="height"?Math.max(0,i):I);Kx(M,j,I,T,A(y,w),s,g,v,d,n)}else{let[g]=U,v=g==null?void 0:g.latest,y=g==null?void 0:g.original;if(v&&y&&gl(v,s)){let w=s==="width"?Math.max(0,i):v.width;s==="width"&&(a?w=rr(w,xc):w=Math.round(w));let E=s==="height"?Math.max(0,i):v.height;s==="height"&&(a?E=rr(E,xc):E=Math.round(E)),w=Math.max(ia,w),E=Math.max(ia,E),yf(w,E,v,y,d,n,s==="width"?"e":"s",{shouldInformMutation:!1})}}}l.triggerUpdate();return}let o=s==="width"?e:0,f=s==="height"?e:0;for(let m of u){let U=h0(m,d,n);if(U.length>1){let g=U.map(D=>D.latest),v=U.map(D=>D.original),[y,w,E,S]=xt(v),k=E-y,I=S-w,T=k/I,M=Math.max(0,k+o);s==="width"&&(a?M=rr(M,xc):M=Math.round(M));let j=Math.max(0,I+f);s==="height"&&(a?j=rr(j,xc):j=Math.round(j)),M=Math.max(ia,M),j=Math.max(ia,j),Kx(M,j,I,T,A(y,w),s,g,v,d,n)}else{let[g]=U,v=g==null?void 0:g.latest,y=g==null?void 0:g.original;if(v&&y&&gl(v,s)){let w=Math.max(0,y.width+o);s==="width"&&(a?w=rr(w,xc):w=Math.round(w));let E=Math.max(0,y.height+f);s==="height"&&(a?E=rr(E,xc):E=Math.round(E)),w=Math.max(ia,w),E=Math.max(ia,E),yf(w,E,v,y,d,n,s==="width"?"e":"s",{shouldInformMutation:!1})}}}l.triggerUpdate()},Hae=({property:e,elements:t,elementsMap:n,atomicUnits:r,scene:a,appState:i})=>{let l=_.useMemo(()=>r.map(u=>{let o=h0(u,n);if(o.length>1){let[m,U,g,v]=xt(o.map(y=>y.latest));return Math.round((e==="width"?g-m:v-U)*100)/100}let[f]=o;return Math.round((e==="width"?f.latest.width:f.latest.height)*100)/100}),[n,r,e]),s=new Set(l).size===1?Math.round(l[0]*100)/100:"Mixed",d=l.length>0;return p.jsx(xl,{label:e==="width"?"W":"H",elements:t,dragInputCallback:Bae,value:s,editable:d,appState:i,property:e,scene:a})},qx=Hae,Wae=15,Xae=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,property:a,scene:i})=>{let l=i.getNonDeletedElementsMap(),s=t.map(u=>l.get(u.id)).filter(u=>u&&!ed(u)&&gl(u,a)),d=t.filter(u=>!ed(u)&&gl(u,a));if(r!==void 0){let u=oo(r);for(let o of s){if(!o)continue;pe(o,{angle:u},!1);let f=Je(o,l);f&&!nt(o)&&pe(f,{angle:u},!1)}i.triggerUpdate();return}for(let u=0;u<s.length;u++){let o=s[u];if(!o)continue;let f=d[u],m=Math.round(Lf(f.angle)*100)/100,U=Math.round(e),g=(m+U)%360;n&&(g=rr(g,Wae)),g=g<0?g+360:g;let v=oo(g);pe(o,{angle:v},!1);let y=Je(o,l);y&&!nt(o)&&pe(y,{angle:v},!1)}i.triggerUpdate()},Vae=({elements:e,scene:t,appState:n,property:r})=>{let a=e.filter(d=>!ed(d)&&gl(d,"angle")),i=a.map(d=>Math.round(Lf(d.angle)%360*100)/100),l=new Set(i).size===1?i[0]:"Mixed",s=a.some(d=>gl(d,"angle"));return p.jsx(xl,{label:"A",icon:sS,value:l,elements:e,dragInputCallback:Xae,editable:s,appState:n,scene:t,property:r})},Gae=Vae,Qx=4,Yae=4,Zae=(e,t)=>e.reduce((n,r)=>{if(!r||ed(r))return n;if(ke(r))return n.push(r),n;if(Ua(r)){let a=Je(r,t);if(a)return n.push(a),n}return n},[]),Kae=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:r,scene:a})=>{let i=a.getNonDeletedElementsMap(),l=t.map(d=>i.get(d.id)),s;if(r){s=Math.max(Math.round(r),Qx);for(let d of l)pe(d,{fontSize:s},!1),hr(d,a.getContainerElement(d),i,!1);a.triggerUpdate()}else{let d=t;for(let u=0;u<l.length;u++){let o=l[u],f=d[u],m=Math.round(f.fontSize),U=Math.round(e),g=Math.max(m+U,Qx);n&&(g=rr(g,Yae)),pe(o,{fontSize:g},!1),hr(o,a.getContainerElement(o),i,!1)}a.triggerUpdate()}},qae=({elements:e,scene:t,appState:n,property:r,elementsMap:a})=>{let i=Zae(e,a);if(!i.length)return null;let l=i.map(u=>Math.round(u.fontSize*10)/10),s=new Set(l).size===1?l[0]:"Mixed",d=l.length>0;return p.jsx(xl,{label:"F",icon:_0,elements:i,dragInputCallback:Kae,value:s,editable:d,scene:t,property:r,appState:n})},Qae=qae,Jx=10,Jae=({accumulatedChange:e,instantChange:t,originalElements:n,originalElementsMap:r,shouldChangeByStepSize:a,nextValue:i,property:l,scene:s,originalAppState:d})=>{let u=s.getNonDeletedElementsMap(),o=s.getNonDeletedElements(),f=n[0],[m,U]=[f.x+f.width/2,f.y+f.height/2],[g,v]=ce(A(f.x,f.y),A(m,U),f.angle);if(d.croppingElementId===f.id){let k=u.get(f.id);if(!k||!vt(k)||!k.crop)return;let I=k.crop,T=I,M=k.scale[0]===-1,j=k.scale[1]===-1,{width:D,height:P}=ol(k);if(i!==void 0){if(l==="x"){let z=i*(I.naturalWidth/D);M?T={...I,x:lt(I.naturalWidth-z-I.width,0,I.naturalWidth-I.width)}:T={...I,x:lt(i*(I.naturalWidth/D),0,I.naturalWidth-I.width)}}l==="y"&&(T={...I,y:lt(i*(I.naturalHeight/P),0,I.naturalHeight-I.height)}),pe(k,{crop:T});return}let N=(l==="x"?t:0)*(M?-1:1),$=(l==="y"?t:0)*(j?-1:1);T={...I,x:lt(I.x+N,0,I.naturalWidth-I.width),y:lt(I.y+$,0,I.naturalHeight-I.height)},pe(k,{crop:T});return}if(i!==void 0){Mf(l==="x"?i:g,l==="y"?i:v,f,u,o,s,r);return}let y=l==="x"?e:0,w=l==="y"?e:0,E=l==="x"?Math.round(a?rr(f.x+y,Jx):g+y):g,S=l==="y"?Math.round(a?rr(f.y+w,Jx):v+w):v;Mf(E,S,f,u,o,s,r)},eie=({property:e,element:t,elementsMap:n,scene:r,appState:a})=>{let[i,l]=ce(A(t.x,t.y),A(t.x+t.width/2,t.y+t.height/2),t.angle),s=vi(e==="x"?i:l,2);if(a.croppingElementId===t.id&&vt(t)&&t.crop){let d=YX(t);d&&(s=vi(e==="x"?d.x:d.y,2))}return p.jsx(xl,{label:e==="x"?"X":"Y",elements:[t],dragInputCallback:Jae,scene:r,value:s,property:e,appState:a})},ew=eie,tie=10,nie=(e,t,n,r,a,i,l,s)=>{for(let d=0;d<r.length;d++){let u=a[d],[o,f]=[u.x+u.width/2,u.y+u.height/2],[m,U]=ce(A(u.x,u.y),A(o,f),u.angle),g=e==="x"?Math.round(m+t):m,v=e==="y"?Math.round(U+n):U;Mf(g,v,u,i,r,s,l,!1)}},rie=(e,t,n,r,a,i,l)=>{let[s,d,,]=xt(n),u=e-s,o=t-d;for(let f=0;f<n.length;f++){let m=n[f],U=r.get(m.id);if(U&&(!ke(U)||!U.containerId)){let[g,v]=[U.x+U.width/2,U.y+U.height/2],[y,w]=ce(A(U.x,U.y),A(g,v),U.angle);Mf(y+u,w+o,m,r,a,l,i,!1)}}},aie=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldChangeByStepSize:r,nextValue:a,property:i,scene:l,originalAppState:s})=>{var f,m;let d=l.getNonDeletedElementsMap(),u=l.getNonDeletedElements();if(a!==void 0){for(let U of tb(t,s)){let g=h0(U,d,n);if(g.length>1){let[v,y,,]=xt(g.map(w=>w.latest));rie(i==="x"?a:v,i==="y"?a:y,g.map(w=>w.original),d,u,n,l)}else{let v=(f=g[0])==null?void 0:f.original,y=(m=g[0])==null?void 0:m.latest;if(v&&y&&gl(y,i)){let[w,E]=[v.x+v.width/2,v.y+v.height/2],[S,k]=ce(A(v.x,v.y),A(w,E),v.angle);Mf(i==="x"?a:S,i==="y"?a:k,v,d,u,l,n,!1)}}}l.triggerUpdate();return}let o=r?rr(e,tie):e;nie(i,i==="x"?o:0,i==="y"?o:0,t,t,d,n,l),l.triggerUpdate()},iie=({property:e,elements:t,elementsMap:n,atomicUnits:r,scene:a,appState:i})=>{let l=_.useMemo(()=>r.map(d=>{let u=Object.keys(d).map(v=>n.get(v)).filter(v=>v!==void 0);if(u.length>1){let[v,y]=xt(u);return Math.round((e==="x"?v:y)*100)/100}let[o]=u,[f,m]=[o.x+o.width/2,o.y+o.height/2],[U,g]=ce(A(o.x,o.y),A(f,m),o.angle);return Math.round((e==="x"?U:g)*100)/100}),[r,n,e]),s=new Set(l).size===1?l[0]:"Mixed";return p.jsx(xl,{label:e==="x"?"X":"Y",elements:t,dragInputCallback:aie,value:s,property:e,scene:a,appState:i})},tw=iie,nw=5,lie=({property:e,scene:t,appState:n,setAppState:r})=>p.jsx(xl,{label:"Grid step",sensitivity:8,elements:[],dragInputCallback:({nextValue:a,instantChange:i,shouldChangeByStepSize:l,setInputValue:s})=>{r(d=>{let u;return a?u=a:i&&(u=l?rr(d.gridStep+nw*Math.sign(i),nw):d.gridStep+i),u?(u=nk(u),s(u),{gridStep:u}):(s(d.gridStep),null)})},scene:t,value:n.gridStep,property:e,appState:n}),sie=lie,oie=50,fm=e=>{let t=Jf(),n=e.app.scene.getSceneNonce()||1,r=e.app.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}),a=gf(e.app);return p.jsx(cie,{...e,appState:t,sceneNonce:n,selectedElements:r,gridModeEnabled:a})},$t=({children:e,columns:t=1,heading:n,style:r,...a})=>p.jsx("div",{className:Ae("exc-stats__row",{"exc-stats__row--heading":n}),style:{gridTemplateColumns:`repeat(${t}, 1fr)`,...r},...a,children:e});$t.displayName="StatsRow";var p0=({children:e,order:t,style:n,...r})=>p.jsx("div",{className:"exc-stats__rows",style:{order:t,...n},...r,children:e});p0.displayName="StatsRows";fm.StatsRow=$t;fm.StatsRows=p0;var cie=_.memo(({app:e,onClose:t,renderCustomStats:n,selectedElements:r,appState:a,sceneNonce:i,gridModeEnabled:l})=>{let s=e.scene,d=s.getNonDeletedElements(),u=s.getNonDeletedElementsMap(),o=Rn(),f=r.length===1?r[0]:null,m=r.length>1?r:null,U=a.croppingElementId&&vt(f),g=U?ol(f):null,[v,y]=_.useState({width:0,height:0}),w=_.useMemo(()=>Af(k=>{let I=xt(k);y({width:Math.round(I[2])-Math.round(I[0]),height:Math.round(I[3])-Math.round(I[1])})},oie),[]);_.useEffect(()=>{w(d)},[i,d,w]),_.useEffect(()=>()=>w.cancel(),[w]);let E=_.useMemo(()=>tb(r,a),[r,a]),S=_.useMemo(()=>rC(r),[r]);return p.jsx("div",{className:"exc-stats",children:p.jsxs(Wa,{padding:3,children:[p.jsxs("div",{className:"title",children:[p.jsx("h2",{children:L("stats.title")}),p.jsx("div",{className:"close",onClick:t,children:hd})]}),p.jsxs(F6,{label:p.jsx("h3",{children:L("stats.generalStats")}),open:!!(a.stats.panels&Ic.generalStats),openTrigger:()=>o(k=>({stats:{open:!0,panels:k.stats.panels^Ic.generalStats}})),children:[p.jsxs(p0,{children:[p.jsx($t,{heading:!0,children:L("stats.scene")}),p.jsxs($t,{columns:2,children:[p.jsx("div",{children:L("stats.shapes")}),p.jsx("div",{children:d.length})]}),p.jsxs($t,{columns:2,children:[p.jsx("div",{children:L("stats.width")}),p.jsx("div",{children:v.width})]}),p.jsxs($t,{columns:2,children:[p.jsx("div",{children:L("stats.height")}),p.jsx("div",{children:v.height})]}),l&&p.jsxs(p.Fragment,{children:[p.jsx($t,{heading:!0,children:"Canvas"}),p.jsx($t,{children:p.jsx(sie,{property:"gridStep",scene:s,appState:a,setAppState:o})})]})]}),n==null?void 0:n(d,a)]}),!S&&r.length>0&&p.jsx("div",{id:"elementStats",style:{marginTop:12},children:p.jsx(F6,{label:p.jsx("h3",{children:L("stats.elementProperties")}),open:!!(a.stats.panels&Ic.elementProperties),openTrigger:()=>o(k=>({stats:{open:!0,panels:k.stats.panels^Ic.elementProperties}})),children:p.jsxs(p0,{children:[f&&p.jsxs(p.Fragment,{children:[U&&p.jsx($t,{heading:!0,children:L("labels.unCroppedDimension")}),a.croppingElementId&&vt(f)&&g&&p.jsxs($t,{columns:2,children:[p.jsx("div",{children:L("stats.width")}),p.jsx("div",{children:vi(g.width,2)})]}),a.croppingElementId&&vt(f)&&g&&p.jsxs($t,{columns:2,children:[p.jsx("div",{children:L("stats.height")}),p.jsx("div",{children:vi(g.height,2)})]}),p.jsx($t,{heading:!0,"data-testid":"stats-element-type",children:a.croppingElementId?L("labels.imageCropping"):L(`element.${f.type}`)}),p.jsx($t,{children:p.jsx(ew,{element:f,property:"x",elementsMap:u,scene:s,appState:a})}),p.jsx($t,{children:p.jsx(ew,{element:f,property:"y",elementsMap:u,scene:s,appState:a})}),p.jsx($t,{children:p.jsx(Yx,{property:"width",element:f,scene:s,appState:a})}),p.jsx($t,{children:p.jsx(Yx,{property:"height",element:f,scene:s,appState:a})}),!Me(f)&&p.jsx($t,{children:p.jsx(Dae,{property:"angle",element:f,scene:s,appState:a})}),p.jsx($t,{children:p.jsx($ae,{property:"fontSize",element:f,scene:s,appState:a})})]}),m&&p.jsxs(p.Fragment,{children:[sk(m)&&p.jsx($t,{heading:!0,children:L("element.group")}),p.jsxs($t,{columns:2,style:{margin:"0.3125rem 0"},children:[p.jsx("div",{children:L("stats.shapes")}),p.jsx("div",{children:r.length})]}),p.jsx($t,{children:p.jsx(tw,{property:"x",elements:m,elementsMap:u,atomicUnits:E,scene:s,appState:a})}),p.jsx($t,{children:p.jsx(tw,{property:"y",elements:m,elementsMap:u,atomicUnits:E,scene:s,appState:a})}),p.jsx($t,{children:p.jsx(qx,{property:"width",elements:m,elementsMap:u,atomicUnits:E,scene:s,appState:a})}),p.jsx($t,{children:p.jsx(qx,{property:"height",elements:m,elementsMap:u,atomicUnits:E,scene:s,appState:a})}),p.jsx($t,{children:p.jsx(Gae,{property:"angle",elements:m,scene:s,appState:a})}),p.jsx($t,{children:p.jsx(Qae,{property:"fontSize",elements:m,scene:s,appState:a,elementsMap:u})})]})]})})})]})})},(e,t)=>e.sceneNonce===t.sceneNonce&&e.selectedElements===t.selectedElements&&e.appState.stats.panels===t.appState.stats.panels&&e.gridModeEnabled===t.gridModeEnabled&&e.appState.gridStep===t.appState.gridStep&&e.appState.croppingElementId===t.appState.croppingElementId),die=({sourceElementId:e,onClose:t,elementsMap:n,appState:r,generateLinkForSelection:a=Lk})=>{var f;let i=((f=n.get(e))==null?void 0:f.link)??null,[l,s]=_.useState(i),[d,u]=_.useState(!1);_.useEffect(()=>{let m=tt(n,r),U=i;if(m.length>0&&a){let g=Dk(m,r);g&&(U=Rr(a(g.id,g.type)))}s(U)},[n,r,r.selectedElementIds,i,a]);let o=_.useCallback(()=>{var m;if(l&&l!==((m=n.get(e))==null?void 0:m.link)){let U=n.get(e);U&&pe(U,{link:l})}if(!l&&d&&e){let U=n.get(e);U&&pe(U,{link:null})}t==null||t()},[e,l,n,d,t]);return _.useEffect(()=>{let m=U=>{var g,v;((g=r.openDialog)==null?void 0:g.name)==="elementLinkSelector"&&U.key===B.ENTER&&o(),((v=r.openDialog)==null?void 0:v.name)==="elementLinkSelector"&&U.key===B.ESCAPE&&(t==null||t())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m)}},[r,t,o]),p.jsxs("div",{className:"ElementLinkDialog",children:[p.jsxs("div",{className:"ElementLinkDialog__header",children:[p.jsx("h2",{children:L("elementLink.title")}),p.jsx("p",{children:L("elementLink.desc")})]}),p.jsxs("div",{className:"ElementLinkDialog__input",children:[p.jsx(q8,{value:l??"",onChange:m=>{d||u(!0),s(m)},onKeyDown:m=>{m.key===B.ENTER&&o()},className:"ElementLinkDialog__input-field",selectOnRender:!0}),i&&l&&p.jsx(dt,{type:"button",title:L("buttons.remove"),"aria-label":L("buttons.remove"),label:L("buttons.remove"),onClick:()=>{s(null),u(!0)},className:"ElementLinkDialog__remove",icon:So})]}),p.jsxs("div",{className:"ElementLinkDialog__actions",children:[p.jsx(sd,{label:L("buttons.cancel"),onClick:()=>{t==null||t()},style:{marginRight:10}}),p.jsx(sd,{label:L("buttons.confirm"),onClick:o,actionType:"primary"})]})]})},uie=die,fie=({UIOptions:e})=>p.jsxs(ur,{__fallback:!0,children:[p.jsx(ur.DefaultItems.LoadScene,{}),p.jsx(ur.DefaultItems.SaveToActiveFile,{}),e.canvasActions.export&&p.jsx(ur.DefaultItems.Export,{}),e.canvasActions.saveAsImage&&p.jsx(ur.DefaultItems.SaveAsImage,{}),p.jsx(ur.DefaultItems.SearchMenu,{}),p.jsx(ur.DefaultItems.Help,{}),p.jsx(ur.DefaultItems.ClearCanvas,{}),p.jsx(ur.Separator,{}),p.jsx(ur.Group,{title:"Excalidraw links",children:p.jsx(ur.DefaultItems.Socials,{})}),p.jsx(ur.Separator,{}),p.jsx(ur.DefaultItems.ToggleTheme,{}),p.jsx(ur.DefaultItems.ChangeCanvasBackground,{})]}),hie=()=>p.jsxs(Eg,{__fallback:!0,children:[p.jsx(Eg.Actions.SaveToDisk,{}),p.jsx(Eg.Actions.ExportToImage,{})]}),pie=({actionManager:e,appState:t,files:n,setAppState:r,elements:a,canvas:i,onLockToggle:l,onHandToolToggle:s,onPenModeToggle:d,showExitZenModeBtn:u,renderTopRightUI:o,renderCustomStats:f,UIOptions:m,onExportImage:U,renderWelcomeScreen:g,children:v,app:y,isCollaborating:w,generateLinkForSelection:E})=>{var Q,W,q;let S=Sn(),k=tre(),I=k.tunnelsJotai.Provider,[T,M]=sn(im),j=()=>m.canvasActions.export?p.jsx(qre,{elements:a,appState:t,files:n,actionManager:e,exportOpts:m.canvasActions.export,canvas:i,setAppState:r}):null,D=()=>{var V;return!m.canvasActions.saveAsImage||((V=t.openDialog)==null?void 0:V.name)!=="imageExport"?null:p.jsx(Cre,{elements:a,appState:t,files:n,actionManager:e,onExportImage:U,onCloseRequest:()=>r({openDialog:null}),name:y.getName()})},P=()=>p.jsxs("div",{style:{position:"relative"},children:[p.jsx(k.MainMenuTunnel.Out,{}),g&&p.jsx(k.WelcomeScreenMenuHintTunnel.Out,{})]}),N=()=>p.jsx(Cf,{heading:"selectedShapeActions",className:Ae("selected-shape-actions zen-mode-transition",{"transition-left":t.zenModeEnabled}),children:p.jsx(Wa,{className:Wc.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:`${t.height-166}px`},children:p.jsx(j_,{appState:t,elementsMap:y.scene.getNonDeletedElementsMap(),renderAction:e.renderAction,app:y})})}),$=()=>{var X,se,ge,_e,Y;let V=b8(t,a),ee=t.stats.open&&!t.zenModeEnabled&&!t.viewModeEnabled&&((X=t.openDialog)==null?void 0:X.name)!=="elementLinkSelector";return p.jsx(B_,{side:"top",children:p.jsxs("div",{className:"App-menu App-menu_top",children:[p.jsxs(ca.Col,{gap:6,className:Ae("App-menu_top__left"),children:[P(),V&&N()]}),!t.viewModeEnabled&&((se=t.openDialog)==null?void 0:se.name)!=="elementLinkSelector"&&p.jsx(Cf,{heading:"shapes",className:"shapes-section",children:H=>p.jsxs("div",{style:{position:"relative"},children:[g&&p.jsx(k.WelcomeScreenToolbarHintTunnel.Out,{}),p.jsx(ca.Col,{gap:4,align:"start",children:p.jsxs(ca.Row,{gap:1,className:Ae("App-toolbar-container",{"zen-mode":t.zenModeEnabled}),children:[p.jsxs(Wa,{padding:1,className:Ae("App-toolbar",{"zen-mode":t.zenModeEnabled}),children:[p.jsx(X_,{appState:t,isMobile:S.editor.isMobile,device:S,app:y}),H,p.jsxs(ca.Row,{gap:1,children:[p.jsx(G_,{zenModeEnabled:t.zenModeEnabled,checked:t.penMode,onChange:()=>d(null),title:L("toolBar.penMode"),penDetected:t.penDetected}),p.jsx(V_,{checked:t.activeTool.locked,onChange:l,title:L("toolBar.lock")}),p.jsx("div",{className:"App-toolbar__divider"}),p.jsx(Y_,{checked:Vc(t),onChange:()=>s(),title:L("toolBar.hand"),isMobile:!0}),p.jsx(L_,{appState:t,activeTool:t.activeTool,UIOptions:m,app:y})]})]}),w&&p.jsx(Wa,{style:{marginLeft:8,alignSelf:"center",height:"fit-content"},children:p.jsx(gae,{title:L("toolBar.laser"),checked:t.activeTool.type===_n.laser,onChange:()=>y.setActiveTool({type:_n.laser}),isMobile:!0})})]})})]})}),p.jsxs("div",{className:Ae("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":t.zenModeEnabled}),children:[t.collaborators.size>0&&p.jsx(Z_,{collaborators:t.collaborators,userToFollow:((ge=t.userToFollow)==null?void 0:ge.socketId)||null}),o==null?void 0:o(S.editor.isMobile,t),!t.viewModeEnabled&&((_e=t.openDialog)==null?void 0:_e.name)!=="elementLinkSelector"&&(!Z||((Y=t.openSidebar)==null?void 0:Y.name)!==Fa.name)&&p.jsx(k.DefaultSidebarTriggerTunnel.Out,{}),ee&&p.jsx(fm,{app:y,onClose:()=>{e.executeAction(X6)},renderCustomStats:f})]})]})})},z=()=>p.jsx(q6,{__fallback:!0,onDock:V=>{Nt("sidebar",`toggleDock (${V?"dock":"undock"})`,`(${S.editor.isMobile?"mobile":"desktop"})`)}}),Z=NI(Q8),K=p.jsxs(p.Fragment,{children:[v,p.jsx(fie,{UIOptions:m}),p.jsx(q6.Trigger,{__fallback:!0,icon:S5,title:zu(L("toolBar.library")),onToggle:V=>{V&&Nt("sidebar",`${Fa.name} (open)`,`button (${S.editor.isMobile?"mobile":"desktop"})`)},tab:Fa.defaultTab,children:L("toolBar.library")}),p.jsx(hie,{}),((Q=t.openDialog)==null?void 0:Q.name)==="ttd"&&p.jsx(AT,{__fallback:!0}),t.isLoading&&p.jsx(zI,{delay:250}),t.errorMessage&&p.jsx(yre,{onClose:()=>r({errorMessage:null}),children:t.errorMessage}),T&&!S.editor.isMobile&&p.jsx(Kee,{colorPickerType:T.colorPickerType,onCancel:()=>{M(null)},onChange:(V,ee,X,{altKey:se})=>{var ge;if(!(V!=="elementBackground"&&V!=="elementStroke"))if(X.length){for(let _e of X)pe(_e,{[se&&T.swapPreviewOnAlt?V==="elementBackground"?"strokeColor":"backgroundColor":V==="elementBackground"?"backgroundColor":"strokeColor"]:ee},!1),Qt.delete(_e);(ge=fl.getScene(X[0]))==null||ge.triggerUpdate()}else r(V==="elementBackground"?{currentItemBackgroundColor:ee}:{currentItemStrokeColor:ee})},onSelect:(V,ee)=>{var X;M(se=>se!=null&&se.keepOpenOnAlt&&ee.altKey?se:null),(X=T==null?void 0:T.onSelect)==null||X.call(T,V,ee)}}),((W=t.openDialog)==null?void 0:W.name)==="help"&&p.jsx(Xre,{onClose:()=>{r({openDialog:null})}}),p.jsx(lre,{}),((q=t.openDialog)==null?void 0:q.name)==="elementLinkSelector"&&p.jsx(uie,{sourceElementId:t.openDialog.sourceElementId,onClose:()=>{r({openDialog:null})},elementsMap:y.scene.getNonDeletedElementsMap(),appState:t,generateLinkForSelection:E}),p.jsx(k.OverwriteConfirmDialogTunnel.Out,{}),D(),j(),t.pasteDialog.shown&&p.jsx($re,{setAppState:r,appState:t,onClose:()=>r({pasteDialog:{shown:!1,data:null}})}),S.editor.isMobile&&p.jsx(Ore,{app:y,appState:t,elements:a,actionManager:e,renderJSONExportDialog:j,renderImageExportDialog:D,setAppState:r,onLockToggle:l,onHandToolToggle:s,onPenModeToggle:d,renderTopRightUI:o,renderCustomStats:f,renderSidebars:z,device:S,renderWelcomeScreen:g,UIOptions:m}),!S.editor.isMobile&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"layer-ui__wrapper",style:t.openSidebar&&Z&&S.editor.canFitSidebar?{width:"calc(100% - var(--right-sidebar-width))"}:{},children:[g&&p.jsx(k.WelcomeScreenCenterTunnel.Out,{}),$(),p.jsx(Jre,{appState:t,actionManager:e,showExitZenModeBtn:u,renderWelcomeScreen:g}),t.scrolledOutside&&p.jsx("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{r(V=>({...mf(a,V)}))},children:L("buttons.scrollBackToContent")})]}),z()]})]});return p.jsx(KI.Provider,{value:t,children:p.jsx(I,{children:p.jsx(T_.Provider,{value:k,children:K})})})},rw=e=>{let{suggestedBindings:t,startBoundElement:n,cursorButton:r,scrollX:a,scrollY:i,...l}=e;return l},mie=(e,t)=>{if(e.children!==t.children)return!1;let{canvas:n,appState:r,...a}=e,{canvas:i,appState:l,...s}=t;return Yn(rw(r),rw(l),{selectedElementIds:Yn,selectedGroupIds:Yn})&&Yn(a,s)},Uie=we.memo(pie,mie),gie=5e3,bie=({message:e,onClose:t,closable:n=!1,duration:r=gie,style:a})=>{let i=_.useRef(0),l=r!==1/0,s=_.useCallback(()=>{l&&(i.current=window.setTimeout(()=>t(),r))},[t,r,l]);return _.useEffect(()=>{if(l)return s(),()=>clearTimeout(i.current)},[s,e,r,l]),p.jsxs("div",{className:"Toast",onMouseEnter:l?()=>clearTimeout(i==null?void 0:i.current):void 0,onMouseLeave:l?s:void 0,style:a,children:[p.jsx("p",{className:"Toast__message",children:e}),n&&p.jsx(dt,{icon:hd,"aria-label":"close",type:"icon",onClick:t,className:"close"})]})},aw=xe({name:"viewMode",label:"labels.viewMode",paletteName:"Toggle view mode",icon:_5,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.viewModeEnabled},perform(e,t){return{appState:{...t,viewModeEnabled:!this.checked(t)},captureUpdate:ie.EVENTUALLY}},checked:e=>e.viewModeEnabled,predicate:(e,t,n)=>typeof n.viewModeEnabled>"u",keyTest:e=>!e[B.CTRL_OR_CMD]&&e.altKey&&e.code===ft.R}),RT=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length===1&&He(n[0])},vie=xe({name:"selectAllElementsInFrame",label:"labels.selectAllElementsInFrame",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t).at(0)||null;if(He(a)){let i=Mi(Rt(e),a.id).filter(l=>!(l.type==="text"&&l.containerId));return{elements:e,appState:{...t,selectedElementIds:i.reduce((l,s)=>(l[s.id]=!0,l),{})},captureUpdate:ie.IMMEDIATELY}}return{elements:e,appState:t,captureUpdate:ie.EVENTUALLY}},predicate:(e,t,n,r)=>RT(t,r)}),yie=xe({name:"removeAllElementsFromFrame",label:"labels.removeAllElementsFromFrame",trackEvent:{category:"history"},perform:(e,t,n,r)=>{let a=r.scene.getSelectedElements(t).at(0)||null;return He(a)?{elements:eC(e,a),appState:{...t,selectedElementIds:{[a.id]:!0}},captureUpdate:ie.IMMEDIATELY}:{elements:e,appState:t,captureUpdate:ie.EVENTUALLY}},predicate:(e,t,n,r)=>RT(t,r)});xe({name:"updateFrameRendering",label:"labels.updateFrameRendering",viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t)=>({elements:e,appState:{...t,frameRendering:{...t.frameRendering,enabled:!t.frameRendering.enabled}},captureUpdate:ie.EVENTUALLY}),checked:e=>e.frameRendering.enabled});xe({name:"setFrameAsActiveTool",label:"toolBar.frame",trackEvent:{category:"toolbar"},icon:cS,viewMode:!1,perform:(e,t,n,r)=>{let a=gn(t,{type:"frame"});return oi(r.interactiveCanvas,{...t,activeTool:a}),{elements:e,appState:{...t,activeTool:gn(t,{type:"frame"})},captureUpdate:ie.EVENTUALLY}},keyTest:e=>!e[B.CTRL_OR_CMD]&&!e.shiftKey&&!e.altKey&&e.key.toLocaleLowerCase()===B.F});var xie=xe({name:"wrapSelectionInFrame",label:"labels.wrapSelectionInFrame",trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=tt(e,t);return a.length>0&&!a.some(i=>He(i))},perform:(e,t,n,r)=>{let a=tt(e,t),[i,l,s,d]=xt(a,r.scene.getNonDeletedElementsMap()),u=16,o=F5({x:i-u,y:l-u,width:s-i+u*2,height:d-l+u*2});if(t.editingGroupId){let f=zt(a,t.editingGroupId);for(let m of f){let U=m.groupIds.indexOf(t.editingGroupId);pe(m,{groupIds:m.groupIds.slice(0,U)},!1)}}return{elements:Hu([...r.scene.getElementsIncludingDeleted(),o],a,o,t),appState:{selectedElementIds:{[o.id]:!0}},captureUpdate:ie.IMMEDIATELY}}}),wie=()=>p.jsxs("div",{"data-testid":"brave-measure-text-error",children:[p.jsx("p",{children:p.jsx(bi,{i18nKey:"errors.brave_measure_text_error.line1",bold:e=>p.jsx("span",{style:{fontWeight:600},children:e})})}),p.jsx("p",{children:p.jsx(bi,{i18nKey:"errors.brave_measure_text_error.line2",bold:e=>p.jsx("span",{style:{fontWeight:600},children:e})})}),p.jsx("p",{children:p.jsx(bi,{i18nKey:"errors.brave_measure_text_error.line3",link:e=>p.jsx("a",{href:"http://docs.excalidraw.com/docs/@excalidraw/excalidraw/faq#turning-off-aggresive-block-fingerprinting-in-brave-browser",children:e})})}),p.jsx("p",{children:p.jsx(bi,{i18nKey:"errors.brave_measure_text_error.line4",issueLink:e=>p.jsx("a",{href:"https://github.com/excalidraw/excalidraw/issues/new",children:e}),discordLink:e=>p.jsxs("a",{href:"https://discord.gg/UexuTaE",children:[e,"."]})})})]}),Eie=wie,$1={width:100,height:0},os=100,Sie=(e,t,n)=>{let r=Wr({x:0,y:0,textAlign:of.CENTER,verticalAlign:Br.MIDDLE,...t,containerId:e.id,strokeColor:t.strokeColor||e.strokeColor});return Object.assign(e,{boundElements:(e.boundElements||[]).concat({type:"text",id:r.id})}),hr(r,e,n),[e,r]},iw=(e,t,n,r,a)=>{let i,l;if(Object.assign(e,{startBinding:(e==null?void 0:e.startBinding)||null,endBinding:e.endBinding||null}),t){let o=(t==null?void 0:t.width)??os,f=(t==null?void 0:t.height)??os,m;t.id&&(m=r.getElement(t.id),m||console.error(`No element for start binding with id ${t.id} found`));let U=t.x||e.x-o,g=t.y||e.y-f/2,v=m?m.type:t.type;if(v){if(v==="text"){let y="";m&&m.type==="text"?y=m.text:t.type==="text"&&(y=t.text),y||console.error(`No text found for start binding text element for ${e.id}`),i=Wr({x:U,y:g,type:"text",...m,...t,text:y}),Object.assign(i,{x:t.x||e.x-i.width,y:t.y||e.y-i.height/2})}else switch(v){case"rectangle":case"ellipse":case"diamond":{i=ki({x:U,y:g,width:o,height:f,...m,...t,type:v});break}default:wo(e,`Unhandled element start type "${t.type}"`,!0)}Ei(e,i,"start",a)}}if(n){let o=(n==null?void 0:n.height)??os,f=(n==null?void 0:n.width)??os,m;n.id&&(m=r.getElement(n.id),m||console.error(`No element for end binding with id ${n.id} found`));let U=n.x||e.x+e.width,g=n.y||e.y-o/2,v=m?m.type:n.type;if(v){if(v==="text"){let y="";m&&m.type==="text"?y=m.text:n.type==="text"&&(y=n.text),y||console.error(`No text found for end binding text element for ${e.id}`),l=Wr({x:U,y:g,type:"text",...m,...n,text:y}),Object.assign(l,{y:n.y||e.y-l.height/2})}else switch(v){case"rectangle":case"ellipse":case"diamond":{l=ki({x:U,y:g,width:f,height:o,...m,...n,type:v});break}default:wo(e,`Unhandled element end type "${v}"`,!0)}Ei(e,l,"end",a)}}if(e.points.length<2)return{linearElement:e,startBoundElement:i,endBoundElement:l};let s=e.points.length-1,d=.5,u=rl(e.points);return e.points[s][0]>e.points[s-1][0]&&(u[0][0]=d,u[s][0]-=d),e.points[s][0]<e.points[s-1][0]&&(u[0][0]=-d,u[s][0]+=d),e.points[s][1]>e.points[s-1][1]&&(u[0][1]=d,u[s][1]-=d),e.points[s][1]<e.points[s-1][1]&&(u[0][1]=-d,u[s][1]+=d),Object.assign(e,{points:u}),{linearElement:e,startBoundElement:i,endBoundElement:l}},kie=class{constructor(){F(this,"excalidrawElements",new Map),F(this,"add",e=>{e&&this.excalidrawElements.set(e.id,e)}),F(this,"getElements",()=>ul(Array.from(this.excalidrawElements.values()))),F(this,"getElementsMap",()=>pa(We(this.getElements()))),F(this,"getElement",e=>this.excalidrawElements.get(e))}},Ji=(e,t)=>{var s,d,u;if(!e)return[];let n=rl(e),r=new kie,a=new Map,i=new Map;for(let o of n){let f,m=o.id;switch((t==null?void 0:t.regenerateIds)!==!1&&Object.assign(o,{id:ga()}),o.type){case"rectangle":case"ellipse":case"diamond":{let U=(s=o==null?void 0:o.label)!=null&&s.text&&o.width===void 0?0:(o==null?void 0:o.width)||os,g=(d=o==null?void 0:o.label)!=null&&d.text&&o.height===void 0?0:(o==null?void 0:o.height)||os;f=ki({...o,width:U,height:g});break}case"line":{let U=o.width||$1.width,g=o.height||$1.height;f=ho({width:U,height:g,points:[A(0,0),A(U,g)],...o});break}case"arrow":{let U=o.width||$1.width,g=o.height||$1.height;f=B5({width:U,height:g,endArrowhead:"arrow",points:[A(0,0),A(U,g)],...o,type:"arrow"}),Object.assign(f,Jc(f.points));break}case"text":{let U=(o==null?void 0:o.fontFamily)||Es,g=(o==null?void 0:o.fontSize)||bl,v=(o==null?void 0:o.lineHeight)||Co(U),y=o.text??"",w=Kc(y),E=sr(w,_t({fontFamily:U,fontSize:g}),v);f=Wr({width:E.width,height:E.height,fontFamily:U,fontSize:g,...o});break}case"image":{f=vk({width:(o==null?void 0:o.width)||os,height:(o==null?void 0:o.height)||os,...o});break}case"frame":{f=F5({x:0,y:0,...o});break}case"magicframe":{f=f6({x:0,y:0,...o});break}case"freedraw":case"iframe":case"embeddable":{f=o;break}default:f=o,wo(o,`Unhandled element type "${o.type}"`,!0)}r.getElement(f.id)?console.error(`Duplicate id found for ${f.id}`):(r.add(f),a.set(f.id,o),m&&i.set(m,f.id))}let l=r.getElementsMap();for(let[o,f]of a){let m=r.getElement(o);switch(f.type){case"rectangle":case"ellipse":case"diamond":case"arrow":{if((u=f.label)!=null&&u.text){let[U,g]=Sie(m,f==null?void 0:f.label,l);if(r.add(U),r.add(g),nt(U)){let v=f.type==="arrow"?f==null?void 0:f.start:void 0,y=f.type==="arrow"?f==null?void 0:f.end:void 0;if(v&&v.id){let k=i.get(v.id);k&&Object.assign(v,{id:k})}if(y&&y.id){let k=i.get(y.id);k&&Object.assign(y,{id:k})}let{linearElement:w,startBoundElement:E,endBoundElement:S}=iw(U,v,y,r,l);U=w,r.add(w),r.add(E),r.add(S)}}else switch(f.type){case"arrow":{let{start:U,end:g}=f;if(U&&U.id){let E=i.get(U.id);Object.assign(U,{id:E})}if(g&&g.id){let E=i.get(g.id);Object.assign(g,{id:E})}let{linearElement:v,startBoundElement:y,endBoundElement:w}=iw(m,U,g,r,l);r.add(v),r.add(y),r.add(w);break}}break}}}for(let[o,f]of a){if(f.type!=="frame"&&f.type!=="magicframe")continue;let m=r.getElement(o);if(!m)throw new Error(`Excalidraw element with id ${o} doesn't exist`);let U=[];f.children.forEach(M=>{var P;let j=i.get(M);if(!j)throw new Error(`Element with ${M} wasn't mapped correctly`);let D=r.getElement(j);if(!D)throw new Error(`Frame element with id ${j} doesn't exist`);Object.assign(D,{frameId:m.id}),(P=D==null?void 0:D.boundElements)==null||P.forEach(N=>{let $=r.getElement(N.id);if(!$)throw new Error(`Bound element with id ${N.id} doesn't exist`);Object.assign($,{frameId:m.id}),U.push($)}),U.push(D)});let[g,v,y,w]=xt(U),E=10;g=g-E,v=v-E,y=y+E,w=w+E;let S=(m==null?void 0:m.x)||g,k=(m==null?void 0:m.y)||v,I=(m==null?void 0:m.width)||y-g,T=(m==null?void 0:m.height)||w-v;Object.assign(m,{x:S,y:k,width:I,height:T}),FE()&&f.children.length&&(m!=null&&m.x||m!=null&&m.y||m!=null&&m.width||m!=null&&m.height)&&console.info("User provided frame attributes are being considered, if you find this inaccurate, please remove any of the attributes - x, y, width and height so frame coordinates and dimensions are calculated automatically")}return r.getElements()},tn=e=>t=>{$n.unstable_batchedUpdates(e,t)},kg=e=>S0(t=>{$n.unstable_batchedUpdates(e,t)}),nb=(()=>{let e;try{let n=_.version.split(".");e=Number(n[0])>17}catch{e=!1}let t=!1;return()=>window.EXCALIDRAW_THROTTLE_RENDER===!0?e?!0:(t||(t=!0,console.warn("Excalidraw: render throttling is disabled on React versions < 18.")),!1):!1})(),Cie="#ff6b6b",Mie="#ff0000",lw=1,sw=2,Iie=(e,t)=>{if(!t.snapLines.length)return;let n=t.theme===ot.LIGHT||t.zenModeEnabled?Cie:Mie,r=(t.zenModeEnabled?lw*1.5:lw)/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY);for(let a of t.snapLines)a.type==="pointer"?(e.lineWidth=r,e.strokeStyle=n,Tie(a,e,t)):a.type==="gap"?(e.lineWidth=r,e.strokeStyle=n,Aie(a.points[0],a.points[1],a.direction,t,e)):a.type==="points"&&(e.lineWidth=r,e.strokeStyle=n,_ie(a,e,t));e.restore()},_ie=(e,t,n)=>{if(!n.zenModeEnabled){let r=e.points[0],a=e.points[e.points.length-1];ra(r,a,t)}for(let r of e.points)jT(r,n,t)},Tie=(e,t,n)=>{jT(e.points[0],n,t),n.zenModeEnabled||ra(e.points[0],e.points[1],t)},jT=([e,t],n,r)=>{r.save();let a=(n.zenModeEnabled?sw*1.5:sw)/n.zoom.value;r.beginPath(),r.moveTo(e-a,t-a),r.lineTo(e+a,t+a),r.moveTo(e+a,t-a),r.lineTo(e-a,t+a),r.stroke(),r.restore()},ra=(e,t,n)=>{n.beginPath(),n.lineTo(e[0],e[1]),n.lineTo(t[0],t[1]),n.stroke()},Aie=(e,t,n,r,a)=>{let i=8/r.zoom.value,l=i/2,s=i/4;if(n==="horizontal"){let d=[(e[0]+t[0])/2,e[1]];r.zenModeEnabled||ra(A(e[0],e[1]-i),A(e[0],e[1]+i),a),ra(A(d[0]-s,d[1]-l),A(d[0]-s,d[1]+l),a),ra(A(d[0]+s,d[1]-l),A(d[0]+s,d[1]+l),a),r.zenModeEnabled||(ra(A(t[0],t[1]-i),A(t[0],t[1]+i),a),ra(e,t,a))}else{let d=[e[0],(e[1]+t[1])/2];r.zenModeEnabled||ra(A(e[0]-i,e[1]),A(e[0]+i,e[1]),a),ra(A(d[0]-l,d[1]-s),A(d[0]+l,d[1]-s),a),ra(A(d[0]-l,d[1]+s),A(d[0]+l,d[1]+s),a),r.zenModeEnabled||(ra(A(t[0]-i,t[1]),A(t[0]+i,t[1]),a),ra(e,t,a))}},Rie=(e,t)=>{lr(t.selectedLinearElement,"selectedLinearElement is null");let{segmentMidPointHoveredCoords:n}=t.selectedLinearElement;lr(n,"midPointCoords is null"),e.save(),e.translate(t.scrollX,t.scrollY),LT(n,e,t),e.restore()},jie=(e,t,n)=>{var s,d;let{elementId:r,hoverPointIndex:a}=t.selectedLinearElement;if((d=(s=t.editingLinearElement)==null?void 0:s.selectedPointsIndices)!=null&&d.includes(a))return;let i=Ce.getElement(r,n);if(!i)return;let l=Ce.getPointAtIndexGlobalCoordinates(i,a,n);e.save(),e.translate(t.scrollX,t.scrollY),LT(l,e,t),e.restore()},LT=(e,t,n)=>{t.fillStyle="rgba(105, 101, 219, 0.4)",B0(t,e[0],e[1],Ce.POINT_HANDLE_SIZE/n.zoom.value,!1)},qf=(e,t,n,r,a,i,l,s,d=!1,u=0)=>{e.save(),e.translate(i,l),e.rotate(s),d&&e.fillRect(t-i,n-l,r,a),u&&e.roundRect?(e.beginPath(),e.roundRect(t-i,n-l,r,a,u),e.stroke(),e.closePath()):e.strokeRect(t-i,n-l,r,a),e.restore()},Lie=(e,t,n,r,a,i)=>{e.save(),e.translate(r,a),e.rotate(i),e.beginPath(),e.moveTo(0,n/2),e.lineTo(t/2,0),e.lineTo(0,-n/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()},Cg=(e,t,n,r,a,i=!1)=>{e.strokeStyle="#5e5ad8",e.setLineDash([]),e.fillStyle="rgba(255, 255, 255, 0.9)",a?e.fillStyle="rgba(134, 131, 226, 0.9)":i&&(e.fillStyle="rgba(177, 151, 252, 0.7)"),B0(e,n[0],n[1],r/t.zoom.value,!i)},Die=(e,t,n,r,a,i)=>{e.beginPath(),e.ellipse(r,a,t/2,n/2,i,0,Math.PI*2),e.stroke()},Pie=(e,t,n,r)=>{let[a,i,l,s]=Ze(t,n),d=l-a,u=s-i;e.strokeStyle="rgba(0,0,0,.05)";let o=r.value<1?r.value:1;e.lineWidth=O5/o;let f=e.lineWidth/2+$5,m=Ba(Math.min(t.width,t.height),t);switch(t.type){case"rectangle":case"text":case"image":case"iframe":case"embeddable":case"frame":case"magicframe":qf(e,a-f,i-f,d+f*2,u+f*2,a+d/2,i+u/2,t.angle,void 0,m);break;case"diamond":let U=Math.hypot(d,u),g=f*U/u,v=f*U/d;Lie(e,d+g*2,u+v*2,a+d/2,i+u/2,t.angle);break;case"ellipse":Die(e,d+f*2,u+f*2,a+d/2,i+u/2,t.angle);break}},Nie=(e,t,n,r)=>{let[a,i,l]=t,s=$f(l,l.width,l.height,r);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)",(i==="both"?[0,-1]:i==="start"?[0]:[-1]).forEach(d=>{let[u,o]=Ce.getPointAtIndexGlobalCoordinates(a,d,n);B0(e,u,o,s)})},DT=(e,t,n)=>{let{angle:r,x1:a,y1:i,x2:l,y2:s,selectionColors:d,cx:u,cy:o,dashed:f,activeEmbeddable:m}=n,U=l-a,g=s-i,v=(n.padding??yo*2)/t.zoom.value,y=8/t.zoom.value,w=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=(m?4:1)/t.zoom.value;let E=d.length;for(let S=0;S<E;++S)e.strokeStyle=d[S],f&&e.setLineDash([y,w+(y+w)*(E-1)]),e.lineDashOffset=(y+w)*S,qf(e,a-v,i-v,U+v*2,g+v*2,u,o,r);e.restore()},Oie=(e,t,n,r)=>{let a=Array.isArray(n)?Nie:Pie;e.save(),e.translate(t.scrollX,t.scrollY),a(e,n,r,t.zoom),e.restore()},$ie=(e,t,n,r)=>{let[a,i,l,s]=Ze(n,r),d=l-a,u=s-i;e.strokeStyle="rgb(0,118,255)",e.lineWidth=Kt.strokeWidth/t.zoom.value,e.save(),e.translate(t.scrollX,t.scrollY),qf(e,a,i,d,u,a+d/2,i+u/2,n.angle,!1,Kt.radius/t.zoom.value),e.restore()},zie=(e,t,n)=>{let r=n.filter(s=>s.groupIds.length===0),a=n.filter(s=>s.groupIds.length>0),i=s=>{let[d,u,o,f]=xt(s);return{angle:0,x1:d,x2:o,y1:u,y2:f,selectionColors:["rgb(0,118,255)"],dashed:!1,cx:d+(o-d)/2,cy:u+(f-u)/2,activeEmbeddable:!1}},l=s=>{let d=zt(n,s);return i(d)};Object.entries(lk(a,t)).filter(([s,d])=>d).map(([s,d])=>s).map(s=>l(s)).concat(r.map(s=>i([s]))).forEach(s=>DT(e,t,s))},Mg=(e,t,n,r)=>{var s;if(!t.selectedLinearElement)return;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;let a=Ce.getPointsGlobalCoordinates(n,r),{POINT_HANDLE_SIZE:i}=Ce,l=t.editingLinearElement?i:i/2;if(a.forEach((d,u)=>{var f,m;if(Me(n)&&u!==0&&u!==a.length-1)return;let o=!!((m=(f=t.editingLinearElement)==null?void 0:f.selectedPointsIndices)!=null&&m.includes(u));Cg(e,t,d,l,o)}),Me(n)){let d=((s=n.fixedSegments)==null?void 0:s.map(u=>u.index))||[];a.slice(0,-1).forEach((u,o)=>{Ce.isSegmentTooShort(n,a[o+1],a[o],o,t.zoom)||Cg(e,t,A((u[0]+a[o+1][0])/2,(u[1]+a[o+1][1])/2),i/2,!1,!d.includes(o+1))})}else Ce.getEditorMidPoints(n,r,t).filter((d,u,o)=>d!==null&&!(Me(n)&&(u===0||u===o.length-1))).forEach(d=>{(t.editingLinearElement||a.length===2)&&Cg(e,t,d,i/2,!1,!0)});e.restore()},ow=(e,t,n,r,a)=>{Object.keys(r).forEach(i=>{let l=r[i];if(l!==void 0){let[s,d,u,o]=l;e.save(),e.lineWidth=1/n.zoom.value,t.selectionColor&&(e.strokeStyle=t.selectionColor),i==="rotation"?B0(e,s+u/2,d+o/2,u/2):e.roundRect?(e.beginPath(),e.roundRect(s,d,u,o,2/n.zoom.value),e.fill(),e.stroke()):qf(e,s,d,u,o,s+u/2,d+o/2,a,!0),e.restore()}})},Fie=(e,t,n,r,a)=>{let[i,l,,,s,d]=Ze(r,a),u=3,o=20,f=u/n.zoom.value,m=f/2,U=s-i+f,g=d-l+f,v=Math.min(o/n.zoom.value,U),y=Math.min(o/n.zoom.value,g);e.save(),e.fillStyle=t.selectionColor,e.strokeStyle=t.selectionColor,e.lineWidth=f,[[[-U,-g],[0,m],[v,m],[m,0],[m,y]],[[U-m,-g],[m,m],[-v+m,m],[0,0],[0,y]],[[-U,g],[0,-m],[v,-m],[m,0],[m,-y]],[[U-m,g],[m,-m],[-v+m,-m],[0,0],[0,-y]]].forEach(w=>{let[[E,S],[k,I],[T,M],[j,D],[P,N]]=w;e.save(),e.translate(s,d),e.rotate(r.angle),e.beginPath(),e.moveTo(E+k,S+I),e.lineTo(E+T,S+M),e.stroke(),e.beginPath(),e.moveTo(E+j,S+D),e.lineTo(E+P,S+N),e.stroke(),e.restore()}),e.restore()},Bie=(e,t,n,r)=>{t.save();let a=yo*2/n.zoom.value,i=e.width+a*2,l=e.height+a*2,s=e.x+i/2,d=e.y+l/2,u=-(i/2+a),o=-(l/2+a);t.translate(s+n.scrollX,d+n.scrollY),t.rotate(e.angle),t.lineWidth=1/n.zoom.value,t.strokeStyle=r,t.strokeRect(u,o,i,l),t.restore()},PT=({canvas:e,elementsMap:t,visibleElements:n,selectedElements:r,allElementsMap:a,scale:i,appState:l,renderConfig:s,device:d})=>{var v,y,w;if(e===null)return{atLeastOneVisibleElement:!1,elementsMap:t};let[u,o]=G5(e,i),f=Y5({canvas:e,scale:i,normalizedWidth:u,normalizedHeight:o});f.save(),f.scale(l.zoom.value,l.zoom.value);let m;if(n.forEach(E=>{var S;((S=l.editingLinearElement)==null?void 0:S.elementId)===E.id&&E&&(m=E)}),m&&Mg(f,l,m,t),l.selectionElement&&!l.isCropping)try{JX(l.selectionElement,f,l,s.selectionColor)}catch(E){console.error(E)}if(l.editingTextElement&&ke(l.editingTextElement)){let E=a.get(l.editingTextElement.id);E&&!E.autoResize&&Bie(E,f,l,s.selectionColor)}l.isBindingEnabled&&l.suggestedBindings.filter(E=>E!=null).forEach(E=>{Oie(f,l,E,t)}),l.frameToHighlight&&$ie(f,l,l.frameToHighlight,t),l.elementsToHighlight&&zie(f,l,l.elementsToHighlight);let U=r.some(E=>He(E));if(r.length===1&&((v=l.editingLinearElement)==null?void 0:v.elementId)===r[0].id&&Mg(f,l,r[0],t),Me(r[0])&&l.selectedLinearElement&&l.selectedLinearElement.segmentMidPointHoveredCoords?Rie(f,l):l.selectedLinearElement&&l.selectedLinearElement.hoverPointIndex>=0&&!(Me(r[0])&&l.selectedLinearElement.hoverPointIndex>0&&l.selectedLinearElement.hoverPointIndex<r[0].points.length-1)&&jie(f,l,t),!l.multiElement&&!l.editingLinearElement){let E=cC(r,l),S=r.length===1&&Ge(r[0]);S&&((y=l.selectedLinearElement)==null?void 0:y.elementId)===r[0].id&&!r[0].locked&&Mg(f,l,r[0],t);let k=s.selectionColor||Fn.black;if(E){let I=We(r),T=[];for(let j of t.values()){let D=[],P=s.remoteSelectedElementIds.get(j.id);if(S&&Me(j)&&(j.startBinding||j.endBinding)||(I.has(j.id)&&!ak(l,j)&&D.push(k),P&&D.push(...P.map(N=>dm(N,l.collaborators.get(N))))),D.length){let[N,$,z,Z,K,Q]=Ze(j,t,!0);T.push({angle:j.angle,x1:N,y1:$,x2:z,y2:Z,selectionColors:D,dashed:!!P,cx:K,cy:Q,activeEmbeddable:((w=l.activeEmbeddable)==null?void 0:w.element)===j&&l.activeEmbeddable.state==="active",padding:j.id===l.croppingElementId||vt(j)?0:void 0})}}let M=j=>{let D=zt(t,j),[P,N,$,z]=xt(D);T.push({angle:0,x1:P,x2:$,y1:N,y2:z,selectionColors:[Fn.black],dashed:!0,cx:P+($-P)/2,cy:N+(z-N)/2,activeEmbeddable:!1})};for(let j of fo(l))M(j);l.editingGroupId&&M(l.editingGroupId),T.forEach(j=>DT(f,l,j))}if(f.save(),f.translate(l.scrollX,l.scrollY),r.length===1){f.fillStyle=Fn.white;let I=oC(r[0],l.zoom,t,"mouse",Wu(d));if(!l.viewModeEnabled&&E&&!ke(l.editingTextElement)&&!l.croppingElementId&&ow(f,s,l,I,r[0].angle),l.croppingElementId&&!l.isCropping){let T=t.get(l.croppingElementId);T&&vt(T)&&Fie(f,s,l,T,t)}}else if(r.length>1&&!l.isRotating){let I=yo*2/l.zoom.value;f.fillStyle=Fn.white;let[T,M,j,D]=xt(r),P=f.getLineDash();f.setLineDash([2/l.zoom.value]);let N=f.lineWidth;f.lineWidth=1/l.zoom.value,f.strokeStyle=k,qf(f,T-I,M-I,j-T+I*2,D-M+I*2,(T+j)/2,(M+D)/2,0),f.lineWidth=N,f.setLineDash(P);let $=m8([T,M,j,D,(T+j)/2,(M+D)/2],0,l.zoom,"mouse",U?{...Wu(d),rotation:!0}:Wu(d));r.some(z=>!z.locked)&&ow(f,s,l,$,0)}f.restore()}l.searchMatches.forEach(({id:E,focus:S,matchedLines:k})=>{let I=t.get(E);if(I&&ke(I)){let[T,M,,,j,D]=Ze(I,t,!0);f.save(),l.theme===ot.LIGHT?S?f.fillStyle="rgba(255, 124, 0, 0.4)":f.fillStyle="rgba(255, 226, 0, 0.4)":S?f.fillStyle="rgba(229, 82, 0, 0.4)":f.fillStyle="rgba(99, 52, 0, 0.4)",f.translate(l.scrollX,l.scrollY),f.translate(j,D),f.rotate(I.angle),k.forEach(P=>{f.fillRect(T+P.offsetX-j,M+P.offsetY-D,P.width,P.height)}),f.restore()}}),Iie(f,l),f.restore(),Tte({context:f,renderConfig:s,appState:l,normalizedWidth:u,normalizedHeight:o});let g;return s.renderScrollbars&&(g=Pre(n,u,o,l),f.save(),f.fillStyle=Dre,f.strokeStyle="rgba(255,255,255,0.8)",[g.horizontal,g.vertical].forEach(E=>{E&&h_(f,E.x,E.y,E.width,E.height,ss/2)}),f.restore()),{scrollBars:g,atLeastOneVisibleElement:n.length>0,elementsMap:t}},NT=S0(e=>{var n;let t=PT(e);(n=e.callback)==null||n.call(e,t)},{trailing:!0}),Hie=(e,t)=>{if(t){NT(e);return}let n=PT(e);return e.callback(n),n},Wie=e=>{let t=_.useRef(!1);return _.useEffect(()=>{var d;if(!t.current){t.current=!0;return}let n=new Map,r=new Map,a=new Map,i=new Map,l=new Map;e.appState.collaborators.forEach((u,o)=>{if(u.selectedElementIds)for(let f of Object.keys(u.selectedElementIds))a.has(f)||a.set(f,[]),a.get(f).push(o);!u.pointer||u.pointer.renderCursor===!1||(u.username&&i.set(o,u.username),u.userState&&l.set(o,u.userState),r.set(o,oa({sceneX:u.pointer.x,sceneY:u.pointer.y},e.appState)),n.set(o,u.button))});let s=((d=e.containerRef)==null?void 0:d.current)&&getComputedStyle(e.containerRef.current).getPropertyValue("--color-selection")||"#6965db";Hie({canvas:e.canvas,elementsMap:e.elementsMap,visibleElements:e.visibleElements,selectedElements:e.selectedElements,allElementsMap:e.allElementsMap,scale:window.devicePixelRatio,appState:e.appState,renderConfig:{remotePointerViewportCoords:r,remotePointerButton:n,remoteSelectedElementIds:a,remotePointerUsernames:i,remotePointerUserStates:l,selectionColor:s,renderScrollbars:!1},device:e.device,callback:e.renderInteractiveSceneCallback},nb())}),p.jsx("canvas",{className:"excalidraw__canvas interactive",style:{width:e.appState.width,height:e.appState.height,cursor:e.appState.viewModeEnabled?kt.GRAB:kt.AUTO},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:e.handleCanvasRef,onContextMenu:e.onContextMenu,onPointerMove:e.onPointerMove,onPointerUp:e.onPointerUp,onPointerCancel:e.onPointerCancel,onTouchMove:e.onTouchMove,onPointerDown:e.onPointerDown,onDoubleClick:e.appState.viewModeEnabled?void 0:e.onDoubleClick,children:L("labels.drawingCanvas")})},cw=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,editingGroupId:e.editingGroupId,editingLinearElement:e.editingLinearElement,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,selectionElement:e.selectionElement,selectedGroupIds:e.selectedGroupIds,selectedLinearElement:e.selectedLinearElement,multiElement:e.multiElement,isBindingEnabled:e.isBindingEnabled,suggestedBindings:e.suggestedBindings,isRotating:e.isRotating,elementsToHighlight:e.elementsToHighlight,collaborators:e.collaborators,activeEmbeddable:e.activeEmbeddable,snapLines:e.snapLines,zenModeEnabled:e.zenModeEnabled,editingTextElement:e.editingTextElement,isCropping:e.isCropping,croppingElementId:e.croppingElementId,searchMatches:e.searchMatches}),Xie=(e,t)=>e.selectionNonce!==t.selectionNonce||e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements||e.selectedElements!==t.selectedElements?!1:Yn(cw(e.appState),cw(t.appState)),Vie=we.memo(Wie,Xie),Gie=e=>{let t=_.useRef(null),n=_.useRef(!1);return _.useEffect(()=>{let r=t.current;if(!r)return;let a=e.canvas;n.current||(n.current=!0,r.replaceChildren(a),a.classList.add("excalidraw__canvas","static"));let i=`${e.appState.width}px`,l=`${e.appState.height}px`;a.style.width!==i&&(a.style.width=i),a.style.height!==l&&(a.style.height=l);let s=e.appState.width*e.scale,d=e.appState.height*e.scale;a.width!==s&&(a.width=s),a.height!==d&&(a.height=d),Ok({canvas:a,rc:e.rc,scale:e.scale,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,visibleElements:e.visibleElements,appState:e.appState,renderConfig:e.renderConfig},nb())}),p.jsx("div",{className:"excalidraw__canvas-wrapper",ref:t})},dw=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,hoveredElementIds:e.hoveredElementIds,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,shouldCacheIgnoreZoom:e.shouldCacheIgnoreZoom,viewBackgroundColor:e.viewBackgroundColor,exportScale:e.exportScale,selectedElementsAreBeingDragged:e.selectedElementsAreBeingDragged,gridSize:e.gridSize,gridStep:e.gridStep,frameRendering:e.frameRendering,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,editingGroupId:e.editingGroupId,currentHoveredFontFamily:e.currentHoveredFontFamily,croppingElementId:e.croppingElementId}),Yie=(e,t)=>e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements?!1:Yn(dw(e.appState),dw(t.appState))&&Yn(e.renderConfig,t.renderConfig),Zie=we.memo(Gie,Yie),uw=class{constructor(e){F(this,"scene"),F(this,"getRenderableElements",(()=>{let t=({elementsMap:r,zoom:a,offsetLeft:i,offsetTop:l,scrollX:s,scrollY:d,height:u,width:o})=>{let f=[];for(let m of r.values())e0(m,o,u,{zoom:a,offsetLeft:i,offsetTop:l,scrollX:s,scrollY:d},r)&&f.push(m);return f},n=({elements:r,editingTextElement:a,newElementId:i,pendingImageElementId:l})=>{let s=pa(new Map);for(let d of r)vt(d)&&l===d.id||i!==d.id&&(!a||a.type!=="text"||d.id!==a.id)&&s.set(d.id,d);return s};return AO(({zoom:r,offsetLeft:a,offsetTop:i,scrollX:l,scrollY:s,height:d,width:u,editingTextElement:o,newElementId:f,pendingImageElementId:m,sceneNonce:U})=>{let g=this.scene.getNonDeletedElements(),v=n({elements:g,editingTextElement:o,newElementId:f,pendingImageElementId:m}),y=t({elementsMap:v,zoom:r,offsetLeft:a,offsetTop:i,scrollX:l,scrollY:s,height:d,width:u});return{elementsMap:v,visibleElements:y}})})()),this.scene=e}destroy(){NT.cancel(),Nk.cancel(),this.getRenderableElements.clear()}},Kie=({trails:e})=>{let t=_.useRef(null);return _.useEffect(()=>{if(t.current)for(let n of e)n.start(t.current);return()=>{for(let n of e)n.stop()}},e),p.jsx("div",{className:"SVGLayer",children:p.jsx("svg",{ref:t})})},qie=5,Qie=(e,t,n)=>{let[r,a]=Ze(e,n),{x:i,y:l}=oa({sceneX:r+e.width,sceneY:a},t),s=i-t.offsetLeft+10,d=l-t.offsetTop;return{x:s,y:d}},fw=({children:e,element:t,elementsMap:n})=>{let r=Jf();if(r.contextMenu||r.newElement||r.resizingElement||r.isRotating||r.openMenu||r.viewModeEnabled)return null;let{x:a,y:i}=Qie(t,r,n);return p.jsx("div",{className:"excalidraw-canvas-buttons",style:{top:`${i}px`,left:`${a}px`,padding:qie},children:e})},Jie="small",Ig=e=>p.jsxs("label",{className:Ae("ToolIcon ToolIcon__MagicButton",`ToolIcon_size_${Jie}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[p.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),p.jsx("div",{className:"ToolIcon__icon",children:e.icon})]}),ele=({height:e,width:t,userToFollow:n,onDisconnect:r})=>p.jsx("div",{className:"follow-mode",style:{width:t,height:e},children:p.jsxs("div",{className:"follow-mode__badge",children:[p.jsxs("div",{className:"follow-mode__badge__label",children:["Following"," ",p.jsx("span",{className:"follow-mode__badge__username",title:n.username,children:n.username})]}),p.jsx("button",{type:"button",onClick:r,className:"follow-mode__disconnect-btn",children:hd})]})}),tle=ele,nle=class{constructor(){F(this,"targets",new WeakMap),F(this,"rafIds",new WeakMap)}register(e,t){this.targets.set(e,{callback:t,stopped:!0})}start(e){let t=this.targets.get(e);t&&(this.rafIds.has(e)||(this.targets.set(e,{...t,stopped:!1}),this.scheduleFrame(e)))}stop(e){let t=this.targets.get(e);t&&!t.stopped&&this.targets.set(e,{...t,stopped:!0}),this.cancelFrame(e)}constructFrame(e){return t=>{let n=this.targets.get(e);if(!n)return;let r=this.onFrame(n,t);!n.stopped&&!r?this.scheduleFrame(e):this.cancelFrame(e)}}scheduleFrame(e){let t=requestAnimationFrame(this.constructFrame(e));this.rafIds.set(e,t)}cancelFrame(e){if(this.rafIds.has(e)){let t=this.rafIds.get(e);cancelAnimationFrame(t)}this.rafIds.delete(e)}onFrame(e,t){return e.callback(t)??!1}},t5=class{constructor(e,t,n){this.animationFrameHandler=e,this.app=t,this.options=n,F(this,"currentTrail"),F(this,"pastTrails",[]),F(this,"container"),F(this,"trailElement"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.trailElement=document.createElementNS(pt,"path")}get hasCurrentTrail(){return!!this.currentTrail}hasLastPoint(e,t){if(this.currentTrail){let n=this.currentTrail.originalPoints.length;return this.currentTrail.originalPoints[n-1][0]===e&&this.currentTrail.originalPoints[n-1][1]===t}return!1}start(e){e&&(this.container=e),this.trailElement.parentNode!==this.container&&this.container&&this.container.appendChild(this.trailElement),this.animationFrameHandler.start(this)}stop(){var e;this.animationFrameHandler.stop(this),this.trailElement.parentNode===this.container&&((e=this.container)==null||e.removeChild(this.trailElement))}startPath(e,t){this.currentTrail=new o0(this.options),this.currentTrail.addPoint([e,t,performance.now()]),this.update()}addPointToPath(e,t){this.currentTrail&&(this.currentTrail.addPoint([e,t,performance.now()]),this.update())}endPath(){this.currentTrail&&(this.currentTrail.close(),this.currentTrail.options.keepHead=!1,this.pastTrails.push(this.currentTrail),this.currentTrail=void 0,this.update())}update(){this.start()}onFrame(){let e=[];for(let n of this.pastTrails)e.push(this.drawTrail(n,this.app.state));if(this.currentTrail){let n=this.drawTrail(this.currentTrail,this.app.state);e.push(n)}this.pastTrails=this.pastTrails.filter(n=>n.getStrokeOutline().length!==0),e.length===0&&this.stop();let t=e.join(" ").trim();this.trailElement.setAttribute("d",t),this.trailElement.setAttribute("fill",(this.options.fill??(()=>"black"))(this))}drawTrail(e,t){let n=e.getStrokeOutline(e.options.size/t.zoom.value).map(([r,a])=>{let i=oa({sceneX:r,sceneY:a},t);return[i.x,i.y]});return RO(n,!0)}},rle=class{constructor(e,t){this.animationFrameHandler=e,this.app=t,F(this,"localTrail"),F(this,"collabTrails",new Map),F(this,"container"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.localTrail=new t5(e,t,{...this.getTrailOptions(),fill:()=>kE})}getTrailOptions(){return{simplify:0,streamline:.4,sizeMapping:e=>{let t=Math.max(0,1-(performance.now()-e.pressure)/1e3),n=(50-Math.min(50,e.totalLength-e.currentIndex))/50;return Math.min(co(n),co(t))}}}startPath(e,t){this.localTrail.startPath(e,t)}addPointToPath(e,t){this.localTrail.addPointToPath(e,t)}endPath(){this.localTrail.endPath()}start(e){this.container=e,this.animationFrameHandler.start(this),this.localTrail.start(e)}stop(){this.animationFrameHandler.stop(this),this.localTrail.stop()}onFrame(){this.updateCollabTrails()}updateCollabTrails(){if(!(!this.container||this.app.state.collaborators.size===0)){for(let[e,t]of this.app.state.collaborators.entries()){let n;this.collabTrails.has(e)?n=this.collabTrails.get(e):(n=new t5(this.animationFrameHandler,this.app,{...this.getTrailOptions(),fill:()=>{var r;return((r=t.pointer)==null?void 0:r.laserColor)||dm(e,t)}}),n.start(this.container),this.collabTrails.set(e,n)),t.pointer&&t.pointer.tool==="laser"&&(t.button==="down"&&!n.hasCurrentTrail&&n.startPath(t.pointer.x,t.pointer.y),t.button==="down"&&n.hasCurrentTrail&&!n.hasLastPoint(t.pointer.x,t.pointer.y)&&n.addPointToPath(t.pointer.x,t.pointer.y),t.button==="up"&&n.hasCurrentTrail&&(n.addPointToPath(t.pointer.x,t.pointer.y),n.endPath()))}for(let e of this.collabTrails.keys())this.app.state.collaborators.has(e)||(this.collabTrails.get(e).stop(),this.collabTrails.delete(e))}}},ale=(e,t,n,r,a,i)=>{let{zoom:l}=r,s=180*n/Math.PI,d=e*(l.value-1)/2,u=t*(l.value-1)/2;return e>a&&l.value!==1&&(d=a*(l.value-1)/2),t>i&&l.value!==1&&(u=i*(l.value-1)/2),`translate(${d}px, ${u}px) scale(${l.value}) rotate(${s}deg)`},ile=({id:e,onChange:t,onSubmit:n,getViewportCoords:r,element:a,canvas:i,excalidrawContainer:l,app:s,autoSelect:d=!0})=>{let u=(K,Q)=>{if(!Q.style.fontFamily||!Q.style.fontSize)return!1;let W=Q.style.fontFamily.replace(/"/g,"");return Gc({fontFamily:K.fontFamily})!==W||`${K.fontSize}px`!==Q.style.fontSize},o=()=>{var ee;let K=s.state,Q=(ee=fl.getScene(a))==null?void 0:ee.getElement(e);if(!Q)return;let{textAlign:W,verticalAlign:q}=Q,V=s.scene.getNonDeletedElementsMap();if(Q&&ke(Q)){let X=Q.x,se=Q.y,ge=Bn(Q,s.scene.getNonDeletedElementsMap()),_e=Q.width,Y=Q.height,H=Q.width,re=Q.height;if(ge&&Q.containerId){if(nt(ge)){let Mt=Ce.getBoundTextElementPosition(ge,Q,V);X=Mt.x,se=Mt.y}let mt=u(Q,f),Be;if(mt?Be=Vp(ge.id,ge.height):(Be=nd[ge.id],Be||(Be=Vp(ge.id,ge.height))),H=dl(ge,Q),re=F0(ge,Q),!nt(ge)&&Y>re){let Mt=Io(Y,ge.type);pe(ge,{height:Mt});return}else if(!nt(ge)&&ge.height>Be.height&&Y<re){let Mt=Io(Y,ge.type);pe(ge,{height:Mt})}else{let{y:Mt}=z0(ge,Q,V);se=Mt}}let[te,de]=r(X,se),me=f.selectionStart,fe=f.selectionEnd,Ue=f.value.length;if(me===fe&&fe!==Ue){let mt=Ue-fe;f.selectionStart=f.value.length-mt,f.selectionEnd=f.value.length-mt}ge?_e+=.5:(H=(K.width-8-te)/K.zoom.value,_e=Math.min(_e,H)),Y*=1.05;let Te=_t(Q),it=(K.height-de)/K.zoom.value;Object.assign(f.style,{font:Te,lineHeight:Q.lineHeight,width:`${_e}px`,height:`${Y}px`,left:`${te}px`,top:`${de}px`,transform:ale(_e,Y,dG(Q,ge),K,H,it),textAlign:W,verticalAlign:q,color:Q.strokeColor,opacity:Q.opacity/100,filter:"var(--theme-filter)",maxHeight:`${it}px`}),f.scrollTop=0,ll()&&(f.style.fontFamily=Gc(Q)),pe(Q,{x:X,y:se})}},f=document.createElement("textarea");f.dir="auto",f.tabIndex=0,f.dataset.type="wysiwyg",f.wrap="off",f.classList.add("excalidraw-wysiwyg");let m="pre",U="normal";(Ft(a)||!a.autoResize)&&(m="pre-wrap",U="break-word"),Object.assign(f.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",zIndex:"var(--zIndex-wysiwyg)",wordBreak:U,whiteSpace:m,overflowWrap:"break-word",boxSizing:"content-box"}),f.value=a.originalText,o(),t&&(f.onpaste=async K=>{let Q=await Yk(K,!0);if(!Q.text)return;let W=Kc(Q.text);if(!W)return;let q=Bn(a,s.scene.getNonDeletedElementsMap()),V=_t({fontSize:s.state.currentItemFontSize,fontFamily:s.state.currentItemFontFamily});if(q){let ee=Je(q,s.scene.getNonDeletedElementsMap()),X=Po(`${f.value}${W}`,V,dl(q,ee)),se=w5(X,V);f.style.width=`${se}px`}},f.oninput=()=>{let K=Kc(f.value);if(f.value!==K){let Q=f.selectionStart;f.value=K,f.selectionStart=Q,f.selectionEnd=Q}t(f.value)}),f.onkeydown=K=>{if(!K.shiftKey&&hx.keyTest(K))K.preventDefault(),s.actionManager.executeAction(hx),o();else if(!K.shiftKey&&px.keyTest(K))K.preventDefault(),s.actionManager.executeAction(px),o();else if(!K.shiftKey&&mx.keyTest(K))K.preventDefault(),s.actionManager.executeAction(mx),o();else if(dx.keyTest(K))s.actionManager.executeAction(dx);else if(ux.keyTest(K))s.actionManager.executeAction(ux);else if(K.key===B.ESCAPE)K.preventDefault(),I=!0,T();else if(K.key===B.ENTER&&K[B.CTRL_OR_CMD]){if(K.preventDefault(),K.isComposing||K.keyCode===229)return;I=!0,T()}else if(K.key===B.TAB||K[B.CTRL_OR_CMD]&&(K.code===ft.BRACKET_LEFT||K.code===ft.BRACKET_RIGHT)){if(K.preventDefault(),K.isComposing)return;K.shiftKey||K.code===ft.BRACKET_LEFT?E():w(),f.dispatchEvent(new Event("input"))}};let g=4,v=" ".repeat(g),y=new RegExp(`^ {1,${g}}`),w=()=>{let{selectionStart:K,selectionEnd:Q}=f,W=S(),q=f.value;W.forEach(V=>{let ee=q.slice(0,V),X=q.slice(V);q=`${ee}${v}${X}`}),f.value=q,f.selectionStart=K+g,f.selectionEnd=Q+g*W.length},E=()=>{let{selectionStart:K,selectionEnd:Q}=f,W=S(),q=[],V=f.value;W.forEach(ee=>{let X=V.slice(ee,ee+g).match(y);if(X){let se=V.slice(0,ee),ge=V.slice(ee+X[0].length);V=`${se}${ge}`,q.push(ee)}}),f.value=V,q.length&&(K>q[q.length-1]?f.selectionStart=Math.max(K-g,q[q.length-1]):f.selectionStart=K,f.selectionEnd=Math.max(f.selectionStart,Q-g*q.length))},S=()=>{let{selectionStart:K,selectionEnd:Q,value:W}=f,q=W.slice(0,K).match(/[^\n]*$/)[0].length;return K=K-q,W.slice(K,Q).split(`
|
|
160
|
+
`).reduce((V,ee,X,se)=>V.concat(X?V[X-1]+se[X-1].length+1:K),[]).reverse()},k=K=>{K.target instanceof HTMLCanvasElement&&(K.preventDefault(),K.stopPropagation())},I=!1,T=()=>{var W,q;if(z)return;z=!0,M();let K=(W=fl.getScene(a))==null?void 0:W.getElement(a.id);if(!K)return;let Q=Bn(K,s.scene.getNonDeletedElementsMap());if(Q){if(f.value.trim()){let V=cl(Q);!V||V!==a.id?pe(Q,{boundElements:(Q.boundElements||[]).concat({type:"text",id:a.id})}):nt(Q)&&Gf(Q)}else pe(Q,{boundElements:(q=Q.boundElements)==null?void 0:q.filter(V=>!ke(V))});hr(K,Q,s.scene.getNonDeletedElementsMap())}n({viaKeyboard:I,nextOriginalText:f.value})},M=()=>{f.onblur=null,f.oninput=null,f.onkeydown=null,Z&&Z.disconnect(),window.removeEventListener("resize",o),window.removeEventListener("wheel",k,!0),window.removeEventListener("pointerdown",P),window.removeEventListener("pointerup",j),window.removeEventListener("blur",T),window.removeEventListener("beforeunload",T),N(),$(),f.remove()},j=K=>{window.removeEventListener("pointerup",j);let Q=K==null?void 0:K.target,W=Q instanceof HTMLElement&&Q.classList.contains("properties-trigger");setTimeout(()=>{f.onblur=T,W||f.focus()})},D=()=>{f.onblur=null,window.addEventListener("pointerup",j),window.addEventListener("blur",T)},P=K=>{let Q=K==null?void 0:K.target;if(K.button===Kl.WHEEL){Q instanceof HTMLTextAreaElement&&(K.preventDefault(),s.handleCanvasPanUsingWheelOrSpaceDrag(K)),D();return}let W=Q instanceof HTMLElement&&Q.classList.contains("properties-trigger");(K.target instanceof HTMLElement||K.target instanceof SVGElement)&&K.target.closest(`.${Wc.SHAPE_ACTIONS_MENU}, .${Wc.ZOOM_ACTIONS}`)&&!Qs(K.target)||W?D():K.target instanceof HTMLCanvasElement&&!ll()&&requestAnimationFrame(()=>{T()})},N=s.scene.onUpdate(()=>{var K;o(),(K=document.activeElement)!=null&&K.closest(".properties-content")||f.focus()}),$=s.onScrollChangeEmitter.on(()=>{o()}),z=!1;d&&f.select(),j();let Z=null;i&&"ResizeObserver"in window?(Z=new window.ResizeObserver(()=>{o()}),Z.observe(i)):window.addEventListener("resize",o),f.onpointerdown=K=>K.stopPropagation(),requestAnimationFrame(()=>{window.addEventListener("pointerdown",P,{capture:!0})}),window.addEventListener("beforeunload",T),l==null||l.querySelector(".excalidraw-textEditorContainer").appendChild(f)},lle=xe({name:"autoResize",label:"labels.autoResize",icon:null,trackEvent:{category:"element"},predicate:(e,t,n,r)=>{let a=tt(e,t);return a.length===1&&ke(a[0])&&!a[0].autoResize},perform:(e,t,n,r)=>{let a=tt(e,t);return{appState:t,elements:e.map(i=>{if(i.id===a[0].id&&ke(i)){let l=sr(i.originalText,_t(i),i.lineHeight);return Ke(i,{autoResize:!0,width:l.width,height:l.height,text:i.originalText})}return i}),captureUpdate:ie.IMMEDIATELY}}}),sle=e=>{let t=["flowchart","graph","sequenceDiagram","classDiagram","stateDiagram","stateDiagram-v2","erDiagram","journey","gantt","pie","quadrantChart","requirementDiagram","gitGraph","C4Context","mindmap","timeline","zenuml","sankey","xychart","block"];return new RegExp(`^(?:%%{.*?}%%[\\s\\n]*)?\\b(?:${t.map(n=>`\\s*${n}(-beta)?`).join("|")})\\b`).test(e.trim())},OT=({canvas:e,rc:t,newElement:n,elementsMap:r,allElementsMap:a,scale:i,appState:l,renderConfig:s})=>{if(e){let[d,u]=G5(e,i),o=Y5({canvas:e,scale:i,normalizedWidth:d,normalizedHeight:u});o.save(),o.scale(l.zoom.value,l.zoom.value),n&&n.type!=="selection"?qs(n,r,a,t,o,s,l):o.clearRect(0,0,d,u)}},ole=S0(e=>{OT(e)},{trailing:!0}),cle=(e,t)=>{if(t){ole(e);return}OT(e)},dle=e=>{let t=_.useRef(null);return _.useEffect(()=>{t.current&&cle({canvas:t.current,scale:e.scale,newElement:e.appState.newElement,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,rc:e.rc,renderConfig:e.renderConfig,appState:e.appState},nb())}),p.jsx("canvas",{className:"excalidraw__canvas",style:{width:e.appState.width,height:e.appState.height},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:t})},ule=dle,$T=we.createContext(null),zT=we.createContext(null),FT={viewport:{isMobile:!1,isLandscape:!1},editor:{isMobile:!1,canFitSidebar:!1},isTouchScreen:!1},rb=we.createContext(FT);rb.displayName="DeviceContext";var ab=we.createContext({container:null,id:null});ab.displayName="ExcalidrawContainerContext";var ib=we.createContext([]);ib.displayName="ExcalidrawElementsContext";var lb=we.createContext({...wi(),width:0,height:0,offsetLeft:0,offsetTop:0});lb.displayName="ExcalidrawAppStateContext";var sb=we.createContext(()=>{console.warn("Uninitialized ExcalidrawSetAppStateContext context!")});sb.displayName="ExcalidrawSetAppStateContext";var ob=we.createContext(null);ob.displayName="ExcalidrawActionManagerContext";var Ri=()=>_.useContext($T),Qf=()=>_.useContext(zT),Sn=()=>_.useContext(rb),ji=()=>_.useContext(ab),hm=()=>_.useContext(ib),Jf=()=>_.useContext(lb),Rn=()=>_.useContext(sb),Lr=()=>_.useContext(ob),gu=!1,_g=0,Xs=!1,bu=!1,Tg=!1,Ag={horizontal:null,vertical:null},Yl=0,vu=!1,Rg=new Map,z1=!1,hw=0,pw=!1,Vs=null,gt={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},fle=class BT extends we.Component{constructor(t){super(t),F(this,"canvas"),F(this,"interactiveCanvas",null),F(this,"rc"),F(this,"unmounted",!1),F(this,"actionManager"),F(this,"device",FT),F(this,"excalidrawContainerRef",we.createRef()),F(this,"scene"),F(this,"fonts"),F(this,"renderer"),F(this,"visibleElements"),F(this,"resizeObserver"),F(this,"nearestScrollableContainer"),F(this,"library"),F(this,"libraryItemsFromStorage"),F(this,"id"),F(this,"store"),F(this,"history"),F(this,"excalidrawContainerValue"),F(this,"files",{}),F(this,"imageCache",new Map),F(this,"iFrameRefs",new Map),F(this,"embedsValidationStatus",new Map),F(this,"initializedEmbeds",new Set),F(this,"elementsPendingErasure",new Set),F(this,"flowChartCreator",new Are),F(this,"flowChartNavigator",new Tre),F(this,"hitLinkElement"),F(this,"lastPointerDownEvent",null),F(this,"lastPointerUpEvent",null),F(this,"lastPointerMoveEvent",null),F(this,"lastPointerMoveCoords",null),F(this,"lastViewportPosition",{x:0,y:0}),F(this,"animationFrameHandler",new nle),F(this,"laserTrails",new rle(this.animationFrameHandler,this)),F(this,"eraserTrail",new t5(this.animationFrameHandler,this,{streamline:.2,size:5,keepHead:!0,sizeMapping:o=>{let f=Math.max(0,1-(performance.now()-o.pressure)/200),m=(10-Math.min(10,o.totalLength-o.currentIndex))/10;return Math.min(co(m),co(f))},fill:()=>this.state.theme===ot.LIGHT?"rgba(0, 0, 0, 0.2)":"rgba(255, 255, 255, 0.2)"})),F(this,"onChangeEmitter",new di),F(this,"onPointerDownEmitter",new di),F(this,"onPointerUpEmitter",new di),F(this,"onUserFollowEmitter",new di),F(this,"onScrollChangeEmitter",new di),F(this,"missingPointerEventCleanupEmitter",new di),F(this,"onRemoveEventListenersEmitter",new di),F(this,"getEffectiveGridSize",()=>gf(this)?this.state.gridSize:null),F(this,"updateEmbedValidationStatus",(o,f)=>{this.embedsValidationStatus.set(o.id,f),Qt.delete(o)}),F(this,"updateEmbeddables",()=>{let o=new Set,f=!1;this.scene.getNonDeletedElements().filter(m=>{if(Cr(m)){if(o.add(m.id),!this.embedsValidationStatus.has(m.id)){f=!0;let U=sp(m.link,this.props.validateEmbeddable);this.updateEmbedValidationStatus(m,U)}}else es(m)&&o.add(m.id);return!1}),f&&this.scene.triggerUpdate(),this.iFrameRefs.forEach((m,U)=>{o.has(U)||this.iFrameRefs.delete(U)})}),F(this,"getFrameNameDOMId",o=>`${this.id}-frame-name-${o.id}`),F(this,"frameNameBoundsCache",{get:o=>{let f=this.frameNameBoundsCache._cache.get(o.id);if(!f||f.zoom!==this.state.zoom.value||f.versionNonce!==o.versionNonce){let m=document.getElementById(this.getFrameNameDOMId(o));if(m){let U=m.getBoundingClientRect(),g=jt({clientX:U.x,clientY:U.y},this.state),v=jt({clientX:U.right,clientY:U.bottom},this.state);return f={x:g.x,y:g.y,width:v.x-g.x,height:v.y-g.y,angle:0,zoom:this.state.zoom.value,versionNonce:o.versionNonce},this.frameNameBoundsCache._cache.set(o.id,f),f}return null}return f},_cache:new Map}),F(this,"resetEditingFrame",o=>{var f;o&&pe(o,{name:((f=o.name)==null?void 0:f.trim())||null}),this.setState({editingFrame:null})}),F(this,"renderFrameNames",()=>{if(!this.state.frameRendering.enabled||!this.state.frameRendering.name)return this.state.editingFrame&&this.resetEditingFrame(null),null;let o=this.state.theme===ot.DARK;return this.scene.getNonDeletedFramesLikes().map(f=>{if(!e0(f,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap()))return this.state.editingFrame===f.id&&this.resetEditingFrame(f),null;let{x:m,y:U}=oa({sceneX:f.x,sceneY:f.y},this.state),g=6,v,y=nC(f);if(f.id===this.state.editingFrame){let w=y;v=p.jsx("input",{autoFocus:!0,value:w,onChange:E=>{pe(f,{name:E.target.value})},onFocus:E=>E.target.select(),onBlur:()=>this.resetEditingFrame(f),onKeyDown:E=>{(E.key===B.ESCAPE||E.key===B.ENTER)&&this.resetEditingFrame(f)},style:{background:this.state.viewBackgroundColor,filter:o?m5:"none",zIndex:2,border:"none",display:"block",padding:`${g}px`,borderRadius:4,boxShadow:"inset 0 0 0 1px var(--color-primary)",fontFamily:"Assistant",fontSize:"14px",transform:`translate(-${g}px, ${g}px)`,color:"var(--color-gray-80)",overflow:"hidden",maxWidth:`${document.body.clientWidth-m-g}px`},size:w.length+1||1,dir:"auto",autoComplete:"off",autoCapitalize:"off",autoCorrect:"off"})}else v=y;return p.jsx("div",{id:this.getFrameNameDOMId(f),style:{position:"absolute",bottom:`${this.state.height+Kt.nameOffsetY-U+this.state.offsetTop}px`,left:`${m-this.state.offsetLeft}px`,zIndex:2,fontSize:Kt.nameFontSize,color:o?Kt.nameColorDarkTheme:Kt.nameColorLightTheme,lineHeight:Kt.nameLineHeight,width:"max-content",maxWidth:`${f.width}px`,overflow:f.id===this.state.editingFrame?"visible":"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",cursor:kt.MOVE,pointerEvents:this.state.viewModeEnabled?hc.disabled:hc.enabled},onPointerDown:w=>this.handleCanvasPointerDown(w),onWheel:w=>this.handleWheel(w),onContextMenu:this.handleCanvasContextMenu,onDoubleClick:()=>{this.setState({editingFrame:f.id})},children:v},f.id)})}),F(this,"focusContainer",()=>{var o;(o=this.excalidrawContainerRef.current)==null||o.focus()}),F(this,"getSceneElementsIncludingDeleted",()=>this.scene.getElementsIncludingDeleted()),F(this,"getSceneElements",()=>this.scene.getNonDeletedElements()),F(this,"onInsertElements",o=>{this.addElementsFromPasteOrLibrary({elements:o,position:"center",files:null})}),F(this,"onExportImage",async(o,f,m)=>{Nt("export",o,"ui");let U=await cm(o,f,this.state,this.files,{exportBackground:this.state.exportBackground,name:this.getName(),viewBackgroundColor:this.state.viewBackgroundColor,exportingFrame:m.exportingFrame}).catch($E).catch(g=>{console.error(g),this.setState({errorMessage:g.message})});this.state.exportEmbedScene&&U&&v8(U)&&this.setState({fileHandle:U})}),F(this,"magicGenerations",new Map),F(this,"updateMagicGeneration",({frameElement:o,data:f})=>{f.status==="pending"?pe(o,{customData:{generationData:void 0}},!1):pe(o,{customData:{generationData:f}},!1),this.magicGenerations.set(o.id,f),this.triggerRender()}),F(this,"plugins",{}),F(this,"onMagicframeToolSelect",()=>{let o=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds});if(o.length===0)this.setActiveTool({type:_n.magicframe}),Nt("ai","tool-select (empty-selection)","d2c");else{let f=o.length===1&&tp(o[0])&&o[0];if(!f&&o.some(U=>He(U)||U.frameId)){this.setActiveTool({type:_n.magicframe});return}Nt("ai","tool-select (existing selection)","d2c");let m;if(f)m=f;else{let[U,g,v,y]=xt(o),w=50;m=f6({...Kt,x:U-w,y:g-w,width:v-U+w*2,height:y-g+w*2,opacity:100,locked:!1}),this.scene.insertElement(m);for(let E of o)pe(E,{frameId:m.id});this.setState({selectedElementIds:{[m.id]:!0}})}this.onMagicFrameGenerate(m,"upstream")}}),F(this,"openEyeDropper",({type:o})=>{$a.set(im,{swapPreviewOnAlt:!0,colorPickerType:o==="stroke"?"elementStroke":"elementBackground",onSelect:(f,m)=>{let U=o==="background"&&m.altKey||o==="stroke"&&!m.altKey;!this.scene.getSelectedElements(this.state).length||this.state.activeTool.type!=="selection"?U?this.syncActionResult({appState:{...this.state,currentItemStrokeColor:f},captureUpdate:ie.IMMEDIATELY}):this.syncActionResult({appState:{...this.state,currentItemBackgroundColor:f},captureUpdate:ie.IMMEDIATELY}):this.updateScene({elements:this.scene.getElementsIncludingDeleted().map(g=>this.state.selectedElementIds[g.id]?Ke(g,{[U?"strokeColor":"backgroundColor"]:f}):g),captureUpdate:ie.IMMEDIATELY})},keepOpenOnAlt:!1})}),F(this,"dismissLinearEditor",()=>{setTimeout(()=>{this.setState({editingLinearElement:null})})}),F(this,"syncActionResult",tn(o=>{var U,g,v,y,w,E;if(this.unmounted||o===!1)return;o.captureUpdate===ie.NEVER?this.store.shouldUpdateSnapshot():o.captureUpdate===ie.IMMEDIATELY&&this.store.shouldCaptureIncrement();let f=!1,m=null;if(o.elements&&(this.scene.replaceAllElements(o.elements),f=!0),o.files&&(this.addMissingFiles(o.files,o.replaceFiles),this.addNewImagesToImageCache()),o.appState||m||this.state.contextMenu){let S=((U=o==null?void 0:o.appState)==null?void 0:U.viewModeEnabled)||!1,k=((g=o==null?void 0:o.appState)==null?void 0:g.zenModeEnabled)||!1,I=((v=o==null?void 0:o.appState)==null?void 0:v.theme)||this.props.theme||ot.LIGHT,T=((y=o==null?void 0:o.appState)==null?void 0:y.name)??this.state.name,M=((w=o==null?void 0:o.appState)==null?void 0:w.errorMessage)??this.state.errorMessage;typeof this.props.viewModeEnabled<"u"&&(S=this.props.viewModeEnabled),typeof this.props.zenModeEnabled<"u"&&(k=this.props.zenModeEnabled),m=((E=o.appState)==null?void 0:E.editingTextElement)||null,o.elements&&m&&o.elements.forEach(j=>{(m==null?void 0:m.id)===j.id&&m!==j&&x6(j)&&ke(j)&&(m=j)}),m!=null&&m.isDeleted&&(m=null),this.setState(j=>{let D=o.appState||{};return{...j,...D,contextMenu:null,editingTextElement:m,viewModeEnabled:S,zenModeEnabled:k,theme:I,name:T,errorMessage:M}}),f=!0}!f&&o.captureUpdate!==ie.EVENTUALLY&&this.scene.triggerUpdate()})),F(this,"onBlur",tn(()=>{Xs=!1,this.setState({isBindingEnabled:!0})})),F(this,"onUnload",()=>{this.onBlur()}),F(this,"disableEvent",o=>{o.preventDefault()}),F(this,"resetHistory",()=>{this.history.clear()}),F(this,"resetStore",()=>{this.store.clear()}),F(this,"resetScene",tn(o=>{this.scene.replaceAllElements([]),this.setState(f=>({...wi(),isLoading:o!=null&&o.resetLoadingState?!1:f.isLoading,theme:this.state.theme})),this.resetStore(),this.resetHistory()})),F(this,"initializeScene",async()=>{var m;"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(async U=>{if(!U.files.length)return;let g=U.files[0],v=await g.getFile();this.loadFileToCanvas(new File([v],v.name||"",{type:v.type}),g)}),this.props.theme&&this.setState({theme:this.props.theme}),this.state.isLoading||this.setState({isLoading:!0});let o=null;try{typeof this.props.initialData=="function"?o=await this.props.initialData()||null:o=await this.props.initialData||null,o!=null&&o.libraryItems&&this.library.updateLibrary({libraryItems:o.libraryItems,merge:!0}).catch(U=>{console.error(U)})}catch(U){console.error(U),o={appState:{errorMessage:U.message||"Encountered an error during importing or restoring scene data"}}}let f=Hf(o,null,null,{repairBindings:!0});f.appState={...f.appState,theme:this.props.theme||f.appState.theme,openSidebar:((m=f.appState)==null?void 0:m.openSidebar)||this.state.openSidebar,activeTool:f.appState.activeTool.type==="image"?{...f.appState.activeTool,type:"selection"}:f.appState.activeTool,isLoading:!1,toast:this.state.toast},o!=null&&o.scrollToContent&&(f.appState={...f.appState,...mf(f.elements,{...f.appState,width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})}),this.resetStore(),this.resetHistory(),this.syncActionResult({...f,captureUpdate:ie.NEVER}),this.clearImageShapeCache(),this.fonts.loadSceneFonts().then(U=>{this.fonts.onLoaded(U)}),Nc(window.location.href)&&this.scrollToContent(window.location.href,{animate:!1})}),F(this,"isMobileBreakpoint",(o,f)=>o<XN||f<GN&&o<VN),F(this,"refreshViewportBreakpoints",()=>{if(!this.excalidrawContainerRef.current)return;let{clientWidth:o,clientHeight:f}=document.body,m=this.device.viewport,U=J1(m,{isLandscape:o>f,isMobile:this.isMobileBreakpoint(o,f)});return m!==U?(this.device={...this.device,viewport:U},!0):!1}),F(this,"refreshEditorBreakpoints",()=>{let o=this.excalidrawContainerRef.current;if(!o)return;let{width:f,height:m}=o.getBoundingClientRect(),U=this.props.UIOptions.dockedSidebarBreakpoint!=null?this.props.UIOptions.dockedSidebarBreakpoint:YN,g=this.device.editor,v=J1(g,{isMobile:this.isMobileBreakpoint(f,m),canFitSidebar:f>U});return g!==v?(this.device={...this.device,editor:v},!0):!1}),F(this,"onResize",tn(()=>{this.scene.getElementsIncludingDeleted().forEach(o=>Qt.delete(o)),this.refreshViewportBreakpoints(),this.updateDOMRect(),Gg||this.refreshEditorBreakpoints(),this.setState({})})),F(this,"onFullscreenChange",()=>{var o;!document.fullscreenElement&&((o=this.state.activeEmbeddable)==null?void 0:o.state)==="active"&&this.setState({activeEmbeddable:null})}),F(this,"renderInteractiveSceneCallback",({atLeastOneVisibleElement:o,scrollBars:f,elementsMap:m})=>{f&&(Ag=f);let U=this.state.editingTextElement?!1:!o&&m.size>0;this.state.scrolledOutside!==U&&this.setState({scrolledOutside:U}),this.scheduleImageRefresh()}),F(this,"onScroll",Yc(()=>{let{offsetTop:o,offsetLeft:f}=this.getCanvasOffsets();this.setState(m=>m.offsetLeft===f&&m.offsetTop===o?null:{offsetTop:o,offsetLeft:f})},HN)),F(this,"onCut",tn(o=>{var f;!((f=this.excalidrawContainerRef.current)!=null&&f.contains(document.activeElement))||Qs(o.target)||(this.actionManager.executeAction(xx,"keyboard",o),o.preventDefault(),o.stopPropagation())})),F(this,"onCopy",tn(o=>{var f;!((f=this.excalidrawContainerRef.current)!=null&&f.contains(document.activeElement))||Qs(o.target)||(this.actionManager.executeAction(gp,"keyboard",o),o.preventDefault(),o.stopPropagation())})),F(this,"onTouchStart",o=>{if(SE&&o.preventDefault(),!gu){gu=!0,clearTimeout(_g),_g=window.setTimeout(BT.resetTapTwice,FN);return}if(gu&&o.touches.length===1){let f=o.touches[0];this.handleCanvasDoubleClick({clientX:f.clientX,clientY:f.clientY}),gu=!1,clearTimeout(_g)}o.touches.length===2&&this.setState({selectedElementIds:bt({},this.state),activeEmbeddable:null})}),F(this,"onTouchEnd",o=>{this.resetContextMenuTimer(),o.touches.length>0?this.setState({previousSelectedElementIds:{},selectedElementIds:bt(this.state.previousSelectedElementIds,this.state)}):gt.pointers.clear()}),F(this,"pasteFromClipboard",tn(async o=>{var S,k;let f=!!z1,m=document.activeElement,U=(S=this.excalidrawContainerRef.current)==null?void 0:S.contains(m);if(o&&!U)return;let g=document.elementFromPoint(this.lastViewportPosition.x,this.lastViewportPosition.y);if(o&&(!(g instanceof HTMLCanvasElement)||Qs(m)))return;let{x:v,y}=jt({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),w=(k=o==null?void 0:o.clipboardData)==null?void 0:k.files[0],E=await Yk(o,f);if(!w&&!f){if(E.mixedContent)return this.addElementsFromMixedContentPaste(E.mixedContent,{isPlainPaste:f,sceneX:v,sceneY:y});if(E.text){let I=E.text.trim();I.startsWith("<svg")&&I.endsWith("</svg>")&&(w=c9(I))}}if(po(w)&&!E.spreadsheet){if(!this.isToolSupported("image")){this.setState({errorMessage:L("errors.imageToolNotSupported")});return}let I=this.createImageElement({sceneX:v,sceneY:y});this.insertImageElement(I,w),this.initializeImageDimensions(I),this.setState({selectedElementIds:bt({[I.id]:!0},this.state)});return}if(this.props.onPaste)try{if(await this.props.onPaste(E,o)===!1)return}catch(I){console.error(I)}if(E.errorMessage)this.setState({errorMessage:E.errorMessage});else if(E.spreadsheet&&!f)this.setState({pasteDialog:{data:E.spreadsheet,shown:!0}});else if(E.elements){let I=E.programmaticAPI?Ji(E.elements):E.elements;this.addElementsFromPasteOrLibrary({elements:I,files:E.files||null,position:"cursor",retainSeed:f})}else if(E.text){if(E.text&&sle(E.text)){let M=await Re(()=>import("./index-BkW4NM9R.js").then(j=>j.b5),[]);try{let{elements:j,files:D}=await M.parseMermaidToExcalidraw(E.text),P=Ji(j,{regenerateIds:!0});this.addElementsFromPasteOrLibrary({elements:P,files:D,position:"cursor"});return}catch(j){console.warn(`parsing pasted text as mermaid definition failed: ${j.message}`)}}let I=WE(E.text).split(/\n+/).map(M=>M.trim()).filter(Boolean),T=I.map(M=>OG(M)).filter(M=>{var j;return sp(M,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(M)||((j=Rc(M))==null?void 0:j.type)==="video")});if(!z1&&T.length>0&&T.length===I.length){let M=[];for(let j of T){let D=M[M.length-1],P=this.insertEmbeddableElement({sceneX:D?D.x+D.width+20:v,sceneY:y,link:Rr(j)});P&&M.push(P)}M.length&&this.setState({selectedElementIds:Object.fromEntries(M.map(j=>[j.id,!0]))});return}this.addTextFromPaste(E.text,f)}this.setActiveTool({type:"selection"}),o==null||o.preventDefault()})),F(this,"addElementsFromPasteOrLibrary",o=>{var K,Q;let f=Bf(o.elements,null,void 0),[m,U,g,v]=xt(f),y=nr(m,g)/2,w=nr(U,v)/2,E=typeof o.position=="object"?o.position.clientX:o.position==="cursor"?this.lastViewportPosition.x:this.state.width/2+this.state.offsetLeft,S=typeof o.position=="object"?o.position.clientY:o.position==="cursor"?this.lastViewportPosition.y:this.state.height/2+this.state.offsetTop,{x:k,y:I}=jt({clientX:E,clientY:S},this.state),T=k-y,M=I-w,[j,D]=xn(T,M,this.getEffectiveGridSize()),P=wk(f.map(W=>Ke(W,{x:W.x+j-m,y:W.y+D-U})),{randomizeSeed:!o.retainSeed}),N=this.scene.getElementsIncludingDeleted(),$=[...N,...P];$=((Q=(K=this.props).onDuplicate)==null?void 0:Q.call(K,$,N))||$,Ci($,We(P));let z=this.getTopLayerFrameAtSceneCoords({x:k,y:I});if(z){let W=WY(P,z);Hu($,W,z,this.state)}this.scene.replaceAllElements($),P.forEach(W=>{if(ke(W)&&Ft(W)){let q=Bn(W,this.scene.getElementsMapIncludingDeleted());hr(W,q,this.scene.getElementsMapIncludingDeleted())}}),_N&&al.loadElementsFonts(P).then(W=>{this.fonts.onLoaded(W)}),o.files&&this.addMissingFiles(o.files),this.store.shouldCaptureIncrement();let Z=f8(P);this.setState({...this.state,openSidebar:this.state.openSidebar&&this.device.editor.canFitSidebar&&$a.get(Q8)?this.state.openSidebar:null,...fr({editingGroupId:null,selectedElementIds:Z.reduce((W,q)=>(Ft(q)||(W[q.id]=!0),W),{})},this.scene.getNonDeletedElements(),this.state,this)},()=>{o.files&&this.addNewImagesToImageCache()}),this.setActiveTool({type:"selection"}),o.fitToContent&&this.scrollToContent(P,{fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()})}),F(this,"setAppState",(o,f)=>{this.setState(o,f)}),F(this,"removePointer",o=>{Yl&&this.resetContextMenuTimer(),gt.pointers.delete(o.pointerId)}),F(this,"toggleLock",(o="ui")=>{this.state.activeTool.locked||Nt("toolbar","toggleLock",`${o} (${this.device.editor.isMobile?"mobile":"desktop"})`),this.setState(f=>({activeTool:{...f.activeTool,...gn(this.state,f.activeTool.locked?{type:"selection"}:f.activeTool),locked:!f.activeTool.locked}}))}),F(this,"updateFrameRendering",o=>{this.setState(f=>{let m=typeof o=="function"?o(f.frameRendering):o;return{frameRendering:{enabled:(m==null?void 0:m.enabled)??f.frameRendering.enabled,clip:(m==null?void 0:m.clip)??f.frameRendering.clip,name:(m==null?void 0:m.name)??f.frameRendering.name,outline:(m==null?void 0:m.outline)??f.frameRendering.outline}}})}),F(this,"togglePenMode",o=>{this.setState(f=>({penMode:o??!f.penMode,penDetected:!0}))}),F(this,"onHandToolToggle",()=>{this.actionManager.executeAction(mte)}),F(this,"zoomCanvas",o=>{this.setState({...so({viewportX:this.state.width/2+this.state.offsetLeft,viewportY:this.state.height/2+this.state.offsetTop,nextZoom:nl(o)},this.state)})}),F(this,"cancelInProgressAnimation",null),F(this,"scrollToContent",(o=this.scene.getNonDeletedElements(),f)=>{var y;if(typeof o=="string"){let w;if(Nc(o)?w=XG(o):w=o,w){let E=this.scene.getElementsFromId(w);E!=null&&E.length?this.scrollToContent(E,{fitToContent:(f==null?void 0:f.fitToContent)??!0,animate:(f==null?void 0:f.animate)??!0}):Nc(o)&&this.setState({toast:{message:L("elementLink.notFound"),duration:3e3,closable:!0}})}return}(y=this.cancelInProgressAnimation)==null||y.call(this);let m=Array.isArray(o)?o:[o],U=this.state.zoom,g=this.state.scrollX,v=this.state.scrollY;if(f!=null&&f.fitToContent||f!=null&&f.fitToViewport){let{appState:w}=sm({canvasOffsets:f.canvasOffsets,targetElements:m,appState:this.state,fitToViewport:!!(f!=null&&f.fitToViewport),viewportZoomFactor:f==null?void 0:f.viewportZoomFactor,minZoom:f==null?void 0:f.minZoom,maxZoom:f==null?void 0:f.maxZoom});U=w.zoom,g=w.scrollX,v=w.scrollY}else{let w=mf(m,this.state);g=w.scrollX,v=w.scrollY}if(f!=null&&f.animate){let w=this.state.scrollX,E=this.state.scrollY,S=this.state.zoom.value,k=bO({fromValues:{scrollX:w,scrollY:E,zoom:S},toValues:{scrollX:g,scrollY:v,zoom:U.value},interpolateValue:(I,T,M,j)=>{if(j==="zoom")return I*Math.pow(T/I,co(M))},onStep:({scrollX:I,scrollY:T,zoom:M})=>{this.setState({scrollX:I,scrollY:T,zoom:{value:M}})},onStart:()=>{this.setState({shouldCacheIgnoreZoom:!0})},onEnd:()=>{this.setState({shouldCacheIgnoreZoom:!1})},onCancel:()=>{this.setState({shouldCacheIgnoreZoom:!1})},duration:(f==null?void 0:f.duration)??500});this.cancelInProgressAnimation=()=>{k(),this.cancelInProgressAnimation=null}}else this.setState({scrollX:g,scrollY:v,zoom:U})}),F(this,"maybeUnfollowRemoteUser",()=>{this.state.userToFollow&&this.setState({userToFollow:null})}),F(this,"translateCanvas",o=>{var f;(f=this.cancelInProgressAnimation)==null||f.call(this),this.maybeUnfollowRemoteUser(),this.setState(o)}),F(this,"setToast",o=>{this.setState({toast:o})}),F(this,"restoreFileFromShare",async()=>{try{let o=await caches.open("web-share-target"),f=await o.match("shared-file");if(f){let m=await f.blob(),U=new File([m],m.name||"",{type:m.type});this.loadFileToCanvas(U,null),await o.delete("shared-file"),window.history.replaceState(null,AN,window.location.pathname)}}catch(o){this.setState({errorMessage:o.message})}}),F(this,"addFiles",tn(o=>{let{addedFiles:f}=this.addMissingFiles(o);this.clearImageShapeCache(f),this.scene.triggerUpdate(),this.addNewImagesToImageCache()})),F(this,"addMissingFiles",(o,f=!1)=>{let m=f?{}:{...this.files},U={},g=Array.isArray(o)?o:Object.values(o);for(let v of g)if(!m[v.id]&&(U[v.id]=v,m[v.id]=v,v.mimeType===De.svg))try{let y=mZ(Dy(gZ(v.dataURL)),De.svg);v.dataURL!==y&&(v.version=(v.version??1)+1,v.dataURL=y)}catch(y){console.error(y)}return this.files=m,{addedFiles:U}}),F(this,"updateScene",tn(o=>{let f=ul(o.elements??[]);if(o.captureUpdate&&o.captureUpdate!==ie.EVENTUALLY){let m=this.store.snapshot.appState,U=this.store.snapshot.elements,g=o.appState?Object.assign({},m,o.appState):m,v=o.elements?this.store.filterUncomittedElements(this.scene.getElementsMapIncludingDeleted(),We(f)):U;o.captureUpdate===ie.IMMEDIATELY?this.store.captureIncrement(v,g):o.captureUpdate===ie.NEVER&&this.store.updateSnapshot(v,g)}o.appState&&this.setState(o.appState),o.elements&&this.scene.replaceAllElements(f),o.collaborators&&this.setState({collaborators:o.collaborators})})),F(this,"triggerRender",o=>{o===!0?this.scene.triggerUpdate():this.setState({})}),F(this,"toggleSidebar",({name:o,tab:f,force:m})=>{var v,y;let U;m===void 0?U=((v=this.state.openSidebar)==null?void 0:v.name)===o&&((y=this.state.openSidebar)==null?void 0:y.tab)===f?null:o:U=m?o:null;let g=U?{name:U}:null;return g&&f&&(g.tab=f),this.setState({openSidebar:g}),!!U}),F(this,"updateCurrentCursorPosition",tn(o=>{this.lastViewportPosition.x=o.clientX,this.lastViewportPosition.y=o.clientY})),F(this,"getEditorUIOffsets",()=>{var g,v,y,w,E,S,k,I,T,M;let o=((w=(y=(v=(g=this.excalidrawContainerRef)==null?void 0:g.current)==null?void 0:v.querySelector(".App-toolbar"))==null?void 0:y.getBoundingClientRect())==null?void 0:w.bottom)??0,f=(k=(S=(E=this.excalidrawContainerRef)==null?void 0:E.current)==null?void 0:S.querySelector(".sidebar"))==null?void 0:k.getBoundingClientRect(),m=(M=(T=(I=this.excalidrawContainerRef)==null?void 0:I.current)==null?void 0:T.querySelector(".App-menu__left"))==null?void 0:M.getBoundingClientRect(),U=16;return Sf().rtl?{top:o+U,right:Math.max(this.state.width-((m==null?void 0:m.left)??this.state.width),0)+U,bottom:U,left:Math.max((f==null?void 0:f.right)??0,0)+U}:{top:o+U,right:Math.max(this.state.width-((f==null?void 0:f.left)??this.state.width)+U,0),bottom:U,left:Math.max((m==null?void 0:m.right)??0,0)+U}}),F(this,"onKeyDown",tn(o=>{var g,v;if("Proxy"in window&&(!o.shiftKey&&/^[A-Z]$/.test(o.key)||o.shiftKey&&/^[a-z]$/.test(o.key))&&(o=new Proxy(o,{get(y,w){let E=y[w];return typeof E=="function"?E.bind(y):w==="key"?o.shiftKey?y.key.toUpperCase():y.key.toLowerCase():E}})),!Kg(o.target)){if((o.key===B.ESCAPE||o.key===B.ENTER)&&this.state.croppingElementId){this.finishImageCropping();return}let y=tt(this.scene.getNonDeletedElementsMap(),this.state);if(y.length===1&&vt(y[0])&&o.key===B.ENTER){this.startImageCropping(y[0]);return}if(o.key===B.ESCAPE&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.clear(),this.triggerRender(!0);return}let w=ku(o.key);if(o[B.CTRL_OR_CMD]&&w&&!o.shiftKey){o.preventDefault();let E=tt(this.scene.getNonDeletedElementsMap(),this.state);E.length===1&&C0(E[0])&&this.flowChartCreator.createNodes(E[0],this.scene.getNonDeletedElementsMap(),this.state,$x(o.key)),(g=this.flowChartCreator.pendingNodes)!=null&&g.length&&!up(this.flowChartCreator.pendingNodes,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(this.flowChartCreator.pendingNodes,{animate:!0,duration:300,fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()});return}if(o.altKey){let E=tt(this.scene.getNonDeletedElementsMap(),this.state);if(E.length===1&&w){o.preventDefault();let S=this.flowChartNavigator.exploreByDirection(E[0],this.scene.getNonDeletedElementsMap(),$x(o.key));if(S){this.setState(I=>({selectedElementIds:bt({[S]:!0},I)}));let k=this.scene.getNonDeletedElementsMap().get(S);k&&!up([k],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(k,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})}return}}}if(o[B.CTRL_OR_CMD]&&o.key===B.P&&!o.shiftKey&&!o.altKey){this.setToast({message:L("commandPalette.shortcutHint",{shortcut:ir("commandPalette")})}),o.preventDefault();return}if(o[B.CTRL_OR_CMD]&&o.key.toLowerCase()===B.V&&(z1=o.shiftKey,clearTimeout(hw),hw=window.setTimeout(()=>{z1=!1},100)),o[B.CTRL_OR_CMD]&&Qs(o.target)&&(o.code===ft.MINUS||o.code===ft.EQUAL)){o.preventDefault();return}if(Qs(o.target)&&o.key!==B.ESCAPE||ku(o.key)&&Kg(o.target))return;if(o.key===B.QUESTION_MARK){this.setState({openDialog:{name:"help"}});return}else if(o.key.toLowerCase()===B.E&&o.shiftKey&&o[B.CTRL_OR_CMD]){o.preventDefault(),this.setState({openDialog:{name:"imageExport"}});return}if(o.key===B.PAGE_UP||o.key===B.PAGE_DOWN){let y=(o.shiftKey?this.state.width:this.state.height)/this.state.zoom.value;o.key===B.PAGE_DOWN&&(y=-y),o.shiftKey?this.translateCanvas(w=>({scrollX:w.scrollX+y})):this.translateCanvas(w=>({scrollY:w.scrollY+y}))}if(((v=this.state.openDialog)==null?void 0:v.name)==="elementLinkSelector"||this.actionManager.handleKeyDown(o)||this.state.viewModeEnabled)return;if(o[B.CTRL_OR_CMD]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),ku(o.key)){let y=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),w=y.find(Me),E=new Set;y.filter(Me).filter(T=>{let M=T.startBinding&&!y.some(D=>{var P;return D.id===((P=T.startBinding)==null?void 0:P.elementId)}),j=T.endBinding&&!y.some(D=>{var P;return D.id===((P=T.endBinding)==null?void 0:P.elementId)});return M||j}).forEach(T=>E.add(T.id)),y=y.filter(T=>!E.has(T.id));let S=this.getEffectiveGridSize()&&(o.shiftKey?Sv:this.getEffectiveGridSize())||(o.shiftKey?jN:Sv),k=0,I=0;o.key===B.ARROW_LEFT?k=-S:o.key===B.ARROW_RIGHT?k=S:o.key===B.ARROW_UP?I=-S:o.key===B.ARROW_DOWN&&(I=S),y.forEach(T=>{pe(T,{x:T.x+k,y:T.y+I},!1),Ar(T,this.scene.getNonDeletedElementsMap(),{simultaneouslyUpdated:y})}),this.setState({suggestedBindings:H2(y.filter(T=>T.id!==(w==null?void 0:w.id)||S!==0),this.scene.getNonDeletedElementsMap(),this.state.zoom)}),this.scene.triggerUpdate(),o.preventDefault()}else if(o.key===B.ENTER){let y=this.scene.getSelectedElements(this.state);if(y.length===1){let w=y[0];if(o[B.CTRL_OR_CMD])Ge(w)&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==y[0].id)&&(this.store.shouldCaptureIncrement(),Me(w)||this.setState({editingLinearElement:new Ce(w)}));else if(ke(w)||pG(w)){let E;ke(w)||(E=w);let S=W2(w,this.state,this.scene.getNonDeletedElementsMap()),k=S.x,I=S.y;this.startTextEditing({sceneX:k,sceneY:I,container:E}),o.preventDefault();return}else He(w)&&this.setState({editingFrame:w.id})}}else if(!o.ctrlKey&&!o.altKey&&!o.metaKey&&!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged){let y=zX(o.key);y?(this.state.activeTool.type!==y&&Nt("toolbar",y,`keyboard (${this.device.editor.isMobile?"mobile":"desktop"})`),y==="arrow"&&this.state.activeTool.type==="arrow"&&this.setState(w=>({currentItemArrowType:w.currentItemArrowType===On.sharp?On.round:w.currentItemArrowType===On.round?On.elbow:On.sharp})),this.setActiveTool({type:y}),o.stopPropagation()):o.key===B.Q&&(this.toggleLock("keyboard"),o.stopPropagation())}if(o.key===B.SPACE&>.pointers.size===0&&(Xs=!0,It(this.interactiveCanvas,kt.GRAB),o.preventDefault()),(o.key===B.G||o.key===B.S)&&!o.altKey&&!o[B.CTRL_OR_CMD]){let y=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!y.length)return;o.key===B.G&&(Qc(this.state.activeTool.type)||y.some(w=>Qc(w.type)))&&(this.setState({openPopup:"elementBackground"}),o.stopPropagation()),o.key===B.S&&(this.setState({openPopup:"elementStroke"}),o.stopPropagation())}if(!o[B.CTRL_OR_CMD]&&o.shiftKey&&o.key.toLowerCase()===B.F){let y=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!y.length)return;(this.state.activeTool.type==="text"||y.find(w=>ke(w)||Je(w,this.scene.getNonDeletedElementsMap())))&&(o.preventDefault(),this.setState({openPopup:"fontFamily"}))}if(o.key===B.K&&!o.altKey&&!o[B.CTRL_OR_CMD]){this.state.activeTool.type==="laser"?this.setActiveTool({type:"selection"}):this.setActiveTool({type:"laser"});return}o[B.CTRL_OR_CMD]&&(o.key===B.BACKSPACE||o.key===B.DELETE)&&$a.set(um,"clearCanvas");let f=o.key.toLocaleLowerCase(),m=f===B.S&&o.shiftKey,U=o.key===B.I||f===B.G&&o.shiftKey;(m||U)&&this.openEyeDropper({type:m?"stroke":"background"})})),F(this,"onKeyUp",tn(o=>{var f,m,U,g;if(o.key===B.SPACE&&(this.state.viewModeEnabled||((f=this.state.openDialog)==null?void 0:f.name)==="elementLinkSelector"?It(this.interactiveCanvas,kt.GRAB):this.state.activeTool.type==="selection"?Ta(this.interactiveCanvas):(oi(this.interactiveCanvas,this.state),this.setState({selectedElementIds:bt({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})),Xs=!1),!o[B.CTRL_OR_CMD]&&!this.state.isBindingEnabled&&this.setState({isBindingEnabled:!0}),ku(o.key)&&(Wp(this.scene.getSelectedElements(this.state).filter(Ge),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,io(this.state),((m=this.state.selectedLinearElement)==null?void 0:m.selectedPointsIndices)??[],this.state.zoom),this.setState({suggestedBindings:[]})),o.altKey||this.flowChartNavigator.isExploring&&(this.flowChartNavigator.clear(),this.syncActionResult({captureUpdate:ie.IMMEDIATELY})),!o[B.CTRL_OR_CMD]&&this.flowChartCreator.isCreatingChart){(U=this.flowChartCreator.pendingNodes)!=null&&U.length&&this.scene.insertElements(this.flowChartCreator.pendingNodes);let v=(g=this.flowChartCreator.pendingNodes)==null?void 0:g[0];v&&(this.setState(y=>({selectedElementIds:bt({[v.id]:!0},y)})),up([v],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())||this.scrollToContent(v,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})),this.flowChartCreator.clear(),this.syncActionResult({captureUpdate:ie.IMMEDIATELY})}})),F(this,"isToolSupported",o=>{var f;return((f=this.props.UIOptions.tools)==null?void 0:f[o])!==!1}),F(this,"setActiveTool",o=>{if(!this.isToolSupported(o.type)){console.warn(`"${o.type}" tool is disabled via "UIOptions.canvasActions.tools.${o.type}"`);return}let f=gn(this.state,o);f.type==="hand"?It(this.interactiveCanvas,kt.GRAB):Xs||oi(this.interactiveCanvas,{...this.state,activeTool:f}),UO(document.activeElement)&&this.focusContainer(),v5(f.type)||this.setState({suggestedBindings:[]}),f.type==="image"&&this.onImageAction({insertOnCanvasDirectly:(o.type==="image"&&o.insertOnCanvasDirectly)??!1}),this.setState(m=>{let U={snapLines:m.snapLines.length?[]:m.snapLines,originSnapOffset:null,activeEmbeddable:null};return f.type==="freedraw"&&this.store.shouldCaptureIncrement(),f.type!=="selection"?{...m,activeTool:f,selectedElementIds:bt({},m),selectedGroupIds:bt({},m),editingGroupId:null,multiElement:null,...U}:{...m,activeTool:f,...U}})}),F(this,"setOpenDialog",o=>{this.setState({openDialog:o})}),F(this,"setCursor",o=>{It(this.interactiveCanvas,o)}),F(this,"resetCursor",()=>{Ta(this.interactiveCanvas)}),F(this,"isTouchScreenMultiTouchGesture",()=>gt.pointers.size>=2),F(this,"getName",()=>this.state.name||this.props.name||`${L("labels.untitled")}-${Rv()}`),F(this,"onGestureStart",tn(o=>{o.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({selectedElementIds:bt({},this.state),activeEmbeddable:null}),gt.initialScale=this.state.zoom.value})),F(this,"onGestureChange",tn(o=>{if(o.preventDefault(),this.isTouchScreenMultiTouchGesture())return;let f=gt.initialScale;f&&this.setState(m=>({...so({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:nl(f*o.scale)},m)}))})),F(this,"onGestureEnd",tn(o=>{o.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({previousSelectedElementIds:{},selectedElementIds:bt(this.state.previousSelectedElementIds,this.state)}),gt.initialScale=null})),F(this,"startTextEditing",({sceneX:o,sceneY:f,insertAtParentCenter:m=!0,container:U,autoEdit:g=!0})=>{let v=!1,y=m&&this.getTextWysiwygSnappedToCenterPosition(o,f,this.state,U);U&&y&&(Je(U,this.scene.getNonDeletedElementsMap())||(v=!0));let w=null,E=this.scene.getSelectedElements(this.state);E.length===1?ke(E[0])?w=E[0]:U?w=Je(E[0],this.scene.getNonDeletedElementsMap()):w=this.getTextElementAtPosition(o,f):w=this.getTextElementAtPosition(o,f);let S=(w==null?void 0:w.fontFamily)||this.state.currentItemFontFamily,k=(w==null?void 0:w.lineHeight)||Co(S),I=this.state.currentItemFontSize;if(!w&&v&&U&&!nt(U)){let j=KE(_t({fontSize:I,fontFamily:S}),k),D=qE(I,k),P=Math.max(U.height,D),N=Math.max(U.width,j);pe(U,{height:P,width:N}),o=U.x+N/2,f=U.y+P/2,y&&(y=this.getTextWysiwygSnappedToCenterPosition(o,f,this.state,U))}let T=this.getTopLayerFrameAtSceneCoords({x:o,y:f}),M=w||Wr({x:y?y.elementCenterX:o,y:y?y.elementCenterY:f,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,text:"",fontSize:I,fontFamily:S,textAlign:y?"center":this.state.currentItemTextAlign,verticalAlign:y?Br.MIDDLE:Mp,containerId:v?U==null?void 0:U.id:void 0,groupIds:(U==null?void 0:U.groupIds)??[],lineHeight:k,angle:(U==null?void 0:U.angle)??0,frameId:T?T.id:null});if(!w&&v&&U&&pe(U,{boundElements:(U.boundElements||[]).concat({type:"text",id:M.id})}),this.setState({editingTextElement:M}),!w)if(U&&v){let j=this.scene.getElementIndex(U.id);this.scene.insertElementAtIndex(M,j+1)}else this.scene.insertElement(M);g||w||U?this.handleTextWysiwyg(M,{isExistingElement:!!w}):this.setState({newElement:M,multiElement:null})}),F(this,"startImageCropping",o=>{this.store.shouldCaptureIncrement(),this.setState({croppingElementId:o.id})}),F(this,"finishImageCropping",()=>{this.state.croppingElementId&&(this.store.shouldCaptureIncrement(),this.setState({croppingElementId:null}))}),F(this,"handleCanvasDoubleClick",o=>{if(this.state.multiElement||this.state.activeTool.type!=="selection")return;let f=this.scene.getSelectedElements(this.state),{x:m,y:U}=jt(o,this.state);if(f.length===1&&Ge(f[0])){if(o[B.CTRL_OR_CMD]&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==f[0].id)&&!Me(f[0])){this.store.shouldCaptureIncrement(),this.setState({editingLinearElement:new Ce(f[0])});return}else if(this.state.selectedLinearElement&&Me(f[0])){let g=Ce.getSegmentMidpointHitCoords(this.state.selectedLinearElement,{x:m,y:U},this.state,this.scene.getNonDeletedElementsMap()),v=g?Ce.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,g,this.scene.getNonDeletedElementsMap()):-1;if(v&&v>-1){this.store.shouldCaptureIncrement(),Ce.deleteFixedSegment(f[0],v);let y=Ce.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:m,y:U},this.state,this.scene.getNonDeletedElementsMap()),w=y?Ce.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,y,this.scene.getNonDeletedElementsMap()):null;this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:{...this.state.selectedLinearElement.pointerDownState,segmentMidpoint:{index:w,value:g,added:!1}},segmentMidPointHoveredCoords:y}});return}}}if(f.length===1&&vt(f[0])){this.startImageCropping(f[0]);return}if(Ta(this.interactiveCanvas),fo(this.state).length>0){let g=this.getElementAtPosition(m,U),v=g&&VV(g,this.state.selectedGroupIds);if(v){this.store.shouldCaptureIncrement(),this.setState(y=>({...y,...fr({editingGroupId:v,selectedElementIds:{[g.id]:!0}},this.scene.getNonDeletedElements(),y,this)}));return}}if(Ta(this.interactiveCanvas),!o[B.CTRL_OR_CMD]&&!this.state.viewModeEnabled){let g=this.getElementAtPosition(m,U);if(sa(g)){this.setState({activeEmbeddable:{element:g,state:"active"}});return}let v=this.getTextBindableContainerAtPosition(m,U);if(v&&(Ua(v)||!Na(v.backgroundColor)||Sc({x:m,y:U,element:v,shape:qi(v,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()}))){let y=W2(v,this.state,this.scene.getNonDeletedElementsMap());m=y.x,U=y.y}this.startTextEditing({sceneX:m,sceneY:U,insertAtParentCenter:!o.altKey,container:v})}}),F(this,"getElementLinkAtPosition",(o,f)=>{let m=this.scene.getNonDeletedElements(),U=-1;for(let g=m.length-1;g>=0;g--){let v=m[g];if(f&&v.id===f.id&&(U=g),v.link&&g>=U&&X2(v,this.scene.getNonDeletedElementsMap(),this.state,A(o.x,o.y),this.device.editor.isMobile))return v}}),F(this,"redirectToLink",(o,f)=>{let m=yt(A(this.lastPointerDownEvent.clientX,this.lastPointerDownEvent.clientY),A(this.lastPointerUpEvent.clientX,this.lastPointerUpEvent.clientY));if(!this.hitLinkElement||m>Ks)return;let U=jt(this.lastPointerDownEvent,this.state),g=this.scene.getNonDeletedElementsMap(),v=X2(this.hitLinkElement,g,this.state,A(U.x,U.y),this.device.editor.isMobile),y=jt(this.lastPointerUpEvent,this.state),w=X2(this.hitLinkElement,g,this.state,A(y.x,y.y),this.device.editor.isMobile);if(v&&w){Mx();let E=this.hitLinkElement.link;if(E){E=Rr(E);let S;if(this.props.onLinkOpen&&(S=BE("excalidraw-link",o.nativeEvent),this.props.onLinkOpen({...this.hitLinkElement,link:E},S)),!(S!=null&&S.defaultPrevented)){let k=fk(E)?"_self":"_blank",I=window.open(void 0,k);I&&(I.opener=null,I.location=E)}}}}),F(this,"getTopLayerFrameAtSceneCoords",o=>{let f=this.scene.getNonDeletedElementsMap(),m=this.scene.getNonDeletedFramesLikes().filter(U=>qy(o,U,f));return m.length?m[m.length-1]:null}),F(this,"handleCanvasPointerMove",o=>{var S,k,I,T,M,j;this.savePointer(o.clientX,o.clientY,this.state.cursorButton),this.lastPointerMoveEvent=o.nativeEvent,gt.pointers.has(o.pointerId)&>.pointers.set(o.pointerId,{x:o.clientX,y:o.clientY});let f=gt.initialScale;if(gt.pointers.size===2&>.lastCenter&&f&>.initialDistance){let D=Px(gt.pointers),P=D.x-gt.lastCenter.x,N=D.y-gt.lastCenter.y;gt.lastCenter=D;let $=Nx(Array.from(gt.pointers.values())),z=this.state.activeTool.type==="freedraw"&&this.state.penMode?1:$/gt.initialDistance,Z=z?nl(f*z):this.state.zoom.value;this.setState(K=>{let Q=so({viewportX:D.x,viewportY:D.y,nextZoom:Z},K);this.translateCanvas({zoom:Q.zoom,scrollX:Q.scrollX+2*(P/Z),scrollY:Q.scrollY+2*(N/Z),shouldCacheIgnoreZoom:!0})}),this.resetShouldCacheIgnoreZoomDebounced()}else gt.lastCenter=gt.initialDistance=gt.initialScale=null;if(Xs||bu||Tg||Vc(this.state))return;let m=Fx(Ag,o.clientX-this.state.offsetLeft,o.clientY-this.state.offsetTop).isOverEither;!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.multiElement&&(m?Ta(this.interactiveCanvas):oi(this.interactiveCanvas,this.state));let U=jt(o,this.state),{x:g,y:v}=U;if(!this.state.newElement&&lG(this.state.activeTool.type)){let{originOffset:D,snapLines:P}=iG(this.scene.getNonDeletedElements(),this,{x:g,y:v},o,this.scene.getNonDeletedElementsMap());this.setState(N=>{let $=cu(N.snapLines,P),z=N.originSnapOffset?cu(N.originSnapOffset,D):D;return N.snapLines===$&&N.originSnapOffset===z?null:{snapLines:$,originSnapOffset:z}})}else!this.state.newElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.selectionElement&&this.setState(D=>D.snapLines.length?{snapLines:[]}:null);if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){let D=Ce.handlePointerMove(o,g,v,this,this.scene.getNonDeletedElementsMap());D&&D!==this.state.editingLinearElement&&$n.flushSync(()=>{this.setState({editingLinearElement:D})}),(D==null?void 0:D.lastUncommittedPoint)!=null?this.maybeSuggestBindingAtCursor(U,D.elbowed):$n.flushSync(()=>{this.setState({suggestedBindings:[]})})}if(VE(this.state.activeTool.type)){let{newElement:D}=this.state;mi(D,!1)?this.maybeSuggestBindingsForLinearElementAtCoords(D,[U],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(U,!1)}if(this.state.multiElement){let{multiElement:D}=this.state,{x:P,y:N}=D,{points:$,lastCommittedPoint:z}=D,Z=$[$.length-1];if(oi(this.interactiveCanvas,this.state),Z===z)yt(A(g-P,v-N),Z)>=Q1?pe(D,{points:[...$,A(g-P,v-N)]},!1):It(this.interactiveCanvas,kt.POINTER);else if($.length>2&&z&&yt(A(g-P,v-N),z)<Q1)It(this.interactiveCanvas,kt.POINTER),pe(D,{points:$.slice(0,-1)},!1);else{let[K,Q]=xn(g,v,o[B.CTRL_OR_CMD]||Me(D)?null:this.getEffectiveGridSize()),[W,q]=(D==null?void 0:D.lastCommittedPoint)??[0,0],V=K-P-W,ee=Q-N-q;Fu(o)&&({width:V,height:ee}=v6(W+P,q+N,K,Q)),sl($,this.state.zoom.value)&&It(this.interactiveCanvas,kt.POINTER),pe(D,{points:[...$.slice(0,-1),A(W+V,q+ee)]},!1,{isDragging:!0}),this.triggerRender(!1)}return}if(o.buttons||this.state.activeTool.type!=="selection"&&this.state.activeTool.type!=="text"&&this.state.activeTool.type!=="eraser")return;let y=this.scene.getNonDeletedElements(),w=this.scene.getSelectedElements(this.state);if(w.length===1&&!m&&!this.state.editingLinearElement){if(this.state.selectedLinearElement&&this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,g,v),(!this.state.selectedLinearElement||this.state.selectedLinearElement.hoverPointIndex===-1)&&((S=this.state.openDialog)==null?void 0:S.name)!=="elementLinkSelector"&&!(w.length===1&&Me(w[0]))){let D=a9(y,this.state,g,v,this.state.zoom,o.pointerType,this.scene.getNonDeletedElementsMap(),this.device);if(D&&D.transformHandleType){It(this.interactiveCanvas,l9(D));return}}}else if(w.length>1&&!m&&((k=this.state.openDialog)==null?void 0:k.name)!=="elementLinkSelector"){let D=i9(xt(w),g,v,this.state.zoom,o.pointerType,this.device);if(D){It(this.interactiveCanvas,l9({transformHandleType:D}));return}}let E=this.getElementAtPosition(U.x,U.y);this.hitLinkElement=this.getElementLinkAtPosition(U,E),!ci(this.state)&&(this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?(It(this.interactiveCanvas,kt.POINTER),Gte(this.hitLinkElement,this.state,this.scene.getNonDeletedElementsMap())):(Mx(),E&&(E.link||Cr(E))&&this.state.selectedElementIds[E.id]&&!this.state.contextMenu&&!this.state.showHyperlinkPopup?this.setState({showHyperlinkPopup:"info"}):this.state.activeTool.type==="text"?It(this.interactiveCanvas,ke(E)?kt.TEXT:kt.CROSSHAIR):this.state.viewModeEnabled?It(this.interactiveCanvas,kt.GRAB):((I=this.state.openDialog)==null?void 0:I.name)==="elementLinkSelector"?It(this.interactiveCanvas,kt.AUTO):m?It(this.interactiveCanvas,kt.AUTO):this.state.selectedLinearElement?this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,g,v):o[B.CTRL_OR_CMD]?It(this.interactiveCanvas,kt.AUTO):(E||this.isHittingCommonBoundingBoxOfSelectedElements(U,w))&&!(E!=null&&E.locked)&&(E&&sa(E)&&this.isIframeLikeElementCenter(E,o,g,v)?(It(this.interactiveCanvas,kt.POINTER),this.setState({activeEmbeddable:{element:E,state:"hover"}})):(!E||!Me(E))&&(It(this.interactiveCanvas,kt.MOVE),((T=this.state.activeEmbeddable)==null?void 0:T.state)==="hover"&&this.setState({activeEmbeddable:null})))),((M=this.state.openDialog)==null?void 0:M.name)==="elementLinkSelector"&&E?this.setState(D=>({hoveredElementIds:cu(D.hoveredElementIds,fr({editingGroupId:D.editingGroupId,selectedElementIds:{[E.id]:!0}},this.scene.getNonDeletedElements(),D,this).selectedElementIds)})):((j=this.state.openDialog)==null?void 0:j.name)==="elementLinkSelector"&&!E&&this.setState(D=>({hoveredElementIds:cu(D.hoveredElementIds,{})})))}),F(this,"handleEraser",(o,f,m)=>{this.eraserTrail.addPointToPath(m.x,m.y);let U=!1,g=new Set,v=this.scene.getNonDeletedElements(),y=I=>{var T;for(let M of I){if(M.locked)return;if(o.altKey?this.elementsPendingErasure.delete(M.id)&&(U=!0):this.elementsPendingErasure.has(M.id)||(U=!0,this.elementsPendingErasure.add(M.id)),U&&((T=M.groupIds)==null?void 0:T.length)){let j=M.groupIds.at(-1);if(!g.has(j)){g.add(j);let D=zt(v,j);for(let P of D)o.altKey?this.elementsPendingErasure.delete(P.id):this.elementsPendingErasure.add(P.id)}}}},w=yt(A(f.lastCoords.x,f.lastCoords.y),A(m.x,m.y)),E=this.getElementHitThreshold(),S={...f.lastCoords},k=0;for(;k<=w;){let I=this.getElementsAtPosition(S.x,S.y);if(y(I),k===w)break;k=Math.min(k+E,w);let T=k/w,M=(1-T)*S.x+T*m.x,j=(1-T)*S.y+T*m.y;S.x=M,S.y=j}if(f.lastCoords.x=m.x,f.lastCoords.y=m.y,U){for(let I of this.scene.getNonDeletedElements())Ft(I)&&(this.elementsPendingErasure.has(I.id)||this.elementsPendingErasure.has(I.containerId))&&(o.altKey?(this.elementsPendingErasure.delete(I.id),this.elementsPendingErasure.delete(I.containerId)):(this.elementsPendingErasure.add(I.id),this.elementsPendingErasure.add(I.containerId)));this.elementsPendingErasure=new Set(this.elementsPendingErasure),this.triggerRender()}}),F(this,"handleTouchMove",o=>{vu=!0}),F(this,"handleCanvasPointerDown",o=>{var E,S,k;let f=o.target;if(f.setPointerCapture&&f.setPointerCapture(o.pointerId),this.maybeCleanupAfterMissingPointerUp(o.nativeEvent),this.maybeUnfollowRemoteUser(),this.state.searchMatches&&(this.setState(I=>({searchMatches:I.searchMatches.map(T=>({...T,focus:!1}))})),$a.set(yT,null)),this.state.contextMenu&&this.setState({contextMenu:null}),this.state.snapLines&&this.setAppState({snapLines:[]}),this.updateGestureOnPointerDown(o),o.pointerType==="touch"&&this.state.newElement&&this.state.newElement.type==="freedraw"){let I=this.state.newElement;this.updateScene({...I.points.length<10?{elements:this.scene.getElementsIncludingDeleted().filter(T=>T.id!==I.id)}:{},appState:{newElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:bt(Object.keys(this.state.selectedElementIds).filter(T=>T!==I.id).reduce((T,M)=>(T[M]=this.state.selectedElementIds[M],T),{}),this.state)},captureUpdate:((E=this.state.openDialog)==null?void 0:E.name)==="elementLinkSelector"?ie.EVENTUALLY:ie.NEVER});return}let m=document.getSelection();if(m!=null&&m.anchorNode&&m.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(o),!this.state.penDetected&&o.pointerType==="pen"&&this.setState(I=>({penMode:!0,penDetected:!0})),!this.device.isTouchScreen&&["pen","touch"].includes(o.pointerType)&&(this.device=J1(this.device,{isTouchScreen:!0})),bu||(this.lastPointerDownEvent=o,this.handleCanvasPanUsingWheelOrSpaceDrag(o)))return;if(this.setState({lastPointerDownWith:o.pointerType,cursorButton:"down"}),this.savePointer(o.clientX,o.clientY,"down"),o.button===Kl.ERASER&&this.state.activeTool.type!==_n.eraser){this.setState({activeTool:gn(this.state,{type:_n.eraser,lastActiveToolBeforeEraser:this.state.activeTool})},()=>{this.handleCanvasPointerDown(o);let I=()=>{T(),M==null||M(),ci(this.state)&&this.setState({activeTool:gn(this.state,{...this.state.activeTool.lastActiveTool||{type:_n.selection},lastActiveToolBeforeEraser:null})})},T=Yt(window,"pointerup",I,{once:!0}),M;requestAnimationFrame(()=>{M=this.missingPointerEventCleanupEmitter.once(I)})});return}if(o.button!==Kl.MAIN&&o.button!==Kl.TOUCH&&o.button!==Kl.ERASER||gt.pointers.size>1)return;let U=this.initialPointerDownState(o);if(this.setState({selectedElementsAreBeingDragged:!1}),this.handleDraggingScrollBar(o,U)||(this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(o),this.handleSelectionOnPointerDown(o,U))||!(!this.state.penMode||o.pointerType!=="touch"||this.state.activeTool.type==="selection"||this.state.activeTool.type==="text"||this.state.activeTool.type==="image"))return;if(this.state.activeTool.type==="text")this.handleTextOnPointerDown(o,U);else if(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")this.handleLinearElementOnPointerDown(o,this.state.activeTool.type,U);else if(this.state.activeTool.type==="image"){It(this.interactiveCanvas,kt.CROSSHAIR);let I=this.state.pendingImageElementId&&this.scene.getElement(this.state.pendingImageElementId);if(!I)return;this.setState({newElement:I,pendingImageElementId:null,multiElement:null});let{x:T,y:M}=jt(o,this.state),j=this.getTopLayerFrameAtSceneCoords({x:T,y:M});pe(I,{x:T,y:M,frameId:j?j.id:null})}else this.state.activeTool.type==="freedraw"?this.handleFreeDrawElementOnPointerDown(o,this.state.activeTool.type,U):this.state.activeTool.type==="custom"?oi(this.interactiveCanvas,this.state):this.state.activeTool.type===_n.frame||this.state.activeTool.type===_n.magicframe?this.createFrameElementOnPointerDown(U,this.state.activeTool.type):this.state.activeTool.type==="laser"?this.laserTrails.startPath(U.lastCoords.x,U.lastCoords.y):this.state.activeTool.type!=="eraser"&&this.state.activeTool.type!=="hand"&&this.createGenericElementOnPointerDown(this.state.activeTool.type,U);(k=(S=this.props)==null?void 0:S.onPointerDown)==null||k.call(S,this.state.activeTool,U),this.onPointerDownEmitter.trigger(this.state.activeTool,U,o),this.state.activeTool.type==="eraser"&&this.eraserTrail.startPath(U.lastCoords.x,U.lastCoords.y);let g=this.onPointerMoveFromPointerDownHandler(U),v=this.onPointerUpFromPointerDownHandler(U),y=this.onKeyDownFromPointerDownHandler(U),w=this.onKeyUpFromPointerDownHandler(U);this.missingPointerEventCleanupEmitter.once(I=>v(I||o.nativeEvent)),(!this.state.viewModeEnabled||this.state.activeTool.type==="laser")&&(window.addEventListener("pointermove",g),window.addEventListener("pointerup",v),window.addEventListener("keydown",y),window.addEventListener("keyup",w),U.eventListeners.onMove=g,U.eventListeners.onUp=v,U.eventListeners.onKeyUp=w,U.eventListeners.onKeyDown=y)}),F(this,"handleCanvasPointerUp",o=>{var U;this.removePointer(o),this.lastPointerUpEvent=o;let f=jt({clientX:o.clientX,clientY:o.clientY},this.state),m=o.timeStamp-(((U=this.lastPointerDownEvent)==null?void 0:U.timeStamp)??0);if(this.device.editor.isMobile&&m<300){let g=this.getElementAtPosition(f.x,f.y);if(sa(g)&&this.isIframeLikeElementCenter(g,o,f.x,f.y)){this.handleEmbeddableCenterClick(g);return}}if(this.device.isTouchScreen){let g=this.getElementAtPosition(f.x,f.y);this.hitLinkElement=this.getElementLinkAtPosition(f,g)}this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?m<300&&sa(this.hitLinkElement)&&!jk(this.hitLinkElement,this.scene.getNonDeletedElementsMap(),this.state,A(f.x,f.y))?this.handleEmbeddableCenterClick(this.hitLinkElement):this.redirectToLink(o,this.device.isTouchScreen):this.state.viewModeEnabled&&this.setState({activeEmbeddable:null,selectedElementIds:{}})}),F(this,"maybeOpenContextMenuAfterPointerDownOnTouchDevices",o=>{o.pointerType==="touch"&&(vu=!1,Yl?vu=!0:Yl=window.setTimeout(()=>{Yl=0,vu||this.handleCanvasContextMenu(o)},BN))}),F(this,"resetContextMenuTimer",()=>{clearTimeout(Yl),Yl=0,vu=!1}),F(this,"maybeCleanupAfterMissingPointerUp",o=>{Vs==null||Vs(),this.missingPointerEventCleanupEmitter.trigger(o).clear()}),F(this,"handleCanvasPanUsingWheelOrSpaceDrag",o=>{if(!(gt.pointers.size<=1&&(o.button===Kl.WHEEL||o.button===Kl.MAIN&&Xs||Vc(this.state)||this.state.viewModeEnabled)))return!1;bu=!0,this.focusContainer(),this.state.editingTextElement||o.preventDefault();let f=!1,m=typeof window===void 0?!1:/Linux/.test(window.navigator.platform);It(this.interactiveCanvas,kt.GRABBING);let{clientX:U,clientY:g}=o,v=kg(w=>{let E=U-w.clientX,S=g-w.clientY;if(U=w.clientX,g=w.clientY,m&&!f&&(Math.abs(E)>1||Math.abs(S)>1)){f=!0;let k=T=>{document.body.removeEventListener("paste",k),T.stopPropagation()},I=()=>{setTimeout(()=>{document.body.removeEventListener("paste",k),window.removeEventListener("pointerup",I)},100)};document.body.addEventListener("paste",k),window.addEventListener("pointerup",I)}this.translateCanvas({scrollX:this.state.scrollX-E/this.state.zoom.value,scrollY:this.state.scrollY-S/this.state.zoom.value})}),y=tn(Vs=()=>{Vs=null,bu=!1,Xs||(this.state.viewModeEnabled?It(this.interactiveCanvas,kt.GRAB):oi(this.interactiveCanvas,this.state)),this.setState({cursorButton:"up"}),this.savePointer(o.clientX,o.clientY,"up"),window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",y),window.removeEventListener("blur",y),v.flush()});return window.addEventListener("blur",y),window.addEventListener("pointermove",v,{passive:!0}),window.addEventListener("pointerup",y),!0}),F(this,"clearSelectionIfNotUsingSelection",()=>{this.state.activeTool.type!=="selection"&&this.setState({selectedElementIds:bt({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}),F(this,"handleSelectionOnPointerDown",(o,f)=>{var m;if(this.state.activeTool.type==="selection"){let U=this.scene.getNonDeletedElements(),g=this.scene.getNonDeletedElementsMap(),v=this.scene.getSelectedElements(this.state);if(v.length===1&&!this.state.editingLinearElement&&!Me(v[0])&&!(this.state.selectedLinearElement&&this.state.selectedLinearElement.hoverPointIndex!==-1)){let y=a9(U,this.state,f.origin.x,f.origin.y,this.state.zoom,o.pointerType,this.scene.getNonDeletedElementsMap(),this.device);y!=null&&(y.transformHandleType==="rotation"?(this.setState({resizingElement:y.element}),f.resize.handleType=y.transformHandleType):(this.state.croppingElementId||this.setState({resizingElement:y.element}),f.resize.handleType=y.transformHandleType))}else v.length>1&&(f.resize.handleType=i9(xt(v),f.origin.x,f.origin.y,this.state.zoom,o.pointerType,this.device));if(f.resize.handleType)f.resize.isResizing=!0,f.resize.offset=Pa(nZ(f.resize.handleType,v,g,f.origin.x,f.origin.y)),v.length===1&&Ge(v[0])&&v[0].points.length===2&&(f.resize.arrowDirection=rZ(f.resize.handleType,v[0]));else{if(this.state.selectedLinearElement){let E=this.state.editingLinearElement||this.state.selectedLinearElement,S=Ce.handlePointerDown(o,this,this.store,f.origin,E,this.scene);if(S.hitElement&&(f.hit.element=S.hitElement),S.linearElementEditor&&(this.setState({selectedLinearElement:S.linearElementEditor}),this.state.editingLinearElement&&this.setState({editingLinearElement:S.linearElementEditor})),S.didAddPoint)return!0}if(f.hit.element=f.hit.element??this.getElementAtPosition(f.origin.x,f.origin.y),this.hitLinkElement=this.getElementLinkAtPosition(f.origin,f.hit.element),this.hitLinkElement)return!0;if(this.state.croppingElementId&&((m=f.hit.element)==null?void 0:m.id)!==this.state.croppingElementId&&this.finishImageCropping(),f.hit.element&&this.getElementLinkAtPosition({x:f.origin.x,y:f.origin.y},f.hit.element))return!1;f.hit.allHitElements=this.getElementsAtPosition(f.origin.x,f.origin.y);let y=f.hit.element,w=f.hit.allHitElements.some(E=>this.isASelectedElement(E));if((y===null||!w)&&!o.shiftKey&&!f.hit.hasHitCommonBoundingBoxOfSelectedElements&&this.clearSelection(y),this.state.editingLinearElement)this.setState({selectedElementIds:bt({[this.state.editingLinearElement.elementId]:!0},this.state)});else if(y!=null){if(o[B.CTRL_OR_CMD])return this.state.selectedElementIds[y.id]||(f.hit.wasAddedToSelection=!0),this.setState(E=>({...XV(E,y),previousSelectedElementIds:this.state.selectedElementIds})),!1;this.state.selectedElementIds[y.id]||(this.state.editingGroupId&&!Uf(y,this.state.editingGroupId)&&this.setState({selectedElementIds:bt({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),!w&&!f.hit.hasHitCommonBoundingBoxOfSelectedElements&&(this.setState(E=>{var I;let S={...E.selectedElementIds,[y.id]:!0},k=[];if(Object.keys(E.selectedElementIds).forEach(T=>{let M=this.scene.getElement(T);M&&k.push(M)}),He(y))Mi(k,y.id).forEach(T=>{delete S[T.id]});else if(y.frameId)S[y.frameId]&&delete S[y.id];else{let T=y.groupIds,M=new Set(T.flatMap(j=>zt(this.scene.getNonDeletedElements(),j)).filter(j=>He(j)).map(j=>j.id));M.size>0&&k.forEach(j=>{j.frameId&&M.has(j.frameId)&&(delete S[j.id],j.groupIds.flatMap(D=>zt(this.scene.getNonDeletedElements(),D)).forEach(D=>{delete S[D.id]}))})}return((I=E.openDialog)==null?void 0:I.name)==="elementLinkSelector"&&(y.groupIds.some(T=>E.selectedGroupIds[T])||(S={[y.id]:!0})),{...fr({editingGroupId:E.editingGroupId,selectedElementIds:S},this.scene.getNonDeletedElements(),E,this),showHyperlinkPopup:y.link||Cr(y)?"info":!1}}),f.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1}),F(this,"handleTextOnPointerDown",(o,f)=>{if(this.state.editingTextElement)return;let m=f.origin.x,U=f.origin.y,g=this.getElementAtPosition(m,U,{includeBoundTextElement:!0}),v=this.getTextBindableContainerAtPosition(m,U);Ua(g)&&(v=g,m=g.x+g.width/2,U=g.y+g.height/2),this.startTextEditing({sceneX:m,sceneY:U,insertAtParentCenter:!o.altKey,container:v,autoEdit:!1}),Ta(this.interactiveCanvas),this.state.activeTool.locked||this.setState({activeTool:gn(this.state,{type:"selection"})})}),F(this,"handleFreeDrawElementOnPointerDown",(o,f,m)=>{let[U,g]=xn(m.origin.x,m.origin.y,null),v=this.getTopLayerFrameAtSceneCoords({x:U,y:g}),y=o.pressure===.5,w=EG({type:f,x:U,y:g,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,roundness:null,simulatePressure:y,locked:!1,frameId:v?v.id:null,points:[A(0,0)],pressures:y?[]:[o.pressure]});this.scene.insertElement(w),this.setState(S=>{let k={...S.selectedElementIds};return delete k[w.id],{selectedElementIds:bt(k,S)}});let E=Oa(m.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom);this.setState({newElement:w,startBoundElement:E,suggestedBindings:[]})}),F(this,"insertIframeElement",({sceneX:o,sceneY:f,width:m,height:U})=>{var w;let[g,v]=xn(o,f,(w=this.lastPointerDownEvent)!=null&&w[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),y=yG({type:"iframe",x:g,y:v,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("iframe"),opacity:this.state.currentItemOpacity,locked:!1,width:m,height:U});return this.scene.insertElement(y),y}),F(this,"insertEmbeddableElement",({sceneX:o,sceneY:f,link:m})=>{var w;let[U,g]=xn(o,f,(w=this.lastPointerDownEvent)!=null&&w[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=Rc(m);if(!v)return;v.error instanceof URIError&&this.setToast({message:L("toast.unrecognizedLinkFormat"),closable:!0});let y=Sy({type:"embeddable",x:U,y:g,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("embeddable"),opacity:this.state.currentItemOpacity,locked:!1,width:v.intrinsicSize.w,height:v.intrinsicSize.h,link:m});return this.scene.insertElement(y),y}),F(this,"createImageElement",({sceneX:o,sceneY:f,addToFrameUnderCursor:m=!0})=>{var y;let[U,g]=xn(o,f,(y=this.lastPointerDownEvent)!=null&&y[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=m?this.getTopLayerFrameAtSceneCoords({x:U,y:g}):null;return vk({type:"image",x:U,y:g,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:null,opacity:this.state.currentItemOpacity,locked:!1,frameId:v?v.id:null})}),F(this,"handleLinearElementOnPointerDown",(o,f,m)=>{if(this.state.multiElement){let{multiElement:U}=this.state;if(U.type==="line"&&sl(U.points,this.state.zoom.value)){pe(U,{lastCommittedPoint:U.points[U.points.length-1]}),this.actionManager.executeAction(Ia);return}if(Me(U)&&U.points.length>1){pe(U,{lastCommittedPoint:U.points[U.points.length-1]}),this.actionManager.executeAction(Ia);return}let{x:g,y:v,lastCommittedPoint:y}=U;if(U.points.length>1&&y&&yt(A(m.origin.x-g,m.origin.y-v),y)<Q1){this.actionManager.executeAction(Ia);return}this.setState(w=>({selectedElementIds:bt({...w.selectedElementIds,[U.id]:!0},w)})),pe(U,{lastCommittedPoint:U.points[U.points.length-1]}),It(this.interactiveCanvas,kt.POINTER)}else{let[U,g]=xn(m.origin.x,m.origin.y,o[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=this.getTopLayerFrameAtSceneCoords({x:U,y:g}),{currentItemStartArrowhead:y,currentItemEndArrowhead:w}=this.state,[E,S]=f==="arrow"?[y,w]:[null,null],k=f==="arrow"?B5({type:f,x:U,y:g,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,roundness:this.state.currentItemArrowType===On.round?{type:bn.PROPORTIONAL_RADIUS}:null,startArrowhead:E,endArrowhead:S,locked:!1,frameId:v?v.id:null,elbowed:this.state.currentItemArrowType===On.elbow,fixedSegments:this.state.currentItemArrowType===On.elbow?[]:null}):ho({type:f,x:U,y:g,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,roundness:this.state.currentItemRoundness==="round"?{type:bn.PROPORTIONAL_RADIUS}:null,locked:!1,frameId:v?v.id:null});this.setState(T=>{let M={...T.selectedElementIds};return delete M[k.id],{selectedElementIds:bt(M,T)}}),pe(k,{points:[...k.points,A(0,0)]});let I=Oa(m.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,Me(k),Me(k));this.scene.insertElement(k),this.setState({newElement:k,startBoundElement:I,suggestedBindings:[]})}}),F(this,"createGenericElementOnPointerDown",(o,f)=>{var w;let[m,U]=xn(f.origin.x,f.origin.y,(w=this.lastPointerDownEvent)!=null&&w[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g=this.getTopLayerFrameAtSceneCoords({x:m,y:U}),v={x:m,y:U,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,roundness:this.getCurrentItemRoundness(o),locked:!1,frameId:g?g.id:null},y;o==="embeddable"?y=Sy({type:"embeddable",...v}):y=ki({type:o,...v}),y.type==="selection"?this.setState({selectionElement:y}):(this.scene.insertElement(y),this.setState({multiElement:null,newElement:y}))}),F(this,"createFrameElementOnPointerDown",(o,f)=>{var y;let[m,U]=xn(o.origin.x,o.origin.y,(y=this.lastPointerDownEvent)!=null&&y[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g={x:m,y:U,opacity:this.state.currentItemOpacity,locked:!1,...Kt},v=f===_n.magicframe?f6(g):F5(g);this.scene.insertElement(v),this.setState({multiElement:null,newElement:v})}),F(this,"restoreReadyToEraseElements",()=>{this.elementsPendingErasure=new Set,this.triggerRender()}),F(this,"eraseElements",()=>{let o=!1,f=this.scene.getElementsIncludingDeleted().map(m=>this.elementsPendingErasure.has(m.id)||m.frameId&&this.elementsPendingErasure.has(m.frameId)||Ft(m)&&this.elementsPendingErasure.has(m.containerId)?(o=!0,Ke(m,{isDeleted:!0})):m);this.elementsPendingErasure=new Set,o&&(this.store.shouldCaptureIncrement(),this.scene.replaceAllElements(f))}),F(this,"initializeImage",async({imageFile:o,imageElement:f,showCursorImagePreview:m=!1})=>{var w,E,S,k,I;if(!po(o))throw new Error(L("errors.unsupportedFileType"));let U=o.type;if(It(this.interactiveCanvas,"wait"),U===De.svg)try{o=c9(Dy(await o.text()),o.name)}catch(T){throw console.warn(T),new Error(L("errors.svgImageInsertError"))}let g=await(((E=(w=this.props).generateIdForFile)==null?void 0:E.call(w,o))||pZ(o));if(!g)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(L("errors.imageInsertError"));if(!((S=this.files[g])!=null&&S.dataURL)){try{o=await E6(o,{maxWidthOrHeight:ZN})}catch(T){console.error("Error trying to resizing image file on insertion",T)}if(o.size>Cv)throw new Error(L("errors.fileTooBig",{maxSize:`${Math.trunc(Cv/1024/1024)}MB`}))}if(m){let T=(k=this.files[g])==null?void 0:k.dataURL,M=T&&UZ(T);this.setImagePreviewCursor(M||o)}let v=((I=this.files[g])==null?void 0:I.dataURL)||await w6(o),y=pe(f,{fileId:g},!1);return new Promise(async(T,M)=>{var j;try{this.addMissingFiles([{mimeType:U,id:g,dataURL:v,created:Date.now(),lastRetrieved:Date.now()}]);let D=this.imageCache.get(g);D||(this.addNewImagesToImageCache(),await this.updateImageCache([y])),(D==null?void 0:D.image)instanceof Promise&&await D.image,this.state.pendingImageElementId!==y.id&&((j=this.state.newElement)==null?void 0:j.id)!==y.id&&this.initializeImageDimensions(y,!0),T(y)}catch(D){console.error(D),M(new Error(L("errors.imageInsertError")))}finally{m||Ta(this.interactiveCanvas)}})}),F(this,"insertImageElement",async(o,f,m)=>{if(!this.isToolSupported("image")){this.setState({errorMessage:L("errors.imageToolNotSupported")});return}this.scene.insertElement(o);try{return await this.initializeImage({imageFile:f,imageElement:o,showCursorImagePreview:m})}catch(U){return pe(o,{isDeleted:!0}),this.actionManager.executeAction(Ia),this.setState({errorMessage:U.message||L("errors.imageInsertError")}),null}}),F(this,"setImagePreviewCursor",async o=>{let f;try{f=await E6(o,{maxWidthOrHeight:96})}catch(U){throw U.cause==="UNSUPPORTED"?new Error(L("errors.unsupportedFileType")):U}let m=await w6(f);if(o.type===De.svg){let U=await Ik(m),g=Math.min(U.height,96),v=g*(U.width/U.height);v>96&&(v=96,g=v*(U.height/U.width));let y=document.createElement("canvas");y.height=g,y.width=v,y.getContext("2d").drawImage(U,0,0,v,g),m=y.toDataURL(De.svg)}this.state.pendingImageElementId&&It(this.interactiveCanvas,`url(${m}) 4 4, auto`)}),F(this,"onImageAction",async({insertOnCanvasDirectly:o})=>{try{let f=this.state.width/2+this.state.offsetLeft,m=this.state.height/2+this.state.offsetTop,{x:U,y:g}=jt({clientX:f,clientY:m},this.state),v=await W5({description:"Image",extensions:Object.keys(Xc)}),y=this.createImageElement({sceneX:U,sceneY:g,addToFrameUnderCursor:!1});o?(this.insertImageElement(y,v),this.initializeImageDimensions(y),this.setState({selectedElementIds:bt({[y.id]:!0},this.state)},()=>{this.actionManager.executeAction(Ia)})):this.setState({pendingImageElementId:y.id},()=>{this.insertImageElement(y,v,!0)})}catch(f){f.name!=="AbortError"?console.error(f):console.warn(f),this.setState({pendingImageElementId:null,newElement:null,activeTool:gn(this.state,{type:"selection"})},()=>{this.actionManager.executeAction(Ia)})}}),F(this,"initializeImageDimensions",(o,f=!1)=>{var U;let m=la(o)&&((U=this.imageCache.get(o.fileId))==null?void 0:U.image);if(!m||m instanceof Promise){if(o.width<Ks/this.state.zoom.value&&o.height<Ks/this.state.zoom.value){let g=100/this.state.zoom.value;pe(o,{x:o.x-g/2,y:o.y-g/2,width:g,height:g})}return}if(f||o.width<Ks/this.state.zoom.value&&o.height<Ks/this.state.zoom.value){let g=Math.max(this.state.height-120,160),v=Math.min(g,Math.floor(this.state.height*.5)/this.state.zoom.value),y=Math.min(m.naturalHeight,v),w=y*(m.naturalWidth/m.naturalHeight),E=o.x+o.width/2-w/2,S=o.y+o.height/2-y/2;pe(o,{x:E,y:S,width:w,height:y,crop:null})}}),F(this,"updateImageCache",async(o,f=this.files)=>{let{updatedFiles:m,erroredFiles:U}=await _k({imageCache:this.imageCache,fileIds:o.map(g=>g.fileId),files:f});if(m.size||U.size)for(let g of o)m.has(g.fileId)&&Qt.delete(g);return U.size&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().map(g=>la(g)&&U.has(g.fileId)?Ke(g,{status:"error"}):g)),{updatedFiles:m,erroredFiles:U}}),F(this,"addNewImagesToImageCache",async(o=Tk(this.scene.getNonDeletedElements()),f=this.files)=>{let m=o.filter(U=>!U.isDeleted&&!this.imageCache.has(U.fileId));if(m.length){let{updatedFiles:U}=await this.updateImageCache(m,f);U.size&&this.scene.triggerUpdate()}}),F(this,"scheduleImageRefresh",Af(()=>{this.addNewImagesToImageCache()},zN)),F(this,"updateBindingEnabledOnPointerMove",o=>{let f=yV(o);this.state.isBindingEnabled!==f&&this.setState({isBindingEnabled:f})}),F(this,"maybeSuggestBindingAtCursor",(o,f)=>{let m=Oa(o,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,!1,f);this.setState({suggestedBindings:m!=null?[m]:[]})}),F(this,"maybeSuggestBindingsForLinearElementAtCoords",(o,f,m)=>{if(!f.length)return;let U=f.reduce((g,v)=>{let y=Oa(v,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,Me(o),Me(o));return y!=null&&!KS(o,m==null?void 0:m.id,y)&&g.push(y),g},[]);this.setState({suggestedBindings:U})}),F(this,"handleInteractiveCanvasRef",o=>{var f,m;o!==null?(this.interactiveCanvas=o,this.interactiveCanvas.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.interactiveCanvas.addEventListener("touchend",this.onTouchEnd)):((f=this.interactiveCanvas)==null||f.removeEventListener("touchstart",this.onTouchStart),(m=this.interactiveCanvas)==null||m.removeEventListener("touchend",this.onTouchEnd))}),F(this,"handleAppOnDrop",async o=>{var y,w,E,S;let{file:f,fileHandle:m}=await vZ(o),{x:U,y:g}=jt(o,this.state);try{if(po(f)&&this.isToolSupported("image")){if((f==null?void 0:f.type)===De.png||(f==null?void 0:f.type)===De.svg)try{let I=await x8(f,this.state,this.scene.getElementsIncludingDeleted(),m);this.syncActionResult({...I,appState:{...I.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:ie.IMMEDIATELY});return}catch(I){if(I.name!=="EncodingError")throw new Error(L("alerts.couldNotLoadInvalidFile"))}let k=this.createImageElement({sceneX:U,sceneY:g});this.insertImageElement(k,f),this.initializeImageDimensions(k),this.setState({selectedElementIds:bt({[k.id]:!0},this.state)});return}}catch(k){return this.setState({isLoading:!1,errorMessage:k.message})}let v=o.dataTransfer.getData(De.excalidrawlib);if(v&&typeof v=="string"){try{let k=gC(v);this.addElementsFromPasteOrLibrary({elements:E_(k),position:o,files:null})}catch(k){this.setState({errorMessage:k.message})}return}if(f&&await this.loadFileToCanvas(f,m),(w=(y=o.dataTransfer)==null?void 0:y.types)==null?void 0:w.includes("text/plain")){let k=(E=o.dataTransfer)==null?void 0:E.getData("text");if(k&&sp(k,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(k)||((S=Rc(k))==null?void 0:S.type)==="video")){let I=this.insertEmbeddableElement({sceneX:U,sceneY:g,link:Rr(k)});I&&this.setState({selectedElementIds:{[I.id]:!0}})}}}),F(this,"loadFileToCanvas",async(o,f)=>{o=await w8(o);try{let m=this.scene.getElementsIncludingDeleted(),U;try{U=await y8(o,this.state,m,f)}catch(g){let v=g instanceof ao;if(v&&g.code==="IMAGE_NOT_CONTAINS_SCENE_DATA"&&!this.isToolSupported("image")){this.setState({isLoading:!1,errorMessage:L("errors.imageToolNotSupported")});return}let y=L(v?"alerts.cannotRestoreFromImage":"alerts.couldNotLoadInvalidFile");this.setState({isLoading:!1,errorMessage:y})}if(!U)return;U.type===De.excalidraw?(ul(m.concat(U.data.elements)),this.store.updateSnapshot(We(m),this.state),this.setState({isLoading:!0}),this.syncActionResult({...U.data,appState:{...U.data.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:ie.IMMEDIATELY})):U.type===De.excalidrawlib&&await this.library.updateLibrary({libraryItems:o,merge:!0,openLibraryMenu:!0}).catch(g=>{console.error(g),this.setState({errorMessage:L("errors.importLibraryError")})})}catch(m){this.setState({isLoading:!1,errorMessage:m.message})}}),F(this,"handleCanvasContextMenu",o=>{if(o.preventDefault(),("pointerType"in o.nativeEvent&&o.nativeEvent.pointerType==="touch"||"pointerType"in o.nativeEvent&&o.nativeEvent.pointerType==="pen"&&o.button!==Kl.SECONDARY)&&this.state.activeTool.type!=="selection")return;let{x:f,y:m}=jt(o,this.state),U=this.getElementAtPosition(f,m,{preferSelected:!0,includeLockedElements:!0}),g=this.scene.getSelectedElements(this.state),v=this.isHittingCommonBoundingBoxOfSelectedElements({x:f,y:m},g),y=U||v?"element":"canvas",w=this.excalidrawContainerRef.current,{top:E,left:S}=w.getBoundingClientRect(),k=o.clientX-S,I=o.clientY-E;Nt("contextMenu","openContextMenu",y),this.setState({...U&&!this.state.selectedElementIds[U.id]?{...this.state,...fr({editingGroupId:this.state.editingGroupId,selectedElementIds:{[U.id]:!0}},this.scene.getNonDeletedElements(),this.state,this),selectedLinearElement:Ge(U)?new Ce(U):null}:this.state,showHyperlinkPopup:!1},()=>{this.setState({contextMenu:{top:I,left:k,items:this.getContextMenuItems(y)}})})}),F(this,"maybeDragNewGenericElement",(o,f,m=!0)=>{var T,M,j;let U=this.state.selectionElement,g=o.lastCoords;if(U&&this.state.activeTool.type!=="eraser"){o9({newElement:U,elementType:this.state.activeTool.type,originX:o.origin.x,originY:o.origin.y,x:g.x,y:g.y,width:nr(o.origin.x,g.x),height:nr(o.origin.y,g.y),shouldMaintainAspectRatio:du(f),shouldResizeFromCenter:F2(f),zoom:this.state.zoom.value,informMutation:m});return}let v=this.state.newElement;if(!v)return;let[y,w]=xn(g.x,g.y,f[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),E=la(v)&&((T=this.imageCache.get(v.fileId))==null?void 0:T.image),S=E&&!(E instanceof Promise)?E.width/E.height:null;this.maybeCacheReferenceSnapPoints(f,[v]);let{snapOffset:k,snapLines:I}=aG(v,this,f,{x:o.originInGrid.x+(((M=this.state.originSnapOffset)==null?void 0:M.x)??0),y:o.originInGrid.y+(((j=this.state.originSnapOffset)==null?void 0:j.y)??0)},{x:y-o.originInGrid.x,y:w-o.originInGrid.y},this.scene.getNonDeletedElementsMap());y+=k.x,w+=k.y,this.setState({snapLines:I}),o9({newElement:v,elementType:this.state.activeTool.type,originX:o.originInGrid.x,originY:o.originInGrid.y,x:y,y:w,width:nr(o.originInGrid.x,y),height:nr(o.originInGrid.y,w),shouldMaintainAspectRatio:vt(v)?!du(f):du(f),shouldResizeFromCenter:F2(f),zoom:this.state.zoom.value,widthAspectRatio:S,originOffset:this.state.originSnapOffset,informMutation:m}),this.setState({newElement:v}),(this.state.activeTool.type===_n.frame||this.state.activeTool.type===_n.magicframe)&&this.setState({elementsToHighlight:cp(this.scene.getNonDeletedElements(),v,this.state,this.scene.getNonDeletedElementsMap())})}),F(this,"maybeHandleCrop",(o,f)=>{var w;if(!this.state.croppingElementId)return!1;let m=o.resize.handleType,U=o.lastCoords,[g,v]=xn(U.x-o.resize.offset.x,U.y-o.resize.offset.y,f[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),y=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(m&&y&&vt(y)){let E=o.originalElements.get(y.id),S=la(y)&&((w=this.imageCache.get(y.fileId))==null?void 0:w.image);if(E&&vt(E)&&S&&!(S instanceof Promise)){let[k,I]=xn(U.x,U.y,f[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),T={x:k-o.originInGrid.x,y:I-o.originInGrid.y};this.maybeCacheReferenceSnapPoints(f,[y]);let{snapOffset:M,snapLines:j}=wy([y],[E],this,f,T,m);pe(y,WX(y,m,S.naturalWidth,S.naturalHeight,g+M.x,v+M.y,f.shiftKey?E.width/E.height:void 0)),Ar(y,this.scene.getNonDeletedElementsMap(),{newSize:{width:y.width,height:y.height}}),this.setState({isCropping:m&&m!=="rotation",snapLines:j})}return!0}return!1}),F(this,"maybeHandleResize",(o,f)=>{let m=this.scene.getSelectedElements(this.state),U=m.filter(S=>He(S)),g=o.resize.handleType;if(U.length>0&&g==="rotation"||m.length===1&&Me(m[0])||this.state.croppingElementId)return!1;this.setState({isResizing:g&&g!=="rotation",isRotating:g==="rotation",activeEmbeddable:null});let v=o.lastCoords,[y,w]=xn(v.x-o.resize.offset.x,v.y-o.resize.offset.y,f[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),E=new Map;if(U.forEach(S=>{Mi(this.scene.getNonDeletedElements(),S.id).forEach(k=>{E.set(S.id+k.id,{x:k.x-S.x,y:k.y-S.y})})}),!this.state.selectedElementsAreBeingDragged){let[S,k]=xn(v.x,v.y,f[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),I={x:S-o.originInGrid.x,y:k-o.originInGrid.y},T=[...o.originalElements.values()];this.maybeCacheReferenceSnapPoints(f,m);let{snapOffset:M,snapLines:j}=wy(m,tt(T,this.state),this,f,I,g);y+=M.x,w+=M.y,this.setState({snapLines:j})}if(QY(o.originalElements,g,m,this.scene.getElementsMapIncludingDeleted(),this.scene,Fu(f),F2(f),m.some(S=>vt(S))?!du(f):du(f),y,w,o.resize.center.x,o.resize.center.y)){let S=H2(m,this.scene.getNonDeletedElementsMap(),this.state.zoom),k=new Set;return U.forEach(I=>{cp(this.scene.getNonDeletedElements(),I,this.state,this.scene.getNonDeletedElementsMap()).forEach(T=>k.add(T))}),this.setState({elementsToHighlight:[...k],suggestedBindings:S}),!0}return!1}),F(this,"getContextMenuItems",o=>{let f=[];return f.push(Ex,wx),o==="canvas"?this.state.viewModeEnabled?[...f,kx,W6,aw,X6]:[yx,Mn,Ex,wx,Sx,Mn,Aee,qte,Mn,kx,Ote,W6,aw,X6]:(f.push(Sx),this.state.viewModeEnabled?[gp,...f]:[Mn,xx,gp,yx,Mn,vie,yie,xie,Mn,hre,Mn,...f,Mn,Ete,Ste,Mn,Cte,lle,$te,zte,Hte,Mte,Mn,Ate,Mn,Mee,Iee,_ee,Tee,Mn,Dte,Pte,Mn,fre,Mn,v_,P_,Mn,Dee,Kte,Mn,FI])}),F(this,"handleWheel",tn(o=>{if(!(o.target instanceof HTMLCanvasElement||o.target instanceof HTMLTextAreaElement||o.target instanceof HTMLIFrameElement)){o[B.CTRL_OR_CMD]&&o.preventDefault();return}if(o.preventDefault(),bu)return;let{deltaX:f,deltaY:m}=o;if(o.metaKey||o.ctrlKey){let U=Math.sign(m),g=w0*100,v=Math.abs(m),y=m;v>g&&(y=g*U);let w=this.state.zoom.value-y/100;w+=Math.log10(Math.max(1,this.state.zoom.value))*-U*Math.min(1,v/20),this.translateCanvas(E=>({...so({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:nl(w)},E),shouldCacheIgnoreZoom:!0})),this.resetShouldCacheIgnoreZoomDebounced();return}if(o.shiftKey){this.translateCanvas(({zoom:U,scrollX:g})=>({scrollX:g-(m||f)/U.value}));return}this.translateCanvas(({zoom:U,scrollX:g,scrollY:v})=>({scrollX:g-f/U.value,scrollY:v-m/U.value}))})),F(this,"savePointer",(o,f,m)=>{var y,w;if(!o||!f)return;let{x:U,y:g}=jt({clientX:o,clientY:f},this.state),v={x:U,y:g,tool:this.state.activeTool.type==="laser"?"laser":"pointer"};(w=(y=this.props).onPointerUpdate)==null||w.call(y,{pointer:v,button:m,pointersMap:gt.pointers})}),F(this,"resetShouldCacheIgnoreZoomDebounced",Yc(()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})},300)),F(this,"updateDOMRect",o=>{var f;if((f=this.excalidrawContainerRef)!=null&&f.current){let m=this.excalidrawContainerRef.current,{width:U,height:g,left:v,top:y}=m.getBoundingClientRect(),{width:w,height:E,offsetTop:S,offsetLeft:k}=this.state;if(U===w&&g===E&&v===k&&y===S){o&&o();return}this.setState({width:U,height:g,offsetLeft:v,offsetTop:y},()=>{o&&o()})}}),F(this,"refresh",()=>{this.setState({...this.getCanvasOffsets()})});let n=wi(),{excalidrawAPI:r,viewModeEnabled:a=!1,zenModeEnabled:i=!1,gridModeEnabled:l=!1,objectsSnapModeEnabled:s=!1,theme:d=n.theme,name:u=`${L("labels.untitled")}-${Rv()}`}=t;if(this.state={...n,theme:d,isLoading:!0,...this.getCanvasOffsets(),viewModeEnabled:a,zenModeEnabled:i,objectsSnapModeEnabled:s,gridModeEnabled:l??n.gridModeEnabled,name:u,width:window.innerWidth,height:window.innerHeight},this.id=o5(),this.library=new lne(this),this.actionManager=new gre(this.syncActionResult,()=>this.state,()=>this.scene.getElementsIncludingDeleted(),this),this.scene=new fl,this.canvas=document.createElement("canvas"),this.rc=ws.canvas(this.canvas),this.renderer=new uw(this.scene),this.visibleElements=[],this.store=new _G,this.history=new Dx,r){let o={updateScene:this.updateScene,updateLibrary:this.library.updateLibrary,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,getName:this.getName,registerAction:f=>{this.actionManager.registerAction(f)},refresh:this.refresh,setToast:this.setToast,id:this.id,setActiveTool:this.setActiveTool,setCursor:this.setCursor,resetCursor:this.resetCursor,updateFrameRendering:this.updateFrameRendering,toggleSidebar:this.toggleSidebar,onChange:f=>this.onChangeEmitter.on(f),onPointerDown:f=>this.onPointerDownEmitter.on(f),onPointerUp:f=>this.onPointerUpEmitter.on(f),onScrollChange:f=>this.onScrollChangeEmitter.on(f),onUserFollow:f=>this.onUserFollowEmitter.on(f)};typeof r=="function"?r(o):console.error("excalidrawAPI should be a function!")}this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.fonts=new al(this.scene),this.history=new Dx,this.actionManager.registerAll(u6),this.actionManager.registerAction(mre(this.history,this.store)),this.actionManager.registerAction(Ure(this.history,this.store))}onWindowMessage(t){if(t.origin!=="https://player.vimeo.com"&&t.origin!=="https://www.youtube.com")return;let n=null;try{n=JSON.parse(t.data)}catch{}if(n)switch(t.origin){case"https://player.vimeo.com":if(n.method==="paused"){let r=null,a=document.body.querySelectorAll("iframe.excalidraw__embeddable");if(!a)break;for(let i of a)i.contentWindow===t.source&&(r=i.contentWindow);r==null||r.postMessage(JSON.stringify({method:n.value?"play":"pause",value:!0}),"*")}break;case"https://www.youtube.com":if(n.event==="infoDelivery"&&n.info&&n.id&&typeof n.info.playerState=="number"){let r=n.id,a=n.info.playerState;Object.values(v1).includes(a)&&Rg.set(r,a)}break}}cacheEmbeddableRef(t,n){n&&this.iFrameRefs.set(t.id,n)}getHTMLIFrameElement(t){return this.iFrameRefs.get(t.id)}handleEmbeddableCenterClick(t){var r,a,i,l;if(((r=this.state.activeEmbeddable)==null?void 0:r.element)===t&&((a=this.state.activeEmbeddable)==null?void 0:a.state)==="active"||(setTimeout(()=>{this.setState({activeEmbeddable:{element:t,state:"active"},selectedElementIds:{[t.id]:!0},newElement:null,selectionElement:null})},100),es(t)))return;let n=this.getHTMLIFrameElement(t);if(n!=null&&n.contentWindow){if(n.src.includes("youtube")){let s=Rg.get(t.id);switch(s||(Rg.set(t.id,v1.UNSTARTED),n.contentWindow.postMessage(JSON.stringify({event:"listening",id:t.id}),"*")),s){case v1.PLAYING:case v1.BUFFERING:(i=n.contentWindow)==null||i.postMessage(JSON.stringify({event:"command",func:"pauseVideo",args:""}),"*");break;default:(l=n.contentWindow)==null||l.postMessage(JSON.stringify({event:"command",func:"playVideo",args:""}),"*")}}n.src.includes("player.vimeo.com")&&n.contentWindow.postMessage(JSON.stringify({method:"paused"}),"*")}}isIframeLikeElementCenter(t,n,r,a){var i,l;return t&&!n.altKey&&!n.shiftKey&&!n.metaKey&&!n.ctrlKey&&(((i=this.state.activeEmbeddable)==null?void 0:i.element)!==t||((l=this.state.activeEmbeddable)==null?void 0:l.state)==="hover"||!this.state.activeEmbeddable)&&r>=t.x+t.width/3&&r<=t.x+2*t.width/3&&a>=t.y+t.height/3&&a<=t.y+2*t.height/3}renderEmbeddables(){let t=this.state.zoom.value,n=this.state.width,r=this.state.height,a=this.scene.getNonDeletedElements().filter(i=>Cr(i)&&this.embedsValidationStatus.get(i.id)===!0||es(i));return p.jsx(p.Fragment,{children:a.map(i=>{var U,g,v,y,w,E,S,k,I;let{x:l,y:s}=oa({sceneX:i.x,sceneY:i.y},this.state),d=e0(i,n,r,this.state,this.scene.getNonDeletedElementsMap()),u=this.initializedEmbeds.has(i.id);if(d&&!u&&this.initializedEmbeds.add(i.id),!(d||u))return null;let o;if(es(i)){o=null;let T=(((U=i.customData)==null?void 0:U.generationData)??this.magicGenerations.get(i.id))||{status:"error",message:"No generation data",code:"ERR_NO_GENERATION_DATA"};if(T.status==="done"){let M=T.html;o={intrinsicSize:{w:i.width,h:i.height},type:"document",srcdoc:()=>M}}else if(T.status==="pending")o={intrinsicSize:{w:i.width,h:i.height},type:"document",srcdoc:()=>Bu(`
|
|
161
|
+
<style>
|
|
162
|
+
html, body {
|
|
163
|
+
width: 100%;
|
|
164
|
+
height: 100%;
|
|
165
|
+
color: ${this.state.theme===ot.DARK?"white":"black"};
|
|
166
|
+
}
|
|
167
|
+
body {
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
flex-direction: column;
|
|
172
|
+
gap: 1rem;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.Spinner {
|
|
176
|
+
display: flex;
|
|
177
|
+
align-items: center;
|
|
178
|
+
justify-content: center;
|
|
179
|
+
margin-left: auto;
|
|
180
|
+
margin-right: auto;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.Spinner svg {
|
|
184
|
+
animation: rotate 1.6s linear infinite;
|
|
185
|
+
transform-origin: center center;
|
|
186
|
+
width: 40px;
|
|
187
|
+
height: 40px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.Spinner circle {
|
|
191
|
+
stroke: currentColor;
|
|
192
|
+
animation: dash 1.6s linear 0s infinite;
|
|
193
|
+
stroke-linecap: round;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@keyframes rotate {
|
|
197
|
+
100% {
|
|
198
|
+
transform: rotate(360deg);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@keyframes dash {
|
|
203
|
+
0% {
|
|
204
|
+
stroke-dasharray: 1, 300;
|
|
205
|
+
stroke-dashoffset: 0;
|
|
206
|
+
}
|
|
207
|
+
50% {
|
|
208
|
+
stroke-dasharray: 150, 300;
|
|
209
|
+
stroke-dashoffset: -200;
|
|
210
|
+
}
|
|
211
|
+
100% {
|
|
212
|
+
stroke-dasharray: 1, 300;
|
|
213
|
+
stroke-dashoffset: -280;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
</style>
|
|
217
|
+
<div class="Spinner">
|
|
218
|
+
<svg
|
|
219
|
+
viewBox="0 0 100 100"
|
|
220
|
+
>
|
|
221
|
+
<circle
|
|
222
|
+
cx="50"
|
|
223
|
+
cy="50"
|
|
224
|
+
r="46"
|
|
225
|
+
stroke-width="8"
|
|
226
|
+
fill="none"
|
|
227
|
+
stroke-miter-limit="10"
|
|
228
|
+
/>
|
|
229
|
+
</svg>
|
|
230
|
+
</div>
|
|
231
|
+
<div>Generating...</div>
|
|
232
|
+
`)};else{let M;T.code==="ERR_GENERATION_INTERRUPTED"?M="Generation was interrupted...":M=T.message||"Generation failed",o={intrinsicSize:{w:i.width,h:i.height},type:"document",srcdoc:()=>Bu(`
|
|
233
|
+
<style>
|
|
234
|
+
html, body {
|
|
235
|
+
height: 100%;
|
|
236
|
+
}
|
|
237
|
+
body {
|
|
238
|
+
display: flex;
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
align-items: center;
|
|
241
|
+
justify-content: center;
|
|
242
|
+
color: ${at.red[3]};
|
|
243
|
+
}
|
|
244
|
+
h1, h3 {
|
|
245
|
+
margin-top: 0;
|
|
246
|
+
margin-bottom: 0.5rem;
|
|
247
|
+
}
|
|
248
|
+
</style>
|
|
249
|
+
<h1>Error!</h1>
|
|
250
|
+
<h3>${M}</h3>
|
|
251
|
+
`)}}}else o=Rc(hk(i.link||""));let f=((g=this.state.activeEmbeddable)==null?void 0:g.element)===i&&((v=this.state.activeEmbeddable)==null?void 0:v.state)==="active",m=((y=this.state.activeEmbeddable)==null?void 0:y.element)===i&&((w=this.state.activeEmbeddable)==null?void 0:w.state)==="hover";return p.jsx("div",{className:Ae("excalidraw__embeddable-container",{"is-hovered":m}),style:{transform:d?`translate(${l-this.state.offsetLeft}px, ${s-this.state.offsetTop}px) scale(${t})`:"none",display:d?"block":"none",opacity:NS(i,jr(i,this.scene.getNonDeletedElementsMap()),this.elementsPendingErasure,null,((E=this.state.openDialog)==null?void 0:E.name)==="elementLinkSelector"?AE:1),"--embeddable-radius":`${Ba(Math.min(i.width,i.height),i)}px`},children:p.jsxs("div",{className:"excalidraw__embeddable-container__inner",style:{width:d?`${i.width}px`:0,height:d?`${i.height}px`:0,transform:d?`rotate(${i.angle}rad)`:"none",pointerEvents:f?hc.enabled:hc.disabled},children:[m&&p.jsx("div",{className:"excalidraw__embeddable-hint",children:L("buttons.embeddableInteractionButton")}),p.jsx("div",{className:"excalidraw__embeddable__outer",style:{padding:`${i.strokeWidth}px`},children:(Cr(i)?(k=(S=this.props).renderEmbeddable)==null?void 0:k.call(S,i,this.state):null)??p.jsx("iframe",{ref:T=>this.cacheEmbeddableRef(i,T),className:"excalidraw__embeddable",srcDoc:(o==null?void 0:o.type)==="document"?o.srcdoc(this.state.theme):void 0,src:(o==null?void 0:o.type)!=="document"?(o==null?void 0:o.link)??"":void 0,scrolling:"no",referrerPolicy:"no-referrer-when-downgrade",title:"Excalidraw Embedded Content",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sandbox:`${(I=o==null?void 0:o.sandbox)!=null&&I.allowSameOrigin?"allow-same-origin":""} allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-downloads`})})]})},i.id)})})}toggleOverscrollBehavior(t){document.documentElement.style.overscrollBehaviorX=t.type==="pointerenter"?"none":"auto"}render(){var o,f,m,U,g,v,y,w;let t=this.scene.getSelectedElements(this.state),{renderTopRightUI:n,renderCustomStats:r}=this.props,a=this.scene.getSceneNonce(),{elementsMap:i,visibleElements:l}=this.renderer.getRenderableElements({sceneNonce:a,zoom:this.state.zoom,offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,height:this.state.height,width:this.state.width,editingTextElement:this.state.editingTextElement,newElementId:(o=this.state.newElement)==null?void 0:o.id,pendingImageElementId:this.state.pendingImageElementId});this.visibleElements=l;let s=this.scene.getNonDeletedElementsMap(),d="setPointerCapture"in HTMLElement.prototype?!1:this.state.selectionElement||this.state.newElement||this.state.selectedElementsAreBeingDragged||this.state.resizingElement||this.state.activeTool.type==="laser"&&this.state.cursorButton==="down",u=t[0];return p.jsx("div",{className:Ae("excalidraw excalidraw-container",{"excalidraw--view-mode":this.state.viewModeEnabled||((f=this.state.openDialog)==null?void 0:f.name)==="elementLinkSelector","excalidraw--mobile":this.device.editor.isMobile}),style:{"--ui-pointerEvents":d?hc.disabled:hc.enabled,"--right-sidebar-width":"302px"},ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,onPointerEnter:this.toggleOverscrollBehavior,onPointerLeave:this.toggleOverscrollBehavior,children:p.jsx($T.Provider,{value:this,children:p.jsx(zT.Provider,{value:this.props,children:p.jsx(ab.Provider,{value:this.excalidrawContainerValue,children:p.jsx(rb.Provider,{value:this.device,children:p.jsx(sb.Provider,{value:this.setAppState,children:p.jsx(lb.Provider,{value:this.state,children:p.jsxs(ib.Provider,{value:this.scene.getNonDeletedElements(),children:[p.jsxs(ob.Provider,{value:this.actionManager,children:[p.jsx(Uie,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getNonDeletedElements(),onLockToggle:this.toggleLock,onPenModeToggle:this.togglePenMode,onHandToolToggle:this.onHandToolToggle,langCode:Sf().code,renderTopRightUI:n,renderCustomStats:r,showExitZenModeBtn:typeof((m=this.props)==null?void 0:m.zenModeEnabled)>"u"&&this.state.zenModeEnabled,UIOptions:this.props.UIOptions,onExportImage:this.onExportImage,renderWelcomeScreen:!this.state.isLoading&&this.state.showWelcomeScreen&&this.state.activeTool.type==="selection"&&!this.state.zenModeEnabled&&!this.scene.getElementsIncludingDeleted().length,app:this,isCollaborating:this.props.isCollaborating,generateLinkForSelection:this.props.generateLinkForSelection,children:this.props.children}),p.jsx("div",{className:"excalidraw-textEditorContainer"}),p.jsx("div",{className:"excalidraw-contextMenuContainer"}),p.jsx("div",{className:"excalidraw-eye-dropper-container"}),p.jsx(Kie,{trails:[this.laserTrails,this.eraserTrail]}),t.length===1&&((U=this.state.openDialog)==null?void 0:U.name)!=="elementLinkSelector"&&this.state.showHyperlinkPopup&&p.jsx(Vte,{element:u,elementsMap:s,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen,setToast:this.setToast,updateEmbedValidationStatus:this.updateEmbedValidationStatus},u.id),this.props.aiEnabled!==!1&&t.length===1&&tp(u)&&p.jsx(fw,{element:u,elementsMap:i,children:p.jsx(Ig,{title:L("labels.convertToCode"),icon:fS,checked:!1,onChange:()=>this.onMagicFrameGenerate(u,"button")})}),t.length===1&&es(u)&&((v=(g=u.customData)==null?void 0:g.generationData)==null?void 0:v.status)==="done"&&p.jsxs(fw,{element:u,elementsMap:i,children:[p.jsx(Ig,{title:L("labels.copySource"),icon:I5,checked:!1,onChange:()=>this.onIframeSrcCopy(u)}),p.jsx(Ig,{title:"Enter fullscreen",icon:bz,checked:!1,onChange:()=>{let E=this.getHTMLIFrameElement(u);if(E)try{E.requestFullscreen(),this.setState({activeEmbeddable:{element:u,state:"active"},selectedElementIds:{[u.id]:!0},newElement:null,selectionElement:null})}catch(S){console.warn(S),this.setState({errorMessage:"Couldn't enter fullscreen"})}}})]}),this.state.toast!==null&&p.jsx(bie,{message:this.state.toast.message,onClose:()=>this.setToast(null),duration:this.state.toast.duration,closable:this.state.toast.closable}),this.state.contextMenu&&p.jsx(vre,{items:this.state.contextMenu.items,top:this.state.contextMenu.top,left:this.state.contextMenu.left,actionManager:this.actionManager,onClose:E=>{this.setState({contextMenu:null},()=>{this.focusContainer(),E==null||E()})}}),p.jsx(Zie,{canvas:this.canvas,rc:this.rc,elementsMap:i,allElementsMap:s,visibleElements:l,sceneNonce:a,selectionNonce:(y=this.state.selectionElement)==null?void 0:y.versionNonce,scale:window.devicePixelRatio,appState:this.state,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:gf(this),canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:this.flowChartCreator.pendingNodes}}),this.state.newElement&&p.jsx(ule,{appState:this.state,scale:window.devicePixelRatio,rc:this.rc,elementsMap:i,allElementsMap:s,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:!1,canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:null}}),p.jsx(Vie,{containerRef:this.excalidrawContainerRef,canvas:this.interactiveCanvas,elementsMap:i,visibleElements:l,allElementsMap:s,selectedElements:t,sceneNonce:a,selectionNonce:(w=this.state.selectionElement)==null?void 0:w.versionNonce,scale:window.devicePixelRatio,appState:this.state,device:this.device,renderInteractiveSceneCallback:this.renderInteractiveSceneCallback,handleCanvasRef:this.handleInteractiveCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick}),this.state.userToFollow&&p.jsx(tle,{width:this.state.width,height:this.state.height,userToFollow:this.state.userToFollow,onDisconnect:this.maybeUnfollowRemoteUser}),this.renderFrameNames()]}),this.renderEmbeddables()]})})})})})})})})}setPlugins(t){Object.assign(this.plugins,t)}async onMagicFrameGenerate(t,n){var l;let r=(l=this.plugins.diagramToCode)==null?void 0:l.generate;if(!r){this.setState({errorMessage:"No diagram to code plugin found"});return}let a=u8(this.scene.getNonDeletedElements(),t).filter(s=>!tp(s));if(!a.length){n==="button"?(this.setState({errorMessage:"Cannot generate from an empty frame"}),Nt("ai","generate (no-children)","d2c")):this.setActiveTool({type:"magicframe"});return}let i=this.insertIframeElement({sceneX:t.x+t.width+30,sceneY:t.y,width:t.width,height:t.height});if(i){this.updateMagicGeneration({frameElement:i,data:{status:"pending"}}),this.setState({selectedElementIds:{[i.id]:!0}}),Nt("ai","generate (start)","d2c");try{let{html:s}=await r({frame:t,children:a});if(Nt("ai","generate (success)","d2c"),!s.trim()){this.updateMagicGeneration({frameElement:i,data:{status:"error",code:"ERR_OAI",message:"Nothing genereated :("}});return}let d=s.includes("<!DOCTYPE html>")&&s.includes("</html>")?s.slice(s.indexOf("<!DOCTYPE html>"),s.indexOf("</html>")+7):s;this.updateMagicGeneration({frameElement:i,data:{status:"done",html:d}})}catch(s){Nt("ai","generate (failed)","d2c"),this.updateMagicGeneration({frameElement:i,data:{status:"error",code:"ERR_OAI",message:s.message||"Unknown error during generation"}})}}}onIframeSrcCopy(t){var n,r;((r=(n=t.customData)==null?void 0:n.generationData)==null?void 0:r.status)==="done"&&(Wf(t.customData.generationData.html),this.setToast({message:"copied to clipboard",closable:!1,duration:1500}))}clearImageShapeCache(t){let n=t??this.files;this.scene.getNonDeletedElements().forEach(r=>{la(r)&&n[r.fileId]&&(this.imageCache.delete(r.fileId),Qt.delete(r))})}async componentDidMount(){var t;this.unmounted=!1,this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,(et.MODE===Tr.TEST||et.DEV)&&(this.setState.bind(this),Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:(...n)=>this.setState(...n)},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history},store:{configurable:!0,value:this.store},fonts:{configurable:!0,value:this.fonts}})),this.store.onStoreIncrementEmitter.on(n=>{this.history.record(n.elementsChange,n.appStateChange)}),this.scene.onUpdate(this.triggerRender),this.addEventListeners(),this.props.autoFocus&&this.excalidrawContainerRef.current&&this.focusContainer(),ll()||(this.refreshViewportBreakpoints(),this.refreshEditorBreakpoints()),Gg&&this.excalidrawContainerRef.current&&(this.resizeObserver=new ResizeObserver(()=>{this.refreshEditorBreakpoints(),this.updateDOMRect()}),(t=this.resizeObserver)==null||t.observe(this.excalidrawContainerRef.current)),new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene),TN()&&!OO()&&this.setState({errorMessage:p.jsx(Eie,{})})}componentWillUnmount(){var t,n;(t=window.launchQueue)==null||t.setConsumer(()=>{}),this.renderer.destroy(),this.scene.destroy(),this.scene=new fl,this.fonts=new al(this.scene),this.renderer=new uw(this.scene),this.files={},this.imageCache.clear(),(n=this.resizeObserver)==null||n.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.library.destroy(),this.laserTrails.stop(),this.eraserTrail.stop(),this.onChangeEmitter.clear(),this.store.onStoreIncrementEmitter.clear(),Qt.destroy(),Yi.destroy(),clearTimeout(Yl),En.clearCache(),fr.clearCache(),Yl=0,document.documentElement.style.overscrollBehaviorX=""}removeEventListeners(){this.onRemoveEventListenersEmitter.trigger()}addEventListeners(){this.removeEventListeners(),this.props.handleKeyboardGlobally&&this.onRemoveEventListenersEmitter.once(Yt(document,"keydown",this.onKeyDown,!1)),this.onRemoveEventListenersEmitter.once(Yt(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),Yt(window,"message",this.onWindowMessage,!1),Yt(document,"pointerup",this.removePointer,{passive:!1}),Yt(document,"copy",this.onCopy,{passive:!1}),Yt(document,"keyup",this.onKeyUp,{passive:!0}),Yt(document,"pointermove",this.updateCurrentCursorPosition,{passive:!1}),Yt(document.fonts,"loadingdone",t=>{let n=t.fontfaces;this.fonts.onLoaded(n)},{passive:!1}),Yt(document,"gesturestart",this.onGestureStart,!1),Yt(document,"gesturechange",this.onGestureChange,!1),Yt(document,"gestureend",this.onGestureEnd,!1),Yt(window,"focus",()=>{this.maybeCleanupAfterMissingPointerUp(null),this.triggerRender(!0)},{passive:!1})),!this.state.viewModeEnabled&&(this.onRemoveEventListenersEmitter.once(Yt(document,"fullscreenchange",this.onFullscreenChange,{passive:!1}),Yt(document,"paste",this.pasteFromClipboard,{passive:!1}),Yt(document,"cut",this.onCut,{passive:!1}),Yt(window,"resize",this.onResize,!1),Yt(window,"unload",this.onUnload,!1),Yt(window,"blur",this.onBlur,!1),Yt(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),Yt(this.excalidrawContainerRef.current,"dragover",this.disableEvent,!1),Yt(this.excalidrawContainerRef.current,"drop",this.disableEvent,!1)),this.props.detectScroll&&this.onRemoveEventListenersEmitter.once(Yt(SO(this.excalidrawContainerRef.current),"scroll",this.onScroll,{passive:!1})))}componentDidUpdate(t,n){var s,d,u,o,f,m,U,g,v,y;this.updateEmbeddables();let r=this.scene.getElementsIncludingDeleted(),a=this.scene.getElementsMapIncludingDeleted(),i=this.scene.getNonDeletedElementsMap();!this.state.showWelcomeScreen&&!r.length&&this.setState({showWelcomeScreen:!0}),t.UIOptions.dockedSidebarBreakpoint!==this.props.UIOptions.dockedSidebarBreakpoint&&this.refreshEditorBreakpoints(),n.userToFollow&&!this.state.collaborators.has(n.userToFollow.socketId)&&this.maybeUnfollowRemoteUser(),(n.zoom.value!==this.state.zoom.value||n.scrollX!==this.state.scrollX||n.scrollY!==this.state.scrollY)&&((d=(s=this.props)==null?void 0:s.onScrollChange)==null||d.call(s,this.state.scrollX,this.state.scrollY,this.state.zoom),this.onScrollChangeEmitter.trigger(this.state.scrollX,this.state.scrollY,this.state.zoom)),n.userToFollow!==this.state.userToFollow&&(n.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:n.userToFollow,action:"UNFOLLOW"}),this.state.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:this.state.userToFollow,action:"FOLLOW"})),Object.keys(this.state.selectedElementIds).length&&ci(this.state)&&this.setState({activeTool:gn(this.state,{type:"selection"})}),this.state.activeTool.type==="eraser"&&n.theme!==this.state.theme&&Uk(this.interactiveCanvas,this.state.theme),n.activeTool.type==="selection"&&this.state.activeTool.type!=="selection"&&this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),t.langCode!==this.props.langCode&&this.updateLanguage(),ci(n)&&!ci(this.state)&&this.eraserTrail.endPath(),t.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),n.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),(((u=n.openDialog)==null?void 0:u.name)==="elementLinkSelector"||((o=this.state.openDialog)==null?void 0:o.name)==="elementLinkSelector")&&((f=n.openDialog)==null?void 0:f.name)!==((m=this.state.openDialog)==null?void 0:m.name)&&(this.deselectElements(),this.setState({hoveredElementIds:{}})),t.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),t.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),(U=this.excalidrawContainerRef.current)==null||U.classList.toggle("theme--dark",this.state.theme===ot.DARK),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout(()=>{this.state.editingLinearElement&&this.actionManager.executeAction(Ia)}),(g=this.state.editingTextElement)!=null&&g.isDeleted&&this.setState({editingTextElement:null}),this.state.selectedLinearElement&&!this.state.selectedElementIds[this.state.selectedLinearElement.elementId]&&this.setState({selectedLinearElement:null});let{multiElement:l}=n;n.activeTool!==this.state.activeTool&&l!=null&&io(this.state)&&mi(l,!1)&&c6(l,this.state,Pa(Ce.getPointAtIndexGlobalCoordinates(l,-1,i)),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.store.commit(a,this.state),this.state.isLoading||((y=(v=this.props).onChange)==null||y.call(v,r,this.state,this.files),this.onChangeEmitter.trigger(r,this.state,this.files))}static resetTapTwice(){gu=!1}async addElementsFromMixedContentPaste(t,{isPlainPaste:n,sceneX:r,sceneY:a}){if(!n&&t.some(i=>i.type==="imageUrl")&&this.isToolSupported("image")){let i=t.filter(f=>f.type==="imageUrl").map(f=>f.value),l=await Promise.all(i.map(async f=>{try{return{file:await bZ(f)}}catch(m){let U=m.message;return m.cause==="FETCH_ERROR"?U=L("errors.failedToFetchImage"):m.cause==="UNSUPPORTED"&&(U=L("errors.unsupportedFileType")),{errorMessage:U}}})),s=a,d=!1,u={};for(let f of l)if(f.file){let m=this.createImageElement({sceneX:r,sceneY:s}),U=await this.insertImageElement(m,f.file);U&&(d||(d=!0,s-=U.height/2),pe(U,{y:s},!1),s=m.y+m.height+25,u[m.id]=!0)}this.setState({selectedElementIds:bt(u,this.state)});let o=l.find(f=>!!f.errorMessage);o&&o.errorMessage&&this.setState({errorMessage:o.errorMessage})}else{let i=t.filter(l=>l.type==="text");i.length&&this.addTextFromPaste(i.map(l=>l.value).join(`
|
|
252
|
+
|
|
253
|
+
`),n)}}addTextFromPaste(t,n=!1){let{x:r,y:a}=jt({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),i={x:r,y:a,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roundness:null,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:t,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:jf,verticalAlign:Mp,locked:!1},l=_t({fontSize:i.fontSize,fontFamily:i.fontFamily}),s=Co(i.fontFamily),[d,,u]=GS(this.state),o=Math.max(Math.min((u-d)*.5,800),200),f=10,m=a,U=n?[t]:t.split(`
|
|
254
|
+
`),g=U.reduce((v,y,w)=>{var S;let E=Kc(y).trim();if(E.length){let k=this.getTopLayerFrameAtSceneCoords({x:r,y:m}),I=sr(E,l,s),T=I.width>o,M=T?Po(E,l,o):E;I=T?sr(M,l,s):I;let j=r-I.width/2,D=m-I.height/2,P=Wr({...i,x:j,y:D,text:M,originalText:E,lineHeight:s,autoResize:!T,frameId:k?k.id:null});v.push(P),m+=P.height+f}else(S=U[w-1])!=null&&S.trim()&&(m+=Nf(i.fontSize,s)+f);return v},[]);g.length!==0&&(this.scene.insertElements(g),this.setState({selectedElementIds:bt(Object.fromEntries(g.map(v=>[v.id,!0])),this.state)}),!n&&g.length>1&&pw===!1&&!this.device.editor.isMobile&&(this.setToast({message:L("toast.pasteAsSingleElement",{shortcut:he("CtrlOrCmd+Shift+V")}),duration:5e3}),pw=!0),this.store.shouldCaptureIncrement())}handleTextWysiwyg(t,{isExistingElement:n=!1}){let r=this.scene.getElementsMapIncludingDeleted(),a=(i,l)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map(s=>s.id===t.id&&ke(s)?Ke(s,{originalText:i,isDeleted:l??s.isDeleted,...bk(s,Bn(s,r),r,i)}):s)])};ile({id:t.id,canvas:this.canvas,getViewportCoords:(i,l)=>{let{x:s,y:d}=oa({sceneX:i,sceneY:l},this.state);return[s-this.state.offsetLeft,d-this.state.offsetTop]},onChange:tn(i=>{a(i,!1),x6(t)&&Ar(t,this.scene.getNonDeletedElementsMap())}),onSubmit:tn(({viaKeyboard:i,nextOriginalText:l})=>{let s=!l.trim();if(a(l,s),!s&&i){let d=t.containerId?t.containerId:t.id;$n.flushSync(()=>{this.setState(u=>({selectedElementIds:bt({...u.selectedElementIds,[d]:!0},u)}))})}s&&ek(this.scene.getNonDeletedElements(),[t]),(!s||n)&&this.store.shouldCaptureIncrement(),$n.flushSync(()=>{this.setState({newElement:null,editingTextElement:null})}),this.state.activeTool.locked&&oi(this.interactiveCanvas,this.state),this.focusContainer()}),element:t,excalidrawContainer:this.excalidrawContainerRef.current,app:this,autoSelect:!this.device.isTouchScreen}),this.deselectElements(),a(t.originalText,!1)}deselectElements(){this.setState({selectedElementIds:bt({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}getTextElementAtPosition(t,n){let r=this.getElementAtPosition(t,n,{includeBoundTextElement:!0});return r&&ke(r)&&!r.isDeleted?r:null}getElementAtPosition(t,n,r){let a=this.getElementsAtPosition(t,n,r==null?void 0:r.includeBoundTextElement,r==null?void 0:r.includeLockedElements);if(a.length>1){if(r!=null&&r.preferSelected){for(let l=a.length-1;l>-1;l--)if(this.state.selectedElementIds[a[l].id])return a[l]}let i=a[a.length-1];return Sc({x:t,y:n,element:i,shape:qi(i,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()/2,frameNameBound:He(i)?this.frameNameBoundsCache.get(i):null})?i:a[a.length-2]}return a.length===1?a[0]:null}getElementsAtPosition(t,n,r=!1,a=!1){let i=[],l=this.scene.getNonDeletedElementsMap();return(r&&a?this.scene.getNonDeletedElements():this.scene.getNonDeletedElements().filter(s=>(a||!s.locked)&&(r||!(ke(s)&&s.containerId)))).filter(s=>this.hitElement(t,n,s)).filter(s=>{let d=jr(s,l);return d&&this.state.frameRendering.enabled&&this.state.frameRendering.clip?qy({x:t,y:n},d,l):!0}).filter(s=>es(s)?(i.push(s),!1):!0).concat(i)}getElementHitThreshold(){return PN/this.state.zoom.value}hitElement(t,n,r,a=!0){if(a&&this.state.selectedElementIds[r.id]&&cC([r],this.state)){let i=yX(r,this.scene.getNonDeletedElementsMap(),vt(r)?0:this.getElementHitThreshold());if(Fp(A(t,n),i))return!0}return IS(t,n,TS(r,this.scene.getNonDeletedElementsMap()))?!0:Sc({x:t,y:n,element:r,shape:qi(r,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:He(r)?this.frameNameBoundsCache.get(r):null})}getTextBindableContainerAtPosition(t,n){let r=this.scene.getNonDeletedElements(),a=this.scene.getSelectedElements(this.state);if(a.length===1)return uo(a[0],!1)?a[0]:null;let i=null;for(let l=r.length-1;l>=0;--l){if(r[l].isDeleted)continue;let[s,d,u,o]=Ze(r[l],this.scene.getNonDeletedElementsMap());if(nt(r[l])&&Sc({x:t,y:n,element:r[l],shape:qi(r[l],this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()})){i=r[l];break}else if(s<t&&t<u&&d<n&&n<o){i=r[l];break}}return uo(i,!1)?i:null}handleHoverSelectedLinearElement(t,n,r){let a=this.scene.getNonDeletedElementsMap(),i=Ce.getElement(t.elementId,a);if(i)if(this.state.selectedLinearElement){let l=-1,s=null;Sc({x:n,y:r,element:i,shape:qi(i,this.scene.getNonDeletedElementsMap())})?(l=Ce.getPointIndexUnderCursor(i,a,this.state.zoom,n,r),s=Ce.getSegmentMidpointHitCoords(t,{x:n,y:r},this.state,this.scene.getNonDeletedElementsMap()),(Me(i)?l===0||l===i.points.length-1:l>=0)||s?It(this.interactiveCanvas,kt.POINTER):this.hitElement(n,r,i)&&It(this.interactiveCanvas,kt.MOVE)):this.hitElement(n,r,i)&&(!Me(i)||!(i.startBinding||i.endBinding))&&It(this.interactiveCanvas,kt.MOVE),this.state.selectedLinearElement.hoverPointIndex!==l&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,hoverPointIndex:l}}),Ce.arePointsEqual(this.state.selectedLinearElement.segmentMidPointHoveredCoords,s)||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:s}})}else It(this.interactiveCanvas,kt.AUTO)}updateGestureOnPointerDown(t){gt.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),gt.pointers.size===2&&(gt.lastCenter=Px(gt.pointers),gt.initialScale=this.state.zoom.value,gt.initialDistance=Nx(Array.from(gt.pointers.values())))}initialPointerDownState(t){let n=jt(t,this.state),r=this.scene.getSelectedElements(this.state),[a,i,l,s]=xt(r),d=r.findIndex(Me)===0;return{origin:n,withCmdOrCtrl:t[B.CTRL_OR_CMD],originInGrid:Pa(xn(n.x,n.y,t[B.CTRL_OR_CMD]||d?null:this.getEffectiveGridSize())),scrollbars:Fx(Ag,t.clientX-this.state.offsetLeft,t.clientY-this.state.offsetTop),lastCoords:{...n},originalElements:this.scene.getNonDeletedElements().reduce((u,o)=>(u.set(o.id,No(o)),u),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(l+a)/2,y:(s+i)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(n,r)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(t,n){if(!(n.scrollbars.isOverEither&&!this.state.multiElement))return!1;Tg=!0,n.lastCoords.x=t.clientX,n.lastCoords.y=t.clientY;let r=kg(i=>{i.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(i,n)}),a=tn(()=>{Vs=null,Tg=!1,oi(this.interactiveCanvas,this.state),this.setState({cursorButton:"up"}),this.savePointer(t.clientX,t.clientY,"up"),window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",a),r.flush()});return Vs=a,window.addEventListener("pointermove",r),window.addEventListener("pointerup",a),!0}isASelectedElement(t){return t!=null&&this.state.selectedElementIds[t.id]}isHittingCommonBoundingBoxOfSelectedElements(t,n){if(n.length<2)return!1;let r=this.getElementHitThreshold(),[a,i,l,s]=xt(n);return t.x>a-r&&t.x<l+r&&t.y>i-r&&t.y<s+r}getCurrentItemRoundness(t){return this.state.currentItemRoundness==="round"?{type:fd(t)?bn.ADAPTIVE_RADIUS:bn.PROPORTIONAL_RADIUS}:null}maybeCacheReferenceSnapPoints(t,n,r=!1){Us({event:t,app:this,selectedElements:n})&&(r||!Yi.getReferenceSnapPoints())&&Yi.setReferenceSnapPoints(eG(this.scene.getNonDeletedElements(),n,this.state,this.scene.getNonDeletedElementsMap()))}maybeCacheVisibleGaps(t,n,r=!1){Us({event:t,app:this,selectedElements:n})&&(r||!Yi.getVisibleGaps())&&Yi.setVisibleGaps(JV(this.scene.getNonDeletedElements(),n,this.state,this.scene.getNonDeletedElementsMap()))}onKeyDownFromPointerDownHandler(t){return tn(n=>{this.maybeHandleResize(t,n)||this.maybeDragNewGenericElement(t,n)})}onKeyUpFromPointerDownHandler(t){return tn(n=>{n.key===B.ALT&&n.preventDefault(),!this.maybeHandleResize(t,n)&&this.maybeDragNewGenericElement(t,n)})}onPointerMoveFromPointerDownHandler(t){return kg(n=>{var o,f,m,U,g,v;if(((o=this.state.openDialog)==null?void 0:o.name)==="elementLinkSelector")return;let r=jt(n,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.elbowed&&this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index){let[y,w]=xn(r.x,r.y,n[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),E=this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index;if(E<0){let k=Ce.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:y,y:w},this.state,this.scene.getNonDeletedElementsMap());E=k?Ce.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,k,this.scene.getNonDeletedElementsMap()):-1}let S=Ce.moveFixedSegment(this.state.selectedLinearElement,E,y,w,this.scene.getNonDeletedElementsMap());$n.flushSync(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:S.segmentMidPointHoveredCoords,pointerDownState:S.pointerDownState}})});return}let a=this.lastPointerMoveCoords??t.origin;if(this.lastPointerMoveCoords=r,t.drag.offset===null&&(t.drag.offset=Pa(dZ(this.scene.getSelectedElements(this.state),t.origin.x,t.origin.y))),!(n.target instanceof HTMLElement)||this.handlePointerMoveOverScrollbars(n,t))return;if(ci(this.state)){this.handleEraser(n,t,r);return}this.state.activeTool.type==="laser"&&this.laserTrails.addPointToPath(r.x,r.y);let[i,l]=xn(r.x,r.y,n[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize());if(!t.drag.hasOccurred&&(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")&&yt(A(r.x,r.y),A(t.origin.x,t.origin.y))<Ks)return;if(t.resize.isResizing&&(t.lastCoords.x=r.x,t.lastCoords.y=r.y,this.maybeHandleCrop(t,n)||this.maybeHandleResize(t,n)))return!0;let s=this.scene.getNonDeletedElementsMap();if(this.state.selectedLinearElement){let y=this.state.editingLinearElement||this.state.selectedLinearElement;if(Ce.shouldAddMidpoint(this.state.selectedLinearElement,r,this.state,s)){let w=Ce.addMidpoint(this.state.selectedLinearElement,r,this,!n[B.CTRL_OR_CMD],s);if(!w)return;$n.flushSync(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:w.pointerDownState,selectedPointsIndices:w.selectedPointsIndices}}),this.state.editingLinearElement&&this.setState({editingLinearElement:{...this.state.editingLinearElement,pointerDownState:w.pointerDownState,selectedPointsIndices:w.selectedPointsIndices}})});return}else if(y.pointerDownState.segmentMidpoint.value!==null&&!y.pointerDownState.segmentMidpoint.added)return;if(Ce.handlePointDragging(n,this,r.x,r.y,(w,E)=>{this.maybeSuggestBindingsForLinearElementAtCoords(w,E)},y,this.scene)){t.lastCoords.x=r.x,t.lastCoords.y=r.y,t.drag.hasOccurred=!0,this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging&&this.setState({editingLinearElement:{...this.state.editingLinearElement,isDragging:!0}}),this.state.selectedLinearElement.isDragging||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,isDragging:!0}});return}}let d=t.hit.allHitElements.some(y=>this.isASelectedElement(y)),u=this.state.editingLinearElement&&n.shiftKey&&this.state.editingLinearElement.elementId===((f=t.hit.element)==null?void 0:f.id);if((d||t.hit.hasHitCommonBoundingBoxOfSelectedElements)&&!u){let y=this.scene.getSelectedElements(this.state);if(y.every(k=>k.locked))return;let w=y.find(k=>He(k)),E=this.getTopLayerFrameAtSceneCoords(r),S=E&&!w?E:null;if(this.state.frameToHighlight!==S&&$n.flushSync(()=>{this.setState({frameToHighlight:S})}),t.drag.hasOccurred=!0,y.length>0&&!t.withCmdOrCtrl&&!this.state.editingTextElement&&((m=this.state.activeEmbeddable)==null?void 0:m.state)!=="active"){let k={x:r.x-t.origin.x,y:r.y-t.origin.y},I=[...t.originalElements.values()],T=n.shiftKey;if(T){let D=Math.abs(k.x),P=Math.abs(k.y),N=T&&D<P,$=T&&D>P;N&&(k.x=0),$&&(k.y=0)}if(this.state.croppingElementId){let D=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(D&&vt(D)&&D.crop!==null&&t.hit.element===D){let P=D.crop,N=la(D)&&((U=this.imageCache.get(D.fileId))==null?void 0:U.image);if(N&&!(N instanceof Promise)){let $=an(Vn(r.x-a.x,r.y-a.y),Math.max(this.state.zoom.value,2)),[z,Z,K,Q,W,q]=Ze(D,s),V=Pe(ce(A(z,Z),A(W,q),D.angle)),ee=Pe(ce(A(K,Z),A(W,q),D.angle)),X=Pe(ce(A(z,Q),A(W,q),D.angle)),se=ar(jp(ee,V)),ge=ar(jp(X,V)),_e=Vn(Iv($,se),Iv($,ge)),Y={...P,x:lt(P.x-_e[0]*Math.sign(D.scale[0]),0,N.naturalWidth-P.width),y:lt(P.y-_e[1]*Math.sign(D.scale[1]),0,N.naturalHeight-P.height)};pe(D,{crop:Y});return}}}this.maybeCacheVisibleGaps(n,y),this.maybeCacheReferenceSnapPoints(n,y);let{snapOffset:M,snapLines:j}=tG(I,k,this,n,this.scene.getNonDeletedElementsMap());if(this.setState({snapLines:j}),this.state.editingFrame||oZ(t,y,k,this.scene,M,n[B.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),this.setState({selectedElementsAreBeingDragged:!0,selectionElement:null}),(y.length!==1||!Me(y[0]))&&this.setState({suggestedBindings:H2(y,this.scene.getNonDeletedElementsMap(),this.state.zoom)}),n.altKey&&!t.hit.hasBeenDuplicated){t.hit.hasBeenDuplicated=!0;let D=[],P=[],N=new Map,$=new Map,z=t.hit.element,Z=new Set(this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}).map(W=>W.id)),K=this.scene.getElementsIncludingDeleted();for(let W of K){let q=Z.has(W.id)||W.id===(z==null?void 0:z.id)&&t.hit.wasAddedToSelection;if(Math.abs(W.x)>1e7||Math.abs(W.x)>1e7||Math.abs(W.width)>1e7||Math.abs(W.height)>1e7){console.error("Alt+dragging element in scene with invalid dimensions",W.x,W.y,W.width,W.height,q);return}if(q){let V=xk(this.state.editingGroupId,N,W);if(Math.abs(V.x)>1e7||Math.abs(V.x)>1e7||Math.abs(V.width)>1e7||Math.abs(V.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",V.x,V.y,V.width,V.height);return}let ee=t.originalElements.get(W.id);if(Math.abs(ee.x)>1e7||Math.abs(ee.x)>1e7||Math.abs(ee.width)>1e7||Math.abs(ee.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",ee.x,ee.y,ee.width,ee.height);return}pe(V,{x:ee.x,y:ee.y}),t.originalElements.set(V.id,V),D.push(V),P.push(W),$.set(W.id,V.id)}else D.push(W)}let Q=[...D,...P];Q=((v=(g=this.props).onDuplicate)==null?void 0:v.call(g,Q,K))||Q,Ci(Q,We(P)),dk(D,P,$),JS(Q,P,$,"duplicatesServeAsOld"),Qk(Q,P,$),this.scene.replaceAllElements(Q),this.maybeCacheVisibleGaps(n,y,!0),this.maybeCacheReferenceSnapPoints(n,y,!0)}return}}if(this.state.selectionElement)t.lastCoords.x=r.x,t.lastCoords.y=r.y,this.maybeDragNewGenericElement(t,n);else{let y=this.state.newElement;if(!y)return;if(y.type==="freedraw"){let w=y.points,E=r.x-y.x,S=r.y-y.y,k=w.length>0&&w[w.length-1];if(!(k&&k[0]===E&&k[1]===S)){let I=y.simulatePressure?y.pressures:[...y.pressures,n.pressure];pe(y,{points:[...w,A(E,S)],pressures:I},!1),this.setState({newElement:y})}}else if(Ge(y)){t.drag.hasOccurred=!0;let w=y.points,E=i-y.x,S=l-y.y;Fu(n)&&w.length===2&&({width:E,height:S}=v6(y.x,y.y,r.x,r.y)),w.length===1?pe(y,{points:[...w,A(E,S)]},!1):(w.length===2||w.length>1&&Me(y))&&pe(y,{points:[...w.slice(0,-1),A(E,S)]},!1,{isDragging:!0}),this.setState({newElement:y}),mi(y,!1)&&this.maybeSuggestBindingsForLinearElementAtCoords(y,[r],this.state.startBoundElement)}else t.lastCoords.x=r.x,t.lastCoords.y=r.y,this.maybeDragNewGenericElement(t,n,!1)}if(this.state.activeTool.type==="selection"){t.boxSelection.hasOccurred=!0;let y=this.scene.getNonDeletedElements();if(this.state.editingLinearElement)Ce.handleBoxSelection(n,this.state,this.setState.bind(this),this.scene.getNonDeletedElementsMap());else{let w=!0;!n.shiftKey&&En(y,this.state)&&(t.withCmdOrCtrl&&t.hit.element?this.setState(S=>fr({...S,selectedElementIds:{[t.hit.element.id]:!0}},this.scene.getNonDeletedElements(),S,this)):w=!1);let E=this.state.selectionElement?h8(y,this.state.selectionElement,this.scene.getNonDeletedElementsMap(),!1):[];this.setState(S=>{let k={...w&&S.selectedElementIds,...E.reduce((I,T)=>(I[T.id]=!0,I),{})};return t.hit.element&&(E.length?delete k[t.hit.element.id]:k[t.hit.element.id]=!0),S=w?S:{...S,selectedGroupIds:{},editingGroupId:null},{...fr({editingGroupId:S.editingGroupId,selectedElementIds:k},this.scene.getNonDeletedElements(),S,this),selectedLinearElement:E.length===1&&Ge(E[0])?new Ce(E[0]):null,showHyperlinkPopup:E.length===1&&(E[0].link||Cr(E[0]))?"info":!1}})}}})}handlePointerMoveOverScrollbars(t,n){if(n.scrollbars.isOverHorizontal){let r=t.clientX,a=r-n.lastCoords.x;return this.translateCanvas({scrollX:this.state.scrollX-a/this.state.zoom.value}),n.lastCoords.x=r,!0}if(n.scrollbars.isOverVertical){let r=t.clientY,a=r-n.lastCoords.y;return this.translateCanvas({scrollY:this.state.scrollY-a/this.state.zoom.value}),n.lastCoords.y=r,!0}return!1}onPointerUpFromPointerDownHandler(t){return tn(n=>{var v,y,w,E,S,k,I,T,M,j,D,P;this.removePointer(n),t.eventListeners.onMove&&t.eventListeners.onMove.flush();let{newElement:r,resizingElement:a,croppingElementId:i,multiElement:l,activeTool:s,isResizing:d,isRotating:u,isCropping:o}=this.state;this.setState(N=>({isResizing:!1,isRotating:!1,isCropping:!1,resizingElement:null,selectionElement:null,frameToHighlight:null,elementsToHighlight:null,cursorButton:"up",snapLines:cu(N.snapLines,[]),originSnapOffset:null})),this.lastPointerMoveCoords=null,Yi.setReferenceSnapPoints(null),Yi.setVisibleGaps(null),this.savePointer(n.clientX,n.clientY,"up"),this.setState({selectedElementsAreBeingDragged:!1});let f=this.scene.getNonDeletedElementsMap();if(t.drag.hasOccurred&&((y=(v=t.hit)==null?void 0:v.element)!=null&&y.id)){let N=f.get(t.hit.element.id);Va(N)&&((w=N.boundElements)==null||w.filter($=>$.type==="arrow").map($=>f.get($.id)).filter($=>Me($)).forEach($=>{$&&pe($,{},!0)}))}if(this.state.editingLinearElement)if(!t.boxSelection.hasOccurred&&((S=(E=t.hit)==null?void 0:E.element)==null?void 0:S.id)!==this.state.editingLinearElement.elementId)this.actionManager.executeAction(Ia);else{let N=Ce.handlePointerUp(n,this.state.editingLinearElement,this.state,this.scene);N!==this.state.editingLinearElement&&this.setState({editingLinearElement:N,suggestedBindings:[]})}else if(this.state.selectedLinearElement){if(this.state.selectedLinearElement.elbowed){let N=Ce.getElement(this.state.selectedLinearElement.elementId,this.scene.getNonDeletedElementsMap());N&&pe(N,{},!0)}if(((I=(k=t.hit)==null?void 0:k.element)==null?void 0:I.id)!==this.state.selectedLinearElement.elementId)this.scene.getSelectedElements(this.state).length>1&&this.setState({selectedLinearElement:null});else{let N=Ce.handlePointerUp(n,this.state.selectedLinearElement,this.state,this.scene),{startBindingElement:$,endBindingElement:z}=N,Z=this.scene.getElement(N.elementId);mi(Z)&&L0(Z,$,z,f,this.scene),N!==this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...N,selectedPointsIndices:null},suggestedBindings:[]})}}if(this.missingPointerEventCleanupEmitter.clear(),window.removeEventListener("pointermove",t.eventListeners.onMove),window.removeEventListener("pointerup",t.eventListeners.onUp),window.removeEventListener("keydown",t.eventListeners.onKeyDown),window.removeEventListener("keyup",t.eventListeners.onKeyUp),this.state.pendingImageElementId&&this.setState({pendingImageElementId:null}),(M=(T=this.props)==null?void 0:T.onPointerUp)==null||M.call(T,s,t),this.onPointerUpEmitter.trigger(this.state.activeTool,t,n),(r==null?void 0:r.type)==="freedraw"){let N=jt(n,this.state),$=r.points,z=N.x-r.x,Z=N.y-r.y;z===$[0][0]&&Z===$[0][1]&&(Z+=1e-4,z+=1e-4);let K=r.simulatePressure?[]:[...r.pressures,n.pressure];pe(r,{points:[...$,A(z,Z)],pressures:K,lastCommittedPoint:A(z,Z)}),this.actionManager.executeAction(Ia);return}if(vt(r)){let N=r;try{this.initializeImageDimensions(N),this.setState({selectedElementIds:bt({[N.id]:!0},this.state)},()=>{this.actionManager.executeAction(Ia)})}catch($){console.error($),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter(z=>z.id!==N.id)),this.actionManager.executeAction(Ia)}return}if(Ge(r)){r.points.length>1&&this.store.shouldCaptureIncrement();let N=jt(n,this.state);!t.drag.hasOccurred&&r&&!l?(pe(r,{points:[...r.points,A(N.x-r.x,N.y-r.y)]}),this.setState({multiElement:r,newElement:r})):t.drag.hasOccurred&&!l&&(io(this.state)&&mi(r,!1)&&c6(r,this.state,N,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.setState({suggestedBindings:[],startBoundElement:null}),s.locked?this.setState($=>({newElement:null})):(Ta(this.interactiveCanvas),this.setState($=>({newElement:null,activeTool:gn(this.state,{type:"selection"}),selectedElementIds:bt({...$.selectedElementIds,[r.id]:!0},$),selectedLinearElement:new Ce(r)}))),this.scene.triggerUpdate());return}if(ke(r)){let N=y5(_t({fontSize:r.fontSize,fontFamily:r.fontFamily}),r.lineHeight);r.width<N&&pe(r,{autoResize:!0}),this.resetCursor(),this.handleTextWysiwyg(r,{isExistingElement:!0})}if(s.type!=="selection"&&r&&_o(r)){this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(N=>N.id!==r.id),appState:{newElement:null},captureUpdate:ie.NEVER});return}if(He(r)){let N=BY(this.scene.getElementsIncludingDeleted(),r,this.scene.getNonDeletedElementsMap());this.scene.replaceAllElements(Hu(this.scene.getElementsMapIncludingDeleted(),N,r,this.state))}if(r&&(pe(r,lC(r)),this.scene.triggerUpdate()),t.drag.hasOccurred){let N=jt(n,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.isDragging){let $=this.scene.getElement(this.state.selectedLinearElement.elementId);if($!=null&&$.frameId){let z=jr($,f);z&&$&&(bs($,z,this.scene.getNonDeletedElementsMap())||(pe($,{groupIds:[]}),W0([$],this.scene.getNonDeletedElementsMap()),this.scene.triggerUpdate()))}}else{let $=this.getTopLayerFrameAtSceneCoords(N),z=this.scene.getSelectedElements(this.state),Z=this.scene.getElementsMapIncludingDeleted(),K=Q=>{if(Q.length>0){for(let W of Q){let q=W.groupIds.indexOf(this.state.editingGroupId);pe(W,{groupIds:W.groupIds.slice(0,q)},!1)}Z.forEach(W=>{W.groupIds.length&&zt(Z,W.groupIds[W.groupIds.length-1]).length<2&&pe(W,{groupIds:[]},!1)}),this.setState({editingGroupId:null})}};if($&&!this.state.selectedElementIds[$.id]){let Q=z.filter(W=>W.frameId!==$.id&&Jp(W,Z,this.state));this.state.editingGroupId&&K(Q),Z=Hu(Z,Q,$,this.state)}else if(!$&&this.state.editingGroupId){let Q=z.filter(W=>W.frameId&&!Jp(W,Z,this.state));K(Q)}Z=ad(Z,this.state,this),this.scene.replaceAllElements(Z)}}if(a&&this.store.shouldCaptureIncrement(),a&&_o(a)&&this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(N=>N.id!==a.id),captureUpdate:ie.NEVER}),t.resize.isResizing){let N=ad(this.scene.getElementsIncludingDeleted(),this.state,this),$=this.scene.getSelectedElements(this.state).filter(z=>He(z));for(let z of $)N=tC(N,cp(this.scene.getElementsIncludingDeleted(),z,this.state,f),z,this);this.scene.replaceAllElements(N)}let m=t.hit.element;((j=this.state.selectedLinearElement)==null?void 0:j.elementId)!==(m==null?void 0:m.id)&&Ge(m)&&this.scene.getSelectedElements(this.state).length===1&&this.setState({selectedLinearElement:new Ce(m)}),(!i||i&&(!m&&!o||m&&m.id!==i))&&this.finishImageCropping();let U=this.lastPointerDownEvent,g=this.lastPointerUpEvent||this.lastPointerMoveEvent;if(ci(this.state)&&U&&g){if(this.eraserTrail.endPath(),yt(A(U.clientX,U.clientY),A(g.clientX,g.clientY))===0){let N=jt({clientX:g.clientX,clientY:g.clientY},this.state);this.getElementsAtPosition(N.x,N.y).forEach($=>this.elementsPendingErasure.add($.id))}this.eraseElements();return}else this.elementsPendingErasure.size&&this.restoreReadyToEraseElements();if(m&&!t.drag.hasOccurred&&!t.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!t.boxSelection.hasOccurred)&&(n.shiftKey&&!this.state.editingLinearElement?this.state.selectedElementIds[m.id]?ak(this.state,m)?this.setState(N=>{let $={...N.selectedElementIds};for(let z of m.groupIds.flatMap(Z=>zt(this.scene.getNonDeletedElements(),Z)))delete $[z.id];return{selectedGroupIds:{...N.selectedElementIds,...m.groupIds.map(z=>({[z]:!1})).reduce((z,Z)=>({...z,...Z}),{})},selectedElementIds:bt($,N)}}):(D=this.state.selectedLinearElement)!=null&&D.isDragging||this.setState(N=>{let $={...N.selectedElementIds};delete $[m.id];let z=tt(this.scene.getNonDeletedElements(),{selectedElementIds:$});return{...fr({editingGroupId:N.editingGroupId,selectedElementIds:$},this.scene.getNonDeletedElements(),N,this),selectedLinearElement:z.length===1&&Ge(z[0])?new Ce(z[0]):N.selectedLinearElement}}):m.frameId&&this.state.selectedElementIds[m.frameId]?this.setState(N=>{var z;let $={...N.selectedElementIds,[m.id]:!0};return delete $[m.frameId],(((z=this.scene.getElement(m.frameId))==null?void 0:z.groupIds)??[]).flatMap(Z=>zt(this.scene.getNonDeletedElements(),Z)).forEach(Z=>{delete $[Z.id]}),{...fr({editingGroupId:N.editingGroupId,selectedElementIds:$},this.scene.getNonDeletedElements(),N,this),showHyperlinkPopup:m.link||Cr(m)?"info":!1}}):this.setState(N=>({selectedElementIds:bt({...N.selectedElementIds,[m.id]:!0},N)})):this.setState(N=>{var $;return{...fr({editingGroupId:N.editingGroupId,selectedElementIds:{[m.id]:!0}},this.scene.getNonDeletedElements(),N,this),selectedLinearElement:Ge(m)&&(($=N.selectedLinearElement)==null?void 0:$.elementId)!==m.id?new Ce(m):N.selectedLinearElement}})),!(m&&Me(m))&&!t.drag.hasOccurred&&!this.state.isResizing&&(m&&LX({x:t.origin.x,y:t.origin.y,element:m,shape:qi(m,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:He(m)?this.frameNameBoundsCache.get(m):null},f)||!m&&t.hit.hasHitCommonBoundingBoxOfSelectedElements)){this.state.editingLinearElement?this.setState({editingLinearElement:null}):this.setState({selectedElementIds:bt({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),It(this.interactiveCanvas,kt.AUTO);return}if(!s.locked&&s.type!=="freedraw"&&r&&this.setState(N=>({selectedElementIds:bt({...N.selectedElementIds,[r.id]:!0},N),showHyperlinkPopup:Cr(r)&&!r.link?"editor":N.showHyperlinkPopup})),(s.type!=="selection"||En(this.scene.getNonDeletedElements(),this.state)||!Yn(this.state.previousSelectedElementIds,this.state.selectedElementIds))&&this.store.shouldCaptureIncrement(),t.drag.hasOccurred||d||u||o){let N=this.scene.getSelectedElements(this.state).filter(Ge);Wp(N,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,io(this.state),((P=this.state.selectedLinearElement)==null?void 0:P.selectedPointsIndices)??[],this.state.zoom)}if(s.type==="laser"){this.laserTrails.endPath();return}!s.locked&&s.type!=="freedraw"?(Ta(this.interactiveCanvas),this.setState({newElement:null,suggestedBindings:[],activeTool:gn(this.state,{type:"selection"})})):this.setState({newElement:null,suggestedBindings:[]}),m&&this.lastPointerUpEvent&&this.lastPointerDownEvent&&this.lastPointerUpEvent.timeStamp-this.lastPointerDownEvent.timeStamp<300&>.pointers.size<=1&&sa(m)&&this.isIframeLikeElementCenter(m,this.lastPointerUpEvent,t.origin.x,t.origin.y)&&this.handleEmbeddableCenterClick(m)})}clearSelection(t){this.setState(n=>({selectedElementIds:bt({},n),activeEmbeddable:null,selectedGroupIds:{},editingGroupId:n.editingGroupId&&t!=null&&Uf(t,n.editingGroupId)?n.editingGroupId:null})),this.setState({selectedElementIds:bt({},this.state),activeEmbeddable:null,previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(t,n,r,a){if(a){let i=a.x+a.width/2,l=a.y+a.height/2,s=W2(a,r,this.scene.getNonDeletedElementsMap());if(s&&(i=s.x,l=s.y),Math.hypot(t-i,n-l)<LN){let{x:d,y:u}=oa({sceneX:i,sceneY:l},r);return{viewportX:d,viewportY:u,elementCenterX:i,elementCenterY:l}}}}getCanvasOffsets(){var t;if((t=this.excalidrawContainerRef)!=null&&t.current){let n=this.excalidrawContainerRef.current,{left:r,top:a}=n.getBoundingClientRect();return{offsetLeft:r,offsetTop:a}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){let t=nm.find(n=>n.code===this.props.langCode)||Oo;await OI(t),this.setAppState({})}},hle=()=>{(et.MODE===Tr.TEST||et.DEV)&&(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){var e;return(e=this.app)==null?void 0:e.scene.getElementsIncludingDeleted()},set(e){var t;return(t=this.app)==null?void 0:t.scene.replaceAllElements(ul(e))}},scene:{configurable:!0,get(){var e;return(e=this.app)==null?void 0:e.scene}}}))};hle();var ple=fle,mle=()=>{Array.prototype.at||Object.defineProperty(Array.prototype,"at",{value:function(e){if(e=Math.trunc(e)||0,e<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]},writable:!0,enumerable:!1,configurable:!0}),Element.prototype.replaceChildren||(Element.prototype.replaceChildren=function(...e){this.innerHTML="",this.append(...e)})},Ule=mle,gle=()=>p.jsx("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"ExcalidrawLogo-icon",children:p.jsx("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),ble=()=>p.jsxs("svg",{viewBox:"0 0 450 55",xmlns:"http://www.w3.org/2000/svg",fill:"none",className:"ExcalidrawLogo-text",children:[p.jsx("path",{d:"M429.27 96.74c2.47-1.39 4.78-3.02 6.83-4.95 1.43-1.35 2.73-2.86 3.81-4.51-.66.9-1.4 1.77-2.23 2.59-2.91 2.84-5.72 5.09-8.42 6.87h.01ZM343.6 69.36c.33 3.13.58 6.27.79 9.4.09 1.37.18 2.75.25 4.12-.12-4.46-.27-8.93-.5-13.39-.11-2.08-.24-4.16-.4-6.24-.06 1.79-.11 3.85-.13 6.11h-.01ZM378.47 98.34c.01-.37.07-1.13.01-6.51-.11 1.9-.22 3.81-.31 5.71-.07 1.42-.22 2.91-.16 4.35.39.03.78.07 1.17.1-.92-.85-.76-2.01-.72-3.66l.01.01ZM344.09 86.12c-.09-2.41-.22-4.83-.39-7.24v12.21c.15-.05.32-.09.47-.14.05-1.61-.03-3.23-.09-4.83h.01ZM440.69 66.79c-.22-.34-.45-.67-.69-.99-3.71-4.87-9.91-7.14-15.65-8.55-1.05-.26-2.12-.49-3.18-.71 2.29.59 4.48 1.26 6.64 2.02 7.19 2.54 10.57 5.41 12.88 8.23ZM305.09 72.46l1.2 3.6c.84 2.53 1.67 5.06 2.46 7.61.24.78.5 1.57.73 2.36.22-.04.44-.08.67-.12a776.9 776.9 0 0 1-5.01-13.57c-.02.04-.03.09-.05.13v-.01ZM345.49 90.25v.31c1.48-.42 3.05-.83 4.66-1.2-1.56.25-3.12.52-4.66.89ZM371.02 90.22c0-.57-.04-1.14-.11-1.71-.06-.02-.12-.04-.19-.05-.21-.05-.43-.08-.65-.11.42.16.74.88.95 1.87ZM398.93 54.23c-.13 0-.27-.01-.4-.02l.03.4c.11-.15.23-.27.37-.38ZM401.57 62.28v-.15c-1.22-.24-2.86-.61-3.23-1.25-.09-.15-.18-.51-.27-.98-.09.37-.2.73-.33 1.09 1.24.56 2.52.98 3.83 1.29ZM421.73 88.68c-2.97 1.65-6.28 3.12-9.69 3.68v.18c4.72-.14 11.63-3.85 16.33-8.38-2.04 1.75-4.33 3.24-6.63 4.53l-.01-.01ZM411.28 80.92c-.05-1.2-.09-2.4-.15-3.6-.21 5.66-.46 11.38-.47 14.51.24-.02.48-.04.71-.07.15-3.61.05-7.23-.09-10.83v-.01Z",transform:"translate(-144.023 -51.76)"}),p.jsx("path",{d:"M425.38 67.41c-3.5-1.45-7.19-2.57-14.06-3.62.09 1.97.06 4.88-.03 8.12.03.04.06.09.06.15.19 1.36.28 2.73.37 4.1.25 3.77.39 7.55.41 11.33 0 1.38-.01 2.76-.07 4.13 1.4-.25 2.78-.65 4.12-1.15 4.07-1.5 7.94-3.78 11.28-6.54 2.33-1.92 5.13-4.49 5.88-7.58.63-3.53-2.45-6.68-7.97-8.96l.01.02ZM411.35 92.53v-.06l-.34.03c.11.01.22.03.34.03ZM314.26 64.06c-.23-.59-.47-1.17-.7-1.75.57 1.62 1.11 3.25 1.6 4.9l.15.54 2.35 6.05c.32.82.66 1.64.98 2.46-1.38-4.1-2.83-8.17-4.39-12.2h.01ZM156.82 103.07c-.18.13-.38.23-.58.33 1.32-.03 2.66-.2 3.93-.34.86-.09 1.72-.22 2.58-.33-2.12.1-4.12.17-5.94.34h.01ZM210.14 68.88s.03.04.05.07c.18-.31.39-.64.58-.96-.21.3-.42.6-.64.89h.01ZM201.65 82.8c-.5.77-1.02 1.56-1.49 2.37 1.11-1.55 2.21-3.1 3.2-4.59-.23.23-.49.51-.75.79-.32.47-.65.95-.96 1.43ZM194.03 98.66c-.33-.4-.65-.84-1.05-1.17-.24-.2-.07-.49.17-.56-.23-.26-.42-.5-.63-.75 1.51-2.55 3.93-5.87 6.4-9.28-.17-.08-.29-.28-.2-.49.04-.09.09-.17.13-.26-1.21 1.78-2.42 3.55-3.61 5.33-.87 1.31-1.74 2.64-2.54 4-.29.5-.63 1.04-.87 1.61.81.65 1.63 1.27 2.47 1.88-.09-.11-.18-.21-.27-.32v.01ZM307.79 82.93c-1-3.17-2.05-6.32-3.1-9.48-1.62 4.08-3.69 9.17-6.16 15.19 3.32-1.04 6.77-1.87 10.27-2.5-.32-1.08-.67-2.15-1.01-3.21ZM149.5 80.7c.05-1.71.04-3.43 0-5.14-.1 2.26-.16 4.51-.22 6.77-.02.73-.03 1.46-.04 2.19.14-1.27.2-2.55.24-3.82h.02ZM228.98 98.3c.39 1.25.91 3.03.94 3.91.06-.03.12-.07.17-.1.08-1.29-.55-2.65-1.11-3.81ZM307.72 53.36c.81.5 1.53 1.04 2.07 1.49-.38-.8-.78-1.58-1.21-2.35-.17.03-.34.06-.51.11-.43.12-.86.26-1.29.41.35-.01.53.1.94.34ZM283.69 96.14c3.91-7.25 6.89-13.35 8.88-18.15l1.1-2.66c-1.27 2.64-2.56 5.27-3.83 7.9-1.53 3.15-3.06 6.31-4.58 9.47-.87 1.81-1.76 3.62-2.54 5.47.04.02.07.04.11.07.05.05.1.09.15.14.05-.73.27-1.48.71-2.24ZM289.92 103.23s-.04.01-.05.03c0-.02.04-.03.05-.04.05-.05.11-.1.16-.15l.21-.21c-.55 0-1.5-.27-2.55-.72.4.26.8.51 1.22.74.24.13.48.26.73.37.05.02.1.03.14.05a.27.27 0 0 1 .08-.07h.01ZM269.23 68.49c-.39-.19-.82-.48-1.33-.87-3.06-1.56-6.31-2.78-9.36-2.35-3.5.49-5.7 1.11-7.74 2.44 5.71-2.6 12.82-2.07 18.44.79l-.01-.01ZM177.87 53.69l1.06.03c-.96-.22-2-.25-2.89-.3-4.95-.26-9.99.33-14.86 1.19-2.44.43-4.88.95-7.28 1.59 9.09-1.76 15.69-2.77 23.97-2.51ZM219.85 55.51c-.18.12-.36.27-.56.45-.45.53-.86 1.11-1.26 1.66-1.91 2.61-3.71 5.31-5.57 7.95l-.12.18 8.05-10.11c-.18-.05-.36-.1-.55-.13h.01ZM510.71 54.1c.12-.15.29-.3.53-.45.69-.4 3.72-.63 5.87-.74-.36-.02-.73-.04-1.09-.05-1.84-.03-3.67.09-5.49.35.05.3.12.59.18.88v.01ZM510.76 86.02c1.37-3.07 2.49-6.27 3.57-9.46.55-1.64 1.12-3.3 1.6-4.97-1.59 4.01-3.67 9.14-6.2 15.3.24-.08.5-.14.74-.22.1-.22.19-.44.29-.65ZM566.95 75.76c.11-.02.23.03.31.11-.05-.13-.09-.26-.14-.39-.05.09-.11.18-.17.28ZM511.33 86.41c3.08-.89 6.24-1.62 9.46-2.14-1.51-3.98-2.98-7.96-4.39-11.87-.05.15-.09.31-.14.46-1.02 3.32-2.15 6.61-3.39 9.85-.48 1.25-.98 2.49-1.53 3.7h-.01ZM578.24 74.45c.11-.44.23-.87.35-1.31-.31.7-.64 1.39-.97 2.08.09.21.19.4.28.61.12-.46.23-.92.35-1.38h-.01ZM520.62 53.11c-.09 0-.18-.01-.28-.02.38.34.29 1.08.93 2.53l6.65 17.15c2.2 5.68 4.69 11.36 7.41 16.87l1.06 2.17c-2.95-7.05-5.92-14.08-8.87-21.13-1.58-3.79-3.16-7.59-4.7-11.4-.78-1.92-1.73-3.89-2.25-5.91-.03-.1 0-.19.04-.26h.01ZM578.78 77.87c1.45-5.77 3.07-10.43 3.58-13.36.05-.34.16-.88.31-1.55-.67 1.79-1.37 3.56-2.08 5.33-.12.43-.23.86-.35 1.29-.65 2.43-1.29 4.86-1.9 7.3.14.33.29.65.43 1l.01-.01ZM545.3 94.66c.02-.44.03-.83.05-1.12.02-1.01.05-2.02.11-3.02.03-6.66-.46-14.33-1.46-22.8-.13-.42-.27-1.24-.56-2.89 0-.02 0-.04-.01-.06.62 6.61.95 13.25 1.32 19.87.17 3.08.33 6.16.52 9.23.02.25.03.52.04.78l-.01.01ZM580.77 102.81c.13.2.27.38.37.49.27-.11.53-.22.8-.32-.43.09-.82.05-1.17-.16v-.01ZM530.48 104.07h.33c-.36-.13-.71-.32-1.04-.56.14.24.3.47.45.7.06-.08.14-.13.26-.13v-.01ZM542.63 58.82c.06.23.11.47.15.71.14-.33.36-.62.7-.86-.28.05-.57.11-.85.15ZM583.81 57.87c.15-.7.29-1.41.42-2.11-.14.45-.28.9-.42 1.34-.46 1.44-.89 2.89-1.31 4.34.44-1.19.88-2.37 1.31-3.57ZM523.62 91.48c-4.66 1.17-9.05 2.89-14.02 5.27 4.65-1.84 9.48-3.29 14.28-4.63-.09-.22-.17-.41-.26-.64ZM460.64 78.3c-.04-2.9-.11-5.81-.28-8.71-.1-1.68-.17-3.43-.5-5.09-.07.02-.14.03-.2.05.3 6.54.45 12.17.51 17.12.17-.07.34-.14.51-.2 0-1.06-.01-2.11-.03-3.17h-.01ZM470.63 63.24c-3.38-.26-6.81.32-10.1 1.1.41 2.01.47 4.14.57 6.18.18 3.55.25 7.11.27 10.67 3.31-1.38 6.5-3.12 9.3-5.35 1.96-1.56 3.86-3.41 5.02-5.66.73-1.41 1.19-3.22.26-4.65-1.09-1.7-3.46-2.14-5.32-2.29ZM460.29 63.68c1-.24 2.01-.46 3.04-.65-1.15.16-2.37.38-3.71.69v.13c.07-.02.15-.04.22-.05.11-.13.3-.18.45-.11v-.01ZM457.24 100.96c.43-.03.86-.07 1.29-.11.14-.49.27-.99.38-1.49-.44.7-1 1.23-1.67 1.6ZM482.88 104.98c-.18.23-.36.38-.55.47.14.09.27.19.4.28a70.76 70.76 0 0 0 4.37-4.63c.76-.89 1.52-1.81 2.19-2.77-.3-.27-.61-.53-.92-.79-.07 1.94-4.62 6.32-5.49 7.45v-.01Z",transform:"translate(-144.023 -51.76)"}),p.jsx("path",{d:"M474.36 63.31c-.4-.16-.84-.27-1.29-.37 1.56.42 3.08 1.22 3.76 2.74.62 1.4.32 2.95-.28 4.32.7-1.22.94-2.34.74-3.47-.24-1.33-1.19-2.54-2.93-3.21v-.01ZM477.34 89.18c-1.2-.81-2.4-1.62-3.6-2.42-.14.1-.26.19-.4.29 1.4.67 2.73 1.39 4 2.13ZM465.88 93.85c.37.25.74.5 1.1.75.46.32.92.65 1.38.97-1.57-1.2-2.01-1.61-2.49-1.72h.01ZM574.92 90.06c-2.28-5.21-4.93-11.13-5.67-12.26-.1-.15-1.57-3.01-1.63-3.08 0 0-.01.02-.02.02.4 1.37 1.09 2.69 1.65 3.99 2.14 4.95 4.36 9.86 6.67 14.73.6 1.26 1.21 2.52 1.83 3.78-.75-2.01-1.64-4.45-2.83-7.18ZM448.73 65.29c.1.2.22.38.34.57.22-.02.43-.06.65-.08v-.08c-.14-.05-.25 0-.99-.41ZM460.16 94.81c-.02.31-.06.59-.1.89-.03 1.71-.33 3.43-.79 5.07.15-.02.3-.03.45-.05.01-.04.02-.08.03-.11.09-.34.15-.69.2-1.03.17-1.07.25-2.16.33-3.24.05-.69.08-1.39.12-2.08-.27.1-.27.26-.24.57v-.02Z",transform:"translate(-144.023 -51.76)"}),p.jsx("path",{d:"m328.67 98.12-3.22-6.58c-1.29-2.63-2.53-5.29-3.72-7.97-.25-.85-.52-1.69-.79-2.53-.81-2.57-1.67-5.12-2.55-7.67-1.92-5.53-3.9-11.08-6.32-16.41-.72-1.58-1.46-3.44-2.63-4.79-.03-.17-.16-.29-.34-.36a.282.282 0 0 0-.23-.04c-.06-.01-.12 0-.18.01-.74.06-1.5.38-2.19.61-2.22.77-4.4 1.64-6.63 2.38-.03-.08-.06-.16-.09-.25-.15-.42-.82-.24-.67.19.03.09.07.19.1.28l-.18.06c-.36.11-.28.6 0 .68.18 1.18.63 2.36.98 3.49.03.09.06.17.08.26-.08.23-.17.46-.24.64-.37.98-.79 1.94-1.21 2.9-1.27 2.89-2.62 5.75-3.98 8.6-3.18 6.67-6.44 13.31-9.64 19.97-1.08 2.25-2.2 4.5-3.15 6.81-.13.32.24.5.5.37 1.34 1.33 2.84 2.5 4.4 3.57.65.44 1.31.87 2.01 1.24.4.22.86.48 1.33.5.24.01.35-.19.33-.37.11-.1.21-.21.28-.28.41-.41.81-.84 1.2-1.26.85-.92 1.69-1.87 2.5-2.84 6.31-2.34 12.6-4.31 18.71-5.84 2.14 5.3 3.43 8.43 3.97 9.58.55 1.05 1.15 1.88 1.82 2.52 1.32.56 6.96-.03 9.23-1.96.87-1.28 1.19-2.67.93-4.15-.09-.5-.22-.95-.4-1.33l-.01-.03Zm-20.09-45.61c.43.77.83 1.56 1.21 2.35-.54-.45-1.27-.99-2.07-1.49-.42-.24-.6-.35-.94-.34.43-.15.85-.29 1.29-.41.17-.05.34-.08.51-.11Zm-25.86 45.66c.78-1.85 1.67-3.66 2.54-5.47 1.51-3.16 3.05-6.31 4.58-9.47 1.28-2.63 2.56-5.26 3.83-7.9l-1.1 2.66c-1.99 4.79-4.97 10.9-8.88 18.15-.43.76-.66 1.51-.71 2.24-.05-.05-.1-.09-.15-.14a.259.259 0 0 0-.11-.07Zm6.24 4.71c-.42-.23-.82-.48-1.22-.74 1.05.45 2 .72 2.55.72l-.21.21c-.05.05-.11.1-.16.15-.01.01-.04.03-.05.04 0-.02.03-.02.05-.03a.27.27 0 0 0-.08.07c-.05-.02-.1-.03-.14-.05-.25-.1-.49-.24-.73-.37h-.01Zm15.73-29.43c1.05 3.15 2.1 6.31 3.1 9.48.34 1.06.69 2.13 1.01 3.21-3.5.63-6.95 1.46-10.27 2.5 2.48-6.03 4.54-11.11 6.16-15.19Zm4.79 12.57c-.23-.79-.49-1.58-.73-2.36-.79-2.54-1.63-5.08-2.46-7.61l-1.2-3.6c.02-.04.04-.09.05-.13 1.6 4.45 3.28 9 5.01 13.57l-.67.12v.01Zm5.83-18.27-.15-.54c-.49-1.64-1.03-3.28-1.6-4.9.23.58.47 1.17.7 1.75 1.56 4.03 3.01 8.1 4.39 12.2-.33-.82-.67-1.64-.98-2.46l-2.35-6.05h-.01ZM390.43 79.37c-.13-10.43-.22-17.5-.24-19.97-.24-1.6.21-2.88-.65-3.65-.14-.13-.32-.23-.52-.32h.03c.45 0 .45-.69 0-.7-1.75-.03-3.5-.04-5.25-.14-1.38-.08-2.76-.21-4.15-.31-.07 0-.12.01-.17.04-.21-.07-.47.03-.45.31l.03.45c-.11.14-.19.3-.22.5-.21 1.26-.32 13.67-.36 23.59-.32 5.79-.67 11.57-.97 17.36-.09 1.73-.29 3.54-.21 5.3-.39.02-.38.64.04.69v.12c.05.44.74.45.7 0v-.06c1.1.09 2.2.21 3.3.3 1.14.19 2.44.2 3.29.17 1.73-.05 2.92-.05 3.8-.37.45-.05.9-.11 1.35-.17.44-.06.25-.73-.19-.67h-.01c.24-.32.45-.72.62-1.25.66-1.84.41-6.36.34-11.33l-.13-9.9.02.01Zm-12.26 18.17c.09-1.91.2-3.81.31-5.71.06 5.38 0 6.14-.01 6.51-.05 1.65-.21 2.81.72 3.66-.39-.04-.78-.07-1.17-.1-.06-1.44.09-2.93.16-4.35l-.01-.01ZM588.97 53.85c-2.06-.25-3.17-.51-3.76-.6a.3.3 0 0 1 .04-.08c.22-.39-.39-.75-.6-.35-.56 1.02-.9 2.19-1.26 3.29-.61 1.88-1.17 3.78-1.72 5.68-.63 2.19-1.24 4.39-1.83 6.59-.81 2.03-1.67 4.05-2.61 6.03-1.7-3.64-3.11-6.04-4.03-7.57-2.26-3.74-2.85-5.48-3.57-6.08l.31-.09c.43-.12.25-.8-.19-.67-1.06.3-2.12.6-3.17.95-.93.32-1.85.69-2.76 1.07-.13.05-.19.16-.22.27-.04.02-.08.05-.11.07-.04-.06-.07-.12-.11-.18a.354.354 0 0 0-.48-.12c-.16.09-.22.32-.13.48l.33.54c0 .09.02.18.06.28.51 1.16.78 1.38.72 1.47-2.42 3.44-5.41 7.86-6.2 9.1-1.27 1.97-2.01 3.14-2.45 3.84l-.91-6.56-.43-4.1c-.19-1.85-.37-3.23-.53-4.13-.19-1.1-.3-2.15-.45-3.16-.2-1.36-.29-2.06-.47-2.42h.04c.45.02.45-.68 0-.7-3.43-.16-6.81.94-10.17 1.48-.24-.22-.73-.04-.58.32.24.59.33 1.25.43 1.87.17 1.06.29 2.13.4 3.2.32 3.09.53 6.2.74 9.3.44 6.75.77 13.51 1.17 20.26.11 1.95.13 3.96.46 5.89.05.3.37.31.55.14.74 1.71 2.87 1.27 6.13 1.27 1.34 0 2.39.04 2.99-.11.02.32.48.53.63.18 3.61-8.26 7.41-16.46 12.05-24.2.03-.05.04-.1.05-.15.3.73.64 1.45.94 2.16.97 2.26 1.97 4.52 2.98 6.76 2.26 5.03 4.54 10.07 7.09 14.96.47.9.94 1.79 1.47 2.65.2.32.4.67.66.96-.18.25 0 .68.34.54.91-.38 1.82-.75 2.76-1.07 1.04-.35 2.11-.65 3.17-.95.39-.11.28-.66-.07-.68.62-.4.95-.96.87-1.91-.3-3.34.72-7.47.86-8.52l2.14-11.43c1.75-10.74 3.13-17.51 3.23-20.86.02-.49.08-2.84.13-3.24.17-1.25.48-1-4.96-1.65l.03-.02Zm-46.19 5.67c-.04-.24-.09-.48-.15-.71l.85-.15c-.34.24-.56.53-.7.86Zm1.95 25.12c-.36-6.63-.7-13.26-1.32-19.87 0 .02 0 .04.01.06.29 1.65.44 2.47.56 2.89 1 8.46 1.5 16.14 1.46 22.8-.06.99-.1 2-.11 3.02-.01.29-.03.68-.05 1.12-.01-.26-.03-.53-.04-.78-.19-3.08-.35-6.16-.52-9.23l.01-.01Zm36.4 18.66c-.11-.11-.24-.29-.37-.49.35.21.74.26 1.17.16-.27.11-.53.22-.8.32v.01Zm-.89-33.72c.12-.43.23-.86.35-1.29.71-1.77 1.41-3.55 2.08-5.33-.15.68-.26 1.22-.31 1.55-.5 2.94-2.13 7.59-3.58 13.36-.15-.35-.29-.66-.43-1 .61-2.44 1.25-4.87 1.9-7.3l-.01.01Zm3.56-12.48c.14-.44.28-.89.42-1.34-.13.7-.27 1.41-.42 2.11-.43 1.19-.86 2.38-1.31 3.57.42-1.45.85-2.9 1.31-4.34Zm-5.22 16.05c-.11.44-.23.87-.35 1.31-.12.46-.23.92-.35 1.38-.1-.22-.19-.4-.28-.61.34-.69.66-1.38.97-2.08h.01Zm-11.64 2.62c.06-.1.12-.19.17-.28.05.13.09.26.14.39a.398.398 0 0 0-.31-.11Zm2.3 2.98c-.56-1.3-1.25-2.63-1.65-3.99 0 0 .01-.02.02-.02.06.08 1.52 2.93 1.63 3.08.73 1.13 3.38 7.04 5.67 12.26 1.2 2.73 2.08 5.17 2.83 7.18-.62-1.25-1.23-2.51-1.83-3.78-2.31-4.87-4.53-9.78-6.67-14.73ZM275.92 87.03c-1.06-2.18-1.13-3.45-2.44-2.93-1.52.57-2.94 1.3-4.5 2.1-1.4.72-2.68 1.44-3.92 2.12.01-.25-.24-.5-.51-.34-4.8 2.93-12.41 4.7-17.28 1.31-1.98-1.77-3.32-4.15-3.97-5.78-.29-.95-.49-1.94-.63-2.93-.14-3.34 1.58-6.53 3.9-9.12.8-.79 1.68-1.51 2.66-2.12 3.7-2.3 8.22-3.07 12.51-2.51 2.71.35 5.32 1.24 7.71 2.55.39.22.75-.39.35-.6-.18-.1-.37-.18-.55-.27.56.27 1.03.33 1.51.19l-.48.39c-.15.11-.23.3-.13.48.09.15.33.24.48.13 1.3-.97 2.46-2.09 3.45-3.37.37-.29.64-.6.65-.97v-.02c.08-.33-.03-.7-.21-1.08-.31-.87-.98-2.01-2.19-3.26-2.43-2.52-3.79-3.45-5.68-4.26-1.14-.49-3.12-1.06-4.42-1.23-3.28-.42-10.64-1.21-18.18 4.11-7.74 5.46-11.94 12.3-12.23 20.61-.08 2.06.04 3.98.34 5.71.74 4.18 2.57 8 5.44 11.34 4.26 4.99 9.76 7.52 16.34 7.52 4.85 0 9.69-1.77 14.89-4.62.23-.12.45-.23.68-.35 2.19-1.1 4.37-2.23 6.46-3.5.49-.3 1.03-.61 1.5-.98 1.47-.87 1.11-1.12.49-2.95-.39-1.14-.76-2.7-2.06-5.36l.02-.01Zm-17.38-21.76c3.05-.42 6.31.79 9.36 2.35.51.39.94.68 1.33.87-5.61-2.86-12.72-3.39-18.44-.79 2.05-1.33 4.24-1.95 7.74-2.44l.01.01ZM443.67 72.67c-.4-2.2-1.15-4.33-2.37-6.22-1.49-2.32-3.58-4.19-5.91-5.64-6.17-3.81-13.75-5.11-20.83-6.01-3.23-.41-6.47-.69-9.72-.92l-1.39-.12c-.85-.07-1.52-.1-2.05-.1-1.08-.06-2.17-.12-3.25-.17-.08 0-.14.02-.19.05-.1.05-.18.14-.16.3.27 2.55-.01 5.12-.92 7.52-.15.38.4.56.62.28 1.32.59 2.68 1.05 4.08 1.37 0 2.78-.14 7.58-.33 12.91 0 0 0 .02-.01.03-.61 3.66-.79 7.42-1 11.12-.23 4.01-.43 8.03-.44 12.05 0 .64 0 1.28.03 1.93.02.31 0 .68.15.96.06.11.14.16.24.17-.2.17-.21.54.11.59 3.83.67 7.78.71 11.68.25 2.3-.19 4.87-.65 7.65-1.56 1.85-.54 3.67-1.18 5.43-1.91 7.2-3.02 14.31-8.07 17.35-15.53.76-1.86 1.17-3.8 1.31-5.75.3-1.93.28-3.82-.09-5.58l.01-.02Zm-19.32-15.42c5.74 1.41 11.94 3.68 15.65 8.55.25.32.47.65.69.99-2.3-2.82-5.68-5.69-12.88-8.23-2.16-.76-4.35-1.43-6.64-2.02 1.06.21 2.13.45 3.18.71Zm-25.82-3.04c.13 0 .27.01.4.02-.14.1-.26.23-.37.38 0-.13-.02-.26-.03-.4Zm34.82 22.17c-.75 3.09-3.55 5.66-5.88 7.58-3.35 2.76-7.21 5.03-11.28 6.54-1.33.49-2.71.9-4.12 1.15.06-1.38.08-2.76.07-4.13-.02-3.78-.16-7.56-.41-11.33-.09-1.37-.18-2.74-.37-4.1 0-.06-.03-.11-.06-.15.09-3.25.12-6.16.03-8.12 6.86 1.05 10.56 2.17 14.06 3.62 5.52 2.28 8.59 5.44 7.97 8.96l-.01-.02Zm-22 16.15c-.12 0-.23-.02-.34-.03l.34-.03v.06Zm-.69-.7c0-3.13.26-8.84.47-14.51.06 1.2.11 2.41.15 3.6.15 3.6.25 7.23.09 10.83-.24.03-.48.05-.71.07v.01Zm-12.33-30.94c.37.63 2.01 1.01 3.23 1.25v.15c-1.31-.31-2.59-.73-3.83-1.29.12-.36.23-.72.33-1.09.08.48.18.84.27.98Zm13.7 31.65v-.18c3.41-.56 6.71-2.02 9.69-3.68 2.31-1.28 4.59-2.78 6.63-4.53-4.69 4.53-11.61 8.24-16.33 8.38l.01.01Zm24.07-.75c-2.05 1.93-4.37 3.56-6.83 4.95 2.7-1.78 5.52-4.03 8.42-6.87.82-.82 1.56-1.69 2.23-2.59-1.08 1.65-2.38 3.16-3.81 4.51h-.01ZM187.16 92.14c-.79-2.47-2.1-7.12-3.1-6.87-.19-.01-2.09.77-4.08 1.54-3.06 1.18-5.91 2.13-10.09 2.82-2.74.42-5.87 1.01-10.61 1.06.04-3.34.05-6.01.05-7.99 7.97-.65 12.33-2.11 16.37-3.55 1.11-.39 2.69-1.01 2.63-1.8-.08-.35-.55-1.39-1.17-2.61-.47-1.16-.98-2.31-1.61-3.38-.42-.71-1.04-1.69-1.86-2.06-.11-.08-.22-.13-.29-.12-.02 0-.04 0-.07.01-.19-.04-.39-.05-.6-.01-.17.03-.24.15-.25.28-.04.02-.09.04-.14.05-4.33 1.48-8.85 2.33-13.24 3.61a499.1 499.1 0 0 0-.31-8.19c4.51-.99 8.88-1.38 13.11-1.82 3.68-.38 6.28.12 7.47.34.59.11.9.16 1.16.18h.1c-.1.37.44.66.62.28.02-.04.03-.08.05-.13.15.2.53.22.62-.1.17-.58.19-1.21.21-1.81v-.36c.03-.15.05-.3.07-.45.52-2.47.33-5.09-.64-7.44-.11-.27-.44-.28-.6-.14-.08-.21-.15-.42-.24-.62-.19-.41-.79-.05-.6.35.03.07.05.15.09.22-.98-.42-2.15-.54-3.17-.63-2.17-.19-4.37-.14-6.54 0-5.7.35-11.4 1.3-16.91 2.79-2.08.56-4.13 1.22-6.14 2-4.54 1.05-3.79 1.51-2.17 6.07.18.51.46 1.68.54 1.94.82 2.47 1.08 2.13 3.1 2.13s0 .05 0 .08h.52c-.48 2.66-.51 5.45-.62 8.13-.15 3.48-.22 6.96-.28 10.45 0 .41-.01.82-.02 1.23-.16.29-.33.57-.51.85-.05.38-.09.77-.14 1.18-.42 3.52-.59 6.48-.52 8.8v.34c.02.47.05.76.06.87.16 1.57-.26 3.47 1.35 3.79 1.61.32 3.5.55 4.85.55.11 0 .22-.02.33-.02 1.79.24 3.67.05 5.45-.12 2.85-.28 5.69-.7 8.51-1.19 3.03-.53 6.05-1.14 9.04-1.86 2.4-.58 4.82-1.19 7.13-2.06.51-.19 1.73-.57 2.46-1.14 1.81-.68 2.18-1 1.57-2.67-.23-.62-.48-1.49-.91-2.78l-.03-.02Zm-11.12-38.71c.89.05 1.93.08 2.89.3-.33 0-.68-.02-1.06-.03-8.28-.26-14.88.75-23.97 2.51 2.41-.64 4.85-1.16 7.28-1.59 4.87-.86 9.91-1.45 14.86-1.19Zm-26.53 22.13c.03 1.71.04 3.43 0 5.14-.04 1.27-.11 2.55-.24 3.82 0-.73.02-1.46.04-2.19.05-2.26.12-4.51.22-6.77h-.02Zm6.73 27.85c.2-.1.4-.21.58-.33 1.82-.17 3.82-.24 5.94-.34-.86.11-1.72.24-2.58.33-1.27.14-2.61.31-3.93.34h-.01ZM534.48 85.44c-3.52-8.38-7.07-16.75-10.5-25.17-.63-1.54-1.25-3.09-1.86-4.65-.31-.8-.65-1.6-.87-2.43-.04-.17-.17-.24-.31-.25.1-.2 0-.51-.29-.53-1.59-.08-3.18-.22-4.78-.25-1.96-.03-3.91.13-5.84.42-.31.05-.31.38-.13.56-.03.06-.05.14-.04.22.23 1.54.63 3.06 1.16 4.53.13.35.27.7.41 1.06l-2.68 6.18c-.11.03-.2.09-.25.22-.67 1.9-1.52 3.73-2.34 5.56a536.85 536.85 0 0 1-3.9 8.45c-2.64 5.64-5.34 11.25-7.91 16.93-.44.97-.88 1.94-1.29 2.93-.2.48-.47 1-.55 1.52v.05c-.02.12.02.26.16.34 1.19.73 2.41 1.41 3.66 2.05 1.2.62 2.45 1.25 3.76 1.61.43.12.62-.55.19-.67-1.13-.31-2.2-.83-3.24-1.36 1.09.36 2.1.69 2.75.93 2.82 1.01 2.38 1.1 4.3-3.75 2.1-1.09 4.34-1.96 6.53-2.79 4.35-1.64 8.8-3.03 13.27-4.29.82 2.01 1.77 3.97 2.72 5.92.35.83.62 1.45.79 1.82.22.42.45.8.69 1.15.17.33.33.67.5 1 .42.8.84 1.63 1.4 2.35.23.29.6 0 .55-.31 1.53-.02 3.06-.07 4.58-.27.92-.12 1.82-.32 2.71-.54 1.39-.27 3.85-1.11 3.74-1.42-.67-1.96-1.55-3.87-2.34-5.78-1.57-3.78-3.16-7.56-4.75-11.33v-.01Zm-11.65-26.16c1.54 3.81 3.12 7.6 4.7 11.4 2.94 7.05 5.91 14.09 8.87 21.13l-1.06-2.17c-2.71-5.51-5.2-11.19-7.41-16.87l-6.65-17.15c-.65-1.45-.55-2.19-.93-2.53.09 0 .18.01.28.02a.29.29 0 0 0-.04.26c.52 2.02 1.47 3.98 2.25 5.91h-.01Zm-6.58 13.58c.05-.15.09-.31.14-.46 1.41 3.92 2.88 7.9 4.39 11.87-3.22.52-6.38 1.25-9.46 2.14.55-1.22 1.05-2.46 1.53-3.7 1.24-3.24 2.37-6.53 3.39-9.85h.01Zm-.23-20c.36 0 .73.03 1.09.05-2.15.1-5.18.33-5.87.74-.24.15-.41.3-.53.45-.06-.29-.13-.58-.18-.88 1.82-.26 3.65-.39 5.49-.35v-.01Zm-.09 18.72c-.49 1.67-1.05 3.33-1.6 4.97-1.07 3.19-2.19 6.38-3.57 9.46-.09.21-.19.43-.29.65-.25.07-.5.14-.74.22 2.53-6.16 4.61-11.29 6.2-15.3Zm-6.34 25.16c4.97-2.38 9.37-4.1 14.02-5.27l.26.64c-4.8 1.35-9.63 2.8-14.28 4.63Zm20.17 6.76c.33.23.68.42 1.04.56h-.33c-.12 0-.21.06-.26.13-.15-.23-.31-.45-.45-.7v.01ZM226.57 91.75c-3.55-4.74-6.68-9.11-9.31-12.99 9.2-15.25 10.05-17.81 10.35-18.38.17-.34 1.09-2.27.64-2.53-1.13-.65-1.03-.65-2.97-1.71-1.19-.65-3.04-1.61-4.53-2.12-1.71-.59-1.24-.36-3 2.77-.06.1-.11.2-.17.3-.75 1.02-1.48 2.05-2.2 3.09-1.88 2.71-3.73 5.45-5.69 8.1-3.68-4.91-6.88-8.76-9.51-11.43-.15-.15-.3-.29-.46-.42-1.27-1.28-7.24 3.53-7.93 5.58-.09.09-.19.16-.28.25-.27.26.03.64.33.58.19.65.5 1.29.94 1.91 3.85 5.06 7.19 9.76 9.94 14-1.23 2.61-3.06 5-4.67 7.38l-2.28 3.33c-.5.66-.93 1.23-1.29 1.69-.67.93-2.09 2.61-2.3 3.87-.51.85-1.16 1.84-1.29 2.83-.06.44.61.63.67.19.01-.08.04-.15.06-.22 1.36 1.08 2.76 2.11 4.19 3.11 1.3.91 2.62 1.85 4.04 2.56.21.1.4 0 .48-.17.24.07.48.14.72.2.44.1.62-.57.19-.67-2.02-.48-3.77-1.57-5.23-3.02-.47-.46-.9-.96-1.32-1.46 1.74 1.35 4.2 2.89 5.89 4.14 1.39 1.03 2.85-2.27 4.22-4.2 1.86-2.64 3.96-5.86 5.52-8.29l10.39 14.51c.67.81 1.14 1.21 1.57 1.36-.05.24.12.51.41.4 1.53-.58 3.05-1.19 4.54-1.87 1.52-.69 3.06-1.45 4.36-2.5a.28.28 0 0 0 .12-.23c1.66-1.1.81-1.74-1.41-4.91-1.13-1.58-1.71-2.36-3.7-5.01l-.03-.02Zm2.41 6.54c.56 1.15 1.19 2.52 1.11 3.81-.06.04-.12.07-.17.1-.03-.88-.55-2.66-.94-3.91Zm-16.51-32.73c1.86-2.65 3.65-5.35 5.57-7.95.4-.55.81-1.13 1.26-1.66.19-.18.38-.33.56-.45.18.03.36.08.55.13l-8.05 10.11.12-.18h-.01ZM192.7 95.48c.79-1.37 1.66-2.69 2.54-4 1.19-1.79 2.4-3.56 3.61-5.33-.04.09-.09.17-.13.26-.1.22.03.41.2.49-2.47 3.42-4.89 6.73-6.4 9.28.21.24.4.48.63.75-.24.07-.4.36-.17.56.4.33.72.77 1.05 1.17.09.11.18.21.27.32-.84-.61-1.66-1.24-2.47-1.88.24-.57.58-1.11.87-1.61v-.01Zm7.46-10.32c.47-.81.98-1.59 1.49-2.37.31-.48.64-.95.96-1.43.26-.29.52-.56.75-.79-.99 1.48-2.09 3.03-3.2 4.59Zm10.03-16.22s-.03-.05-.05-.07c.22-.29.43-.59.64-.89-.2.32-.4.65-.58.96h-.01ZM371.54 87.96c-.01-.08-.01-.16-.03-.23-.06-.38-.58-.29-.66.03-.3-.05-.6-.08-.81-.11-1.14-.15-2.29-.19-3.44-.2 1.04-.09 2.09-.18 3.14-.23.45-.02.45-.72 0-.7-6.57.35-13.14 1.23-19.65 2.11-1.53.21-3.05.42-4.57.68-.01 0-.02.01-.04.01-.04-3.33-.13-6.66-.24-9.99-.19-5.7-.4-11.41-.88-17.1-.13-1.51-.23-3.07-.49-4.58 0-.25 0-.48-.02-.68-.06-1.19-.04-2.61-.68-2.78-.16-.07-.72-.16-1.5-.24.22-.17.16-.62-.2-.63-1.19-.04-2.39.09-3.57.23-1.2.14-2.41.32-3.59.6-.16-.1-.41-.06-.5.12-.06.02-.13.03-.19.05-.35.1-.29.55-.03.66-.26.6-.19 2.27-.21 3-.02.66-.66 33.73-.9 40.3-.03.65.06 1.12.04 1.45-.16 3.05.87 4.96 6.34 3.93 1.09-.08 2.75-.77 5.36-1.43 4.13-1.04 5.78-1.52 6.2-1.65 6.43-1.69 6.78-1.97 11.72-2.43.55-.05 4.8-.38 6.03-.3.64.04 1.19.07 1.65.1.09 0 .16-.03.24-.05.1.27.56.33.66-.02.39-1.32.61-2.71.78-4.08.2-1.61.29-3.24.15-4.86.24.03.52-.23.38-.53-.09-.2-.27-.33-.49-.43v-.02Zm-.63.56c.07.57.11 1.14.11 1.71-.21-.99-.53-1.71-.95-1.87.22.03.44.06.65.11.06.01.12.04.19.05Zm-25.41 1.73c1.54-.36 3.1-.64 4.66-.89-1.61.37-3.18.77-4.66 1.2v-.31Zm-.86-7.37c-.07-1.37-.16-2.75-.25-4.12-.21-3.13-.45-6.27-.79-9.4.02-2.25.08-4.31.13-6.11.16 2.08.29 4.16.4 6.24.23 4.46.38 8.93.5 13.39h.01Zm-.94-4c.16 2.41.29 4.83.39 7.24.06 1.6.14 3.22.09 4.83-.15.05-.32.09-.47.14V78.88h-.01ZM483.72 92.83c-3.05-2.28-6.22-4.4-9.38-6.51 8.86-6.49 13.49-12.95 13.73-19.23.04-.76 0-1.5-.13-2.2-.67-3.82-3.5-6.68-8.39-8.48.13.04.27.08.4.13 3.92 1.39 7.74 4.23 8.5 8.56.34 1.95-.05 3.96-.98 5.69-.21.4.39.75.6.35 1.86-3.46 1.46-7.55-.97-10.63-3.53-4.47-9.76-5.88-15.16-6.16-2.32-.12-4.64-.04-6.95.19-6 .32-12.71 1.68-17.63 3.21-.37.11-.67.23-.92.35-.2-.17-.62.02-.57.37v.03c-.64.68-.18 1.64.48 3.21.38.91.67 1.89 1.15 2.58.32.76.68 1.51 1.13 2.19.14.21.38.19.53.07.19-.02.38-.05.57-.08v1.57c-.06.06-.1.13-.11.23-.27 4.18-.34 8.38-.48 12.57l-.3 9.03c-.24 3.91-.44 6.77-.46 7.26-.05.88-.11 1.95.07 2.81-.01.22-.02.43-.04.65 0 .11-.02.23-.03.35 0 .05-.03.27-.01.16-.05.4.5.59.64.28.05.04.12.08.2.08 1.75.13 3.5.28 5.25.3 1.69.02 3.38-.12 5.06-.32.08.23.36.39.55.15.06-.08.11-.17.16-.26.18-.09.24-.32.18-.48.05-.2.1-.4.13-.6.16-.86.25-1.74.33-2.62.11-1.17.17-2.34.23-3.51.15-.01.32-.03.52-.04.36-.03 1.73-.15 2.06-.15.39 0 .7-.02.95-.04 1.76 1.11 3.45 2.35 5.14 3.55 2.83 2.01 5.64 4.04 8.47 6.04 1.42 1 2.85 2 4.29 2.97.1.06.19.07.27.04.08 0 .17-.02.25-.1 1.61-1.56 3.15-3.18 4.6-4.88.75-.88 1.49-1.78 2.15-2.73.01.01.03.02.04.03.34.3.83-.2.49-.49-2.16-1.9-4.34-3.76-6.64-5.48l.03-.01Zm-6.38-3.65a55.72 55.72 0 0 0-4-2.13c.14-.1.26-.19.4-.29 1.2.81 2.4 1.61 3.6 2.42Zm-20.1 11.78c.67-.37 1.23-.91 1.67-1.6-.11.5-.24 1-.38 1.49-.43.04-.86.08-1.29.11Zm2.38-37.24c1.34-.31 2.56-.52 3.71-.69-1.03.19-2.04.41-3.04.65-.14-.07-.34-.02-.45.11-.07.02-.15.04-.22.05v-.13.01Zm.04.84c.07-.02.14-.03.2-.05.34 1.66.41 3.41.5 5.09.17 2.9.24 5.81.28 8.71l.03 3.17c-.17.07-.34.14-.51.2-.06-4.96-.21-10.58-.51-17.12h.01Zm16.04 5.62c-1.16 2.25-3.06 4.1-5.02 5.66-2.8 2.23-5.99 3.97-9.3 5.35-.01-3.56-.09-7.12-.27-10.67-.1-2.04-.16-4.16-.57-6.18 3.3-.78 6.72-1.36 10.1-1.1 1.85.14 4.23.59 5.32 2.29.92 1.43.46 3.24-.26 4.65Zm.85-.18c.6-1.37.9-2.92.28-4.32-.67-1.52-2.2-2.32-3.76-2.74.46.1.89.21 1.29.37 1.74.67 2.69 1.88 2.93 3.21.2 1.13-.05 2.25-.74 3.47V70Zm-27.47-4.14c-.12-.19-.23-.38-.34-.57.74.42.85.36.99.41v.08c-.22.03-.43.06-.65.08Zm11.21 30.46c-.08 1.08-.16 2.17-.33 3.24-.05.35-.11.69-.2 1.03 0 .04-.02.07-.03.11-.15.02-.3.04-.45.05.45-1.64.76-3.36.79-5.07.03-.29.08-.57.1-.89-.03-.31-.03-.47.24-.57-.04.69-.07 1.39-.12 2.08v.02Zm5.6-2.47c.48.11.92.52 2.49 1.72-.46-.32-.92-.65-1.38-.97-.37-.25-.73-.5-1.1-.75h-.01Zm21.23 7.24a70.76 70.76 0 0 1-4.37 4.63c-.14-.09-.27-.19-.4-.28.19-.09.37-.24.55-.47.87-1.14 5.43-5.51 5.49-7.45.31.26.62.53.92.79-.67.97-1.42 1.88-2.19 2.77v.01Z",fill:"currentColor",transform:"translate(-144.023 -51.76)"})]}),vle=({style:e,size:t="small",withText:n})=>p.jsxs("div",{className:`ExcalidrawLogo is-${t}`,style:e,children:[p.jsx(gle,{}),n&&p.jsx(ble,{})]}),cb=({icon:e,shortcut:t,children:n})=>{let r=Sn();return p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"welcome-screen-menu-item__icon",children:e}),p.jsx("div",{className:"welcome-screen-menu-item__text",children:n}),t&&!r.editor.isMobile&&p.jsx("div",{className:"welcome-screen-menu-item__shortcut",children:t})]})};cb.displayName="WelcomeScreenMenuItemContent";var eh=({onSelect:e,children:t,icon:n,shortcut:r,className:a="",...i})=>p.jsx("button",{...i,type:"button",className:`welcome-screen-menu-item ${a}`,onClick:e,children:p.jsx(cb,{icon:n,shortcut:r,children:t})});eh.displayName="WelcomeScreenMenuItem";var HT=({children:e,href:t,icon:n,shortcut:r,className:a="",...i})=>p.jsx("a",{...i,className:`welcome-screen-menu-item ${a}`,href:t,target:"_blank",rel:"noreferrer",children:p.jsx(cb,{icon:n,shortcut:r,children:e})});HT.displayName="WelcomeScreenMenuItemLink";var wl=({children:e})=>{let{WelcomeScreenCenterTunnel:t}=Vr();return p.jsx(t.In,{children:p.jsx("div",{className:"welcome-screen-center",children:e||p.jsxs(p.Fragment,{children:[p.jsx(db,{}),p.jsx(ub,{children:L("welcomeScreen.defaults.center_heading")}),p.jsxs(fb,{children:[p.jsx(pb,{}),p.jsx(hb,{})]})]})})})};wl.displayName="Center";var db=({children:e})=>p.jsx("div",{className:"welcome-screen-center__logo excalifont welcome-screen-decor",children:e||p.jsx(vle,{withText:!0})});db.displayName="Logo";var ub=({children:e})=>p.jsx("div",{className:"welcome-screen-center__heading welcome-screen-decor excalifont",children:e});ub.displayName="Heading";var fb=({children:e})=>p.jsx("div",{className:"welcome-screen-menu",children:e});fb.displayName="Menu";var hb=()=>{let e=Lr();return p.jsx(eh,{onSelect:()=>e.executeAction(Y8),shortcut:"?",icon:C5,children:L("helpDialog.title")})};hb.displayName="MenuItemHelp";var pb=()=>{let e=Ur(),t=Lr();return e.viewModeEnabled?null:p.jsx(eh,{onSelect:()=>t.executeAction(H6),shortcut:ir("loadScene"),icon:M5,children:L("buttons.load")})};pb.displayName="MenuItemLoadScene";var WT=({onSelect:e})=>{let{t}=Zn();return p.jsx(eh,{shortcut:null,onSelect:e,icon:iS,children:t("labels.liveCollaboration")})};WT.displayName="MenuItemLiveCollaborationTrigger";wl.Logo=db;wl.Heading=ub;wl.Menu=fb;wl.MenuItem=eh;wl.MenuItemLink=HT;wl.MenuItemHelp=hb;wl.MenuItemLoadScene=pb;wl.MenuItemLiveCollaborationTrigger=WT;var yle=({children:e})=>{let{WelcomeScreenMenuHintTunnel:t}=Vr();return p.jsx(t.In,{children:p.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--menu",children:[r$,p.jsx("div",{className:"welcome-screen-decor-hint__label",children:e||L("welcomeScreen.defaults.menuHint")})]})})};yle.displayName="MenuHint";var xle=({children:e})=>{let{WelcomeScreenToolbarHintTunnel:t}=Vr();return p.jsx(t.In,{children:p.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--toolbar",children:[p.jsx("div",{className:"welcome-screen-decor-hint__label",children:e||L("welcomeScreen.defaults.toolbarHint")}),i$]})})};xle.displayName="ToolbarHint";var wle=({children:e})=>{let{WelcomeScreenHelpHintTunnel:t}=Vr();return p.jsx(t.In,{children:p.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--help",children:[p.jsx("div",{children:e||L("welcomeScreen.defaults.helpHint")}),a$]})})};wle.displayName="HelpHint";Af((e,t,n)=>{if(et.DEV||et.MODE===Tr.TEST||window!=null&&window.DEBUG_FRACTIONAL_INDICES){let r=ul(e.map(a=>({...a})));H5(r,{shouldThrow:et.DEV||et.MODE===Tr.TEST,includeBoundTextValidation:!0,reconciliationContext:{localElements:t,remoteElements:n}})}},1e3*60,{leading:!0,trailing:!1});Ule();var Ele=e=>{var q,V,ee,X;let{onChange:t,initialData:n,excalidrawAPI:r,isCollaborating:a=!1,onPointerUpdate:i,renderTopRightUI:l,langCode:s=Oo.code,viewModeEnabled:d,zenModeEnabled:u,gridModeEnabled:o,libraryReturnUrl:f,theme:m,name:U,renderCustomStats:g,onPaste:v,detectScroll:y=!0,handleKeyboardGlobally:w=!1,onLibraryChange:E,autoFocus:S=!1,generateIdForFile:k,onLinkOpen:I,generateLinkForSelection:T,onPointerDown:M,onPointerUp:j,onScrollChange:D,onDuplicate:P,children:N,validateEmbeddable:$,renderEmbeddable:z,aiEnabled:Z,showDeprecatedFonts:K}=e,Q=(q=e.UIOptions)==null?void 0:q.canvasActions,W={...e.UIOptions,canvasActions:{...kv.canvasActions,...Q},tools:{image:((ee=(V=e.UIOptions)==null?void 0:V.tools)==null?void 0:ee.image)??!0}};return Q!=null&&Q.export&&(W.canvasActions.export.saveFileToDisk=((X=Q.export)==null?void 0:X.saveFileToDisk)??kv.canvasActions.export.saveFileToDisk),W.canvasActions.toggleTheme===null&&typeof m>"u"&&(W.canvasActions.toggleTheme=!0),_.useEffect(()=>{(async()=>await Re(()=>import("./roundRect-0PYZxl1G.js"),[]))();let se=ge=>{typeof ge.scale=="number"&&ge.scale!==1&&ge.preventDefault()};return document.addEventListener("touchmove",se,{passive:!1}),()=>{document.removeEventListener("touchmove",se)}},[]),p.jsx(pee,{store:$a,children:p.jsx(bee,{langCode:s,theme:m,children:p.jsx(ple,{onChange:t,initialData:n,excalidrawAPI:r,isCollaborating:a,onPointerUpdate:i,renderTopRightUI:l,langCode:s,viewModeEnabled:d,zenModeEnabled:u,gridModeEnabled:o,libraryReturnUrl:f,theme:m,name:U,renderCustomStats:g,UIOptions:W,onPaste:v,detectScroll:y,handleKeyboardGlobally:w,onLibraryChange:E,autoFocus:S,generateIdForFile:k,onLinkOpen:I,generateLinkForSelection:T,onPointerDown:M,onPointerUp:j,onScrollChange:D,onDuplicate:P,validateEmbeddable:$,renderEmbeddable:z,aiEnabled:Z!==!1,showDeprecatedFonts:K,children:N})})})},Sle=(e,t)=>{if(e.children!==t.children)return!1;let{initialData:n,UIOptions:r={},...a}=e,{initialData:i,UIOptions:l={},...s}=t,d=Object.keys(r),u=Object.keys(l);return d.length!==u.length?!1:d.every(o=>o==="canvasActions"?Object.keys(r.canvasActions).every(f=>{var m,U,g,v;return f==="export"&&((m=r==null?void 0:r.canvasActions)!=null&&m.export)&&((U=l==null?void 0:l.canvasActions)!=null&&U.export)?r.canvasActions.export.saveFileToDisk===l.canvasActions.export.saveFileToDisk:((g=r==null?void 0:r.canvasActions)==null?void 0:g[f])===((v=l==null?void 0:l.canvasActions)==null?void 0:v[f])}):r[o]===l[o])&&Yn(a,s)},mb=we.memo(Ele,Sle);mb.displayName="Excalidraw";const kle=Object.freeze(Object.defineProperty({__proto__:null,Button:jo,CaptureUpdateAction:ie,DEFAULT_LASER_COLOR:kE,DefaultSidebar:q6,Excalidraw:mb,FONT_FAMILY:Xt,MIME_TYPES:De,MainMenu:ur,ROUNDNESS:bn,Sidebar:ja,Stats:fm,THEME:ot,TTDDialog:AT,UserIdleState:RE,bumpVersion:Gf,convertToExcalidrawElements:Ji,defaultLang:Oo,elementPartiallyOverlapsWithOrContainsBBox:Kk,elementsOverlappingBBox:qk,exportToBlob:Zk,exportToCanvas:Xf,exportToSvg:l8,getCommonBounds:xt,getDataURL:w6,getFreeDrawSvgPath:L5,getNonDeletedElements:Rt,getTextFromElements:uk,getVisibleSceneBounds:GS,hashString:fC,isElementLink:Nc,isInvisiblySmallElement:_o,isLinearElement:Ge,languages:nm,loadFromBlob:x8,loadLibraryFromBlob:bC,loadSceneOrLibraryFromBlob:y8,mergeLibraryItems:w_,mutateElement:pe,newElementWith:Ke,normalizeLink:Rr,restore:Hf,restoreAppState:Hk,restoreElements:Bf,restoreLibraryItems:H0,sceneCoordsToViewportCoords:oa,serializeAsJSON:Ff,serializeLibraryAsJSON:X5,useDevice:Sn,useI18n:Zn,viewportCoordsToSceneCoords:jt,zoomToFitBounds:c_},Symbol.toStringTag,{value:"Module"})),XT="agent-canvas-list",Ub="agent-canvas-scene-",n5="agent-canvas-scene",Cle="Default";function VT(){return Math.random().toString(36).substring(2,10)}function gb(){return Date.now()}function mw(){try{const r=localStorage.getItem(XT);if(r)return JSON.parse(r)}catch(r){console.error("Failed to load canvas list:",r)}if(localStorage.getItem(n5))return Ile();const t=GT(),n={activeCanvasId:t.id,canvases:[t]};return Aa(n),n}function Aa(e){try{localStorage.setItem(XT,JSON.stringify(e))}catch(t){console.error("Failed to save canvas list:",t)}}function F1(e){try{const t=`${Ub}${e}`,n=localStorage.getItem(t);if(n)return JSON.parse(n)}catch(t){console.error(`Failed to load canvas scene ${e}:`,t)}return null}function ju(e,t){try{const n=`${Ub}${e}`;localStorage.setItem(n,JSON.stringify(t))}catch(n){console.error(`Failed to save canvas scene ${e}:`,n)}}function Mle(e){try{const t=`${Ub}${e}`;localStorage.removeItem(t)}catch(t){console.error(`Failed to delete canvas scene ${e}:`,t)}}function GT(){const e=gb();return{id:VT(),name:Cle,createdAt:e,updatedAt:e}}function Ile(){const e=GT();try{const n=localStorage.getItem(n5);if(n){const r=JSON.parse(n),a={elements:r.elements||[],appState:r.appState||{}};ju(e.id,a),localStorage.removeItem(n5),console.log("Migrated legacy canvas data to new format")}}catch(n){console.error("Failed to migrate legacy data:",n)}const t={activeCanvasId:e.id,canvases:[e]};return Aa(t),t}function Uw(e){const t=gb();return{id:VT(),name:e,createdAt:t,updatedAt:t}}function gw(e,t){return{...e,canvases:e.canvases.map(n=>n.id===t?{...n,updatedAt:gb()}:n)}}function _le(e,t){const n=t.toLowerCase();return e.canvases.find(r=>r.name.toLowerCase()===n)}function B1(e,t,n){const r=t.toLowerCase();return!e.canvases.some(a=>a.name.toLowerCase()===r&&a.id!==n)}/**
|
|
255
|
+
* @license lucide-react v0.563.0 - ISC
|
|
256
|
+
*
|
|
257
|
+
* This source code is licensed under the ISC license.
|
|
258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
+
*/const YT=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
260
|
+
* @license lucide-react v0.563.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/const Tle=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
265
|
+
* @license lucide-react v0.563.0 - ISC
|
|
266
|
+
*
|
|
267
|
+
* This source code is licensed under the ISC license.
|
|
268
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
+
*/const Ale=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
270
|
+
* @license lucide-react v0.563.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* This source code is licensed under the ISC license.
|
|
273
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
+
*/const bw=e=>{const t=Ale(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
275
|
+
* @license lucide-react v0.563.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/var Rle={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
280
|
+
* @license lucide-react v0.563.0 - ISC
|
|
281
|
+
*
|
|
282
|
+
* This source code is licensed under the ISC license.
|
|
283
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
+
*/const jle=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
285
|
+
* @license lucide-react v0.563.0 - ISC
|
|
286
|
+
*
|
|
287
|
+
* This source code is licensed under the ISC license.
|
|
288
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
+
*/const Lle=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...s},d)=>_.createElement("svg",{ref:d,...Rle,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:YT("lucide",a),...!i&&!jle(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,o])=>_.createElement(u,o)),...Array.isArray(i)?i:[i]]));/**
|
|
290
|
+
* @license lucide-react v0.563.0 - ISC
|
|
291
|
+
*
|
|
292
|
+
* This source code is licensed under the ISC license.
|
|
293
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
+
*/const bb=(e,t)=>{const n=_.forwardRef(({className:r,...a},i)=>_.createElement(Lle,{ref:i,iconNode:t,className:YT(`lucide-${Tle(bw(e))}`,`lucide-${e}`,r),...a}));return n.displayName=bw(e),n};/**
|
|
295
|
+
* @license lucide-react v0.563.0 - ISC
|
|
296
|
+
*
|
|
297
|
+
* This source code is licensed under the ISC license.
|
|
298
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
+
*/const Dle=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Ple=bb("grip-vertical",Dle);/**
|
|
300
|
+
* @license lucide-react v0.563.0 - ISC
|
|
301
|
+
*
|
|
302
|
+
* This source code is licensed under the ISC license.
|
|
303
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
+
*/const Nle=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Ole=bb("panel-left-close",Nle);/**
|
|
305
|
+
* @license lucide-react v0.563.0 - ISC
|
|
306
|
+
*
|
|
307
|
+
* This source code is licensed under the ISC license.
|
|
308
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
+
*/const $le=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],zle=bb("plus",$le);function Fle({scene:e,isDarkMode:t=!1}){const[n,r]=_.useState(null),[a,i]=_.useState(!1),l=_.useMemo(()=>e!=null&&e.elements?e.elements.filter(u=>!u.isDeleted):[],[e]);_.useEffect(()=>{if(l.length===0){r(null);return}let u=!1;return i(!0),(async()=>{try{const{exportToSvg:f}=await Re(async()=>{const{exportToSvg:v}=await Promise.resolve().then(()=>kle);return{exportToSvg:v}},void 0),m=await f({elements:l,appState:{exportBackground:!0,exportWithDarkMode:t,exportEmbedScene:!1},files:(e==null?void 0:e.files)||null,skipInliningFonts:!0});if(u)return;m.removeAttribute("width"),m.removeAttribute("height"),m.style.maxWidth="100%",m.style.maxHeight="100%",m.style.width="auto",m.style.height="auto";const g=new XMLSerializer().serializeToString(m);r(g)}catch(f){console.error("Failed to generate thumbnail:",f),u||r(null)}finally{u||i(!1)}})(),()=>{u=!0}},[l,t,e==null?void 0:e.files]);const s={width:"100%",aspectRatio:"16 / 10",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t?"#121212":"#ffffff",overflow:"hidden"},d={color:t?"#666":"#999",fontSize:12};return a?p.jsx("div",{style:s,children:p.jsx("span",{style:d,children:"..."})}):!n||l.length===0?p.jsx("div",{style:s,children:p.jsx("span",{style:d,children:"Empty"})}):p.jsx("div",{style:s,dangerouslySetInnerHTML:{__html:n}})}const ZT="Assistant, system-ui, BlinkMacSystemFont, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif";function Ble(e){const n=Date.now()-e,r=Math.floor(n/1e3),a=Math.floor(r/60),i=Math.floor(a/60),l=Math.floor(i/24);return r<60?"just now":a<60?`${a} min ago`:i<24?`${i} hr ago`:l<7?`${l} day${l>1?"s":""} ago`:new Date(e).toLocaleDateString()}function Hle({canvas:e,isActive:t,scene:n,isDarkMode:r,onSelect:a,onRename:i,onDelete:l}){const[s,d]=_.useState(!1),[u,o]=_.useState(e.name),[f,m]=_.useState(!1),[U,g]=_.useState(!1),v=_.useCallback(()=>{const N=u.trim();N&&N!==e.name&&i(N),d(!1)},[u,e.name,i]),y=_.useCallback(N=>{N.key==="Enter"?v():N.key==="Escape"&&(o(e.name),d(!1))},[v,e.name]),w={marginBottom:8,borderRadius:6,cursor:"pointer",border:t?"2px solid #6965db":"2px solid transparent",backgroundColor:r?"#2d2d2d":"#fff",overflow:"hidden"},E={padding:"6px 8px 8px"},S={fontSize:13,fontWeight:t?600:400,color:r?"#e0e0e0":"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},k={display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:2},I={fontSize:11,color:r?"#888":"#999"},T={position:"relative"},M={width:20,height:16,border:"none",background:"transparent",cursor:"pointer",borderRadius:3,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,color:r?"#888":"#666",padding:0},j={position:"absolute",bottom:"100%",right:0,marginBottom:4,backgroundColor:r?"#3d3d3d":"#fff",border:`1px solid ${r?"#555":"#ddd"}`,borderRadius:4,boxShadow:"0 2px 8px rgba(0,0,0,0.15)",zIndex:10,minWidth:80},D={padding:"6px 12px",fontSize:12,cursor:"pointer",color:r?"#e0e0e0":"#333",whiteSpace:"nowrap"},P={width:"100%",fontSize:13,padding:"2px 4px",border:`1px solid ${r?"#555":"#ccc"}`,borderRadius:3,backgroundColor:r?"#1e1e1e":"#fff",color:r?"#e0e0e0":"#333",outline:"none",fontFamily:ZT};return p.jsxs("div",{style:w,onClick:()=>!s&&a(),onMouseEnter:()=>m(!0),onMouseLeave:()=>{m(!1),g(!1)},children:[p.jsx(Fle,{scene:n,isDarkMode:r}),p.jsxs("div",{style:E,children:[s?p.jsx("input",{type:"text",value:u,onChange:N=>o(N.target.value),onBlur:v,onKeyDown:y,style:P,autoFocus:!0,onClick:N=>N.stopPropagation()}):p.jsx("div",{style:S,children:e.name}),p.jsxs("div",{style:k,children:[p.jsx("span",{style:I,children:Ble(e.updatedAt)}),!s&&p.jsxs("div",{style:{...T,visibility:f||U?"visible":"hidden"},children:[p.jsx("button",{style:M,onClick:N=>{N.stopPropagation(),g(!U)},children:"···"}),U&&p.jsxs("div",{style:j,onClick:N=>N.stopPropagation(),children:[p.jsx("div",{style:D,onClick:()=>{o(e.name),d(!0),g(!1)},onMouseEnter:N=>{N.currentTarget.style.backgroundColor=r?"#4d4d4d":"#f0f0f0"},onMouseLeave:N=>{N.currentTarget.style.backgroundColor="transparent"},children:"Rename"}),p.jsx("div",{style:{...D,color:"#e74c3c"},onClick:()=>{g(!1),l()},onMouseEnter:N=>{N.currentTarget.style.backgroundColor=r?"#4d4d4d":"#f0f0f0"},onMouseLeave:N=>{N.currentTarget.style.backgroundColor="transparent"},children:"Delete"})]})]})]})]})]})}function Wle({canvases:e,activeCanvasId:t,scenes:n,isDarkMode:r,canvasBackgroundColor:a,isCollapsed:i=!1,onToggleCollapsed:l,onSelectCanvas:s,onCreateCanvas:d,onRenameCanvas:u,onDeleteCanvas:o}){const f=[...e].sort((k,I)=>k.name.localeCompare(I.name)),g={width:i?12:200,height:"100%",backgroundColor:i?a||"#ffffff":r?"#1e1e1e":"#f8f8f8",borderRight:i?"none":`1px solid ${r?"#333":"#e0e0e0"}`,display:"flex",flexDirection:"column",overflow:"hidden",transition:"width 0.2s ease",fontFamily:ZT,...i&&{justifyContent:"center",alignItems:"center",cursor:"pointer",filter:r?"invert(93%) hue-rotate(180deg)":"none"}},v={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 12px",borderBottom:`1px solid ${r?"#333":"#e0e0e0"}`},y={fontSize:13,fontWeight:600,color:r?"#e0e0e0":"#333"},w={width:24,height:24,border:"none",background:"transparent",cursor:"pointer",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,color:r?"#888":"#666"},E={flex:1,overflowY:"auto",padding:i?0:8},S=16;return i?p.jsx("div",{style:g,onClick:l,title:"Expand sidebar",children:p.jsx(Ple,{size:14,color:r?"#666":"#999"})}):p.jsxs("div",{style:g,children:[p.jsxs("div",{style:v,children:[p.jsx("span",{style:y,children:"Canvases"}),p.jsxs("div",{style:{display:"flex",gap:4},children:[p.jsx("button",{style:w,onClick:d,title:"New canvas",children:p.jsx(zle,{size:S})}),p.jsx("button",{style:w,onClick:l,title:"Collapse sidebar",children:p.jsx(Ole,{size:S})})]})]}),p.jsx("div",{style:E,children:f.map(k=>p.jsx(Hle,{canvas:k,isActive:k.id===t,scene:n.get(k.id)||null,isDarkMode:r,onSelect:()=>s(k.id),onRename:I=>u(k.id,I),onDelete:()=>o(k.id)},k.id))})]})}const Xle=7890,Vle=["showWelcomeScreen","theme","currentChartType","currentItemBackgroundColor","currentItemEndArrowhead","currentItemFillStyle","currentItemFontFamily","currentItemFontSize","currentItemOpacity","currentItemRoughness","currentItemStartArrowhead","currentItemStrokeColor","currentItemStrokeStyle","currentItemStrokeWidth","currentItemTextAlign","currentItemRoundness","currentItemArrowType","cursorButton","editingGroupId","activeTool","penMode","penDetected","exportBackground","exportEmbedScene","exportScale","exportWithDarkMode","gridSize","gridStep","gridModeEnabled","defaultSidebarDockedPreference","lastPointerDownWith","name","openMenu","openSidebar","previousSelectedElementIds","scrolledOutside","scrollX","scrollY","selectedElementIds","selectedGroupIds","shouldCacheIgnoreZoom","stats","viewBackgroundColor","zenModeEnabled","zoom","selectedLinearElement","objectsSnapModeEnabled"];function vw(e){const t=e,n={};for(const r of Vle)r in t&&(n[r]=t[r]);return n}function Gle(){const e=_.useRef(null),t=_.useRef(null),[n,r]=_.useState(()=>mw()),[a,i]=_.useState(!1),l=_.useRef(n);l.current=n;const[s,d]=_.useState(()=>{const Y=new Map,H=mw();for(const re of H.canvases)Y.set(re.id,F1(re.id));return Y}),u=_.useMemo(()=>s.get(n.activeCanvasId)||null,[s,n.activeCanvasId]),o=_.useMemo(()=>{const Y=u==null?void 0:u.appState;return(Y==null?void 0:Y.theme)==="dark"},[u]),f=_.useMemo(()=>{const Y=u==null?void 0:u.appState;return(Y==null?void 0:Y.viewBackgroundColor)||"#ffffff"},[u]),m=_.useCallback(()=>{const Y=e.current;if(!Y)return;const H=l.current,re=Y.getSceneElements(),te=Y.getAppState(),de=Y.getFiles(),me=vw(te),fe={elements:re,appState:me,files:de};ju(H.activeCanvasId,fe),d(Ue=>{const Te=new Map(Ue);return Te.set(H.activeCanvasId,fe),Te}),r(Ue=>{const Te=gw(Ue,H.activeCanvasId);return Aa(Te),Te})},[]),U=_.useCallback(Y=>{const H=l.current;return{type:"listCanvasesResult",id:Y,success:!0,activeCanvasId:H.activeCanvasId,canvases:H.canvases}},[]),g=_.useCallback((Y,H)=>{const re=l.current,te=e.current,de=H.name.trim();if(!de)return{type:"createCanvasResult",id:Y,success:!1,error:"Canvas name cannot be empty"};if(!B1(re,de))return{type:"createCanvasResult",id:Y,success:!1,error:`Canvas "${de}" already exists`};const me=Uw(de);H.switchTo&&m();const fe=te==null?void 0:te.getAppState(),Ue={theme:fe==null?void 0:fe.theme},Te={activeCanvasId:H.switchTo?me.id:re.activeCanvasId,canvases:[...re.canvases,me]};r(Te),Aa(Te);const it={elements:[],appState:Ue};return ju(me.id,it),d(mt=>{const Be=new Map(mt);return Be.set(me.id,it),Be}),H.switchTo&&te&&te.updateScene({elements:[],captureUpdate:ie.IMMEDIATELY}),{type:"createCanvasResult",id:Y,success:!0,canvas:me}},[m]),v=_.useRef(null),y=_.useCallback((Y,H)=>{const re=l.current,te=_le(re,H.name);if(!te)return{type:"switchCanvasResult",id:Y,success:!1,error:`Canvas "${H.name}" not found`};if(te.id===re.activeCanvasId)return{type:"switchCanvasResult",id:Y,success:!0,canvas:te};v.current&&(clearTimeout(v.current),v.current=null),m();const de=F1(te.id),me=e.current;me&&me.updateScene({elements:(de==null?void 0:de.elements)||[],appState:de==null?void 0:de.appState,captureUpdate:ie.IMMEDIATELY});const fe={...re,activeCanvasId:te.id};return r(fe),Aa(fe),d(Ue=>{const Te=new Map(Ue);return Te.set(te.id,de),Te}),{type:"switchCanvasResult",id:Y,success:!0,canvas:te}},[m]),w=_.useCallback((Y,H)=>{const re=l.current,te=H.newName.trim();if(!te)return{type:"renameCanvasResult",id:Y,success:!1,error:"Canvas name cannot be empty"};if(!B1(re,te,re.activeCanvasId))return{type:"renameCanvasResult",id:Y,success:!1,error:`Canvas "${te}" already exists`};const de=re.canvases.map(Ue=>Ue.id===re.activeCanvasId?{...Ue,name:te,updatedAt:Date.now()}:Ue),me={...re,canvases:de};r(me),Aa(me);const fe=de.find(Ue=>Ue.id===re.activeCanvasId);return{type:"renameCanvasResult",id:Y,success:!0,canvas:fe}},[]),E=_.useCallback(Y=>{const H=l.current;if(Y===H.activeCanvasId)return;v.current&&(clearTimeout(v.current),v.current=null),m();const re=F1(Y),te=e.current;te&&te.updateScene({elements:(re==null?void 0:re.elements)||[],appState:re==null?void 0:re.appState,captureUpdate:ie.IMMEDIATELY});const de={...H,activeCanvasId:Y};r(de),Aa(de),d(me=>{const fe=new Map(me);return fe.set(Y,re),fe})},[m]),S=_.useCallback(()=>{const Y=l.current,H=e.current;let re="New Canvas",te=1,de=re;for(;!B1(Y,de);)de=`${re} ${te++}`;const me=Uw(de);m();const fe=H==null?void 0:H.getAppState(),Ue={theme:fe==null?void 0:fe.theme},Te={activeCanvasId:me.id,canvases:[...Y.canvases,me]};r(Te),Aa(Te);const it={elements:[],appState:Ue};ju(me.id,it),d(mt=>{const Be=new Map(mt);return Be.set(me.id,it),Be}),H&&H.updateScene({elements:[],captureUpdate:ie.IMMEDIATELY})},[m]),k=_.useCallback((Y,H)=>{const re=l.current,te=H.trim();if(!te||!B1(re,te,Y))return;const de=re.canvases.map(fe=>fe.id===Y?{...fe,name:te,updatedAt:Date.now()}:fe),me={...re,canvases:de};r(me),Aa(me)},[]),I=_.useCallback(Y=>{const H=l.current;if(H.canvases.length<=1)return;const re=H.canvases.findIndex(fe=>fe.id===Y),te=H.canvases[re===0?1:re-1];if(Y===H.activeCanvasId){const fe=F1(te.id),Ue=e.current;Ue&&Ue.updateScene({elements:(fe==null?void 0:fe.elements)||[],appState:fe==null?void 0:fe.appState,captureUpdate:ie.IMMEDIATELY})}const de=H.canvases.filter(fe=>fe.id!==Y),me={activeCanvasId:Y===H.activeCanvasId?te.id:H.activeCanvasId,canvases:de};r(me),Aa(me),Mle(Y),d(fe=>{const Ue=new Map(fe);return Ue.delete(Y),Ue})},[]),T=_.useCallback((Y,H)=>{const re=e.current;if(!re)return{type:"addShapeResult",id:Y,success:!1,error:"Canvas not ready"};try{const te=re.getSceneElements(),de={type:H.type,x:H.x,y:H.y,strokeColor:H.strokeColor??"#1e1e1e",backgroundColor:H.backgroundColor??"transparent",strokeWidth:H.strokeWidth??2,strokeStyle:H.strokeStyle??"solid",fillStyle:H.fillStyle??"solid",customData:H.customData};H.width!==void 0&&(de.width=H.width),H.height!==void 0&&(de.height=H.height),H.label&&(de.label={text:H.label.text.replace(/\\n/g,`
|
|
310
|
+
`),fontSize:H.label.fontSize??16,textAlign:H.label.textAlign??"center",verticalAlign:H.label.verticalAlign??"middle",strokeColor:H.label.strokeColor});const me=Ji([de]),fe=H.customData?me.map(Te=>({...Te,customData:H.customData})):me;re.updateScene({elements:[...te,...fe],captureUpdate:ie.IMMEDIATELY});const Ue=re.getSceneElements().find(Te=>Te.id===me[0].id);return{type:"addShapeResult",id:Y,success:!0,elementId:me[0].id,x:Math.round((Ue==null?void 0:Ue.x)??H.x),y:Math.round((Ue==null?void 0:Ue.y)??H.y),width:(Ue==null?void 0:Ue.width)!==void 0?Math.round(Ue.width):void 0,height:(Ue==null?void 0:Ue.height)!==void 0?Math.round(Ue.height):void 0}}catch(te){return{type:"addShapeResult",id:Y,success:!1,error:te instanceof Error?te.message:"Unknown error"}}},[]),M=_.useCallback((Y,H)=>{const re=e.current;if(!re)return{type:"addTextResult",id:Y,success:!1,error:"Canvas not ready"};try{const te=re.getSceneElements(),de={type:"text",text:H.text.replace(/\\n/g,`
|
|
311
|
+
`),x:0,y:0,fontSize:H.fontSize??20,textAlign:H.textAlign??"left",strokeColor:H.strokeColor??"#1e1e1e",customData:H.customData},me=Ji([de]),fe=me[0],Ue=fe.width??0,Te=fe.height??0;let it=0,mt=0;const Be=H.anchor??"bottomLeft";Be==="topCenter"||Be==="center"||Be==="bottomCenter"?it=-Ue/2:(Be==="topRight"||Be==="rightCenter"||Be==="bottomRight")&&(it=-Ue),Be==="leftCenter"||Be==="center"||Be==="rightCenter"?mt=-Te/2:(Be==="bottomLeft"||Be==="bottomCenter"||Be==="bottomRight")&&(mt=-Te);const Mt=H.x+it,on=H.y+mt,ze=me.map(ht=>({...ht,x:Mt,y:on,customData:H.customData}));return re.updateScene({elements:[...te,...ze],captureUpdate:ie.IMMEDIATELY}),{type:"addTextResult",id:Y,success:!0,elementId:fe.id,x:Math.round(Mt),y:Math.round(on),width:Math.round(Ue),height:Math.round(Te)}}catch(te){return{type:"addTextResult",id:Y,success:!1,error:te instanceof Error?te.message:"Unknown error"}}},[]),j=_.useCallback((Y,H)=>{const re=e.current;if(!re)return{type:"addLineResult",id:Y,success:!1,error:"Canvas not ready"};try{const te=re.getSceneElements(),de={type:"line",x:H.x,y:H.y,points:[[0,0],[H.endX-H.x,H.endY-H.y]],strokeColor:H.strokeColor??"#1e1e1e",strokeWidth:H.strokeWidth??2,strokeStyle:H.strokeStyle??"solid",customData:H.customData},me=Ji([de]),fe=H.customData?me.map(Ue=>({...Ue,customData:H.customData})):me;return re.updateScene({elements:[...te,...fe],captureUpdate:ie.IMMEDIATELY}),{type:"addLineResult",id:Y,success:!0,elementId:me[0].id}}catch(te){return{type:"addLineResult",id:Y,success:!1,error:te instanceof Error?te.message:"Unknown error"}}},[]),D=_.useCallback((Y,H)=>{const re=e.current;if(!re)return{type:"addArrowResult",id:Y,success:!1,error:"Canvas not ready"};try{const te=re.getSceneElements(),de=H.endX-H.x,me=H.endY-H.y;let fe;if(H.arrowType==="round")if(H.midpoints&&H.midpoints.length>0){const ze=H.midpoints[0];fe=[[0,0],[ze.x-H.x,ze.y-H.y],[de,me]]}else fe=[[0,0],[de/2,me/2],[de,me]];else if(H.arrowType==="elbow")if(H.midpoints&&H.midpoints.length>0){fe=[[0,0]];for(const ze of H.midpoints)fe.push([ze.x-H.x,ze.y-H.y]);fe.push([de,me])}else fe=[[0,0],[de,0],[de,me]];else fe=[[0,0],[de,me]];const Ue=fe.map(ze=>ze[0]),Te=fe.map(ze=>ze[1]),it=Math.max(...Ue)-Math.min(...Ue),mt=Math.max(...Te)-Math.min(...Te);if(H.arrowType==="elbow"||H.arrowType==="round"){const ze=Math.random().toString(36).substring(2,15),ht={id:ze,type:"arrow",x:H.x,y:H.y,width:it||Math.abs(de),height:mt||Math.abs(me),points:fe,strokeColor:H.strokeColor??"#1e1e1e",strokeWidth:H.strokeWidth??2,strokeStyle:H.strokeStyle??"solid",startArrowhead:H.startArrowhead??null,endArrowhead:H.endArrowhead??"arrow",customData:H.customData,startBinding:null,endBinding:null,lastCommittedPoint:null};H.arrowType==="round"?(ht.roundness={type:2},ht.elbowed=!1):H.arrowType==="elbow"&&(ht.elbowed=!0,ht.roundness=null,ht.fixedSegments=[],ht.startIsSpecial=!1,ht.endIsSpecial=!1);const Gr=Bf([ht],null);return re.updateScene({elements:[...te,...Gr],captureUpdate:ie.IMMEDIATELY}),{type:"addArrowResult",id:Y,success:!0,elementId:ze}}const Be={type:"arrow",x:H.x,y:H.y,points:fe,strokeColor:H.strokeColor??"#1e1e1e",strokeWidth:H.strokeWidth??2,strokeStyle:H.strokeStyle??"solid",startArrowhead:H.startArrowhead??null,endArrowhead:H.endArrowhead??"arrow",customData:H.customData},Mt=Ji([Be]),on=H.customData?Mt.map(ze=>({...ze,customData:H.customData})):Mt;return re.updateScene({elements:[...te,...on],captureUpdate:ie.IMMEDIATELY}),{type:"addArrowResult",id:Y,success:!0,elementId:Mt[0].id}}catch(te){return{type:"addArrowResult",id:Y,success:!1,error:te instanceof Error?te.message:"Unknown error"}}},[]),P=_.useCallback((Y,H)=>{const re=e.current;if(!re)return{type:"addPolygonResult",id:Y,success:!1,error:"Canvas not ready"};if(H.points.length<3)return{type:"addPolygonResult",id:Y,success:!1,error:"Polygon requires at least 3 points"};try{const te=re.getSceneElements(),de=H.points[0],me=H.points.map(it=>[it.x-de.x,it.y-de.y]);me.push([0,0]);const fe={type:"line",x:de.x,y:de.y,points:me,strokeColor:H.strokeColor??"#1e1e1e",backgroundColor:H.backgroundColor??"transparent",strokeWidth:H.strokeWidth??2,strokeStyle:H.strokeStyle??"solid",fillStyle:H.fillStyle??"solid",customData:H.customData},Ue=Ji([fe]),Te=H.customData?Ue.map(it=>({...it,customData:H.customData})):Ue;return re.updateScene({elements:[...te,...Te],captureUpdate:ie.IMMEDIATELY}),{type:"addPolygonResult",id:Y,success:!0,elementId:Ue[0].id}}catch(te){return{type:"addPolygonResult",id:Y,success:!1,error:te instanceof Error?te.message:"Unknown error"}}},[]),N=_.useCallback((Y,H)=>{const re=e.current;if(!re)return{type:"deleteElementsResult",id:Y,success:!1,error:"Canvas not ready"};try{const te=re.getSceneElements(),de=new Set(H.elementIds);for(const Ue of te)if(de.has(Ue.id)&&Ue.boundElements)for(const Te of Ue.boundElements)de.add(Te.id);let me=0;const fe=te.map(Ue=>de.has(Ue.id)?(me++,{...Ue,isDeleted:!0}):Ue);return me===0?{type:"deleteElementsResult",id:Y,success:!1,error:"No elements found"}:(re.updateScene({elements:fe,captureUpdate:ie.IMMEDIATELY}),{type:"deleteElementsResult",id:Y,success:!0,deletedCount:me})}catch(te){return{type:"deleteElementsResult",id:Y,success:!1,error:te instanceof Error?te.message:"Unknown error"}}},[]),$=_.useCallback((Y,H)=>{const re=e.current;if(!re)return{type:"rotateElementsResult",id:Y,success:!1,error:"Canvas not ready"};try{const te=re.getSceneElements(),de=new Set(H.elementIds),me=H.angle*Math.PI/180;let fe=0;const Ue=new Set;te.forEach(Be=>{var Mt;de.has(Be.id)&&((Mt=Be.groupIds)!=null&&Mt.length)&&Be.groupIds.forEach(on=>Ue.add(on))});const Te=new Set,it=new Map;te.forEach(Be=>{var on;if((de.has(Be.id)||Ue.size>0&&((on=Be.groupIds)==null?void 0:on.some(ze=>Ue.has(ze))))&&Be.boundElements){const ze=(Be.angle??0)+me;for(const ht of Be.boundElements)ht.type==="text"&&(Te.add(ht.id),it.set(ht.id,ze))}});const mt=te.map(Be=>{var on;return Te.has(Be.id)?{...Be,angle:it.get(Be.id)??Be.angle}:de.has(Be.id)||Ue.size>0&&((on=Be.groupIds)==null?void 0:on.some(ze=>Ue.has(ze)))?(fe++,{...Be,angle:(Be.angle??0)+me}):Be});return fe===0?{type:"rotateElementsResult",id:Y,success:!1,error:"No elements found"}:(re.updateScene({elements:mt,captureUpdate:ie.IMMEDIATELY}),{type:"rotateElementsResult",id:Y,success:!0,rotatedCount:fe})}catch(te){return{type:"rotateElementsResult",id:Y,success:!1,error:te instanceof Error?te.message:"Unknown error"}}},[]),z=_.useCallback((Y,H)=>{const re=e.current;if(!re)return{type:"groupElementsResult",id:Y,success:!1,error:"Canvas not ready"};if(H.elementIds.length<2)return{type:"groupElementsResult",id:Y,success:!1,error:"At least 2 elements required for grouping"};try{const te=re.getSceneElements(),de=Math.random().toString(36).substring(2,15),me=te.map(fe=>H.elementIds.includes(fe.id)?{...fe,groupIds:[...fe.groupIds??[],de]}:fe);return re.updateScene({elements:me,captureUpdate:ie.IMMEDIATELY}),{type:"groupElementsResult",id:Y,success:!0,groupId:de}}catch(te){return{type:"groupElementsResult",id:Y,success:!1,error:te instanceof Error?te.message:"Unknown error"}}},[]),Z=_.useCallback((Y,H)=>{var te;const re=e.current;if(!re)return{type:"ungroupElementResult",id:Y,success:!1,error:"Canvas not ready"};try{const de=re.getSceneElements(),me=de.find(Ue=>Ue.id===H.elementId);if(!me)return{type:"ungroupElementResult",id:Y,success:!1,error:"Element not found"};if(!((te=me.groupIds)!=null&&te.length))return{type:"ungroupElementResult",id:Y,success:!1,error:"Element is not in any group"};const fe=de.map(Ue=>{var Te;return Ue.id===H.elementId?{...Ue,groupIds:((Te=Ue.groupIds)==null?void 0:Te.slice(0,-1))??[]}:Ue});return re.updateScene({elements:fe,captureUpdate:ie.IMMEDIATELY}),{type:"ungroupElementResult",id:Y,success:!0}}catch(de){return{type:"ungroupElementResult",id:Y,success:!1,error:de instanceof Error?de.message:"Unknown error"}}},[]),K=_.useCallback((Y,H)=>{const re=e.current;if(!re)return{type:"moveElementsResult",id:Y,success:!1,error:"Canvas not ready"};try{const te=re.getSceneElements(),de=new Set(H.elementIds);for(const Te of te)if(de.has(Te.id)&&Te.boundElements)for(const it of Te.boundElements)de.add(it.id);const me=new Set;te.forEach(Te=>{var it;de.has(Te.id)&&((it=Te.groupIds)!=null&&it.length)&&Te.groupIds.forEach(mt=>me.add(mt))});let fe=0;const Ue=te.map(Te=>{var mt;return de.has(Te.id)||me.size>0&&((mt=Te.groupIds)==null?void 0:mt.some(Be=>me.has(Be)))?(fe++,{...Te,x:(Te.x??0)+H.deltaX,y:(Te.y??0)+H.deltaY}):Te});return fe===0?{type:"moveElementsResult",id:Y,success:!1,error:"No elements found"}:(re.updateScene({elements:Ue,captureUpdate:ie.IMMEDIATELY}),{type:"moveElementsResult",id:Y,success:!0,movedCount:fe})}catch(te){return{type:"moveElementsResult",id:Y,success:!1,error:te instanceof Error?te.message:"Unknown error"}}},[]),Q=_.useCallback((Y,H)=>{const re=e.current;if(!re)return{type:"resizeElementsResult",id:Y,success:!1,error:"Canvas not ready"};const{top:te=0,bottom:de=0,left:me=0,right:fe=0}=H;if(te===0&&de===0&&me===0&&fe===0)return{type:"resizeElementsResult",id:Y,success:!1,error:"At least one resize parameter (top, bottom, left, right) must be non-zero"};try{const Ue=re.getSceneElements(),Te=new Set(H.elementIds),it=["rectangle","ellipse","diamond"],mt=5;for(const ze of Ue)if(Te.has(ze.id)&&!it.includes(ze.type))return{type:"resizeElementsResult",id:Y,success:!1,error:`Element ${ze.id} is not a shape (type: ${ze.type}). Only rectangle, ellipse, and diamond are supported.`};const Be=new Map;let Mt=0,on=Ue.map(ze=>{if(!Te.has(ze.id))return ze;const ht=ze.width??100,Gr=ze.height??100,El=ze.angle??0,Yr=ht+me+fe,Zr=Gr+te+de;if(Yr<=0)return{error:`Resulting width (${Yr}) would be <= 0`};if(Zr<=0)return{error:`Resulting height (${Zr}) would be <= 0`};const Ms=-me,Is=-te,Sl=Math.cos(El),Li=Math.sin(El),th=Ms*Sl-Is*Li,_s=Ms*Li+Is*Sl,kl=ze.x+th,nh=ze.y+_s;return Be.set(ze.id,{x:kl,y:nh,width:Yr,height:Zr,type:ze.type}),Mt++,{...ze,x:kl,y:nh,width:Yr,height:Zr}});for(const ze of on)if("error"in ze)return{type:"resizeElementsResult",id:Y,success:!1,error:ze.error};return Mt===0?{type:"resizeElementsResult",id:Y,success:!1,error:"No elements found"}:(on=on.map(ze=>{if(ze.type!=="text"||!("containerId"in ze)||!ze.containerId)return ze;const ht=Be.get(ze.containerId);if(!ht)return ze;const Gr=ze.width??0,El=ze.height??0;let Yr=mt,Zr=mt;ht.type==="ellipse"?(Yr+=ht.width/2*(1-Math.SQRT2/2),Zr+=ht.height/2*(1-Math.SQRT2/2)):ht.type==="diamond"&&(Yr+=ht.width/4,Zr+=ht.height/4);const Ms=ht.width-2*Yr,Is=ht.height-2*Zr,Sl=ht.x+Yr+(Ms-Gr)/2,Li=ht.y+Zr+(Is-El)/2;return{...ze,x:Sl,y:Li}}),re.updateScene({elements:on,captureUpdate:ie.IMMEDIATELY}),{type:"resizeElementsResult",id:Y,success:!0,resizedCount:Mt})}catch(Ue){return{type:"resizeElementsResult",id:Y,success:!1,error:Ue instanceof Error?Ue.message:"Unknown error"}}},[]),W=_.useCallback(Y=>{const H=e.current;if(!H)return{type:"readSceneResult",id:Y,success:!1,error:"Canvas not ready"};try{const re=H.getSceneElements(),te=H.getAppState(),de=re.filter(fe=>!fe.isDeleted).map(fe=>({id:fe.id,type:fe.type,x:fe.x,y:fe.y,width:fe.width,height:fe.height,angle:fe.angle,strokeColor:fe.strokeColor,backgroundColor:fe.backgroundColor,groupIds:fe.groupIds,text:fe.text,fontSize:fe.fontSize,containerId:fe.containerId,boundElements:fe.boundElements?[...fe.boundElements]:null,points:fe.points,startArrowhead:fe.startArrowhead,endArrowhead:fe.endArrowhead,customData:fe.customData})),me=te.selectedElementIds?Object.keys(te.selectedElementIds):[];return{type:"readSceneResult",id:Y,success:!0,elements:de,selectedElementIds:me}}catch(re){return{type:"readSceneResult",id:Y,success:!1,error:re instanceof Error?re.message:"Unknown error"}}},[]),q=_.useCallback((Y,H)=>{const re=e.current;if(!re)return{type:"loadSceneResult",id:Y,success:!1,error:"Canvas not ready"};try{const te=H.elements||[];return re.updateScene({elements:te,captureUpdate:ie.IMMEDIATELY}),{type:"loadSceneResult",id:Y,success:!0,elementCount:te.length}}catch(te){return{type:"loadSceneResult",id:Y,success:!1,error:te instanceof Error?te.message:"Unknown error"}}},[]),V=_.useCallback(Y=>{const H=e.current;if(!H)return{type:"saveSceneResult",id:Y,success:!1,error:"Canvas not ready"};try{const re=H.getSceneElements().filter(me=>!me.isDeleted),te=H.getAppState(),de=H.getFiles();return{type:"saveSceneResult",id:Y,success:!0,data:{type:"excalidraw",version:2,source:"agent-canvas",elements:re,appState:te,files:de}}}catch(re){return{type:"saveSceneResult",id:Y,success:!1,error:re instanceof Error?re.message:"Unknown error"}}},[]),ee=_.useCallback(Y=>{const H=e.current;if(!H)return{type:"clearCanvasResult",id:Y,success:!1,error:"Canvas not ready"};try{return H.updateScene({elements:[],captureUpdate:ie.IMMEDIATELY}),{type:"clearCanvasResult",id:Y,success:!0}}catch(re){return{type:"clearCanvasResult",id:Y,success:!1,error:re instanceof Error?re.message:"Unknown error"}}},[]),X=_.useCallback(async(Y,H)=>{const re=e.current;if(!re)return{type:"exportImageResult",id:Y,success:!1,error:"Canvas not ready"};try{const te=re.getSceneElements().filter(it=>!it.isDeleted);if(te.length===0)return{type:"exportImageResult",id:Y,success:!1,error:"Canvas is empty"};const de=(H==null?void 0:H.scale)??1,me=(H==null?void 0:H.dark)??!1,fe=await Zk({elements:te,files:null,appState:{exportBackground:(H==null?void 0:H.background)??!0,exportEmbedScene:(H==null?void 0:H.embedScene)??!1,exportWithDarkMode:me},getDimensions:(it,mt)=>({width:it*de,height:mt*de,scale:de})}),Ue=new FileReader,Te=await new Promise((it,mt)=>{Ue.onload=()=>it(Ue.result),Ue.onerror=mt,Ue.readAsDataURL(fe)});return{type:"exportImageResult",id:Y,success:!0,dataUrl:Te}}catch(te){return{type:"exportImageResult",id:Y,success:!1,error:te instanceof Error?te.message:"Unknown error"}}},[]),se=_.useCallback(async Y=>{switch(Y.type){case"listCanvases":return U(Y.id);case"createCanvas":return g(Y.id,Y.params);case"switchCanvas":return y(Y.id,Y.params);case"renameCanvas":return w(Y.id,Y.params);case"addShape":return T(Y.id,Y.params);case"addText":return M(Y.id,Y.params);case"addLine":return j(Y.id,Y.params);case"addArrow":return D(Y.id,Y.params);case"addPolygon":return P(Y.id,Y.params);case"deleteElements":return N(Y.id,Y.params);case"rotateElements":return $(Y.id,Y.params);case"groupElements":return z(Y.id,Y.params);case"ungroupElement":return Z(Y.id,Y.params);case"moveElements":return K(Y.id,Y.params);case"resizeElements":return Q(Y.id,Y.params);case"readScene":return W(Y.id);case"loadScene":return q(Y.id,Y.params);case"saveScene":return V(Y.id);case"exportImage":return await X(Y.id,Y.params);case"clearCanvas":return ee(Y.id);default:return{type:"error",id:Y.id,success:!1,error:`Unknown command: ${Y.type}`}}},[U,g,y,w,T,M,j,D,P,N,$,z,Z,K,Q,W,q,V,X,ee]);_.useEffect(()=>{const Y=()=>{const H=new WebSocket(`ws://localhost:${Xle}`);t.current=H,H.onopen=()=>{console.log("Connected to server"),H.send(JSON.stringify({type:"browserConnect"}))},H.onmessage=async re=>{try{const te=JSON.parse(re.data);if(te.type&&te.id){const de=await se(te);H.send(JSON.stringify(de))}}catch(te){console.error("Error processing command:",te)}},H.onclose=()=>{console.log("Disconnected from server, reconnecting..."),t.current=null,setTimeout(Y,1e3)},H.onerror=re=>{console.error("WebSocket error:",re)}};return Y(),()=>{t.current&&t.current.close()}},[se]);const ge=_.useRef(n.activeCanvasId);ge.current=n.activeCanvasId;const _e=_.useCallback(()=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{const Y=e.current;if(!Y)return;const H=ge.current,re=Y.getSceneElements(),te=Y.getAppState(),de=Y.getFiles(),me=vw(te),fe={elements:re,appState:me,files:de};ju(H,fe),d(Ue=>{const Te=new Map(Ue);return Te.set(H,fe),Te}),r(Ue=>{const Te=gw(Ue,H);return Aa(Te),Te})},500)},[]);return _.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]),p.jsxs("div",{style:{display:"flex",width:"100%",height:"100%",position:"absolute",top:0,left:0},children:[p.jsx(Wle,{canvases:n.canvases,activeCanvasId:n.activeCanvasId,scenes:s,isDarkMode:o,canvasBackgroundColor:f,isCollapsed:a,onToggleCollapsed:()=>i(!a),onSelectCanvas:E,onCreateCanvas:S,onRenameCanvas:k,onDeleteCanvas:I}),p.jsx("div",{style:{flex:1,height:"100%",position:"relative"},children:p.jsx(mb,{excalidrawAPI:Y=>{e.current=Y},initialData:u?{elements:u.elements,appState:u.appState}:void 0,onChange:_e})})]})}ej.createRoot(document.getElementById("root")).render(p.jsx(_.StrictMode,{children:p.jsx(Gle,{})}));const KT=Object.freeze(Object.defineProperty({__proto__:null,decodePngMetadata:xZ,encodePngMetadata:CC,getTEXtChunk:kC},Symbol.toStringTag,{value:"Module"})),Yle=Object.freeze(Object.defineProperty({__proto__:null,alerts:RC,buttons:AC,canvasError:OC,clearCanvasDialog:XC,colorPicker:tM,colors:JC,commandPalette:sM,confirmDialog:YC,default:E8,element:DC,elementLink:IC,encrypted:KC,errorDialog:BC,errorSplash:$C,errors:jC,exportDialog:HC,fontList:iM,headings:PC,helpDialog:WC,hints:NC,imageExportDialog:ZC,labels:MC,library:_C,mermaid:rM,overwriteConfirm:nM,publishDialog:VC,publishSuccessDialog:GC,quickSearch:aM,roomDialog:FC,search:TC,shareDialog:zC,stats:qC,toast:QC,toolBar:LC,userList:lM,welcomeScreen:eM},Symbol.toStringTag,{value:"Module"})),Zle=Object.freeze(Object.defineProperty({__proto__:null,default:dM,en:oM,kaa:cM},Symbol.toStringTag,{value:"Module"}));export{Re as _,rs as c,pN as d,Kle as f,_i as g};
|