lexgui 8.3.0 → 8.3.2
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/build/core/Namespace.js +34 -34
- package/build/core/Namespace.js.map +1 -1
- package/build/extensions/CodeEditor.d.ts +521 -466
- package/build/extensions/CodeEditor.js +4895 -4218
- package/build/extensions/CodeEditor.js.map +1 -1
- package/build/extensions/Timeline.js.map +1 -1
- package/build/extensions/VideoEditor.js +1 -2
- package/build/extensions/VideoEditor.js.map +1 -1
- package/build/lexgui.all.js +28972 -28262
- package/build/lexgui.all.js.map +1 -1
- package/build/lexgui.all.min.js +1 -1
- package/build/lexgui.all.module.js +28897 -28187
- package/build/lexgui.all.module.js.map +1 -1
- package/build/lexgui.all.module.min.js +1 -1
- package/build/lexgui.css +7598 -7541
- package/build/lexgui.js +19071 -18360
- package/build/lexgui.js.map +1 -1
- package/build/lexgui.min.css +1 -1
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +19010 -18299
- package/build/lexgui.module.js.map +1 -1
- package/build/lexgui.module.min.js +1 -1
- package/changelog.md +28 -1
- package/demo.js +5 -2
- package/examples/code-editor.html +9 -0
- package/package.json +1 -1
package/build/lexgui.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("https://cdn.jsdelivr.net/npm/tailwind-merge@3.4.0/+esm")):"function"==typeof define&&define.amd?define(["exports","https://cdn.jsdelivr.net/npm/tailwind-merge@3.4.0/+esm"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).lexgui={},e.twMerge)}(this,function(e,t){"use strict";const s=globalThis;e.LX=s.LX,e.LX||(e.LX={version:"8.3.0",ready:!1,extensions:[],extraCommandbarEntries:[],signals:{},activeDraggable:null,spacingMode:"default",layoutMode:"app",MOUSE_LEFT_CLICK:0,MOUSE_MIDDLE_CLICK:1,MOUSE_RIGHT_CLICK:2,MOUSE_DOUBLE_CLICK:2,MOUSE_TRIPLE_CLICK:3,CURVE_MOVEOUT_CLAMP:0,CURVE_MOVEOUT_DELETE:1,DRAGGABLE_Z_INDEX:101},s.LX=e.LX);const o={Abc:[24,24,[],"regular","M17 15q-.425 0-.712-.288T16 14v-4q0-.425.288-.712T17 9h3q.425 0 .713.288T21 10v1h-1.5v-.5h-2v3h2V13H21v1q0 .425-.288.713T20 15zm-7.5 0V9h4q.425 0 .713.288T14.5 10v1q0 .425-.288.713T13.5 12q.425 0 .713.288T14.5 13v1q0 .425-.288.713T13.5 15zm1.5-3.75h2v-.75h-2zm0 2.25h2v-.75h-2zM3 15v-5q0-.425.288-.712T4 9h3q.425 0 .713.288T8 10v5H6.5v-1.5h-2V15zm1.5-3h2v-1.5h-2z"],Android:[128,128,[],"solid","M21.005 43.003c-4.053-.002-7.338 3.291-7.339 7.341l.005 30.736a7.34 7.34 0 0 0 7.342 7.343a7.33 7.33 0 0 0 7.338-7.342V50.34a7.345 7.345 0 0 0-7.346-7.337m59.193-27.602l5.123-9.355a1.023 1.023 0 0 0-.401-1.388a1.02 1.02 0 0 0-1.382.407l-5.175 9.453c-4.354-1.938-9.227-3.024-14.383-3.019c-5.142-.005-10.013 1.078-14.349 3.005L44.45 5.075a1.01 1.01 0 0 0-1.378-.406a1.007 1.007 0 0 0-.404 1.38l5.125 9.349c-10.07 5.193-16.874 15.083-16.868 26.438l66.118-.008c.002-11.351-6.79-21.221-16.845-26.427M48.942 29.858a2.772 2.772 0 0 1 .003-5.545a2.78 2.78 0 0 1 2.775 2.774a2.776 2.776 0 0 1-2.778 2.771m30.106-.005a2.77 2.77 0 0 1-2.772-2.771a2.793 2.793 0 0 1 2.773-2.778a2.79 2.79 0 0 1 2.767 2.779a2.767 2.767 0 0 1-2.768 2.77M31.195 44.39l.011 47.635a7.82 7.82 0 0 0 7.832 7.831l5.333.002l.006 16.264c-.001 4.05 3.291 7.342 7.335 7.342c4.056 0 7.342-3.295 7.343-7.347l-.004-16.26l9.909-.003l.004 16.263c0 4.047 3.293 7.346 7.338 7.338c4.056.003 7.344-3.292 7.343-7.344l-.005-16.259l5.352-.004a7.835 7.835 0 0 0 7.836-7.834l-.009-47.635zm83.134 5.943a7.34 7.34 0 0 0-7.341-7.339c-4.053-.004-7.337 3.287-7.337 7.342l.006 30.738a7.334 7.334 0 0 0 7.339 7.339a7.337 7.337 0 0 0 7.338-7.343z"],Clone:[512,512,[],"regular","M64 464l224 0c8.8 0 16-7.2 16-16l0-64 48 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64l64 0 0 48-64 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zM224 304l224 0c8.8 0 16-7.2 16-16l0-224c0-8.8-7.2-16-16-16L224 48c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zm-64-16l0-224c0-35.3 28.7-64 64-64L448 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-224 0c-35.3 0-64-28.7-64-64z"],IdBadge:[384,512,[],"regular","M256 48l0 16c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-16L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-384c0-8.8-7.2-16-16-16l-64 0zM0 64C0 28.7 28.7 0 64 0L320 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM160 320l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16L96 416c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z"],Paste:[512,512,[],"regular","M104.6 48L64 48C28.7 48 0 76.7 0 112L0 384c0 35.3 28.7 64 64 64l96 0 0-48-96 0c-8.8 0-16-7.2-16-16l0-272c0-8.8 7.2-16 16-16l16 0c0 17.7 14.3 32 32 32l72.4 0C202 108.4 227.6 96 256 96l62 0c-7.1-27.6-32.2-48-62-48l-40.6 0C211.6 20.9 188.2 0 160 0s-51.6 20.9-55.4 48zM144 56a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM448 464l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L464 243.9 464 448c0 8.8-7.2 16-16 16zM256 512l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9l-67.9-67.9c-9-9-21.2-14.1-33.9-14.1L256 128c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64z"],Trash3:[448,512,[],"regular","M170.5 51.6L151.5 80l145 0-19-28.4c-1.5-2.2-4-3.6-6.7-3.6l-93.7 0c-2.7 0-5.2 1.3-6.7 3.6zm147-26.6L354.2 80 368 80l48 0 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 304c0 44.2-35.8 80-80 80l-224 0c-44.2 0-80-35.8-80-80l0-304-8 0c-13.3 0-24-10.7-24-24S10.7 80 24 80l8 0 48 0 13.8 0 36.7-55.1C140.9 9.4 158.4 0 177.1 0l93.7 0c18.7 0 36.2 9.4 46.6 24.9zM80 128l0 304c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-304L80 128zm80 64l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16zm80 0l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16zm80 0l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16z"],FilePdf:[512,512,[],"regular","M64 464l48 0 0 48-48 0c-35.3 0-64-28.7-64-64L0 64C0 28.7 28.7 0 64 0L229.5 0c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3L384 304l-48 0 0-144-80 0c-17.7 0-32-14.3-32-32l0-80L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16zM176 352l32 0c30.9 0 56 25.1 56 56s-25.1 56-56 56l-16 0 0 32c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48 0-80c0-8.8 7.2-16 16-16zm32 80c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0 0 48 16 0zm96-80l32 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-32 0c-8.8 0-16-7.2-16-16l0-128c0-8.8 7.2-16 16-16zm32 128c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-16 0 0 96 16 0zm80-112c0-8.8 7.2-16 16-16l48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 32 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-64 0-64z"],FileWord:[384,512,[],"regular","M48 448L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm55 241.1c-3.8-12.7-17.2-19.9-29.9-16.1s-19.9 17.2-16.1 29.9l48 160c3 10.2 12.4 17.1 23 17.1s19.9-7 23-17.1l25-83.4 25 83.4c3 10.2 12.4 17.1 23 17.1s19.9-7 23-17.1l48-160c3.8-12.7-3.4-26.1-16.1-29.9s-26.1 3.4-29.9 16.1l-25 83.4-25-83.4c-3-10.2-12.4-17.1-23-17.1s-19.9 7-23 17.1l-25 83.4-25-83.4z"],FilePowerpoint:[384,512,[],"regular","M64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm72 208c-13.3 0-24 10.7-24 24l0 104 0 56c0 13.3 10.7 24 24 24s24-10.7 24-24l0-32 44 0c42 0 76-34 76-76s-34-76-76-76l-68 0zm68 104l-44 0 0-56 44 0c15.5 0 28 12.5 28 28s-12.5 28-28 28z"],FileExcel:[384,512,[],"regular","M48 448L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm90.9 233.3c-8.1-10.5-23.2-12.3-33.7-4.2s-12.3 23.2-4.2 33.7L161.6 320l-44.5 57.3c-8.1 10.5-6.3 25.5 4.2 33.7s25.5 6.3 33.7-4.2L192 359.1l37.1 47.6c8.1 10.5 23.2 12.3 33.7 4.2s12.3-23.2 4.2-33.7L222.4 320l44.5-57.3c8.1-10.5 6.3-25.5-4.2-33.7s-25.5-6.3-33.7 4.2L192 280.9l-37.1-47.6z"],Settings3:[640,512,[],"solid","M308.5 135.3c7.1-6.3 9.9-16.2 6.2-25c-2.3-5.3-4.8-10.5-7.6-15.5L304 89.4c-3-5-6.3-9.9-9.8-14.6c-5.7-7.6-15.7-10.1-24.7-7.1l-28.2 9.3c-10.7-8.8-23-16-36.2-20.9L199 27.1c-1.9-9.3-9.1-16.7-18.5-17.8C173.9 8.4 167.2 8 160.4 8l-.7 0c-6.8 0-13.5 .4-20.1 1.2c-9.4 1.1-16.6 8.6-18.5 17.8L115 56.1c-13.3 5-25.5 12.1-36.2 20.9L50.5 67.8c-9-3-19-.5-24.7 7.1c-3.5 4.7-6.8 9.6-9.9 14.6l-3 5.3c-2.8 5-5.3 10.2-7.6 15.6c-3.7 8.7-.9 18.6 6.2 25l22.2 19.8C32.6 161.9 32 168.9 32 176s.6 14.1 1.7 20.9L11.5 216.7c-7.1 6.3-9.9 16.2-6.2 25c2.3 5.3 4.8 10.5 7.6 15.6l3 5.2c3 5.1 6.3 9.9 9.9 14.6c5.7 7.6 15.7 10.1 24.7 7.1l28.2-9.3c10.7 8.8 23 16 36.2 20.9l6.1 29.1c1.9 9.3 9.1 16.7 18.5 17.8c6.7 .8 13.5 1.2 20.4 1.2s13.7-.4 20.4-1.2c9.4-1.1 16.6-8.6 18.5-17.8l6.1-29.1c13.3-5 25.5-12.1 36.2-20.9l28.2 9.3c9 3 19 .5 24.7-7.1c3.5-4.7 6.8-9.5 9.8-14.6l3.1-5.4c2.8-5 5.3-10.2 7.6-15.5c3.7-8.7 .9-18.6-6.2-25l-22.2-19.8c1.1-6.8 1.7-13.8 1.7-20.9s-.6-14.1-1.7-20.9l22.2-19.8zM112 176a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM504.7 500.5c6.3 7.1 16.2 9.9 25 6.2c5.3-2.3 10.5-4.8 15.5-7.6l5.4-3.1c5-3 9.9-6.3 14.6-9.8c7.6-5.7 10.1-15.7 7.1-24.7l-9.3-28.2c8.8-10.7 16-23 20.9-36.2l29.1-6.1c9.3-1.9 16.7-9.1 17.8-18.5c.8-6.7 1.2-13.5 1.2-20.4s-.4-13.7-1.2-20.4c-1.1-9.4-8.6-16.6-17.8-18.5L583.9 307c-5-13.3-12.1-25.5-20.9-36.2l9.3-28.2c3-9 .5-19-7.1-24.7c-4.7-3.5-9.6-6.8-14.6-9.9l-5.3-3c-5-2.8-10.2-5.3-15.6-7.6c-8.7-3.7-18.6-.9-25 6.2l-19.8 22.2c-6.8-1.1-13.8-1.7-20.9-1.7s-14.1 .6-20.9 1.7l-19.8-22.2c-6.3-7.1-16.2-9.9-25-6.2c-5.3 2.3-10.5 4.8-15.6 7.6l-5.2 3c-5.1 3-9.9 6.3-14.6 9.9c-7.6 5.7-10.1 15.7-7.1 24.7l9.3 28.2c-8.8 10.7-16 23-20.9 36.2L315.1 313c-9.3 1.9-16.7 9.1-17.8 18.5c-.8 6.7-1.2 13.5-1.2 20.4s.4 13.7 1.2 20.4c1.1 9.4 8.6 16.6 17.8 18.5l29.1 6.1c5 13.3 12.1 25.5 20.9 36.2l-9.3 28.2c-3 9-.5 19 7.1 24.7c4.7 3.5 9.5 6.8 14.6 9.8l5.4 3.1c5 2.8 10.2 5.3 15.5 7.6c8.7 3.7 18.6 .9 25-6.2l19.8-22.2c6.8 1.1 13.8 1.7 20.9 1.7s14.1-.6 20.9-1.7l19.8 22.2zM464 304a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"],MessagesCircle:[640,512,[],"regular","M88.2 309.1c9.8-18.3 6.8-40.8-7.5-55.8C59.4 230.9 48 204 48 176c0-63.5 63.8-128 160-128s160 64.5 160 128s-63.8 128-160 128c-13.1 0-25.8-1.3-37.8-3.6c-10.4-2-21.2-.6-30.7 4.2c-4.1 2.1-8.3 4.1-12.6 6c-16 7.2-32.9 13.5-49.9 18c2.8-4.6 5.4-9.1 7.9-13.6c1.1-1.9 2.2-3.9 3.2-5.9zM208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176c0 41.8 17.2 80.1 45.9 110.3c-.9 1.7-1.9 3.5-2.8 5.1c-10.3 18.4-22.3 36.5-36.6 52.1c-6.6 7-8.3 17.2-4.6 25.9C5.8 378.3 14.4 384 24 384c43 0 86.5-13.3 122.7-29.7c4.8-2.2 9.6-4.5 14.2-6.8c15.1 3 30.9 4.5 47.1 4.5zM432 480c16.2 0 31.9-1.6 47.1-4.5c4.6 2.3 9.4 4.6 14.2 6.8C529.5 498.7 573 512 616 512c9.6 0 18.2-5.7 22-14.5c3.8-8.8 2-19-4.6-25.9c-14.2-15.6-26.2-33.7-36.6-52.1c-.9-1.7-1.9-3.4-2.8-5.1C622.8 384.1 640 345.8 640 304c0-94.4-87.9-171.5-198.2-175.8c4.1 15.2 6.2 31.2 6.2 47.8l0 .6c87.2 6.7 144 67.5 144 127.4c0 28-11.4 54.9-32.7 77.2c-14.3 15-17.3 37.6-7.5 55.8c1.1 2 2.2 4 3.2 5.9c2.5 4.5 5.2 9 7.9 13.6c-17-4.5-33.9-10.7-49.9-18c-4.3-1.9-8.5-3.9-12.6-6c-9.5-4.8-20.3-6.2-30.7-4.2c-12.1 2.4-24.8 3.6-37.8 3.6c-61.7 0-110-26.5-136.8-62.3c-16 5.4-32.8 9.4-50 11.8C279 439.8 350 480 432 480z"],LinkOff:[640,512,["ChainBroken","ChainOff","Unlink"],"solid","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L489.3 358.2l90.5-90.5c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114l-96 96-31.9-25C430.9 239.6 420.1 175.1 377 132c-52.2-52.3-134.5-56.2-191.3-11.7L38.8 5.1zM239 162c30.1-14.9 67.7-9.9 92.8 15.3c20 20 27.5 48.3 21.7 74.5L239 162zM406.6 416.4L220.9 270c-2.1 39.8 12.2 80.1 42.2 110c38.9 38.9 94.4 51 143.6 36.3zm-290-228.5L60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5l61.8-61.8-50.6-39.9z"],StreetView:[512,512,[],"solid","M320 64A64 64 0 1 0 192 64a64 64 0 1 0 128 0zm-96 96c-35.3 0-64 28.7-64 64l0 48c0 17.7 14.3 32 32 32l1.8 0 11.1 99.5c1.8 16.2 15.5 28.5 31.8 28.5l38.7 0c16.3 0 30-12.3 31.8-28.5L318.2 304l1.8 0c17.7 0 32-14.3 32-32l0-48c0-35.3-28.7-64-64-64l-64 0zM132.3 394.2c13-2.4 21.7-14.9 19.3-27.9s-14.9-21.7-27.9-19.3c-32.4 5.9-60.9 14.2-82 24.8c-10.5 5.3-20.3 11.7-27.8 19.6C6.4 399.5 0 410.5 0 424c0 21.4 15.5 36.1 29.1 45c14.7 9.6 34.3 17.3 56.4 23.4C130.2 504.7 190.4 512 256 512s125.8-7.3 170.4-19.6c22.1-6.1 41.8-13.8 56.4-23.4c13.7-8.9 29.1-23.6 29.1-45c0-13.5-6.4-24.5-14-32.6c-7.5-7.9-17.3-14.3-27.8-19.6c-21-10.6-49.5-18.9-82-24.8c-13-2.4-25.5 6.3-27.9 19.3s6.3 25.5 19.3 27.9c30.2 5.5 53.7 12.8 69 20.5c3.2 1.6 5.8 3.1 7.9 4.5c3.6 2.4 3.6 7.2 0 9.6c-8.8 5.7-23.1 11.8-43 17.3C374.3 457 318.5 464 256 464s-118.3-7-157.7-17.9c-19.9-5.5-34.2-11.6-43-17.3c-3.6-2.4-3.6-7.2 0-9.6c2.1-1.4 4.8-2.9 7.9-4.5c15.3-7.7 38.8-14.9 69-20.5z"],ClosedCaptioning:[576,512,["CC"],"regular","M512 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l448 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM200 208c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48s21.5-48 48-48zm144 48c0-26.5 21.5-48 48-48c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48z"],ChildReaching:[384,512,[],"solid","M256 64A64 64 0 1 0 128 64a64 64 0 1 0 128 0zM152.9 169.3c-23.7-8.4-44.5-24.3-58.8-45.8L74.6 94.2C64.8 79.5 45 75.6 30.2 85.4s-18.7 29.7-8.9 44.4L40.9 159c18.1 27.1 42.8 48.4 71.1 62.4L112 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 32 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-258.4c29.1-14.2 54.4-36.2 72.7-64.2l18.2-27.9c9.6-14.8 5.4-34.6-9.4-44.3s-34.6-5.5-44.3 9.4L291 122.4c-21.8 33.4-58.9 53.6-98.8 53.6c-12.6 0-24.9-2-36.6-5.8c-.9-.3-1.8-.7-2.7-.9z"],HourglassHalf:[384,512,[],"regular","M0 24C0 10.7 10.7 0 24 0L360 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 19c0 40.3-16 79-44.5 107.5L225.9 256l81.5 81.5C336 366 352 404.7 352 445l0 19 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-19c0-40.3 16-79 44.5-107.5L158.1 256 76.5 174.5C48 146 32 107.3 32 67l0-19-8 0C10.7 48 0 37.3 0 24zM110.5 371.5c-3.9 3.9-7.5 8.1-10.7 12.5l184.4 0c-3.2-4.4-6.8-8.6-10.7-12.5L192 289.9l-81.5 81.5zM284.2 128C297 110.4 304 89 304 67l0-19L80 48l0 19c0 22.1 7 43.4 19.8 61l184.4 0z"],PaperPlane:[512,512,[],"regular","M16.1 260.2c-22.6 12.9-20.5 47.3 3.6 57.3L160 376l0 103.3c0 18.1 14.6 32.7 32.7 32.7c9.7 0 18.9-4.3 25.1-11.8l62-74.3 123.9 51.6c18.9 7.9 40.8-4.5 43.9-24.7l64-416c1.9-12.1-3.4-24.3-13.5-31.2s-23.3-7.5-34-1.4l-448 256zm52.1 25.5L409.7 90.6 190.1 336l1.2 1L68.2 285.7zM403.3 425.4L236.7 355.9 450.8 116.6 403.3 425.4z"],Axis3DArrows:[24,24,[],"solid","m12 2l4 4h-3v7.85l6.53 3.76L21 15.03l1.5 5.47l-5.5 1.46l1.53-2.61L12 15.58l-6.53 3.77L7 21.96L1.5 20.5L3 15.03l1.47 2.58L11 13.85V6H8z"],PersonWalkingDashedLineArrowRight:[640,512,[],"solid","M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM550.6 153.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L530.7 224 384 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l146.7 0-25.4 25.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3l-80-80zM392 0c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48c0-13.3-10.7-24-24-24zm24 152c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16zM392 320c-13.3 0-24 10.7-24 24l0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16c0-13.3-10.7-24-24-24zm24 120c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48z"],PersonWalkingArrowLoopLeft:[640,512,[],"solid","M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zm347.7 119c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L461.3 384l18.7 0c88.4 0 160-71.6 160-160s-71.6-160-160-160L352 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c53 0 96 43 96 96s-43 96-96 96l-18.7 0 25.4-25.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3l80 80z"],PersonWalkingArrowRight:[640,512,[],"solid","M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM550.6 153.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L530.7 224 384 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l146.7 0-25.4 25.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3l-80-80z"],ClapperboardClosed:[512,512,[],"solid","M448 32l-86.1 0-1 1-127 127 92.1 0 1-1L453.8 32.3c-1.9-.2-3.8-.3-5.8-.3zm64 128l0-64c0-15.1-5.3-29.1-14-40l-104 104L512 160zM294.1 32l-92.1 0-1 1L73.9 160l92.1 0 1-1 127-127zM64 32C28.7 32 0 60.7 0 96l0 64 6.1 0 1-1 127-127L64 32zM512 192L0 192 0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-224z"],UserOff:[640,512,[],"solid","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L381.9 274c48.5-23.2 82.1-72.7 82.1-130C464 64.5 399.5 0 320 0C250.4 0 192.4 49.3 178.9 114.9L38.8 5.1zM545.5 512L528 512 284.3 320l-59 0C136.2 320 64 392.2 64 481.3c0 17 13.8 30.7 30.7 30.7l450.6 0 .3 0z"],PhotoFilm:[640,512,["Media"],"solid","M256 0L576 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-320 0c-35.3 0-64-28.7-64-64l0-224c0-35.3 28.7-64 64-64zM476 106.7C471.5 100 464 96 456 96s-15.5 4-20 10.7l-56 84L362.7 169c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l80 0 48 0 144 0c8.9 0 17-4.9 21.2-12.7s3.7-17.3-1.2-24.6l-96-144zM336 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM64 128l96 0 0 256 0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32 160 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64zm8 64c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm336 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16z"],Chart:[448,512,[],"solid","M160 80c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-352zM0 272c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48L0 272zM368 96l32 0c26.5 0 48 21.5 48 48l0 288c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48z"],HandsAslInterpreting:[640,512,["ASL"],"solid","M156.6 46.3c7.9-15.8 1.5-35-14.3-42.9s-35-1.5-42.9 14.3L13.5 189.4C4.6 207.2 0 226.8 0 246.7L0 256c0 70.7 57.3 128 128 128l72 0 8 0 0-.3c35.2-2.7 65.4-22.8 82.1-51.7c8.8-15.3 3.6-34.9-11.7-43.7s-34.9-3.6-43.7 11.7c-7 12-19.9 20-34.7 20c-22.1 0-40-17.9-40-40s17.9-40 40-40c14.8 0 27.7 8 34.7 20c8.8 15.3 28.4 20.5 43.7 11.7s20.5-28.4 11.7-43.7c-12.8-22.1-33.6-39.1-58.4-47.1l80.8-22c17-4.6 27.1-22.2 22.5-39.3s-22.2-27.1-39.3-22.5L194.9 124.6l81.6-68c13.6-11.3 15.4-31.5 4.1-45.1S249.1-3.9 235.5 7.4L133.6 92.3l23-46zM483.4 465.7c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l85.9-171.7c8.9-17.8 13.5-37.4 13.5-57.2l0-9.3c0-70.7-57.3-128-128-128l-72 0-8 0 0 .3c-35.2 2.7-65.4 22.8-82.1 51.7c-8.9 15.3-3.6 34.9 11.7 43.7s34.9 3.6 43.7-11.7c7-12 19.9-20 34.7-20c22.1 0 40 17.9 40 40s-17.9 40-40 40c-14.8 0-27.7-8-34.7-20c-8.9-15.3-28.4-20.5-43.7-11.7s-20.5 28.4-11.7 43.7c12.8 22.1 33.6 39.1 58.4 47.1l-80.8 22c-17.1 4.7-27.1 22.2-22.5 39.3s22.2 27.1 39.3 22.5l100.7-27.5-81.6 68c-13.6 11.3-15.4 31.5-4.1 45.1s31.5 15.4 45.1 4.1l101.9-84.9-23 46z"],HandPointRight:[512,512,[],"regular","M448 128l-177.6 0c1 5.2 1.6 10.5 1.6 16l0 16 32 0 144 0c8.8 0 16-7.2 16-16s-7.2-16-16-16zM224 144c0-17.7-14.3-32-32-32c0 0 0 0 0 0l-24 0c-66.3 0-120 53.7-120 120l0 48c0 52.5 33.7 97.1 80.7 113.4c-.5-3.1-.7-6.2-.7-9.4c0-20 9.2-37.9 23.6-49.7c-4.9-9-7.6-19.4-7.6-30.3c0-15.1 5.3-29 14-40c-8.8-11-14-24.9-14-40l0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40c0 8.8 7.2 16 16 16s16-7.2 16-16l0-40 0-40zM192 64s0 0 0 0c18 0 34.6 6 48 16l208 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-82 0c1.3 5.1 2 10.5 2 16c0 25.3-14.7 47.2-36 57.6c2.6 7 4 14.5 4 22.4c0 20-9.2 37.9-23.6 49.7c4.9 9 7.6 19.4 7.6 30.3c0 35.3-28.7 64-64 64l-64 0-24 0C75.2 448 0 372.8 0 280l0-48C0 139.2 75.2 64 168 64l24 0zm64 336c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l64 0zm16-176c0 5.5-.7 10.9-2 16l2 0 32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0 0 16zm-24 64l-40 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-24 0z"],HandPointUp:[384,512,[],"regular","M64 64l0 177.6c5.2-1 10.5-1.6 16-1.6l16 0 0-32L96 64c0-8.8-7.2-16-16-16s-16 7.2-16 16zM80 288c-17.7 0-32 14.3-32 32c0 0 0 0 0 0l0 24c0 66.3 53.7 120 120 120l48 0c52.5 0 97.1-33.7 113.4-80.7c-3.1 .5-6.2 .7-9.4 .7c-20 0-37.9-9.2-49.7-23.6c-9 4.9-19.4 7.6-30.3 7.6c-15.1 0-29-5.3-40-14c-11 8.8-24.9 14-40 14l-40 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l40 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-40 0-40 0zM0 320s0 0 0 0c0-18 6-34.6 16-48L16 64C16 28.7 44.7 0 80 0s64 28.7 64 64l0 82c5.1-1.3 10.5-2 16-2c25.3 0 47.2 14.7 57.6 36c7-2.6 14.5-4 22.4-4c20 0 37.9 9.2 49.7 23.6c9-4.9 19.4-7.6 30.3-7.6c35.3 0 64 28.7 64 64l0 64 0 24c0 92.8-75.2 168-168 168l-48 0C75.2 512 0 436.8 0 344l0-24zm336-64c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48 0 16c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64zM160 240c5.5 0 10.9 .7 16 2l0-2 0-32c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 32 16 0zm64 24l0 40c0 8.8 7.2 16 16 16s16-7.2 16-16l0-48 0-16c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 24z"],HandPointDown:[384,512,[],"regular","M64 448l0-177.6c5.2 1 10.5 1.6 16 1.6l16 0 0 32 0 144c0 8.8-7.2 16-16 16s-16-7.2-16-16zM80 224c-17.7 0-32-14.3-32-32c0 0 0 0 0 0l0-24c0-66.3 53.7-120 120-120l48 0c52.5 0 97.1 33.7 113.4 80.7c-3.1-.5-6.2-.7-9.4-.7c-20 0-37.9 9.2-49.7 23.6c-9-4.9-19.4-7.6-30.3-7.6c-15.1 0-29 5.3-40 14c-11-8.8-24.9-14-40-14l-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-40 0-40 0zM0 192s0 0 0 0c0 18 6 34.6 16 48l0 208c0 35.3 28.7 64 64 64s64-28.7 64-64l0-82c5.1 1.3 10.5 2 16 2c25.3 0 47.2-14.7 57.6-36c7 2.6 14.5 4 22.4 4c20 0 37.9-9.2 49.7-23.6c9 4.9 19.4 7.6 30.3 7.6c35.3 0 64-28.7 64-64l0-64 0-24C384 75.2 308.8 0 216 0L168 0C75.2 0 0 75.2 0 168l0 24zm336 64c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48 0-16c0-8.8 7.2-16 16-16s16 7.2 16 16l0 64zM160 272c5.5 0 10.9-.7 16-2l0 2 0 32c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-32 16 0zm64-24l0-40c0-8.8 7.2-16 16-16s16 7.2 16 16l0 48 0 16c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-24z"],HandPointLeft:[512,512,[],"regular","M64 128l177.6 0c-1 5.2-1.6 10.5-1.6 16l0 16-32 0L64 160c-8.8 0-16-7.2-16-16s7.2-16 16-16zm224 16c0-17.7 14.3-32 32-32c0 0 0 0 0 0l24 0c66.3 0 120 53.7 120 120l0 48c0 52.5-33.7 97.1-80.7 113.4c.5-3.1 .7-6.2 .7-9.4c0-20-9.2-37.9-23.6-49.7c4.9-9 7.6-19.4 7.6-30.3c0-15.1-5.3-29-14-40c8.8-11 14-24.9 14-40l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-40 0-40zm32-80s0 0 0 0c-18 0-34.6 6-48 16L64 80C28.7 80 0 108.7 0 144s28.7 64 64 64l82 0c-1.3 5.1-2 10.5-2 16c0 25.3 14.7 47.2 36 57.6c-2.6 7-4 14.5-4 22.4c0 20 9.2 37.9 23.6 49.7c-4.9 9-7.6 19.4-7.6 30.3c0 35.3 28.7 64 64 64l64 0 24 0c92.8 0 168-75.2 168-168l0-48c0-92.8-75.2-168-168-168l-24 0zM256 400c-8.8 0-16-7.2-16-16s7.2-16 16-16l48 0 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0zM240 224c0 5.5 .7 10.9 2 16l-2 0-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l32 0 0 16zm24 64l40 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l24 0z"],HandScissors:[512,512,[],"regular","M.2 276.3c-1.2-35.3 26.4-65 61.7-66.2l3.3-.1L57 208.1C22.5 200.5 .7 166.3 8.3 131.8S50.2 75.5 84.7 83.2l173 38.3c2.3-2.9 4.7-5.7 7.1-8.5l18.4-20.3C299.9 74.5 323.5 64 348.3 64l10.2 0c54.1 0 104.1 28.7 131.3 75.4l1.5 2.6c13.6 23.2 20.7 49.7 20.7 76.6L512 344c0 66.3-53.7 120-120 120l-8 0-96 0c-35.3 0-64-28.7-64-64c0-2.8 .2-5.6 .5-8.3c-19.4-11-32.5-31.8-32.5-55.7c0-.8 0-1.6 0-2.4L66.4 338c-35.3 1.2-65-26.4-66.2-61.7zm63.4-18.2c-8.8 .3-15.7 7.7-15.4 16.5s7.7 15.7 16.5 15.4l161.5-5.6c9.8-.3 18.7 5.3 22.7 14.2s2.2 19.3-4.5 26.4c-2.8 2.9-4.4 6.7-4.4 11c0 8.8 7.2 16 16 16c9.1 0 17.4 5.1 21.5 13.3s3.2 17.9-2.3 25.1c-2 2.7-3.2 6-3.2 9.6c0 8.8 7.2 16 16 16l96 0 8 0c39.8 0 72-32.2 72-72l0-125.4c0-18.4-4.9-36.5-14.2-52.4l-1.5-2.6c-18.6-32-52.8-51.6-89.8-51.6l-10.2 0c-11.3 0-22 4.8-29.6 13.1l-17.5-15.9 17.5 15.9-18.4 20.3c-.6 .6-1.1 1.3-1.7 1.9l57 13.2c8.6 2 14 10.6 12 19.2s-10.6 14-19.2 12l-85.6-19.7L74.3 130c-8.6-1.9-17.2 3.5-19.1 12.2s3.5 17.2 12.2 19.1l187.5 41.6c10.2 2.3 17.8 10.9 18.7 21.4l.1 1c.6 6.6-1.5 13.1-5.8 18.1s-10.6 7.9-17.2 8.2L63.6 258.1z"],HandSpock:[576,512,[],"regular","M170.2 80.8C161 47 180.8 12 214.6 2.4c34-9.6 69.4 10.2 79 44.2l30.3 107.1L337.1 84c6.6-34.7 40.1-57.5 74.8-50.9c31.4 6 53 33.9 52 64.9c10-2.6 20.8-2.8 31.5-.1c34.3 8.6 55.1 43.3 46.6 77.6L486.7 397.2C469.8 464.7 409.2 512 339.6 512l-33.7 0c-56.9 0-112.2-19-157.2-53.9l-92-71.6c-27.9-21.7-32.9-61.9-11.2-89.8s61.9-32.9 89.8-11.2l17 13.2L100.5 167.5c-13-32.9 3.2-70.1 36-83c11.1-4.4 22.7-5.4 33.7-3.7zm77.1-21.2c-2.4-8.5-11.2-13.4-19.7-11s-13.4 11.2-11 19.7l54.8 182.4c3.5 12.3-3.3 25.2-15.4 29.3s-25.3-2-30-13.9L174.9 138.1c-3.2-8.2-12.5-12.3-20.8-9s-12.3 12.5-9 20.8l73.3 185.6c12 30.3-23.7 57-49.4 37l-63.1-49.1c-7-5.4-17-4.2-22.5 2.8s-4.2 17 2.8 22.5l92 71.6c36.5 28.4 81.4 43.8 127.7 43.8l33.7 0c47.5 0 89-32.4 100.5-78.5l55.4-221.6c2.1-8.6-3.1-17.3-11.6-19.4s-17.3 3.1-19.4 11.6l-26 104C435.6 271.8 425 280 413 280c-16.5 0-28.9-15-25.8-31.2L415.7 99c1.7-8.7-4-17.1-12.7-18.7s-17.1 4-18.7 12.7L352.5 260c-2.2 11.6-12.4 20-24.2 20c-11 0-20.7-7.3-23.7-17.9L247.4 59.6z"],HandBackFist:[448,512,["HandRock"],"regular","M144 64c0-8.8 7.2-16 16-16s16 7.2 16 16c0 9.1 5.1 17.4 13.3 21.5s17.9 3.2 25.1-2.3c2.7-2 6-3.2 9.6-3.2c8.8 0 16 7.2 16 16c0 9.1 5.1 17.4 13.3 21.5s17.9 3.2 25.1-2.3c2.7-2 6-3.2 9.6-3.2c8.8 0 16 7.2 16 16c0 9.1 5.1 17.4 13.3 21.5s17.9 3.2 25.1-2.3c2.7-2 6-3.2 9.6-3.2c8.8 0 16 7.2 16 16l0 104c0 31.3-20 58-48 67.9c-9.6 3.4-16 12.5-16 22.6L304 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-117.8c38-20.1 64-60.1 64-106.2l0-104c0-35.3-28.7-64-64-64c-2.8 0-5.6 .2-8.3 .5C332.8 77.1 311.9 64 288 64c-2.8 0-5.6 .2-8.3 .5C268.8 45.1 247.9 32 224 32c-2.8 0-5.6 .2-8.3 .5C204.8 13.1 183.9 0 160 0C124.7 0 96 28.7 96 64l0 64.3c-11.7 7.4-22.5 16.4-32 26.9l17.8 16.1L64 155.2l-9.4 10.5C40 181.8 32 202.8 32 224.6l0 12.8c0 49.6 24.2 96.1 64.8 124.5l13.8-19.7L96.8 361.9l8.9 6.2c6.9 4.8 14.4 8.6 22.3 11.3L128 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-128.1c0-12.6-9.8-23.1-22.4-23.9c-7.3-.5-14.3-2.9-20.3-7.1l-13.1 18.7 13.1-18.7-8.9-6.2C96.6 303.1 80 271.3 80 237.4l0-12.8c0-9.9 3.7-19.4 10.3-26.8l9.4-10.5c3.8-4.2 7.9-8.1 12.3-11.6l0 32.3c0 8.8 7.2 16 16 16s16-7.2 16-16l0-65.7 0-14.3 0-64z"],HandLizard:[512,512,[],"regular","M72 112c-13.3 0-24 10.7-24 24s10.7 24 24 24l168 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-104 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l152 0c4.5 0 8.9 1.3 12.7 3.6l64 40c7 4.4 11.3 12.1 11.3 20.4l0 24c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-10.7L281.1 384 136 384c-39.8 0-72-32.2-72-72s32.2-72 72-72l104 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L72 208c-39.8 0-72-32.2-72-72S32.2 64 72 64l209.6 0c46.7 0 90.9 21.5 119.7 58.3l78.4 100.1c20.9 26.7 32.3 59.7 32.3 93.7L512 424c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-107.9c0-23.2-7.8-45.8-22.1-64.1L363.5 151.9c-19.7-25.2-49.9-39.9-81.9-39.9L72 112z"],HandPeace:[512,512,[],"regular","M250.8 1.4c-35.2-3.7-66.6 21.8-70.3 57L174 119 156.7 69.6C145 36.3 108.4 18.8 75.1 30.5S24.2 78.8 35.9 112.1L88.7 262.2C73.5 276.7 64 297.3 64 320c0 0 0 0 0 0l0 24c0 92.8 75.2 168 168 168l48 0c92.8 0 168-75.2 168-168l0-72 0-16 0-32c0-35.3-28.7-64-64-64c-7.9 0-15.4 1.4-22.4 4c-10.4-21.3-32.3-36-57.6-36c-.7 0-1.5 0-2.2 0l5.9-56.3c3.7-35.2-21.8-66.6-57-70.3zm-.2 155.4C243.9 166.9 240 179 240 192l0 48c0 .7 0 1.4 0 2c-5.1-1.3-10.5-2-16-2l-7.4 0-5.4-15.3 17-161.3c.9-8.8 8.8-15.2 17.6-14.2s15.2 8.8 14.2 17.6l-9.5 90.1zM111.4 85.6L165.7 240 144 240c-4 0-8 .3-11.9 .9L81.2 96.2c-2.9-8.3 1.5-17.5 9.8-20.4s17.5 1.5 20.4 9.8zM288 192c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 0 16c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48zm38.4 108c10.4 21.3 32.3 36 57.6 36c5.5 0 10.9-.7 16-2l0 10c0 66.3-53.7 120-120 120l-48 0c-66.3 0-120-53.7-120-120l0-24s0 0 0 0c0-17.7 14.3-32 32-32l80 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0c35.3 0 64-28.7 64-64c0-.7 0-1.4 0-2c5.1 1.3 10.5 2 16 2c7.9 0 15.4-1.4 22.4-4zM400 272c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-32 0-16c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 0 16z"],Html:[24,24,[],"solid","m3 2l1.578 17.824L12 22l7.467-2.175L21 2zm14.049 6.048H9.075l.172 2.016h7.697l-.626 6.565l-4.246 1.381l-4.281-1.455l-.288-2.932h2.024l.16 1.411l2.4.815l2.346-.763l.297-3.005H7.416l-.562-6.05h10.412z"],CircleNodes:[512,512,[],"solid","M418.4 157.9c35.3-8.3 61.6-40 61.6-77.9c0-44.2-35.8-80-80-80c-43.4 0-78.7 34.5-80 77.5L136.2 151.1C121.7 136.8 101.9 128 80 128c-44.2 0-80 35.8-80 80s35.8 80 80 80c12.2 0 23.8-2.7 34.1-7.6L259.7 407.8c-2.4 7.6-3.7 15.8-3.7 24.2c0 44.2 35.8 80 80 80s80-35.8 80-80c0-27.7-14-52.1-35.4-66.4l37.8-207.7zM156.3 232.2c2.2-6.9 3.5-14.2 3.7-21.7l183.8-73.5c3.6 3.5 7.4 6.7 11.6 9.5L317.6 354.1c-5.5 1.3-10.8 3.1-15.8 5.5L156.3 232.2z"],CircleRight:[512,512,[],"regular","M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM294.6 151.2c-4.2-4.6-10.1-7.2-16.4-7.2C266 144 256 154 256 166.3l0 41.7-96 0c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l96 0 0 41.7c0 12.3 10 22.3 22.3 22.3c6.2 0 12.1-2.6 16.4-7.2l84-91c3.5-3.8 5.4-8.7 5.4-13.9s-1.9-10.1-5.4-13.9l-84-91z"],CircleUp:[512,512,[],"regular","M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM151.2 217.4c-4.6 4.2-7.2 10.1-7.2 16.4c0 12.3 10 22.3 22.3 22.3l41.7 0 0 96c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-96 41.7 0c12.3 0 22.3-10 22.3-22.3c0-6.2-2.6-12.1-7.2-16.4l-91-84c-3.8-3.5-8.7-5.4-13.9-5.4s-10.1 1.9-13.9 5.4l-91 84z"],CircleLeft:[512,512,[],"regular","M48 256a208 208 0 1 1 416 0A208 208 0 1 1 48 256zm464 0A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM217.4 376.9c4.2 4.5 10.1 7.1 16.3 7.1c12.3 0 22.3-10 22.3-22.3l0-57.7 96 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32l-96 0 0-57.7c0-12.3-10-22.3-22.3-22.3c-6.2 0-12.1 2.6-16.3 7.1L117.5 242.2c-3.5 3.8-5.5 8.7-5.5 13.8s2 10.1 5.5 13.8l99.9 107.1z"],CircleDown:[512,512,[],"regular","M256 464a208 208 0 1 1 0-416 208 208 0 1 1 0 416zM256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM376.9 294.6c4.5-4.2 7.1-10.1 7.1-16.3c0-12.3-10-22.3-22.3-22.3L304 256l0-96c0-17.7-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32l0 96-57.7 0C138 256 128 266 128 278.3c0 6.2 2.6 12.1 7.1 16.3l107.1 99.9c3.8 3.5 8.7 5.5 13.8 5.5s10.1-2 13.8-5.5l107.1-99.9z"],WindowRestore:[512,512,[],"solid","M432 48L208 48c-17.7 0-32 14.3-32 32l0 16-48 0 0-16c0-44.2 35.8-80 80-80L432 0c44.2 0 80 35.8 80 80l0 224c0 44.2-35.8 80-80 80l-16 0 0-48 16 0c17.7 0 32-14.3 32-32l0-224c0-17.7-14.3-32-32-32zM48 448c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-192L48 256l0 192zM64 128l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64z"],WindowMaximize:[512,512,[],"solid","M.3 89.5C.1 91.6 0 93.8 0 96L0 224 0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-192 0-128c0-35.3-28.7-64-64-64L64 32c-2.2 0-4.4 .1-6.5 .3c-9.2 .9-17.8 3.8-25.5 8.2C21.8 46.5 13.4 55.1 7.7 65.5c-3.9 7.3-6.5 15.4-7.4 24zM48 224l416 0 0 192c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16l0-192z"],WindowMinimize:[512,512,[],"solid","M24 432c-13.3 0-24 10.7-24 24s10.7 24 24 24l464 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 432z"],VrCardboard:[640,512,["VR"],"solid","M576 64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l120.4 0c24.2 0 46.4-13.7 57.2-35.4l32-64c8.8-17.5 26.7-28.6 46.3-28.6s37.5 11.1 46.3 28.6l32 64c10.8 21.7 33 35.4 57.2 35.4L576 448c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64zM96 240a64 64 0 1 1 128 0A64 64 0 1 1 96 240zm384-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"],C:[32,32,[],"solid","M29.86 8c-.224-.385-.532-.724-.871-.921L17.234.292c-.677-.391-1.787-.391-2.464 0L3.015 7.079C2.338 7.47 1.78 8.432 1.78 9.214v13.573c0 .391.14.828.364 1.213.219.385.532.724.871.917l11.749 6.791c.683.391 1.787.391 2.464 0l11.755-6.791c.339-.193.647-.532.871-.917s.359-.823.359-1.213V9.214c.005-.391-.135-.828-.353-1.213zM16 25.479c-5.229 0-9.479-4.249-9.479-9.479S10.77 6.521 16 6.521a9.51 9.51 0 0 1 8.208 4.733l-4.104 2.376A4.76 4.76 0 0 0 16 11.259c-2.615 0-4.74 2.125-4.74 4.74s2.125 4.74 4.74 4.74a4.76 4.76 0 0 0 4.104-2.371l4.104 2.376A9.51 9.51 0 0 1 16 25.479z",{svgClass:"stroke-none"}],CPlusPlus:[32,32,[],"solid","M29.86 8c-.224-.385-.532-.724-.871-.921L17.234.292c-.677-.391-1.787-.391-2.464 0L3.015 7.079C2.338 7.47 1.78 8.432 1.78 9.214v13.573c0 .391.14.828.364 1.213c.219.385.532.724.871.917l11.749 6.791c.683.391 1.787.391 2.464 0l11.755-6.791c.339-.193.647-.532.871-.917s.359-.823.359-1.213V9.214c.005-.391-.135-.828-.353-1.213zM16 25.479c-5.229 0-9.479-4.249-9.479-9.479S10.77 6.521 16 6.521a9.51 9.51 0 0 1 8.208 4.733l-4.104 2.376A4.76 4.76 0 0 0 16 11.259c-2.615 0-4.74 2.125-4.74 4.74s2.125 4.74 4.74 4.74a4.76 4.76 0 0 0 4.104-2.371l4.104 2.376A9.51 9.51 0 0 1 16 25.477zm9.479-8.952h-1.052v1.052H23.37v-1.052h-1.052v-1.053h1.052v-1.052h1.057v1.052h1.052zm3.948 0h-1.052v1.052h-1.052v-1.052h-1.052v-1.053h1.052v-1.052h1.052v1.052h1.052z",{svgClass:"stroke-none"}],Css:[24,24,[],"solid","M0 0v20.16A3.84 3.84 0 0 0 3.84 24h16.32A3.84 3.84 0 0 0 24 20.16V3.84A3.84 3.84 0 0 0 20.16 0Zm14.256 13.08c1.56 0 2.28 1.08 2.304 2.64h-1.608c.024-.288-.048-.6-.144-.84c-.096-.192-.288-.264-.552-.264c-.456 0-.696.264-.696.84c-.024.576.288.888.768 1.08c.72.288 1.608.744 1.92 1.296q.432.648.432 1.656c0 1.608-.912 2.592-2.496 2.592c-1.656 0-2.4-1.032-2.424-2.688h1.68c0 .792.264 1.176.792 1.176c.264 0 .456-.072.552-.24c.192-.312.24-1.176-.048-1.512c-.312-.408-.912-.6-1.32-.816q-.828-.396-1.224-.936c-.24-.36-.36-.888-.36-1.536c0-1.44.936-2.472 2.424-2.448m5.4 0c1.584 0 2.304 1.08 2.328 2.64h-1.608c0-.288-.048-.6-.168-.84c-.096-.192-.264-.264-.528-.264c-.48 0-.72.264-.72.84s.288.888.792 1.08c.696.288 1.608.744 1.92 1.296c.264.432.408.984.408 1.656c.024 1.608-.888 2.592-2.472 2.592c-1.68 0-2.424-1.056-2.448-2.688h1.68c0 .744.264 1.176.792 1.176c.264 0 .456-.072.552-.24c.216-.312.264-1.176-.048-1.512c-.288-.408-.888-.6-1.32-.816c-.552-.264-.96-.576-1.2-.936s-.36-.888-.36-1.536c-.024-1.44.912-2.472 2.4-2.448m-11.031.018c.711-.006 1.419.198 1.839.63c.432.432.672 1.128.648 1.992H9.336c.024-.456-.096-.792-.432-.96c-.312-.144-.768-.048-.888.24c-.12.264-.192.576-.168.864v3.504c0 .744.264 1.128.768 1.128a.65.65 0 0 0 .552-.264c.168-.24.192-.552.168-.84h1.776c.096 1.632-.984 2.712-2.568 2.688c-1.536 0-2.496-.864-2.472-2.472v-4.032c0-.816.24-1.44.696-1.848c.432-.408 1.146-.624 1.857-.63"],Discord:[640,512,[],"solid","M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"],Godot:[32,32,[],"solid","M12.745.917c-1.458.328-2.906.781-4.266 1.464a32 32 0 0 0 .266 3.505c-.526.339-1.078.63-1.568 1.026c-.5.38-1.01.75-1.464 1.198a28 28 0 0 0-2.849-1.651C1.801 7.6.812 8.834-.001 10.214c.609.99 1.25 1.911 1.938 2.792h.016v8.474a.2.2 0 0 1 .047.005l5.198.5a.554.554 0 0 1 .5.521l.161 2.292l4.531.323l.313-2.115a.56.56 0 0 1 .552-.479h5.484a.56.56 0 0 1 .552.479l.313 2.115l4.531-.323l.161-2.292a.554.554 0 0 1 .505-.521l5.193-.5c.016 0 .031-.005.047-.005v-8.474h.021a30 30 0 0 0 1.932-2.792c-.807-1.38-1.802-2.615-2.865-3.755A29 29 0 0 0 26.28 8.11c-.453-.448-.958-.818-1.458-1.198c-.495-.396-1.047-.688-1.573-1.026c.156-1.161.234-2.307.266-3.505c-1.354-.682-2.802-1.135-4.266-1.464A31 31 0 0 0 17.671 4a11 11 0 0 0-1.661-.13h-.026c-.552.005-1.109.042-1.661.13A30 30 0 0 0 12.74.917zm-4.11 12.406a3.134 3.134 0 0 1 3.13 3.135a3.13 3.13 0 1 1-6.26 0a3.134 3.134 0 0 1 3.13-3.135m14.73 0a3.134 3.134 0 0 1 3.13 3.135a3.13 3.13 0 1 1-6.26 0a3.134 3.134 0 0 1 3.13-3.135M8.932 14.568a2.076 2.076 0 1 0 0 4.151a2.077 2.077 0 0 0 2.083-2.073a2.08 2.08 0 0 0-2.083-2.078m14.131 0a2.076 2.076 0 1 0 0 4.151a2.073 2.073 0 0 0 2.078-2.073a2.074 2.074 0 0 0-2.078-2.078M16 15.172c.557 0 1.01.406 1.01.911v2.885c0 .505-.453.917-1.01.917s-1.01-.411-1.01-.917v-2.885c0-.505.453-.911 1.01-.911M1.948 22.599c0 .505.005 1.052.005 1.161c0 4.938 6.26 7.307 14.036 7.333h.021c7.776-.026 14.031-2.396 14.031-7.333l.01-1.161l-4.672.453l-.161 2.307a.556.556 0 0 1-.516.516l-5.578.396a.56.56 0 0 1-.552-.474l-.318-2.156h-4.516l-.318 2.156a.557.557 0 0 1-.594.474l-5.531-.396a.565.565 0 0 1-.521-.516l-.156-2.307l-4.672-.448z"],Google:[488,512,[],"solid","M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"],Go:[24,24,[],"solid","M1.811 10.231c-.047 0-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046 0 .058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047 11.306c-.047 0-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047 0 .07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828 1.075c-.047 0-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047 0 .07.035.07.082l-.023.28c0 .047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514c-.176.046-.187.058-.34-.117c-.174-.199-.303-.327-.548-.444c-.737-.362-1.45-.257-2.115.175c-.795.514-1.204 1.274-1.192 2.22c.011.935.654 1.706 1.577 1.835c.795.105 1.46-.175 1.987-.77c.105-.13.198-.27.315-.434H10.47c-.245 0-.304-.152-.222-.35c.152-.362.432-.97.596-1.274a.32.32 0 0 1 .292-.187h4.253c-.023.316-.023.631-.07.947a5 5 0 0 1-.958 2.29c-.841 1.11-1.94 1.8-3.33 1.986c-1.145.152-2.209-.07-3.143-.77c-.865-.655-1.356-1.52-1.484-2.595c-.152-1.274.222-2.419.993-3.424c.83-1.086 1.928-1.776 3.272-2.02c1.098-.2 2.15-.07 3.096.571c.62.41 1.063.97 1.356 1.648c.07.105.023.164-.117.2m3.868 6.461c-1.064-.024-2.034-.328-2.852-1.029a3.67 3.67 0 0 1-1.262-2.255c-.21-1.32.152-2.489.947-3.529c.853-1.122 1.881-1.706 3.272-1.95c1.192-.21 2.314-.095 3.33.595c.923.63 1.496 1.484 1.648 2.605c.198 1.578-.257 2.863-1.344 3.962c-.771.783-1.718 1.273-2.805 1.495c-.315.06-.63.07-.934.106m2.78-4.72c-.011-.153-.011-.27-.034-.387c-.21-1.157-1.274-1.81-2.384-1.554c-1.087.245-1.788.935-2.045 2.033c-.21.912.234 1.835 1.075 2.21c.643.28 1.285.244 1.905-.07c.923-.48 1.425-1.228 1.484-2.233z"],Git:[32,32,[],"solid","M13.172 2.828L11.78 4.22l1.91 1.91l2 2A2.986 2.986 0 0 1 20 10.81a3.25 3.25 0 0 1-.31 1.31l2.06 2a2.68 2.68 0 0 1 3.37.57a2.86 2.86 0 0 1 .88 2.117a3.02 3.02 0 0 1-.856 2.109A2.9 2.9 0 0 1 23 19.81a2.93 2.93 0 0 1-2.13-.87a2.694 2.694 0 0 1-.56-3.38l-2-2.06a3 3 0 0 1-.31.12V20a3 3 0 0 1 1.44 1.09a2.92 2.92 0 0 1 .56 1.72a2.88 2.88 0 0 1-.878 2.128a2.98 2.98 0 0 1-2.048.871a2.981 2.981 0 0 1-2.514-4.719A3 3 0 0 1 16 20v-6.38a2.96 2.96 0 0 1-1.44-1.09a2.9 2.9 0 0 1-.56-1.72a2.9 2.9 0 0 1 .31-1.31l-3.9-3.9l-7.579 7.572a4 4 0 0 0-.001 5.658l10.342 10.342a4 4 0 0 0 5.656 0l10.344-10.344a4 4 0 0 0 0-5.656L18.828 2.828a4 4 0 0 0-5.656 0"],Json:[32,32,[],"solid","M4.014 14.976a2.5 2.5 0 0 0 1.567-.518a2.38 2.38 0 0 0 .805-1.358a15.3 15.3 0 0 0 .214-2.944q.012-2.085.075-2.747a5.2 5.2 0 0 1 .418-1.686a3 3 0 0 1 .755-1.018A3.05 3.05 0 0 1 9 4.125A6.8 6.8 0 0 1 10.544 4h.7v1.96h-.387a2.34 2.34 0 0 0-1.723.468a3.4 3.4 0 0 0-.425 2.092a36 36 0 0 1-.137 4.133a4.7 4.7 0 0 1-.768 2.06A4.6 4.6 0 0 1 6.1 16a3.8 3.8 0 0 1 1.992 1.754a8.9 8.9 0 0 1 .618 3.865q0 2.435.05 2.9a1.76 1.76 0 0 0 .504 1.181a2.64 2.64 0 0 0 1.592.337h.387V28h-.7a5.7 5.7 0 0 1-1.773-.2a2.97 2.97 0 0 1-1.324-.93a3.35 3.35 0 0 1-.681-1.63a24 24 0 0 1-.165-3.234a16.5 16.5 0 0 0-.214-3.106a2.4 2.4 0 0 0-.805-1.361a2.5 2.5 0 0 0-1.567-.524Zm23.972 2.035a2.5 2.5 0 0 0-1.567.524a2.4 2.4 0 0 0-.805 1.361a16.5 16.5 0 0 0-.212 3.109a24 24 0 0 1-.169 3.234a3.35 3.35 0 0 1-.681 1.63a2.97 2.97 0 0 1-1.324.93a5.7 5.7 0 0 1-1.773.2h-.7V26.04h.387a2.64 2.64 0 0 0 1.592-.337a1.76 1.76 0 0 0 .506-1.186q.05-.462.05-2.9a8.9 8.9 0 0 1 .618-3.865A3.8 3.8 0 0 1 25.9 16a4.6 4.6 0 0 1-1.7-1.286a4.7 4.7 0 0 1-.768-2.06a36 36 0 0 1-.137-4.133a3.4 3.4 0 0 0-.425-2.092a2.34 2.34 0 0 0-1.723-.468h-.387V4h.7a6.8 6.8 0 0 1 1.54.125a3.05 3.05 0 0 1 1.149.581a3 3 0 0 1 .755 1.018a5.2 5.2 0 0 1 .418 1.686q.062.662.075 2.747a15.3 15.3 0 0 0 .212 2.947a2.38 2.38 0 0 0 .805 1.355a2.5 2.5 0 0 0 1.567.518Z"],Js:[32,32,[],"solid","M18.774 19.7a3.73 3.73 0 0 0 3.376 2.078c1.418 0 2.324-.709 2.324-1.688c0-1.173-.931-1.589-2.491-2.272l-.856-.367c-2.469-1.052-4.11-2.37-4.11-5.156c0-2.567 1.956-4.52 5.012-4.52A5.06 5.06 0 0 1 26.9 10.52l-2.665 1.711a2.33 2.33 0 0 0-2.2-1.467a1.49 1.49 0 0 0-1.638 1.467c0 1.027.636 1.442 2.1 2.078l.856.366c2.908 1.247 4.549 2.518 4.549 5.376c0 3.081-2.42 4.769-5.671 4.769a6.58 6.58 0 0 1-6.236-3.5ZM6.686 20c.538.954 1.027 1.76 2.2 1.76c1.124 0 1.834-.44 1.834-2.15V7.975h3.422v11.683c0 3.543-2.078 5.156-5.11 5.156A5.31 5.31 0 0 1 3.9 21.688Z"],Ts:[32,32,[],"solid","M23.827 8.243a4.4 4.4 0 0 1 2.223 1.281a6 6 0 0 1 .852 1.143c.011.045-1.534 1.083-2.471 1.662c-.034.023-.169-.124-.322-.35a2.01 2.01 0 0 0-1.67-1c-1.077-.074-1.771.49-1.766 1.433a1.3 1.3 0 0 0 .153.666c.237.49.677.784 2.059 1.383c2.544 1.095 3.636 1.817 4.31 2.843a5.16 5.16 0 0 1 .416 4.333a4.76 4.76 0 0 1-3.932 2.815a11 11 0 0 1-2.708-.028a6.53 6.53 0 0 1-3.616-1.884a6.3 6.3 0 0 1-.926-1.371a3 3 0 0 1 .327-.208c.158-.09.756-.434 1.32-.761l1.024-.6l.214.312a4.8 4.8 0 0 0 1.35 1.292a3.3 3.3 0 0 0 3.458-.175a1.545 1.545 0 0 0 .2-1.974c-.276-.395-.84-.727-2.443-1.422a8.8 8.8 0 0 1-3.349-2.055a4.7 4.7 0 0 1-.976-1.777a7.1 7.1 0 0 1-.062-2.268a4.33 4.33 0 0 1 3.644-3.374a9 9 0 0 1 2.691.084m-8.343 1.483l.011 1.454h-4.63v13.148H7.6V11.183H2.97V9.755a14 14 0 0 1 .04-1.466c.017-.023 2.832-.034 6.245-.028l6.211.017Z"],Linux:[448,512,[],"regular","M220.8 123.3c1 .5 1.8 1.7 3 1.7 1.1 0 2.8-.4 2.9-1.5.2-1.4-1.9-2.3-3.2-2.9-1.7-.7-3.9-1-5.5-.1-.4.2-.8.7-.6 1.1.3 1.3 2.3 1.1 3.4 1.7zm-21.9 1.7c1.2 0 2-1.2 3-1.7 1.1-.6 3.1-.4 3.5-1.6.2-.4-.2-.9-.6-1.1-1.6-.9-3.8-.6-5.5.1-1.3.6-3.4 1.5-3.2 2.9.1 1 1.8 1.5 2.8 1.4zM420 403.8c-3.6-4-5.3-11.6-7.2-19.7-1.8-8.1-3.9-16.8-10.5-22.4-1.3-1.1-2.6-2.1-4-2.9-1.3-.8-2.7-1.5-4.1-2 9.2-27.3 5.6-54.5-3.7-79.1-11.4-30.1-31.3-56.4-46.5-74.4-17.1-21.5-33.7-41.9-33.4-72C311.1 85.4 315.7.1 234.8 0 132.4-.2 158 103.4 156.9 135.2c-1.7 23.4-6.4 41.8-22.5 64.7-18.9 22.5-45.5 58.8-58.1 96.7-6 17.9-8.8 36.1-6.2 53.3-6.5 5.8-11.4 14.7-16.6 20.2-4.2 4.3-10.3 5.9-17 8.3s-14 6-18.5 14.5c-2.1 3.9-2.8 8.1-2.8 12.4 0 3.9.6 7.9 1.2 11.8 1.2 8.1 2.5 15.7.8 20.8-5.2 14.4-5.9 24.4-2.2 31.7 3.8 7.3 11.4 10.5 20.1 12.3 17.3 3.6 40.8 2.7 59.3 12.5 19.8 10.4 39.9 14.1 55.9 10.4 11.6-2.6 21.1-9.6 25.9-20.2 12.5-.1 26.3-5.4 48.3-6.6 14.9-1.2 33.6 5.3 55.1 4.1.6 2.3 1.4 4.6 2.5 6.7v.1c8.3 16.7 23.8 24.3 40.3 23 16.6-1.3 34.1-11 48.3-27.9 13.6-16.4 36-23.2 50.9-32.2 7.4-4.5 13.4-10.1 13.9-18.3.4-8.2-4.4-17.3-15.5-29.7zM223.7 87.3c9.8-22.2 34.2-21.8 44-.4 6.5 14.2 3.6 30.9-4.3 40.4-1.6-.8-5.9-2.6-12.6-4.9 1.1-1.2 3.1-2.7 3.9-4.6 4.8-11.8-.2-27-9.1-27.3-7.3-.5-13.9 10.8-11.8 23-4.1-2-9.4-3.5-13-4.4-1-6.9-.3-14.6 2.9-21.8zM183 75.8c10.1 0 20.8 14.2 19.1 33.5-3.5 1-7.1 2.5-10.2 4.6 1.2-8.9-3.3-20.1-9.6-19.6-8.4.7-9.8 21.2-1.8 28.1 1 .8 1.9-.2-5.9 5.5-15.6-14.6-10.5-52.1 8.4-52.1zm-13.6 60.7c6.2-4.6 13.6-10 14.1-10.5 4.7-4.4 13.5-14.2 27.9-14.2 7.1 0 15.6 2.3 25.9 8.9 6.3 4.1 11.3 4.4 22.6 9.3 8.4 3.5 13.7 9.7 10.5 18.2-2.6 7.1-11 14.4-22.7 18.1-11.1 3.6-19.8 16-38.2 14.9-3.9-.2-7-1-9.6-2.1-8-3.5-12.2-10.4-20-15-8.6-4.8-13.2-10.4-14.7-15.3-1.4-4.9 0-9 4.2-12.3zm3.3 334c-2.7 35.1-43.9 34.4-75.3 18-29.9-15.8-68.6-6.5-76.5-21.9-2.4-4.7-2.4-12.7 2.6-26.4v-.2c2.4-7.6.6-16-.6-23.9-1.2-7.8-1.8-15 .9-20 3.5-6.7 8.5-9.1 14.8-11.3 10.3-3.7 11.8-3.4 19.6-9.9 5.5-5.7 9.5-12.9 14.3-18 5.1-5.5 10-8.1 17.7-6.9 8.1 1.2 15.1 6.8 21.9 16l19.6 35.6c9.5 19.9 43.1 48.4 41 68.9zm-1.4-25.9c-4.1-6.6-9.6-13.6-14.4-19.6 7.1 0 14.2-2.2 16.7-8.9 2.3-6.2 0-14.9-7.4-24.9-13.5-18.2-38.3-32.5-38.3-32.5-13.5-8.4-21.1-18.7-24.6-29.9s-3-23.3-.3-35.2c5.2-22.9 18.6-45.2 27.2-59.2 2.3-1.7.8 3.2-8.7 20.8-8.5 16.1-24.4 53.3-2.6 82.4.6-20.7 5.5-41.8 13.8-61.5 12-27.4 37.3-74.9 39.3-112.7 1.1.8 4.6 3.2 6.2 4.1 4.6 2.7 8.1 6.7 12.6 10.3 12.4 10 28.5 9.2 42.4 1.2 6.2-3.5 11.2-7.5 15.9-9 9.9-3.1 17.8-8.6 22.3-15 7.7 30.4 25.7 74.3 37.2 95.7 6.1 11.4 18.3 35.5 23.6 64.6 3.3-.1 7 .4 10.9 1.4 13.8-35.7-11.7-74.2-23.3-84.9-4.7-4.6-4.9-6.6-2.6-6.5 12.6 11.2 29.2 33.7 35.2 59 2.8 11.6 3.3 23.7.4 35.7 16.4 6.8 35.9 17.9 30.7 34.8-2.2-.1-3.2 0-4.2 0 3.2-10.1-3.9-17.6-22.8-26.1-19.6-8.6-36-8.6-38.3 12.5-12.1 4.2-18.3 14.7-21.4 27.3-2.8 11.2-3.6 24.7-4.4 39.9-.5 7.7-3.6 18-6.8 29-32.1 22.9-76.7 32.9-114.3 7.2zm257.4-11.5c-.9 16.8-41.2 19.9-63.2 46.5-13.2 15.7-29.4 24.4-43.6 25.5s-26.5-4.8-33.7-19.3c-4.7-11.1-2.4-23.1 1.1-36.3 3.7-14.2 9.2-28.8 9.9-40.6.8-15.2 1.7-28.5 4.2-38.7 2.6-10.3 6.6-17.2 13.7-21.1.3-.2.7-.3 1-.5.8 13.2 7.3 26.6 18.8 29.5 12.6 3.3 30.7-7.5 38.4-16.3 9-.3 15.7-.9 22.6 5.1 9.9 8.5 7.1 30.3 17.1 41.6 10.6 11.6 14 19.5 13.7 24.6zM173.3 148.7c2 1.9 4.7 4.5 8 7.1 6.6 5.2 15.8 10.6 27.3 10.6 11.6 0 22.5-5.9 31.8-10.8 4.9-2.6 10.9-7 14.8-10.4s5.9-6.3 3.1-6.6-2.6 2.6-6 5.1c-4.4 3.2-9.7 7.4-13.9 9.8-7.4 4.2-19.5 10.2-29.9 10.2s-18.7-4.8-24.9-9.7c-3.1-2.5-5.7-5-7.7-6.9-1.5-1.4-1.9-4.6-4.3-4.9-1.4-.1-1.8 3.7 1.7 6.5z"],SquareJs:[448,512,[],"solid","M448 96c0-35.3-28.7-64-64-64H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96zM180.9 444.9c-33.7 0-53.2-17.4-63.2-38.5L152 385.7c6.6 11.7 12.6 21.6 27.1 21.6c13.8 0 22.6-5.4 22.6-26.5V237.7h42.1V381.4c0 43.6-25.6 63.5-62.9 63.5zm85.8-43L301 382.1c9 14.7 20.8 25.6 41.5 25.6c17.4 0 28.6-8.7 28.6-20.8c0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5c0-31.6 24.1-55.6 61.6-55.6c26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18c-12.3 0-20.1 7.8-20.1 18c0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2c0 37.8-29.8 58.6-69.7 58.6c-39.1 0-64.4-18.6-76.7-43z"],Safari:[512,512,[],"solid","M274.69,274.69l-37.38-37.38L166,346ZM256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8ZM411.85,182.79l14.78-6.13A8,8,0,0,1,437.08,181h0a8,8,0,0,1-4.33,10.46L418,197.57a8,8,0,0,1-10.45-4.33h0A8,8,0,0,1,411.85,182.79ZM314.43,94l6.12-14.78A8,8,0,0,1,331,74.92h0a8,8,0,0,1,4.33,10.45l-6.13,14.78a8,8,0,0,1-10.45,4.33h0A8,8,0,0,1,314.43,94ZM256,60h0a8,8,0,0,1,8,8V84a8,8,0,0,1-8,8h0a8,8,0,0,1-8-8V68A8,8,0,0,1,256,60ZM181,74.92a8,8,0,0,1,10.46,4.33L197.57,94a8,8,0,1,1-14.78,6.12l-6.13-14.78A8,8,0,0,1,181,74.92Zm-63.58,42.49h0a8,8,0,0,1,11.31,0L140,128.72A8,8,0,0,1,140,140h0a8,8,0,0,1-11.31,0l-11.31-11.31A8,8,0,0,1,117.41,117.41ZM60,256h0a8,8,0,0,1,8-8H84a8,8,0,0,1,8,8h0a8,8,0,0,1-8,8H68A8,8,0,0,1,60,256Zm40.15,73.21-14.78,6.13A8,8,0,0,1,74.92,331h0a8,8,0,0,1,4.33-10.46L94,314.43a8,8,0,0,1,10.45,4.33h0A8,8,0,0,1,100.15,329.21Zm4.33-136h0A8,8,0,0,1,94,197.57l-14.78-6.12A8,8,0,0,1,74.92,181h0a8,8,0,0,1,10.45-4.33l14.78,6.13A8,8,0,0,1,104.48,193.24ZM197.57,418l-6.12,14.78a8,8,0,0,1-14.79-6.12l6.13-14.78A8,8,0,1,1,197.57,418ZM264,444a8,8,0,0,1-8,8h0a8,8,0,0,1-8-8V428a8,8,0,0,1,8-8h0a8,8,0,0,1,8,8Zm67-6.92h0a8,8,0,0,1-10.46-4.33L314.43,418a8,8,0,0,1,4.33-10.45h0a8,8,0,0,1,10.45,4.33l6.13,14.78A8,8,0,0,1,331,437.08Zm63.58-42.49h0a8,8,0,0,1-11.31,0L372,383.28A8,8,0,0,1,372,372h0a8,8,0,0,1,11.31,0l11.31,11.31A8,8,0,0,1,394.59,394.59ZM286.25,286.25,110.34,401.66,225.75,225.75,401.66,110.34ZM437.08,331h0a8,8,0,0,1-10.45,4.33l-14.78-6.13a8,8,0,0,1-4.33-10.45h0A8,8,0,0,1,418,314.43l14.78,6.12A8,8,0,0,1,437.08,331ZM444,264H428a8,8,0,0,1-8-8h0a8,8,0,0,1,8-8h16a8,8,0,0,1,8,8h0A8,8,0,0,1,444,264Z"],Php:[512,512,[],"solid","M170.322 349.808c-2.4-15.66-9-28.38-25.02-34.531c-6.27-2.4-11.7-6.78-17.88-9.54c-7.02-3.15-14.16-6.15-21.57-8.1c-5.61-1.5-10.83 1.02-14.16 5.94c-3.15 4.62-.87 8.97 1.77 12.84c2.97 4.35 6.27 8.49 9.6 12.57c5.52 6.78 11.37 13.29 16.74 20.161c5.13 6.57 9.51 13.86 8.76 22.56c-1.65 19.08-10.29 34.891-24.21 47.76c-1.53 1.38-4.23 2.37-6.21 2.19c-8.88-.96-16.95-4.32-23.46-10.53c-7.47-7.11-6.33-15.48 2.61-20.67c2.13-1.23 4.35-2.37 6.3-3.87c5.46-4.11 7.29-11.13 4.32-17.22c-1.41-2.94-3-6.12-5.34-8.25c-11.43-10.41-22.651-21.151-34.891-30.63C18.01 307.447 2.771 276.968.43 240.067c-2.64-40.981 6.87-79.231 28.5-114.242c8.19-13.29 17.73-25.951 32.37-32.52c9.96-4.47 20.88-6.99 31.531-9.78c29.311-7.71 58.89-13.5 89.401-8.34c26.28 4.41 45.511 17.94 54.331 43.77c5.79 16.89 7.17 34.35 5.37 52.231c-3.54 35.131-29.49 66.541-63.331 75.841c-14.67 4.02-22.68 1.77-31.5-10.44c-6.33-8.79-11.58-18.36-17.25-27.631c-.84-1.38-1.44-2.97-2.16-4.44c-.69-1.47-1.44-2.88-2.16-4.35c2.13 15.24 5.67 29.911 13.98 42.99c4.5 7.11 10.5 12.36 19.29 13.14c32.34 2.91 59.641-7.71 79.021-33.721c21.69-29.101 26.461-62.581 20.19-97.831c-1.23-6.96-3.3-13.77-4.77-20.7c-.99-4.47.78-7.77 5.19-9.33c2.04-.69 4.14-1.26 6.18-1.68c26.461-5.7 53.221-7.59 80.191-4.86c30.601 3.06 59.551 11.46 85.441 28.471c40.531 26.67 65.641 64.621 79.291 110.522c1.98 6.66 2.28 13.95 2.46 20.971c.12 4.68-2.88 5.91-6.45 2.97c-3.93-3.21-7.53-6.87-10.92-10.65c-3.15-3.57-5.67-7.65-8.73-11.4c-2.37-2.94-4.44-2.49-5.58 1.17c-.72 2.22-1.35 4.41-1.98 6.63c-7.08 25.26-18.24 48.3-36.33 67.711c-2.52 2.73-4.77 6.78-5.07 10.38c-.78 9.96-1.35 20.13-.39 30.06c1.98 21.331 5.07 42.57 7.47 63.871c1.35 12.03-2.52 19.11-13.83 23.281c-7.95 2.91-16.47 5.04-24.87 5.64c-13.38.93-26.88.27-40.32.27c-.36-15 .93-29.731-13.17-37.771c2.73-11.13 5.88-21.69 7.77-32.49c1.56-8.97.24-17.79-6.06-25.14c-5.91-6.93-13.32-8.82-20.101-4.86c-20.43 11.91-41.671 11.97-63.301 4.17c-9.93-3.6-16.86-1.56-22.351 7.5c-5.91 9.75-8.4 20.7-7.74 31.771c.84 13.95 3.27 27.75 5.13 41.64c1.02 7.77.15 9.78-7.56 11.76c-17.13 4.35-34.56 4.83-52.081 3.42c-.93-.09-1.86-.48-2.46-.63c-.87-14.55.66-29.671-16.68-37.411c7.68-16.29 6.63-33.18 3.99-50.07l-.06-.15zm-103.561-57.09c2.55-2.4 4.59-6.15 5.31-9.6c1.8-8.64-4.68-20.22-12.18-23.43c-3.99-1.74-7.47-1.11-10.29 2.07c-6.87 7.77-13.65 15.63-20.401 23.521c-1.14 1.35-2.16 2.94-2.97 4.53c-2.7 5.19-1.11 8.97 4.65 10.38c3.48.87 7.08 1.05 10.65 1.56c9.3-.9 18.3-2.46 25.23-9zm.78-86.371c-.03-6.18-5.19-11.34-11.28-11.37c-6.27-.03-11.67 5.58-11.46 11.76c.27 6.21 5.43 11.19 11.61 11.07c6.24-.09 11.22-5.19 11.16-11.43z"],Python:[448,512,[],"solid","M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"],Markdown:[32,32,[],"solid","m14 10l-4 3.5L6 10H4v12h4v-6l2 2l2-2v6h4V10zm12 6v-6h-4v6h-4l6 8l6-8z"],Microsoft:[448,512,[],"solid","M0 32h214.6v214.6H0V32zm233.4 0H448v214.6H233.4V32zM0 265.4h214.6V480H0V265.4zm233.4 0H448V480H233.4V265.4z"],Npm:[576,512,[],"solid","M288 288h-32v-64h32v64zm288-128v192H288v32H160v-32H0V160h576zm-416 32H32v128h64v-96h32v96h32V192zm160 0H192v160h64v-32h64V192zm224 0H352v128h64v-96h32v96h32v-96h32v96h32V192z"],Reddit:[512,512,[],"solid","M0 256C0 114.6 114.6 0 256 0S512 114.6 512 256s-114.6 256-256 256L37.1 512c-13.7 0-20.5-16.5-10.9-26.2L75 437C28.7 390.7 0 326.7 0 256zM349.6 153.6c23.6 0 42.7-19.1 42.7-42.7s-19.1-42.7-42.7-42.7c-20.6 0-37.8 14.6-41.8 34c-34.5 3.7-61.4 33-61.4 68.4l0 .2c-37.5 1.6-71.8 12.3-99 29.1c-10.1-7.8-22.8-12.5-36.5-12.5c-33 0-59.8 26.8-59.8 59.8c0 24 14.1 44.6 34.4 54.1c2 69.4 77.6 125.2 170.6 125.2s168.7-55.9 170.6-125.3c20.2-9.6 34.1-30.2 34.1-54c0-33-26.8-59.8-59.8-59.8c-13.7 0-26.3 4.6-36.4 12.4c-27.4-17-62.1-27.7-100-29.1l0-.2c0-25.4 18.9-46.5 43.4-49.9l0 0c4.4 18.8 21.3 32.8 41.5 32.8zM177.1 246.9c16.7 0 29.5 17.6 28.5 39.3s-13.5 29.6-30.3 29.6s-31.4-8.8-30.4-30.5s15.4-38.3 32.1-38.3zm190.1 38.3c1 21.7-13.7 30.5-30.4 30.5s-29.3-7.9-30.3-29.6c-1-21.7 11.8-39.3 28.5-39.3s31.2 16.6 32.1 38.3zm-48.1 56.7c-10.3 24.6-34.6 41.9-63 41.9s-52.7-17.3-63-41.9c-1.2-2.9 .8-6.2 3.9-6.5c18.4-1.9 38.3-2.9 59.1-2.9s40.7 1 59.1 2.9c3.1 .3 5.1 3.6 3.9 6.5z"],Rust:[512,512,[],"solid","M508.52,249.75,486.7,236.24c-.17-2-.34-3.93-.55-5.88l18.72-17.5a7.35,7.35,0,0,0-2.44-12.25l-24-9c-.54-1.88-1.08-3.78-1.67-5.64l15-20.83a7.35,7.35,0,0,0-4.79-11.54l-25.42-4.15c-.9-1.73-1.79-3.45-2.73-5.15l10.68-23.42a7.35,7.35,0,0,0-6.95-10.39l-25.82.91q-1.79-2.22-3.61-4.4L439,81.84A7.36,7.36,0,0,0,430.16,73L405,78.93q-2.17-1.83-4.4-3.61l.91-25.82a7.35,7.35,0,0,0-10.39-7L367.7,53.23c-1.7-.94-3.43-1.84-5.15-2.73L358.4,25.08a7.35,7.35,0,0,0-11.54-4.79L326,35.26c-1.86-.59-3.75-1.13-5.64-1.67l-9-24a7.35,7.35,0,0,0-12.25-2.44l-17.5,18.72c-1.95-.21-3.91-.38-5.88-.55L262.25,3.48a7.35,7.35,0,0,0-12.5,0L236.24,25.3c-2,.17-3.93.34-5.88.55L212.86,7.13a7.35,7.35,0,0,0-12.25,2.44l-9,24c-1.89.55-3.79,1.08-5.66,1.68l-20.82-15a7.35,7.35,0,0,0-11.54,4.79l-4.15,25.41c-1.73.9-3.45,1.79-5.16,2.73L120.88,42.55a7.35,7.35,0,0,0-10.39,7l.92,25.81c-1.49,1.19-3,2.39-4.42,3.61L81.84,73A7.36,7.36,0,0,0,73,81.84L78.93,107c-1.23,1.45-2.43,2.93-3.62,4.41l-25.81-.91a7.42,7.42,0,0,0-6.37,3.26,7.35,7.35,0,0,0-.57,7.13l10.66,23.41c-.94,1.7-1.83,3.43-2.73,5.16L25.08,153.6a7.35,7.35,0,0,0-4.79,11.54l15,20.82c-.59,1.87-1.13,3.77-1.68,5.66l-24,9a7.35,7.35,0,0,0-2.44,12.25l18.72,17.5c-.21,1.95-.38,3.91-.55,5.88L3.48,249.75a7.35,7.35,0,0,0,0,12.5L25.3,275.76c.17,2,.34,3.92.55,5.87L7.13,299.13a7.35,7.35,0,0,0,2.44,12.25l24,9c.55,1.89,1.08,3.78,1.68,5.65l-15,20.83a7.35,7.35,0,0,0,4.79,11.54l25.42,4.15c.9,1.72,1.79,3.45,2.73,5.14L42.56,391.12a7.35,7.35,0,0,0,.57,7.13,7.13,7.13,0,0,0,6.37,3.26l25.83-.91q1.77,2.22,3.6,4.4L73,430.16A7.36,7.36,0,0,0,81.84,439L107,433.07q2.18,1.83,4.41,3.61l-.92,25.82a7.35,7.35,0,0,0,10.39,6.95l23.43-10.68c1.69.94,3.42,1.83,5.14,2.73l4.15,25.42a7.34,7.34,0,0,0,11.54,4.78l20.83-15c1.86.6,3.76,1.13,5.65,1.68l9,24a7.36,7.36,0,0,0,12.25,2.44l17.5-18.72c1.95.21,3.92.38,5.88.55l13.51,21.82a7.35,7.35,0,0,0,12.5,0l13.51-21.82c2-.17,3.93-.34,5.88-.56l17.5,18.73a7.36,7.36,0,0,0,12.25-2.44l9-24c1.89-.55,3.78-1.08,5.65-1.68l20.82,15a7.34,7.34,0,0,0,11.54-4.78l4.15-25.42c1.72-.9,3.45-1.79,5.15-2.73l23.42,10.68a7.35,7.35,0,0,0,10.39-6.95l-.91-25.82q2.22-1.79,4.4-3.61L430.16,439a7.36,7.36,0,0,0,8.84-8.84L433.07,405q1.83-2.17,3.61-4.4l25.82.91a7.23,7.23,0,0,0,6.37-3.26,7.35,7.35,0,0,0,.58-7.13L458.77,367.7c.94-1.7,1.83-3.43,2.73-5.15l25.42-4.15a7.35,7.35,0,0,0,4.79-11.54l-15-20.83c.59-1.87,1.13-3.76,1.67-5.65l24-9a7.35,7.35,0,0,0,2.44-12.25l-18.72-17.5c.21-1.95.38-3.91.55-5.87l21.82-13.51a7.35,7.35,0,0,0,0-12.5Zm-151,129.08A13.91,13.91,0,0,0,341,389.51l-7.64,35.67A187.51,187.51,0,0,1,177,424.44l-7.64-35.66a13.87,13.87,0,0,0-16.46-10.68l-31.51,6.76a187.38,187.38,0,0,1-16.26-19.21H258.3c1.72,0,2.89-.29,2.89-1.91V309.55c0-1.57-1.17-1.91-2.89-1.91H213.47l.05-34.35H262c4.41,0,23.66,1.28,29.79,25.87,1.91,7.55,6.17,32.14,9.06,40,2.89,8.82,14.6,26.46,27.1,26.46H407a187.3,187.3,0,0,1-17.34,20.09Zm25.77,34.49A15.24,15.24,0,1,1,368,398.08h.44A15.23,15.23,0,0,1,383.24,413.32Zm-225.62-.68a15.24,15.24,0,1,1-15.25-15.25h.45A15.25,15.25,0,0,1,157.62,412.64ZM69.57,234.15l32.83-14.6a13.88,13.88,0,0,0,7.06-18.33L102.69,186h26.56V305.73H75.65A187.65,187.65,0,0,1,69.57,234.15ZM58.31,198.09a15.24,15.24,0,0,1,15.23-15.25H74a15.24,15.24,0,1,1-15.67,15.24Zm155.16,24.49.05-35.32h63.26c3.28,0,23.07,3.77,23.07,18.62,0,12.29-15.19,16.7-27.68,16.7ZM399,306.71c-9.8,1.13-20.63-4.12-22-10.09-5.78-32.49-15.39-39.4-30.57-51.4,18.86-11.95,38.46-29.64,38.46-53.26,0-25.52-17.49-41.59-29.4-49.48-16.76-11-35.28-13.23-40.27-13.23H116.32A187.49,187.49,0,0,1,221.21,70.06l23.47,24.6a13.82,13.82,0,0,0,19.6.44l26.26-25a187.51,187.51,0,0,1,128.37,91.43l-18,40.57A14,14,0,0,0,408,220.43l34.59,15.33a187.12,187.12,0,0,1,.4,32.54H423.71c-1.91,0-2.69,1.27-2.69,3.13v8.82C421,301,409.31,305.58,399,306.71ZM240,60.21A15.24,15.24,0,0,1,255.21,45h.45A15.24,15.24,0,1,1,240,60.21ZM436.84,214a15.24,15.24,0,1,1,0-30.48h.44a15.24,15.24,0,0,1-.44,30.48Z"],Unity:[16,16,[],"solid","M8 6.5L5 5l2-1V2L2 5v5l2-1V6.5L7 8v4.5L4 11l-2 1l6 3l6-3l-2-1l-3 1.5V8l3-1.5V9l2 1V5L9 2v2l2 1Z"],UnrealEngine:[24,24,[],"regular","M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0m0 23.52A11.52 11.52 0 1 1 23.52 12A11.52 11.52 0 0 1 12 23.52m7.13-9.791c-.206.997-1.126 3.557-4.06 4.942l-1.179-1.325l-1.988 2a7.34 7.34 0 0 1-5.804-2.978a3 3 0 0 0 .65.123c.326.006.678-.114.678-.66v-5.394a.89.89 0 0 0-1.116-.89c-.92.212-1.656 2.509-1.656 2.509a7.3 7.3 0 0 1 2.528-5.597a7.4 7.4 0 0 1 3.73-1.721c-1.006.573-1.57 1.507-1.57 2.29c0 1.262.76 1.109.984.923v7.28a1.2 1.2 0 0 0 .148.256a1.08 1.08 0 0 0 .88.445c.76 0 1.747-.868 1.747-.868V9.172c0-.6-.452-1.324-.905-1.572c0 0 .838-.149 1.484.346a6 6 0 0 1 .387-.425c1.508-1.48 2.929-1.902 4.112-2.112c0 0-2.151 1.69-2.151 3.96c0 1.687.043 5.801.043 5.801c.799.771 1.986-.342 3.059-1.441Z"],"UnrealEngine@solid":[24,24,[],"solid","M12 23c6.075 0 11-4.925 11-11S18.075 1 12 1S1 5.925 1 12s4.925 11 11 11m-8.442-9.416c.718-2.333 2.53-6.86 7.27-8.584v10.23c.179.18.645.54 1.076.54c.67 0 1.615-.54 1.615-.54V8.77c.555-1.16 3.123-3.232 4.847-3.232c-1.044 1.204-1.532 1.91-2.154 3.231v6.462c.718.18 2.154 0 3.23-1.077c-.87 1.98-3.23 4.308-4.307 4.308l-1.616-1.077L11.904 19c-1.615 0-4.308-1.077-5.385-2.692h1.616v-6.17c-1.96-.268-2.857.973-4.577 3.446"],Ubuntu:[576,512,[],"solid","M469.2 75A75.6 75.6 0 1 0 317.9 75a75.6 75.6 0 1 0 151.2 0zM154.2 240.7A75.6 75.6 0 1 0 3 240.7a75.6 75.6 0 1 0 151.2 0zM57 346C75.6 392.9 108 433 150 461.1s91.5 42.6 142 41.7c-14.7-18.6-22.9-41.5-23.2-65.2c-6.8-.9-13.3-2.1-19.5-3.4c-26.8-5.7-51.9-17.3-73.6-34s-39.3-38.1-51.7-62.5c-20.9 9.9-44.5 12.8-67.1 8.2zm395.1 89.8a75.6 75.6 0 1 0 -151.2 0 75.6 75.6 0 1 0 151.2 0zM444 351.6c18.5 14.8 31.6 35.2 37.2 58.2c33.3-41.3 52.6-92.2 54.8-145.2s-12.5-105.4-42.2-149.4c-8.6 21.5-24 39.6-43.8 51.6c15.4 28.6 22.9 60.8 21.9 93.2s-10.7 64-28 91.6zM101.1 135.4c12.4 2.7 24.3 7.5 35.1 14.3c16.6-24.2 38.9-44.1 64.8-58S255.8 70.4 285.2 70c.2-5.9 .9-11.9 2-17.7c3.6-16.7 11.1-32.3 21.8-45.5c-47.7-3.8-95.4 6-137.6 28.5S94.3 91.7 70.8 133.4c2.7-.2 5.3-.3 8-.3c7.5 0 15 .8 22.4 2.3z"],VsCode:[16,16,[],"solid","M11.5 11.19V4.8L7.3 7.99M1.17 6.07a.6.6 0 0 1-.01-.81L2 4.48c.14-.13.48-.18.73 0l2.39 1.83l5.55-5.09c.22-.22.61-.32 1.05-.08l2.8 1.34c.25.15.49.38.49.81v9.49c0 .28-.2.58-.42.7l-3.08 1.48c-.22.09-.64 0-.79-.14L5.11 9.69l-2.38 1.83c-.27.18-.6.13-.74 0l-.84-.77c-.22-.23-.2-.61.04-.84l2.1-1.9"],Windows:[448,512,[],"solid","M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"],Whatsapp:[448,512,[],"regular","M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"],"X-Twitter":[512,512,[],"regular","M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"],Keyboard:[576,512,[],"regular","M64 112c-8.8 0-16 7.2-16 16l0 256c0 8.8 7.2 16 16 16l448 0c8.8 0 16-7.2 16-16l0-256c0-8.8-7.2-16-16-16L64 112zM0 128C0 92.7 28.7 64 64 64l448 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM176 320l224 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm-72-72c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16z"],IdCard:[576,512,[],"regular","M528 160l0 256c0 8.8-7.2 16-16 16l-192 0c0-44.2-35.8-80-80-80l-64 0c-44.2 0-80 35.8-80 80l-32 0c-8.8 0-16-7.2-16-16l0-256 480 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM272 256a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zm104-48c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0z"],BookUser:[576,512,[],"regular","M512 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l448 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM208 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm-32 32c-44.2 0-80 35.8-80 80c0 8.8 7.2 16 16 16l192 0c8.8 0 16-7.2 16-16c0-44.2-35.8-80-80-80l-64 0zM376 144c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0z"],Copy:[448,512,[],"regular","M384 336l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L400 115.9 400 320c0 8.8-7.2 16-16 16zM192 384l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9L366.1 14.1c-9-9-21.2-14.1-33.9-14.1L192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-32-48 0 0 32c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l32 0 0-48-32 0z"],Eye:[576,512,[],"regular","M288 80c-65.2 0-118.8 29.6-159.9 67.7C89.6 183.5 63 226 49.4 256c13.6 30 40.2 72.5 78.6 108.3C169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256c-13.6-30-40.2-72.5-78.6-108.3C406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 336c44.2 0 80-35.8 80-80s-35.8-80-80-80c-.7 0-1.3 0-2 0c1.3 5.1 2 10.5 2 16c0 35.3-28.7 64-64 64c-5.5 0-10.9-.7-16-2c0 .7 0 1.3 0 2c0 44.2 35.8 80 80 80zm0-208a128 128 0 1 1 0 256 128 128 0 1 1 0-256z"],EyeOff:[640,512,[],"regular","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zm151 118.3C226 97.7 269.5 80 320 80c65.2 0 118.8 29.6 159.9 67.7C518.4 183.5 545 226 558.6 256c-12.6 28-36.6 66.8-70.9 100.9l-53.8-42.2c9.1-17.6 14.2-37.5 14.2-58.7c0-70.7-57.3-128-128-128c-32.2 0-61.7 11.9-84.2 31.5l-46.1-36.1zM394.9 284.2l-81.5-63.9c4.2-8.5 6.6-18.2 6.6-28.3c0-5.5-.7-10.9-2-16c.7 0 1.3 0 2 0c44.2 0 80 35.8 80 80c0 9.9-1.8 19.4-5.1 28.2zm9.4 130.3C378.8 425.4 350.7 432 320 432c-65.2 0-118.8-29.6-159.9-67.7C121.6 328.5 95 286 81.4 256c8.3-18.4 21.5-41.5 39.4-64.8L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5l-41.9-33zM192 256c0 70.7 57.3 128 128 128c13.3 0 26.1-2 38.2-5.8L302 334c-23.5-5.4-43.1-21.2-53.7-42.3l-56.1-44.2c-.2 2.8-.3 5.6-.3 8.5z"],StickyNote:[448,512,[],"regular","M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l224 0 0-80c0-17.7 14.3-32 32-32l80 0 0-224c0-8.8-7.2-16-16-16L64 80zM288 480L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 224 0 5.5c0 17-6.7 33.3-18.7 45.3l-90.5 90.5c-12 12-28.3 18.7-45.3 18.7l-5.5 0z"],CreditCard:[576,512,[],"regular","M512 80c8.8 0 16 7.2 16 16l0 32L48 128l0-32c0-8.8 7.2-16 16-16l448 0zm16 144l0 192c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16l0-192 480 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm56 304c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0zm128 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-112 0z"],Hourglass:[384,512,[],"regular","M24 0C10.7 0 0 10.7 0 24S10.7 48 24 48l8 0 0 19c0 40.3 16 79 44.5 107.5L158.1 256 76.5 337.5C48 366 32 404.7 32 445l0 19-8 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l336 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0-19c0-40.3-16-79-44.5-107.5L225.9 256l81.5-81.5C336 146 352 107.3 352 67l0-19 8 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 0zM192 289.9l81.5 81.5C293 391 304 417.4 304 445l0 19L80 464l0-19c0-27.6 11-54 30.5-73.5L192 289.9zm0-67.9l-81.5-81.5C91 121 80 94.6 80 67l0-19 224 0 0 19c0 27.6-11 54-30.5 73.5L192 222.1z"],Bell:[448,512,[],"solid","M224 0c-17.7 0-32 14.3-32 32l0 19.2C119 66 64 130.6 64 208l0 18.8c0 47-17.3 92.4-48.5 127.6l-7.4 8.3c-8.4 9.4-10.4 22.9-5.3 34.4S19.4 416 32 416l384 0c12.6 0 24-7.4 29.2-18.9s3.1-25-5.3-34.4l-7.4-8.3C401.3 319.2 384 273.9 384 226.8l0-18.8c0-77.4-55-142-128-156.8L256 32c0-17.7-14.3-32-32-32zm45.3 493.3c12-12 18.7-28.3 18.7-45.3l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7z"],BellOff:[640,512,[],"solid","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-90.2-70.7c.2-.4 .4-.9 .6-1.3c5.2-11.5 3.1-25-5.3-34.4l-7.4-8.3C497.3 319.2 480 273.9 480 226.8l0-18.8c0-77.4-55-142-128-156.8L352 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 19.2c-42.6 8.6-79 34.2-102 69.3L38.8 5.1zM406.2 416L160 222.1l0 4.8c0 47-17.3 92.4-48.5 127.6l-7.4 8.3c-8.4 9.4-10.4 22.9-5.3 34.4S115.4 416 128 416l278.2 0zm-40.9 77.3c12-12 18.7-28.3 18.7-45.3l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7z"],Compass:[512,512,[],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm50.7-186.9L162.4 380.6c-19.4 7.5-38.5-11.6-31-31l55.5-144.3c3.3-8.5 9.9-15.1 18.4-18.4l144.3-55.5c19.4-7.5 38.5 11.6 31 31L325.1 306.7c-3.2 8.5-9.9 15.1-18.4 18.4zM288 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"],File:[384,512,[],"solid","M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128z"],MessageCircle:[512,512,[],"solid","M512 240c0 114.9-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6C73.6 471.1 44.7 480 16 480c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.3-.3c.3-.3 .7-.7 1.3-1.4c1.1-1.2 2.8-3.1 4.9-5.7c4.1-5 9.6-12.4 15.2-21.6c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208z"],Inbox:[512,512,[],"solid","M121 32C91.6 32 66 52 58.9 80.5L1.9 308.4C.6 313.5 0 318.7 0 323.9L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-92.1c0-5.2-.6-10.4-1.9-15.5l-57-227.9C446 52 420.4 32 391 32L121 32zm0 64l270 0 48 192-51.2 0c-12.1 0-23.2 6.8-28.6 17.7l-14.3 28.6c-5.4 10.8-16.5 17.7-28.6 17.7l-120.4 0c-12.1 0-23.2-6.8-28.6-17.7l-14.3-28.6c-5.4-10.8-16.5-17.7-28.6-17.7L73 288 121 96z"],Mail:[512,512,[],"solid","M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"],MailOpen:[512,512,[],"solid","M64 208.1L256 65.9 448 208.1l0 47.4L289.5 373c-9.7 7.2-21.4 11-33.5 11s-23.8-3.9-33.5-11L64 255.5l0-47.4zM256 0c-12.1 0-23.8 3.9-33.5 11L25.9 156.7C9.6 168.8 0 187.8 0 208.1L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-239.9c0-20.3-9.6-39.4-25.9-51.4L289.5 11C279.8 3.9 268.1 0 256 0z"],Mic:[384,512,[],"solid","M192 0C139 0 96 43 96 96l0 160c0 53 43 96 96 96s96-43 96-96l0-160c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40z"],MicOff:[640,512,[],"solid","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L472.1 344.7c15.2-26 23.9-56.3 23.9-88.7l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 21.2-5.1 41.1-14.2 58.7L416 300.8 416 96c0-53-43-96-96-96s-96 43-96 96l0 54.3L38.8 5.1zM344 430.4c20.4-2.8 39.7-9.1 57.3-18.2l-43.1-33.9C346.1 382 333.3 384 320 384c-70.7 0-128-57.3-128-128l0-8.7L144.7 210c-.5 1.9-.7 3.9-.7 6l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6z"],Link:[640,512,["Chain"],"solid","M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"],House:[576,512,[],"solid","M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c0 2.7-.2 5.4-.5 8.1l0 16.2c0 22.1-17.9 40-40 40l-16 0c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1L416 512l-24 0c-22.1 0-40-17.9-40-40l0-24 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 64 0 24c0 22.1-17.9 40-40 40l-24 0-31.9 0c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2l-16 0c-22.1 0-40-17.9-40-40l0-112c0-.9 0-1.9 .1-2.8l0-69.7-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"],Gamepad:[640,512,[],"solid","M192 64C86 64 0 150 0 256S86 448 192 448l256 0c106 0 192-86 192-192s-86-192-192-192L192 64zM496 168a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM392 304a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM168 200c0-13.3 10.7-24 24-24s24 10.7 24 24l0 32 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-32z"],Camera:[512,512,[],"solid","M149.1 64.8L138.7 96 64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-74.7 0L362.9 64.8C356.4 45.2 338.1 32 317.4 32L194.6 32c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"],Printer:[512,512,[],"solid","M128 0C92.7 0 64 28.7 64 64l0 96 64 0 0-96 226.7 0L384 93.3l0 66.7 64 0 0-66.7c0-17-6.7-33.3-18.7-45.3L400 18.7C388 6.7 371.7 0 354.7 0L128 0zM384 352l0 32 0 64-256 0 0-64 0-16 0-16 256 0zm64 32l32 0c17.7 0 32-14.3 32-32l0-96c0-35.3-28.7-64-64-64L64 192c-35.3 0-64 28.7-64 64l0 96c0 17.7 14.3 32 32 32l32 0 0 64c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-64zM432 248a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"],Server:[512,512,[],"solid","M64 32C28.7 32 0 60.7 0 96l0 64c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-64c0-35.3-28.7-64-64-64L64 32zm280 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm48 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM64 288c-35.3 0-64 28.7-64 64l0 64c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-64c0-35.3-28.7-64-64-64L64 288zm280 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm56 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"],Calendar:[448,512,[],"solid","M96 32l0 32L48 64C21.5 64 0 85.5 0 112l0 48 448 0 0-48c0-26.5-21.5-48-48-48l-48 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32L160 64l0-32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192L0 192 0 464c0 26.5 21.5 48 48 48l352 0c26.5 0 48-21.5 48-48l0-272z"],Pipette:[512,512,[],"solid","M341.6 29.2L240.1 130.8l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4L482.8 170.4c39-39 39-102.2 0-141.1s-102.2-39-141.1 0zM55.4 323.3c-15 15-23.4 35.4-23.4 56.6l0 42.4L5.4 462.2c-8.5 12.7-6.8 29.6 4 40.4s27.7 12.5 40.4 4L89.7 480l42.4 0c21.2 0 41.6-8.4 56.6-23.4L309.4 335.9l-45.3-45.3L143.4 411.3c-3 3-7.1 4.7-11.3 4.7L96 416l0-36.1c0-4.2 1.7-8.3 4.7-11.3L221.4 247.9l-45.3-45.3L55.4 323.3z"],Scroll:[576,512,[],"solid","M0 80l0 48c0 17.7 14.3 32 32 32l16 0 48 0 0-80c0-26.5-21.5-48-48-48S0 53.5 0 80zM112 32c10 13.4 16 30 16 48l0 304c0 35.3 28.7 64 64 64s64-28.7 64-64l0-5.3c0-32.4 26.3-58.7 58.7-58.7L480 320l0-192c0-53-43-96-96-96L112 32zM464 480c61.9 0 112-50.1 112-112c0-8.8-7.2-16-16-16l-245.3 0c-14.7 0-26.7 11.9-26.7 26.7l0 5.3c0 53-43 96-96 96l176 0 96 0z"],Smartphone:[384,512,[],"solid","M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zM144 448c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16zM304 64L80 64l0 320 224 0 0-320z"],Settings:[512,512,[],"solid","M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"],Map:[576,512,[],"solid","M384 476.1L192 421.2l0-385.3L384 90.8l0 385.3zm32-1.2l0-386.5L543.1 37.5c15.8-6.3 32.9 5.3 32.9 22.3l0 334.8c0 9.8-6 18.6-15.1 22.3L416 474.8zM15.1 95.1L160 37.2l0 386.5L32.9 474.5C17.1 480.8 0 469.2 0 452.2L0 117.4c0-9.8 6-18.6 15.1-22.3z"],Folder:[512,512,[],"solid","M64 480H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H288c-10.1 0-19.6-4.7-25.6-12.8L243.2 57.6C231.1 41.5 212.1 32 192 32H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64z"],FolderOpen:[576,512,[],"solid","M384 480l48 0c11.4 0 21.9-6 27.6-15.9l112-192c5.8-9.9 5.8-22.1 .1-32.1S555.5 224 544 224l-400 0c-11.4 0-21.9 6-27.6 15.9L48 357.1 48 96c0-8.8 7.2-16 16-16l117.5 0c4.2 0 8.3 1.7 11.3 4.7l26.5 26.5c21 21 49.5 32.8 79.2 32.8L416 144c8.8 0 16 7.2 16 16l0 32 48 0 0-32c0-35.3-28.7-64-64-64L298.5 96c-17 0-33.3-6.7-45.3-18.7L226.7 50.7c-12-12-28.3-18.7-45.3-18.7L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l23.7 0L384 480z"],FolderClosed:[512,512,[],"solid","M448 480L64 480c-35.3 0-64-28.7-64-64L0 192l512 0 0 224c0 35.3-28.7 64-64 64zm64-320L0 160 0 96C0 60.7 28.7 32 64 32l128 0c20.1 0 39.1 9.5 51.2 25.6l19.2 25.6c6 8.1 15.5 12.8 25.6 12.8l160 0c35.3 0 64 28.7 64 64z"],Function:[384,512,[],"solid","M314.7 32c-38.8 0-73.7 23.3-88.6 59.1L170.7 224 64 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l80 0L98.9 396.3c-5 11.9-16.6 19.7-29.5 19.7L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l37.3 0c38.8 0 73.7-23.3 88.6-59.1L213.3 288 320 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-80 0 45.1-108.3c5-11.9 16.6-19.7 29.5-19.7L352 96c17.7 0 32-14.3 32-32s-14.3-32-32-32l-37.3 0z"],Stop:[384,512,[],"solid","M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"],Image:[512,512,[],"solid","M448 80c8.8 0 16 7.2 16 16l0 319.8-5-6.5-136-176c-4.5-5.9-11.6-9.3-19-9.3s-14.4 3.4-19 9.3L202 340.7l-30.5-42.7C167 291.7 159.8 288 152 288s-15 3.7-19.5 10.1l-80 112L48 416.3l0-.3L48 96c0-8.8 7.2-16 16-16l384 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm80 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"],Images:[576,512,[],"solid","M160 80l352 0c8.8 0 16 7.2 16 16l0 224c0 8.8-7.2 16-16 16l-21.2 0L388.1 178.9c-4.4-6.8-12-10.9-20.1-10.9s-15.7 4.1-20.1 10.9l-52.2 79.8-12.4-16.9c-4.5-6.2-11.7-9.8-19.4-9.8s-14.8 3.6-19.4 9.8L175.6 336 160 336c-8.8 0-16-7.2-16-16l0-224c0-8.8 7.2-16 16-16zM96 96l0 224c0 35.3 28.7 64 64 64l352 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L160 32c-35.3 0-64 28.7-64 64zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120L0 344c0 75.1 60.9 136 136 136l320 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-320 0c-48.6 0-88-39.4-88-88l0-224zm208 24a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"],Info:[512,512,[],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"],Bone:[576,512,[],"solid","M153.7 144.8c6.9 16.3 20.6 31.2 38.3 31.2l192 0c17.7 0 31.4-14.9 38.3-31.2C434.4 116.1 462.9 96 496 96c44.2 0 80 35.8 80 80c0 30.4-17 56.9-42 70.4c-3.6 1.9-6 5.5-6 9.6s2.4 7.7 6 9.6c25 13.5 42 40 42 70.4c0 44.2-35.8 80-80 80c-33.1 0-61.6-20.1-73.7-48.8C415.4 350.9 401.7 336 384 336l-192 0c-17.7 0-31.4 14.9-38.3 31.2C141.6 395.9 113.1 416 80 416c-44.2 0-80-35.8-80-80c0-30.4 17-56.9 42-70.4c3.6-1.9 6-5.5 6-9.6s-2.4-7.7-6-9.6C17 232.9 0 206.4 0 176c0-44.2 35.8-80 80-80c33.1 0 61.6 20.1 73.7 48.8z"],Puzzle:[512,512,[],"solid","M192 104.8c0-9.2-5.8-17.3-13.2-22.8C167.2 73.3 160 61.3 160 48c0-26.5 28.7-48 64-48s64 21.5 64 48c0 13.3-7.2 25.3-18.8 34c-7.4 5.5-13.2 13.6-13.2 22.8c0 12.8 10.4 23.2 23.2 23.2l56.8 0c26.5 0 48 21.5 48 48l0 56.8c0 12.8 10.4 23.2 23.2 23.2c9.2 0 17.3-5.8 22.8-13.2c8.7-11.6 20.7-18.8 34-18.8c26.5 0 48 28.7 48 64s-21.5 64-48 64c-13.3 0-25.3-7.2-34-18.8c-5.5-7.4-13.6-13.2-22.8-13.2c-12.8 0-23.2 10.4-23.2 23.2L384 464c0 26.5-21.5 48-48 48l-56.8 0c-12.8 0-23.2-10.4-23.2-23.2c0-9.2 5.8-17.3 13.2-22.8c11.6-8.7 18.8-20.7 18.8-34c0-26.5-28.7-48-64-48s-64 21.5-64 48c0 13.3 7.2 25.3 18.8 34c7.4 5.5 13.2 13.6 13.2 22.8c0 12.8-10.4 23.2-23.2 23.2L48 512c-26.5 0-48-21.5-48-48L0 343.2C0 330.4 10.4 320 23.2 320c9.2 0 17.3 5.8 22.8 13.2C54.7 344.8 66.7 352 80 352c26.5 0 48-28.7 48-64s-21.5-64-48-64c-13.3 0-25.3 7.2-34 18.8C40.5 250.2 32.4 256 23.2 256C10.4 256 0 245.6 0 232.8L0 176c0-26.5 21.5-48 48-48l120.8 0c12.8 0 23.2-10.4 23.2-23.2z"],Lock:[448,512,[],"solid","M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"],LockOpen:[576,512,[],"solid","M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z"],Shuffle:[512,512,[],"solid","M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-10.1 0-19.6 4.7-25.6 12.8L284 229.3 244 176l31.2-41.6C293.3 110.2 321.8 96 352 96l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6zM164 282.7L204 336l-31.2 41.6C154.7 401.8 126.2 416 96 416l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c10.1 0 19.6-4.7 25.6-12.8L164 282.7zm274.6 188c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z"],Play:[384,512,[],"solid","M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"],Pause:[320,512,[],"solid","M48 64C21.5 64 0 85.5 0 112L0 400c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48L48 64zm192 0c-26.5 0-48 21.5-48 48l0 288c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48l-32 0z"],LogIn:[512,512,[],"solid","M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"],LogOut:[512,512,[],"solid","M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 192 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128zM160 96c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 32C43 32 0 75 0 128L0 384c0 53 43 96 96 96l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l64 0z"],MousePointer:[320,512,[],"solid","M0 55.2L0 426c0 12.2 9.9 22 22 22c6.3 0 12.4-2.7 16.6-7.5L121.2 346l58.1 116.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9L179.8 320l118.1 0c12.2 0 22.1-9.9 22.1-22.1c0-6.3-2.7-12.3-7.4-16.5L38.6 37.9C34.3 34.1 28.9 32 23.2 32C10.4 32 0 42.4 0 55.2z"],User:[512,512,[],"solid","M256 288A144 144 0 1 0 256 0a144 144 0 1 0 0 288zm-94.7 32C72.2 320 0 392.2 0 481.3c0 17 13.8 30.7 30.7 30.7l450.6 0c17 0 30.7-13.8 30.7-30.7C512 392.2 439.8 320 350.7 320l-189.4 0z"],HardDriveDownload:[512,512,[],"solid","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"],HardDriveUpload:[512,512,[],"solid","M288 109.3L288 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-242.7-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0l128 128c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L288 109.3zM64 352l128 0c0 35.3 28.7 64 64 64s64-28.7 64-64l128 0c35.3 0 64 28.7 64 64l0 32c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64l0-32c0-35.3 28.7-64 64-64zM432 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"],CircleCheck:[512,512,["CheckCircle2"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"],CirclePlay:[512,512,[],"solid","M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"],CirclePause:[512,512,[],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM224 192l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32z"],CirclePlus:[512,512,["PlusCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"],CircleMinus:[512,512,["MinusCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM184 232l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"],CircleStop:[512,512,[],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 160l128 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32z"],CircleDot:[512,512,[],"solid","M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"],CircleHelp:[512,512,["HelpCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"],CircleArrowUp:[512,512,["ArrowUpCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM385 215c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-71-71L280 392c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-214.1-71 71c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 103c9.4-9.4 24.6-9.4 33.9 0L385 215z"],CircleArrowDown:[512,512,["ArrowDownCircle"],"solid","M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM127 297c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l71 71L232 120c0-13.3 10.7-24 24-24s24 10.7 24 24l0 214.1 71-71c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L273 409c-9.4 9.4-24.6 9.4-33.9 0L127 297z"],CircleArrowLeft:[512,512,["ArrowLeftCircle"],"solid","M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM215 127c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-71 71L392 232c13.3 0 24 10.7 24 24s-10.7 24-24 24l-214.1 0 71 71c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L103 273c-9.4-9.4-9.4-24.6 0-33.9L215 127z"],CircleArrowRight:[512,512,["ArrowRightCircle"],"solid","M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM297 385c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l71-71L120 280c-13.3 0-24-10.7-24-24s10.7-24 24-24l214.1 0-71-71c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L409 239c9.4 9.4 9.4 24.6 0 33.9L297 385z"],CircleAlert:[512,512,["AlertCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"],CircleUser:[512,512,["UserCircle"],"solid","M399 384.2C376.9 345.8 335.4 320 288 320l-64 0c-47.4 0-88.9 25.8-111 64.2c35.2 39.2 86.2 63.8 143 63.8s107.8-24.7 143-63.8zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 16a72 72 0 1 0 0-144 72 72 0 1 0 0 144z"],CircleChevronRight:[512,512,["ChevronRightCircle"],"solid","M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM241 377c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l87-87-87-87c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L345 239c9.4 9.4 9.4 24.6 0 33.9L241 377z"],CircleChevronDown:[512,512,["ChevronDownCircle"],"solid","M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM135 241c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l87 87 87-87c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L273 345c-9.4 9.4-24.6 9.4-33.9 0L135 241z"],CircleChevronUp:[512,512,["ChevronUpCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM377 271c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-87-87-87 87c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 167c9.4-9.4 24.6-9.4 33.9 0L377 271z"],CircleChevronLeft:[512,512,["ChevronLeftCircle"],"solid","M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM271 135c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-87 87 87 87c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L167 273c-9.4-9.4-9.4-24.6 0-33.9L271 135z"],CircleX:[512,512,["XCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"],Apple:[384,512,[],"solid","M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"],Chrome:[512,512,[],"solid","M0 256C0 209.4 12.47 165.6 34.27 127.1L144.1 318.3C166 357.5 207.9 384 256 384C270.3 384 283.1 381.7 296.8 377.4L220.5 509.6C95.9 492.3 0 385.3 0 256zM365.1 321.6C377.4 302.4 384 279.1 384 256C384 217.8 367.2 183.5 340.7 160H493.4C505.4 189.6 512 222.1 512 256C512 397.4 397.4 511.1 256 512L365.1 321.6zM477.8 128H256C193.1 128 142.3 172.1 130.5 230.7L54.19 98.47C101 38.53 174 0 256 0C350.8 0 433.5 51.48 477.8 128V128zM168 256C168 207.4 207.4 168 256 168C304.6 168 344 207.4 344 256C344 304.6 304.6 344 256 344C207.4 344 168 304.6 168 256z"],Facebook:[512,512,[],"solid","M512 256C512 114.6 397.4 0 256 0S0 114.6 0 256C0 376 82.7 476.8 194.2 504.5V334.2H141.4V256h52.8V222.3c0-87.1 39.4-127.5 125-127.5c16.2 0 44.2 3.2 55.7 6.4V172c-6-.6-16.5-1-29.6-1c-42 0-58.2 15.9-58.2 57.2V256h83.6l-14.4 78.2H287V510.1C413.8 494.8 512 386.9 512 256h0z"],Github:[496,512,[],"solid","M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"],Youtube:[576,512,[],"solid","M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"],"CircleRight@solid":[512,512,[],"solid","M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zm395.3 11.3l-112 112c-4.6 4.6-11.5 5.9-17.4 3.5s-9.9-8.3-9.9-14.8l0-64-96 0c-17.7 0-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32l96 0 0-64c0-6.5 3.9-12.3 9.9-14.8s12.9-1.1 17.4 3.5l112 112c6.2 6.2 6.2 16.4 0 22.6z"],"CircleUp@solid":[512,512,[],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm11.3-395.3l112 112c4.6 4.6 5.9 11.5 3.5 17.4s-8.3 9.9-14.8 9.9l-64 0 0 96c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-96-64 0c-6.5 0-12.3-3.9-14.8-9.9s-1.1-12.9 3.5-17.4l112-112c6.2-6.2 16.4-6.2 22.6 0z"],"CircleLeft@solid":[512,512,[],"solid","M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM116.7 244.7l112-112c4.6-4.6 11.5-5.9 17.4-3.5s9.9 8.3 9.9 14.8l0 64 96 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32l-96 0 0 64c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5l-112-112c-6.2-6.2-6.2-16.4 0-22.6z"],"CircleDown@solid":[512,512,[],"solid","M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM244.7 395.3l-112-112c-4.6-4.6-5.9-11.5-3.5-17.4s8.3-9.9 14.8-9.9l64 0 0-96c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 96 64 0c6.5 0 12.3 3.9 14.8 9.9s1.1 12.9-3.5 17.4l-112 112c-6.2 6.2-16.4 6.2-22.6 0z"],"PaperPlane@solid":[512,512,[],"solid","M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480l0-83.6c0-4 1.5-7.8 4.2-10.8L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z"]};e.LX.LucideIconAlias={Stop:"Square",Refresh:"RefreshCw",Left:"ChevronLeft",Right:"ChevronRight",Up:"ChevronUp",Down:"ChevronDown",MenuArrows:"ChevronsUpDown",RotateForward:"RotateCw",RotateRight:"RotateCw",RotateBack:"RotateCcw",RotateLeft:"RotateCcw"},e.LX.ICONS=(()=>{const e={};for(let t in o){o[t][2].forEach(s=>e[s]=t)}return{...o,...e}})();class n{name;value;domEvent;constructor(e,t,s){this.name=e,this.value=t,this.domEvent=s}}var i;e.LX.IEvent=n,e.ComponentType=void 0,(i=e.ComponentType||(e.ComponentType={}))[i.NONE=0]="NONE",i[i.TEXT=1]="TEXT",i[i.TEXTAREA=2]="TEXTAREA",i[i.BUTTON=3]="BUTTON",i[i.SELECT=4]="SELECT",i[i.CHECKBOX=5]="CHECKBOX",i[i.TOGGLE=6]="TOGGLE",i[i.RADIO=7]="RADIO",i[i.BUTTONS=8]="BUTTONS",i[i.COLOR=9]="COLOR",i[i.RANGE=10]="RANGE",i[i.NUMBER=11]="NUMBER",i[i.TITLE=12]="TITLE",i[i.VECTOR=13]="VECTOR",i[i.TREE=14]="TREE",i[i.PROGRESS=15]="PROGRESS",i[i.FILE=16]="FILE",i[i.LAYERS=17]="LAYERS",i[i.ARRAY=18]="ARRAY",i[i.LIST=19]="LIST",i[i.TAGS=20]="TAGS",i[i.CURVE=21]="CURVE",i[i.CARD=22]="CARD",i[i.IMAGE=23]="IMAGE",i[i.CONTENT=24]="CONTENT",i[i.CUSTOM=25]="CUSTOM",i[i.SEPARATOR=26]="SEPARATOR",i[i.KNOB=27]="KNOB",i[i.SIZE=28]="SIZE",i[i.OTP=29]="OTP",i[i.PAD=30]="PAD",i[i.FORM=31]="FORM",i[i.DIAL=32]="DIAL",i[i.COUNTER=33]="COUNTER",i[i.TABLE=34]="TABLE",i[i.TABS=35]="TABS",i[i.DATE=36]="DATE",i[i.MAP2D=37]="MAP2D",i[i.LABEL=39]="LABEL",i[i.BLANK=40]="BLANK",i[i.RATE=41]="RATE",e.LX.ComponentType=e.ComponentType;class a{type;name;customName;options;root;customIdx=-1;disabled=!1;onSetValue;onGetValue;onAllowPaste;onResize;onSetDisabled;_initialValue;static NO_CONTEXT_TYPES=[e.ComponentType.BUTTON,e.ComponentType.LIST,e.ComponentType.FILE,e.ComponentType.PROGRESS];constructor(t,s,o,n={}){this.type=t,this.name=s,this.options=n,this._initialValue=o;const i=e.LX.makeElement("div",e.LX.mergeClass("lexcomponent flex flex-row outline-none items-center text-foreground text-sm overflow-hidden min-h-8 pad-sm",n.className));if(this.onResize=()=>{},n.id&&(i.id=n.id),n.title&&(i.title=n.title),t!=e.ComponentType.TITLE&&(n.width&&(i.style.width=i.style.minWidth=n.width),n.maxWidth&&(i.style.maxWidth=n.maxWidth),n.minWidth&&(i.style.minWidth=n.minWidth),n.height&&(i.style.height=i.style.minHeight=n.height),e.LX.componentResizeObserver.observe(i)),null!=s){if(!n.hideName){let t=e.LX.makeElement("div","lexcomponentname flex text-sm text-secondary-foreground justify-between whitespace-nowrap overflow-hidden",s);n.justifyName&&t.classList.add("float-"+n.justifyName),t.title=n.title??t.innerHTML,t.style.width=n.nameWidth||e.LX.DEFAULT_NAME_WIDTH,t.style.minWidth=t.style.width,i.appendChild(t),i.domName=t;const a=this;t.addEventListener("contextmenu",function(e){e.preventDefault(),a.oncontextmenu(e)}),n.skipReset||null==o||this._addResetProperty(t,function(e,t){a.set(a._initialValue,!1,t),e.style.display="none"})}}else n.hideName=!0;n.signal&&e.LX.addSignal(n.signal,this),this.root=i,this.root.jsInstance=this,this.disabled=n.disabled??!1,this.options=n}static _dispatchEvent(e,t,s,o,n){let i=new CustomEvent(t,{detail:s,bubbles:o,cancelable:n});e.dispatchEvent(i)}_addResetProperty(t,s){const o=e.LX.makeIcon("Undo2",{iconClass:"ml-0 mr-1 px-1",title:"Reset"});return o.style.display="none",o.addEventListener("click",s.bind(o,o)),t.appendChild(o),o}_canPaste(){const t=navigator.clipboard;let s=this.type===e.ComponentType.CUSTOM?void 0!==t.customIdx&&this.customIdx==t.customIdx:t.type===this.type;return s=s&&!0!==this.disabled,this.onAllowPaste&&(s=this.onAllowPaste(s)),s}_trigger(e,t,s=this){t&&t.call(s,e.value,e.domEvent,e.name)}value(){if(this.onGetValue)return this.onGetValue();console.warn("Can't get value of "+this.typeName())}set(e,t,s){if(this.onSetValue){let o=this.root.querySelector(".lexcomponentname .lexicon");if(o){o.style.display=e!=this.value()?"block":"none";const t=e.constructor===Array?function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var s=0;s<e.length;++s)if(e[s]!==t[s])return!1;return!0}(e,this._initialValue):e==this._initialValue;o.style.display=t?"none":"block"}return this.onSetValue(e,t??!1,s)}console.warn(`Can't set value of ${this.typeName()}`)}oncontextmenu(t){a.NO_CONTEXT_TYPES.includes(this.type)||e.LX.addContextMenu(this.typeName(),t,e=>{e.add("Copy",()=>{this.copy()}),e.add("Paste",{disabled:!this._canPaste(),callback:()=>{this.paste()}})})}copy(){const e=navigator.clipboard;e.type=this.type,e.customIdx=this.customIdx,e.data=this.value(),e.writeText(e.data)}paste(){if(!this._canPaste())return;const e=navigator.clipboard;this.set(e.data)}typeName(){switch(this.type){case e.ComponentType.TEXT:return"Text";case e.ComponentType.TEXTAREA:return"TextArea";case e.ComponentType.BUTTON:return"Button";case e.ComponentType.SELECT:return"Select";case e.ComponentType.CHECKBOX:return"Checkbox";case e.ComponentType.TOGGLE:return"Toggle";case e.ComponentType.RADIO:return"Radio";case e.ComponentType.COLOR:return"Color";case e.ComponentType.RANGE:return"Range";case e.ComponentType.NUMBER:return"Number";case e.ComponentType.VECTOR:return"Vector";case e.ComponentType.TREE:return"Tree";case e.ComponentType.PROGRESS:return"Progress";case e.ComponentType.FILE:return"File";case e.ComponentType.LAYERS:return"Layers";case e.ComponentType.ARRAY:return"Array";case e.ComponentType.LIST:return"List";case e.ComponentType.TAGS:return"Tags";case e.ComponentType.CURVE:return"Curve";case e.ComponentType.KNOB:return"Knob";case e.ComponentType.SIZE:return"Size";case e.ComponentType.PAD:return"Pad";case e.ComponentType.FORM:return"Form";case e.ComponentType.DIAL:return"Dial";case e.ComponentType.COUNTER:return"Counter";case e.ComponentType.TABLE:return"Table";case e.ComponentType.TABS:return"Tabs";case e.ComponentType.DATE:return"Date";case e.ComponentType.MAP2D:return"Map2D";case e.ComponentType.RATE:return"Rate";case e.ComponentType.LABEL:return"Label";case e.ComponentType.BLANK:return"Blank";case e.ComponentType.CUSTOM:return this.customName}console.error(`Unknown Component type: ${this.type}`)}setDisabled(e){this.disabled=e,this.onSetDisabled&&this.onSetDisabled(e)}refresh(e){}}e.LX.BaseComponent=a;class r extends a{selectable=!1;callback;setState;swap;constructor(t,s,o,i={}){super(e.ComponentType.BUTTON,t,null,i),this.callback=o,this.selectable=i.selectable??this.selectable,this.onGetValue=()=>{const t=e.LX.hasClass(a,"selected"),o=a.querySelector("input");return o?o.checked:this.selectable?t:s},this.onSetValue=(t,s,o)=>{if(i.swap)this.setState(t,s);else if(a.innerHTML="",i.icon){const t=e.LX.makeIcon(i.icon);a.prepend(t)}else if(i.img){let e=document.createElement("img");e.src=i.img,a.prepend(e)}else a.innerHTML=`${t??""}`},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=`calc( 100% - ${t})`},this.setState=function(e,r){const l=a.querySelector("input");l?l.checked=e:this.selectable&&(i.parent&&i.parent.querySelectorAll(".lexbutton.selected").forEach(e=>{e!=a&&e.classList.remove("selected")}),a.classList.toggle("selected",e)),r||this._trigger(new n(t,l?l.checked:this.selectable?e:s,null),o)};var a=e.LX.makeElement("button",e.LX.mergeClass(["lexbutton","inline-flex","items-center","justify-center","whitespace-nowrap","transition-all","disabled:pointer-events-none","disabled:opacity-50","[&_svg]:pointer-events-none","shrink-0","[&_svg]:shrink-0","outline-none","select-none","cursor-pointer","font-medium","text-sm","border-1","h-9","px-2","overflow-hidden","bg-clip-padding"].join(" "),i.buttonClass??"outline"));if(a.disabled=this.disabled,a.title=i.tooltip?"":i.title??"",this.root.appendChild(a),i.selected&&a.classList.add("selected"),i.img){let e=document.createElement("img");e.src=i.img,a.prepend(e)}else if(i.icon){const t=e.LX.makeIcon(i.icon,{iconClass:i.iconClass,svgClass:i.svgClass}),o=i.iconPosition??"cover";"cover"==o||void 0!==i.swap?a.prepend(t):(a.innerHTML=`${s||""}`,"start"==o?a.prepend(t):a.appendChild(t)),a.classList.add("justify-center")}else a.innerHTML=`${s||""}`;if(i.fileInput){const e=document.createElement("input");e.type="file",e.className="file-input",e.style.display="none",a.appendChild(e),e.addEventListener("change",function(e){if(!e.target)return;const t=e.target.files;if(!t.length)return;const s=new FileReader;"text"===i.fileInputType?s.readAsText(t[0]):"buffer"===i.fileInputType?s.readAsArrayBuffer(t[0]):"bin"===i.fileInputType?s.readAsBinaryString(t[0]):"url"===i.fileInputType&&s.readAsDataURL(t[0]),s.onload=e=>{o.call(this,e.target?.result,t[0])}})}let r=a;if(i.swap){a.classList.add("swap"),a.querySelector("a").classList.add("swap-off");const t=document.createElement("input");t.className="p-0 border-0",t.type="checkbox",a.prepend(t);const s=e.LX.makeIcon(i.swap,{iconClass:"swap-on"});a.appendChild(s),this.swap=function(e){const t=a.querySelector("input");t.checked=!t.checked,e||r.click()}}r.addEventListener("click",r=>{let l;if(this.selectable&&(i.parent&&i.parent.querySelectorAll(".lexbutton.selected").forEach(e=>{e!=a&&e.classList.remove("selected")}),l=a.classList.toggle("selected")),i.fileInput)a.querySelector(".file-input").click();else if(i.mustConfirm){const l=a.querySelector("input");new e.LX.PopConfirm(a,{onConfirm:()=>{i.swap&&(l.checked=!0),this._trigger(new n(t,s,r),o)},side:i.confirmSide,align:i.confirmAlign,confirmText:i.confirmText,cancelText:i.confirmCancelText,title:i.confirmTitle,content:i.confirmContent}),i.swap&&(l.checked=!1)}else{const e=a.querySelector("input");this._trigger(new n(t,e?.checked??(this.selectable?l:s),r),o)}}),i.tooltip&&e.LX.asTooltip(a,i.title??t),e.LX.doAsync(this.onResize.bind(this))}click(){this.root.querySelector("button").click()}setSwapIcon(t){const s=this.root.querySelector(".swap-on");if(!s)return;const o=e.LX.makeIcon(t,{iconClass:"swap-on"});s.replaceWith(o)}}e.LX.Button=r;class l{root;siblingArea;buttonContainer;items=[];buttons={};icons={};shorts={};focused=!1;_currentDropdown;constructor(t,s={}){this.root=e.LX.makeElement("div","lexmenubar size-full bg-background text-foreground inline-flex gap-1 overflow-hidden text-sm font-medium"),s.float&&(this.root.className=e.LX.mergeClass(this.root.className,`justify-${s.float}`)),this.items=t??[],this.createEntries()}_resetMenubar(e){this.root.querySelectorAll(".lexmenuentry").forEach(e=>{e.classList.remove("selected"),delete e.dataset.built}),this._currentDropdown&&(this._currentDropdown.destroy(),this._currentDropdown=null),this.focused=e??!1}createEntries(){for(let t of this.items){let s=t.name,o=e.LX.getSupportedDOMName(s);if(this.root.querySelector("#"+o))continue;let n=document.createElement("div");n.className="lexmenuentry",n.id=o,n.innerHTML="<span>"+s+"</span>",n.tabIndex=1,this.root.appendChild(n);const i=()=>{this._resetMenubar(!0),n.classList.add("selected"),n.dataset.built="true",this._currentDropdown=e.LX.addDropdownMenu(n,t.submenu??[],{side:"bottom",align:"start",onBlur:()=>{this._resetMenubar()}})};n.addEventListener("mousedown",e=>{e.preventDefault()}),n.addEventListener("mouseup",e=>{e.preventDefault();const o=t.callback;if(!o)return i(),this.focused=!0,!1;o.call(this,s,n,e)}),n.addEventListener("mouseover",e=>{this.focused&&!n.dataset.built&&i()})}}getButton(e){return this.buttons[e]}getSubitem(e,t){for(const s of e)if(s?.name==t[0]){if(1==t.length)return s;if(s.submenu)return t.shift(),this.getSubitem(s.submenu,t)}}getItem(e){const t=e.split("/");return this.getSubitem(this.items,t)}setButtonIcon(t,s,o,n={}){if(!t)throw"Set Button Name!";let i=this.buttons[t];i&&(delete this.buttons[t],e.LX.deleteElement(i.root)),i=new r(t,void 0,o,{title:t,buttonClass:"lexmenubutton main bg-none",disabled:n.disabled,icon:s,svgClass:"xl",hideName:!0,swap:n.swap}),"right"==n.float&&(i.root.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(i.root):"left"==n.float?this.root.prepend(i.root):this.root.appendChild(i.root),this.buttons[t]=i}setButtonImage(e,t,s,o={}){if(!e)throw"Set Button Name!";let n=this.buttons[e];if(n)return void(n.querySelector("img").src=t);n=document.createElement("div");const i=o.disabled??!1;n.className="lexmenubutton main"+(i?" disabled":""),n.title=e,n.innerHTML="<a><image src='"+t+"' class='lexicon' style='height:32px;'></a>","right"==o.float&&(n.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(n):"left"==o.float?this.root.prepend(n):this.root.appendChild(n);const a=n.querySelector("a");a.addEventListener("mousedown",e=>{e.preventDefault()}),a.addEventListener("mouseup",e=>{s&&!i&&s.call(this,a,e)}),this.buttons[e]=n}addButtons(e,t={}){if(!e)throw"No buttons to add!";this.buttonContainer||(this.buttonContainer=document.createElement("div"),this.buttonContainer.className="lexmenubuttons",this.buttonContainer.classList.add(t.float??"center"),"right"==t.float&&(this.buttonContainer.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(this.buttonContainer):this.root.appendChild(this.buttonContainer));for(const t of e){const e=t.title,s=new r(e,t.label,t.callback,{title:e,buttonClass:"ghost",disabled:t.disabled,icon:t.icon,hideName:!0,swap:t.swap,iconPosition:"start"});this.buttonContainer.appendChild(s.root),e&&(this.buttons[e]=s)}}}class c{static TAB_ID=0;root;area;tabs={};tabDOMs={};thumb;selected=null;folding=!1;folded=!1;onclose;constructor(t,s={}){this.onclose=s.onclose;let o=document.createElement("div");o.className="lexareatabs flex flex-row w-fit "+(s.fit?"fit":"row");const n=s.folding??!1;n&&o.classList.add("folding");let i=this;o.addEventListener("dragenter",function(e){e.preventDefault(),this.classList.add("dockingtab")}),o.addEventListener("dragleave",function(e){e.preventDefault(),this.contains(e.relatedTarget)||this.classList.remove("dockingtab")}),o.addEventListener("drop",function(e){e.preventDefault();const t=e.dataTransfer.getData("source"),s=document.getElementById(t);if(!s)return;const o=s.parentElement,n=e.target,a=n.getBoundingClientRect();e.offsetX<.5*a.width?this.insertBefore(s,n):n.nextElementSibling?this.insertBefore(s,n.nextElementSibling):this.appendChild(s);{o.childNodes.forEach((e,t)=>e.childIndex=t-1);const t=/true/.test(e.dataTransfer.getData("fit"));let s=null;if(o.childElementCount==(t?2:1))s=o.lastChild;else{s=o.querySelector(".selected")??o.childNodes[t?1:0]}s._forceSelect=!0,s.click()}this.childNodes.forEach((e,t)=>e.childIndex=t-1);const r=document.getElementById(t+"_content");i.area.attach(r),this.classList.remove("dockingtab"),s.instance=i,s._forceSelect=!0,s.click(),i.tabs[s.dataset.name]=r}),t.root.classList.add("lexareatabscontainer");const[a,r]=t.split({type:"vertical",sizes:s.sizes??"auto",resize:!1,top:2});if(a.attach(o),s.parentClass&&o.parentElement&&(o.parentElement.className=e.LX.mergeClass(o.parentElement.className,s.parentClass)),this.area=r,this.area.root.className+=" lexareatabscontent",s.contentClass&&(this.area.root.className=e.LX.mergeClass(this.area.root.className,s.contentClass)),this.selected=null,this.root=o,s.fit){let t=document.createElement("span");t.className="lexareatab thumb",this.thumb=t,this.root.appendChild(t);new ResizeObserver(t=>{const s=this.thumb.item;if(s){var o=this.thumb.style.transition;this.thumb.style.transition="none",this.thumb.style.transform="translate( "+s.childIndex*s.offsetWidth+"px )",this.thumb.style.width=s.offsetWidth+"px",e.LX.flushCss(this.thumb),this.thumb.style.transition=o}}).observe(this.area.root)}if(n){this.folded=!0,this.folding=n,"up"==n&&e.LX.insertChildAtIndex(t.root,t.sections[1].root,0);new ResizeObserver(e=>{for(const s of e){const e=s.contentRect,o=t.parentArea?.sections[0].root;o.style.height="calc(100% - "+(42+e.height)+"px )"}}).observe(this.area.root),this.area.root.classList.add("folded")}}add(t,s,o={}){let n=o.selected??!1;if(n){this.root.querySelectorAll("span").forEach(e=>e.classList.remove("selected"));(this.area.root.querySelector(":scope > .pseudoparent-tabs")??this.area.root).querySelectorAll(":scope > .lextabcontent").forEach(e=>e.style.display="none")}n=!Object.keys(this.tabs).length&&!this.folding||n;let i=s.root?s.root:s;if(i.originalDisplay=i.style.display,i.style.display=n?i.originalDisplay:"none",i.classList.add("lextabcontent"),o.icon)if(o.icon.includes(".")){const e="https://raw.githubusercontent.com/jxarco/lexgui.js/master/";o.icon="<img src='"+(e+o.icon)+"'>"}else{const t=o.icon.split(" ");o.icon=e.LX.makeIcon(t[0],{svgClass:"sm "+t.slice(0).join(" ")}).innerHTML}let a=document.createElement("span");if(a.dataset.name=t,a.className="lexareatab flex flex-row gap-1"+(n?" selected":""),a.innerHTML=(o.icon??"")+t,a.id=t.replace(/\s/g,"")+c.TAB_ID++,a.title=o.title??"",a.selected=n??!1,a.fixed=o.fixed,a.instance=this,i.id=a.id+"_content",o.badge){const t={};(o.badge.asChild??!1)&&(t.parent=a),a.innerHTML+=e.LX.badge(o.badge.content??"",o.badge.className,t)}a.selected&&(this.selected=t),a.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();const t=a.instance;if(!a.fixed){const e=a.selected;a.parentElement.querySelectorAll("span").forEach(e=>e.selected=!1),a.selected=!t.folding||!e||!!a._forceSelect,a.parentElement.querySelectorAll("span").forEach(e=>e.classList.remove("selected")),a.classList.toggle("selected",a.selected);(t.area.root.querySelector(":scope > .pseudoparent-tabs")??t.area.root).querySelectorAll(":scope > .lextabcontent").forEach(e=>e.style.display="none"),i.style.display=i.originalDisplay,t.selected=a.dataset.name}t.folding&&(t.folded=a.selected,t.area.root.classList.toggle("folded",!t.folded)),o.onSelect&&o.onSelect(e,a.dataset.name),t.thumb&&(t.thumb.style.transform="translate( "+a.childIndex*a.offsetWidth+"px )",t.thumb.style.width=a.offsetWidth+"px",t.thumb.item=a),delete a._forceSelect}),a.addEventListener("contextmenu",e=>{e.preventDefault(),e.stopPropagation(),o.onContextMenu&&o.onContextMenu(e,a.dataset.name)}),o.allowDelete&&(a.addEventListener("mousedown",t=>{t.button==e.LX.MOUSE_MIDDLE_CLICK&&t.preventDefault()}),a.addEventListener("mouseup",t=>{t.preventDefault(),t.stopPropagation(),t.button==e.LX.MOUSE_MIDDLE_CLICK&&this.delete(a.dataset.name)})),a.setAttribute("draggable",!0),a.addEventListener("dragstart",e=>{const t=!!this.thumb;a.parentElement.childNodes.length!=(t?2:1)?(e.dataTransfer.setData("source",e.target.id),e.dataTransfer.setData("fit",t)):e.preventDefault()});const r=o.indexOffset??-1;a.childIndex=this.root.childElementCount+r,e.LX.insertChildAtIndex(this.root,a,a.childIndex+1),this.area.attach(i),this.tabDOMs[t]=a,this.tabs[t]=s,setTimeout(()=>{o.onCreate&&o.onCreate.call(this,this.area.root.getBoundingClientRect()),n&&this.thumb&&(this.thumb.classList.add("no-transition"),this.thumb.style.transform="translate( "+a.childIndex*a.offsetWidth+"px )",this.thumb.style.width=a.offsetWidth+"px",this.thumb.item=a,this.thumb.classList.remove("no-transition"))},10)}select(e){this.tabDOMs[e]&&this.tabDOMs[e].click()}setIcon(t,s){const o=this.tabDOMs[t];if(!o)return;const n=s.split(" "),i=e.LX.makeIcon(n[0],{svgClass:"sm "+n.slice(0).join(" ")});o.innerHTML=i.innerHTML+t}delete(e){this.selected==e&&(this.selected=null);const t=this.tabDOMs[e];if(!t||t.fixed)return;this.onclose&&this.onclose(e),this.tabDOMs[e].remove(),delete this.tabDOMs[e],this.tabs[e].remove(),delete this.tabs[e];const s=this.root.lastChild;s&&!s.fixed&&this.root.lastChild.click()}}e.LX.Tabs=c;class d extends a{setLimits;constructor(t,s,o,i={}){super(e.ComponentType.NUMBER,t,s,i),this.onGetValue=()=>s,this.onSetValue=(a,l,d)=>{if(isNaN(a))return;s=e.LX.clamp(+a,+c.min,+c.max),c.value=s=e.LX.round(s,i.precision);const h=r.querySelector(".lexinputslider");h&&(h.value=s),l||this._trigger(new n(t,s,d),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=i.inputWidth??`calc( 100% - ${t})`},this.setLimits=(e,t,s)=>{};var a=document.createElement("div");a.className="lexnumber",this.root.appendChild(a);let r=e.LX.makeElement("div","numberbox relative flex flex-col w-full bg-secondary rounded-lg scrollbar-hidden overflow-x-hidden","",a),l=e.LX.makeContainer(["auto","100%"],"relative flex flex-row cursor-text","",r),c=document.createElement("input");c.id="number_"+e.LX.guidGenerator(),c.className="vecinput",c.min=i.min??-1e24,c.max=i.max??1e24,c.step=i.step??"any",c.type="number",c.disabled=this.disabled,s.constructor==Number&&(s=e.LX.clamp(s,+c.min,+c.max),s=e.LX.round(s,i.precision)),c.value=c.iValue=s,l.appendChild(c);const d=e.LX.makeIcon("MoveVertical",{iconClass:"drag-icon hidden-opacity",svgClass:"sm"});if(l.appendChild(d),i.units){let t=e.LX.makeContainer(["auto","auto"],"px-2 bg-card content-center break-keep",i.units,l);c.unitBox=t}if(!i.skipSlider&&void 0!==i.min&&void 0!==i.max){let t=e.LX.makeContainer(["100%","auto"],"z-1 input-box","",r),o=document.createElement("input");o.className="lexinputslider",o.min=i.min,o.max=i.max,o.step=i.step??1,o.type="range",o.value=s,o.disabled=this.disabled,o.addEventListener("input",e=>{this.set(o.valueAsNumber,!1,e)},!1),o.addEventListener("mousedown",function(e){i.onPress&&i.onPress.bind(o)(e,o)},!1),o.addEventListener("mouseup",function(e){i.onRelease&&i.onRelease.bind(o)(e,o)},!1),t.appendChild(o),this.setLimits=(e,t,n)=>{c.min=o.min=e??c.min,c.max=o.max=t??c.max,c.step=n??c.step,o.step=n??o.step,this.set(s,!0)}}c.addEventListener("input",function(t){s=+c.valueAsNumber,s=e.LX.round(s,i.precision)},!1),c.addEventListener("wheel",e=>{if(e.preventDefault(),c!==document.activeElement)return;let t=i.step??1;e.shiftKey?t*=10:e.altKey&&(t*=.1),s=+c.valueAsNumber-t*(e.deltaY>0?1:-1),this.set(s,!1,e)},{passive:!1}),c.addEventListener("change",e=>{this.set(c.valueAsNumber,!1,e)},{passive:!1});var h=this;let u=e=>{let t=-e.movementY;if(0!=t){let o=i.step??1;e.shiftKey?o*=10:e.altKey&&(o*=.1),s=+c.valueAsNumber+o*t,this.set(s,!1,e)}e.stopPropagation(),e.preventDefault()},p=e=>{var t=h.root.ownerDocument;t.removeEventListener("mousemove",u),t.removeEventListener("mouseup",p),document.body.classList.remove("noevents"),d.classList.add("hidden-opacity"),document.pointerLockElement&&document.exitPointerLock(),i.onRelease&&i.onRelease.bind(c)(e,c)};l.addEventListener("mousedown",t=>{if(document.activeElement!=c&&t.button==e.LX.MOUSE_LEFT_CLICK){var s=h.root.ownerDocument;s.addEventListener("mousemove",u),s.addEventListener("mouseup",p),document.body.classList.add("noevents"),d.classList.remove("hidden-opacity"),t.stopImmediatePropagation(),t.stopPropagation(),document.pointerLockElement||l.requestPointerLock(),i.onPress&&i.onPress.bind(c)(t,c)}}),e.LX.doAsync(this.onResize.bind(this))}}e.LX.NumberInput=d;class h extends a{valid;input;_triggerEvent;_lastValueTriggered;constructor(t,s,o,i={}){super(e.ComponentType.TEXT,t,String(s),i),this.onGetValue=()=>s,this.onSetValue=(e,a,l)=>{let c=this._lastValueTriggered==e;i.ignoreValidation||(c=c||!this.valid(e)),c||(this._lastValueTriggered=s=e,r.value=e,delete this._triggerEvent,a||this._trigger(new n(t,e,l),o))},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=i.inputWidth??`calc( 100% - ${t})`},this.valid=(t,s)=>{if(t=t??this.value(),!i.pattern)return!0;return 0==e.LX.validateValueAtPattern(t,i.pattern,s).length};let a=document.createElement("div");a.className=i.warning?" lexwarning":"",a.style.display="flex",a.style.position="relative",this.root.appendChild(a),this.disabled=(this.disabled||i.warning)??!!i.url;let r=null;if(this.disabled)i.url?(r=document.createElement("a"),r.href=i.url,r.target="_blank",r.innerHTML=s??"",r.style.textAlign=i.float??"",r.className="lextext ellipsis-overflow"):(r=document.createElement("input"),r.disabled=!0,r.className=e.LX.mergeClass("lextext ellipsis-overflow",i.inputClass));else{r=e.LX.makeElement("input",e.LX.mergeClass("lextext text-sm",i.inputClass)),r.type=i.type||"",r.setAttribute("placeholder",i.placeholder??""),i.required&&r.setAttribute("required",i.required),i.pattern&&r.setAttribute("pattern",e.LX.buildTextPattern(i.pattern));const t=i.trigger??"default";if("default"==t?(r.addEventListener("keyup",e=>{"Enter"==e.key&&(this._triggerEvent=e,r.blur())}),r.addEventListener("focusout",e=>{this._triggerEvent=this._triggerEvent??e,this.set(e.target.value,!1,this._triggerEvent)})):"input"==t&&r.addEventListener("input",e=>{this.set(e.target.value,!1,e)}),r.addEventListener("mousedown",function(e){e.stopImmediatePropagation(),e.stopPropagation()}),i.icon){r.style.paddingLeft="1.75rem";const t=e.LX.makeIcon(i.icon,{iconClass:"absolute z-1 ml-2",svgClass:"sm"});a.appendChild(t)}}i.fit&&r.classList.add("field-sizing-content"),r instanceof HTMLInputElement&&(r.name=i.name,r.value=s??"",i.autocomplete?r.autocomplete=i.autocomplete:"password"===r.type?r.autocomplete="current-password":"username"===i.name||"email"===i.name?r.autocomplete=i.name:r.autocomplete="on",r.style.textAlign=i.float??"",r.addEventListener("transitionstart",e=>{"background-color"===e.propertyName&&r.matches(":-webkit-autofill")&&this.syncFromDOM()})),Object.assign(r.style,i.style??{}),a.appendChild(r),this.input=r,e.LX.doAsync(this.onResize.bind(this))}syncFromDOM(e=!0){this.input instanceof HTMLInputElement&&this.set(this.input.value,e)}}e.LX.TextInput=h;class u extends a{_lastPlacement=[!1,!1];constructor(t,s,o,i,a={}){super(e.ComponentType.SELECT,t,o,a),this.onGetValue=()=>o,this.onSetValue=(r,l,c)=>{o=r;let d=null;if(m.childNodes.forEach(e=>{e.classList.remove("selected"),e.getAttribute("value")==r&&(d=e)}),console.assert(d,`Item ${r} does not exist in the Select.`),d.classList.add("selected"),u.refresh(o),g){g.root.querySelector("input").value="";const e=this._filterOptions(s,"");m.refresh(e)}const h=this.root.querySelector(".lexcustomcontainer"),p=a[`on_${o}`];if(h.toggleAttribute("hidden",!p),p){h.innerHTML="";const t=new e.LX.Panel;t.queue(h),p.call(this,t),t.clearQueue()}this.root.dataset.opened=!!p,m.style.height="",l||this._trigger(new n(t,o,c),i)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=a.inputWidth??`calc( 100% - ${t})`};let l=document.createElement("div");l.className="lexselect",this.root.appendChild(l);let c=document.createElement("div");c.className="lexselect lexoption",c.name=t,c.iValue=o,void 0!==a.overflowContainer&&(a.overflowContainerX=a.overflowContainerY=a.overflowContainer);const d=(t,s)=>{const o=u.root,n=o.getBoundingClientRect(),i=t.parentElement.closest("dialog")??t.parentElement.closest(".lexcolorpicker");{const r=void 0!==a.overflowContainerY?a.overflowContainerY:e.LX.getParentArea(t),l=t.offsetHeight;let c=n.y,d=window.innerHeight;if(r){const e=r.getBoundingClientRect();d=e.y+e.height}if(i){const e=i.getBoundingClientRect();c-=e.y,d-=e.y}t.style.top=c+o.offsetHeight+"px",m.style.height="";const h=s?this._lastPlacement[0]:c-l<0,u=s?this._lastPlacement[1]:c+l>d;u&&!h?(t.style.top=c-l+"px",t.classList.add("place-above")):u&&h&&(m.style.height=d-c-32+"px"),this._lastPlacement=[h,u]}{const s=void 0!==a.overflowContainerX?a.overflowContainerX:e.LX.getParentArea(t),o=t.offsetWidth;let r=n.x;if(t.style.minWidth=n.width+"px",i){r-=i.getBoundingClientRect().x}t.style.left=r+"px";let l=window.innerWidth;if(s){const e=s.getBoundingClientRect();l=e.x+e.width}!("end"===a.align||r+o>l)||a.align&&"start"===a.align||(t.style.left=r-(o-n.width)+"px")}};let u=new r(null,o,(e,t)=>{if(m.unfocus_event)return void delete m.unfocus_event;p.classList.remove("place-above");p.hasAttribute("open")?p.close():(p.show(),d(p)),g&&g.root.querySelector("input").focus()},{buttonClass:"outline [&_a]:ml-auto",skipInlineCount:!0,disabled:this.disabled});u.root.style.width="100%",u.root.querySelector("button").appendChild(e.LX.makeIcon("Down",{svgClass:"sm"})),l.appendChild(u.root),u.refresh=e=>{const t=u.root.querySelector("button");""==t.innerText?t.innerText=e:t.innerHTML=t.innerHTML.replaceAll(t.innerText,e)};const p=document.createElement("dialog");p.className="lexselectoptions";let m=document.createElement("ul");m.tabIndex=-1,m.className="lexoptions",p.appendChild(m),m.addEventListener("focusout",function(e){if(e.stopPropagation(),e.stopImmediatePropagation(),e.relatedTarget===u.root.querySelector("button"))m.unfocus_event=!0,setTimeout(()=>delete m.unfocus_event,200);else{if(e.relatedTarget&&p.contains(e.relatedTarget))return;if("lexinput-filter"==e.target.className)return}p.close()});let g=null;if(a.filter){const t=e.LX.deepCopy(a);t.placeholder=t.placeholder??"Search...",t.skipComponent=t.skipComponent??!0,t.trigger="input",t.icon="Search",t.className="lexfilter",t.inputClass="outline",g=new h(null,a.filterValue??"",e=>{const t=this._filterOptions(s,e);m.refresh(t),d(p,!0)},t),g.root.querySelector(".lextext").style.border="1px solid transparent";g.root.querySelector("input").addEventListener("focusout",function(e){e.relatedTarget&&"UL"==e.relatedTarget.tagName&&e.relatedTarget.classList.contains("lexoptions")||p.close()}),m.appendChild(g.root)}m.refresh=t=>{for(;m.childElementCount>(a.filter?1:0);)m.removeChild(m.lastChild);if(!t.length){let t=a.emptyMsg??"No options found.",s=document.createElement("div");s.className="option",s.innerHTML=e.LX.makeIcon("Inbox",{svgClass:"mr-2"}).innerHTML+t;let o=document.createElement("li");return o.className="lexselectitem empty",o.appendChild(s),void m.appendChild(o)}for(let s=0;s<t.length;s++){let n=t[s],i=document.createElement("li"),a=document.createElement("div");a.className="option",i.appendChild(a);const r=e=>{this.set(e.currentTarget?.getAttribute("value"),!1,e),p.close()};if(i.addEventListener("click",r),n.constructor!=Object){const t="@"===n[0];t?(a.innerHTML="<span>"+n.substr(1)+"</span>",i.removeEventListener("click",r)):(a.innerHTML=`<span class="flex flex-row justify-between">${n}</span>`,a.appendChild(e.LX.makeIcon("Check")),a.value=n,i.setAttribute("value",n),n==o&&(i.classList.add("selected"),c.innerHTML=n)),i.classList.add(t?"lexselectlabel":"lexselectitem")}else{let e=document.createElement("img");e.src=n.src,i.setAttribute("value",n.value),i.className="lexlistitem",a.innerText=n.value,a.className+=" media",a.prepend(e),a.setAttribute("value",n.value),a.setAttribute("data-index",s),a.setAttribute("data-src",n.src),a.setAttribute("title",n.value),o==n.value&&i.classList.add("selected")}m.appendChild(i)}},m.refresh(s),l.appendChild(p);let f=e.LX.makeElement("div","lexcustomcontainer w-full");const L=a[`on_${o}`];if(f.toggleAttribute("hidden",!L),L){f.innerHTML="";const t=new e.LX.Panel;t.queue(f),L.call(this,t),t.clearQueue()}this.root.appendChild(f),this.root.dataset.opened=!!L,e.LX.doAsync(this.onResize.bind(this))}_filterOptions(e,t){const s=!t.length;let o=[];for(let n=0;n<e.length;n++){let i=e[n];if(!s){let e="string"==typeof i?i:i.value;const s=t.toLowerCase();if(!e.toLowerCase().includes(s))continue}o.push(i)}return o}}e.LX.Select=u;class p extends a{_updateItems;constructor(t,s=[],o,i={}){i.nameWidth="auto",super(e.ComponentType.ARRAY,t,null,i),this.onGetValue=()=>s,this.onSetValue=(e,i,a)=>{s=e,this._updateItems(),i||this._trigger(new n(t,s,a),o)};let a=document.createElement("div");a.className="lexarray shrink-1 grow-1 ml-4",a.style.width="auto",this.root.appendChild(a),this.root.dataset.opened=!1;let l=`Array (size ${s.length})`;const c=new r(null,l,()=>{this.root.dataset.opened="true"!=this.root.dataset.opened,this.root.querySelector(".lexarrayitems").toggleAttribute("hidden")},{buttonClass:"outline [&_a]:ml-auto"});c.root.querySelector("button").appendChild(e.LX.makeIcon("Down",{svgClass:"sm"})),a.appendChild(c.root);let p=document.createElement("div");p.className="lexarrayitems",p.toggleAttribute("hidden",!0),this.root.appendChild(p),this._updateItems=()=>{let a=this.root.querySelector("button");for(let e of a.childNodes)if(e.nodeType===Node.TEXT_NODE){e.textContent=`Array (size ${s.length})`;break}p.innerHTML="";for(let e=0;e<s.length;++e){const a=s[e];let l=i.innerValues?"select":a.constructor,c=null;switch(l){case String:c=new h(e+"",a,function(t){s[e]=t,o(s)},{nameWidth:"12px",className:"p-0",disabled:this.disabled,skipReset:!0});break;case Number:c=new d(e+"",a,function(t){s[e]=t,o(s)},{nameWidth:"12px",className:"p-0",disabled:this.disabled,skipReset:!0});break;case"select":c=new u(e+"",i.innerValues,a,function(t){s[e]=t,o(s)},{nameWidth:"12px",className:"p-0",disabled:this.disabled,skipReset:!0})}if(console.assert(c,`Value of type ${l} cannot be modified in ArrayInput`),p.appendChild(c.root),!this.disabled){const e=new r(null,"",(e,i)=>{s.splice(s.indexOf(a),1),this._updateItems(),this._trigger(new n(t,s,i),o)},{buttonClass:"ghost sm p-0",title:"Remove item",icon:"Trash2"});c.root.appendChild(e.root)}}if(!this.disabled){const a=new r(null,e.LX.makeIcon("Plus",{svgClass:"sm"}).innerHTML+"Add item",(e,a)=>{s.push(i.innerValues?i.innerValues[0]:""),this._updateItems(),this._trigger(new n(t,s,a),o)},{buttonClass:"ghost"});p.appendChild(a.root)}},this._updateItems()}}e.LX.ArrayInput=p;class m extends a{constructor(t,s={}){s.hideName=!0,super(e.ComponentType.CARD,t,null,s),this.root.classList.add("place-content-center");const o=e.LX.makeContainer(["100%","auto"],"lexcard max-w-sm flex flex-col gap-4 bg-card border-color rounded-xl py-6","",this.root);if(s.header){const t=void 0!==s.header.action;let n=e.LX.makeContainer(["100%","auto"],`flex ${t?"flex-row gap-4":"flex-col gap-1"} px-6`,"",o);if(t){const t=new r(null,s.header.action.name,s.header.action.callback,{buttonClass:"secondary"});n.appendChild(t.root);const o=e.LX.makeContainer(["75%","auto"],"flex flex-col gap-1","");n.prepend(o),n=o}s.header.title&&e.LX.makeElement("div","text-sm text-foreground leading-none font-semibold",s.header.title,n),s.header.description&&e.LX.makeElement("div","text-xs text-muted-foreground",s.header.description,n)}if(s.content){const t=e.LX.makeContainer(["100%","auto"],"flex flex-col gap-2 px-6","",o),n=[].concat(s.content);for(let e of n)t.appendChild(e.root?e.root:e)}if(s.footer){const t=e.LX.makeContainer(["100%","auto"],"flex flex-col gap-1 px-6","",o),n=[].concat(s.footer);for(let e of n)t.appendChild(e.root?e.root:e)}s.callback&&(o.classList.add("selectable"),o.style.cursor="pointer",o.addEventListener("click",e=>{this._trigger(new n(t,null,e),s.callback)}))}}e.LX.Card=m;class g extends a{constructor(t,s,o,i={}){if(!t&&!i.label)throw"Set Component Name or at least a label!";super(e.ComponentType.CHECKBOX,t,s,i),this.onGetValue=()=>s,this.onSetValue=(e,i,a)=>{e!=s&&(r.checked=s=e,this.root.querySelector(".lexcheckboxsubmenu")?.toggleAttribute("hidden",!e),i||this._trigger(new n(t,e,a),o))},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=i.inputWidth??`calc( 100% - ${t})`};let a=document.createElement("div");a.className="flex items-center gap-2 my-0 mx-auto [&_span]:truncate [&_span]:flex-auto-fill",this.root.appendChild(a);let r=e.LX.makeElement("input",e.LX.mergeClass("lexcheckbox rounded-xl disabled:pointer-events-none disabled:opacity-50",i.className??"primary"));if(r.type="checkbox",r.checked=s,r.disabled=this.disabled,a.appendChild(r),e.LX.makeElement("span","text-sm",i.label??"On",a),r.addEventListener("change",e=>{this.set(r.checked,!1,e)}),i.suboptions){let t=e.LX.makeElement("div","lexcheckboxsubmenu");t.toggleAttribute("hidden",!r.checked);const s=new e.LX.Panel;s.queue(t),i.suboptions.call(this,s),s.clearQueue(),this.root.appendChild(t)}e.LX.doAsync(this.onResize.bind(this))}}e.LX.Checkbox=g;class f{_rgb;_hex="#000000";_hsv;css;get rgb(){return this._rgb}set rgb(e){this._fromRGB(e)}get hex(){return this._hex}set hex(e){this._fromHex(e)}get hsv(){return this._hsv}set hsv(e){this._fromHSV(e)}constructor(e){this.set(e)}set(e){if("string"==typeof e&&e.startsWith("#"))this._fromHex(e);else if("r"in e&&"g"in e&&"b"in e)e.a=e.a??1,this._fromRGB(e);else{if(!("h"in e&&"s"in e&&"v"in e))throw"Bad color model!";e.a=e.a??1,this._fromHSV(e)}}setHSV(e){this._fromHSV(e)}setRGB(e){this._fromRGB(e)}setHex(e){this._fromHex(e)}_fromHex(t){this._fromRGB(e.LX.hexToRgb(t))}_fromRGB(t){this._rgb=t,this._hsv=e.LX.rgbToHsv(t),this._hex=e.LX.rgbToHex(t),this.css=e.LX.rgbToCss(this._rgb)}_fromHSV(t){this._hsv=t,this._rgb=e.LX.hsvToRgb(t),this._hex=e.LX.rgbToHex(this._rgb),this.css=e.LX.rgbToCss(this._rgb)}}e.LX.Color=f;class L{static currentPicker=!1;root;colorModel;useAlpha;callback;markerHalfSize;markerSize;currentColor;labelComponent;colorPickerBackground;intSatMarker;colorPickerTracker;alphaTracker;hueMarker;alphaMarker;onPopover;constructor(t,s={}){this.colorModel=s.colorModel??"Hex",this.useAlpha=s.useAlpha??!1,this.callback=s.onChange,this.callback||console.warn("Define a callback in _options.onChange_ to allow getting new Color values!"),this.root=e.LX.makeElement("div","lexcolorpicker flex flex-col text-sm w-3xs gap-2 p-1"),this.markerHalfSize=8,this.markerSize=2*this.markerHalfSize,this.currentColor=new f(t);const o=new f({h:this.currentColor.hsv.h,s:1,v:1}),n="size-4 rounded-lg bg-transparent absolute pointer-events-none border-3 border-solid border-white";this.colorPickerBackground=e.LX.makeElement("div","lexcolorpickerbg w-full aspect-square relative rounded-md cursor-pointer"),this.colorPickerBackground.style.backgroundColor=`rgb(${o.css.r}, ${o.css.g}, ${o.css.b})`,this.root.appendChild(this.colorPickerBackground),this.intSatMarker=e.LX.makeElement("div",n),this.intSatMarker.style.backgroundColor=this.currentColor.hex,this.colorPickerBackground.appendChild(this.intSatMarker);let i=null,a=t=>{const s=t.movementX,o=t.movementY,n=t.x-i.x,a=t.y-i.y;0!=s&&(n>=0||s<0)&&(n<this.colorPickerBackground.offsetWidth||s>0)&&(this.intSatMarker.style.left=e.LX.clamp(parseInt(this.intSatMarker.style.left)+s,-this.markerHalfSize,this.colorPickerBackground.offsetWidth-this.markerHalfSize)+"px"),0!=o&&(a>=0||o<0)&&(a<this.colorPickerBackground.offsetHeight||o>0)&&(this.intSatMarker.style.top=e.LX.clamp(parseInt(this.intSatMarker.style.top)+o,-this.markerHalfSize,this.colorPickerBackground.offsetHeight-this.markerHalfSize)+"px"),this._positionToSv(parseInt(this.intSatMarker.style.left),parseInt(this.intSatMarker.style.top)),this._updateColorValue(),t.stopPropagation(),t.preventDefault()},l=e=>{var t=this.root.ownerDocument;t.removeEventListener("mousemove",a),t.removeEventListener("mouseup",l),document.body.classList.remove("noevents")};this.colorPickerBackground.addEventListener("mousedown",e=>{var t=this.root.ownerDocument;t.addEventListener("mousemove",a),t.addEventListener("mouseup",l),document.body.classList.add("noevents"),e.stopImmediatePropagation(),e.stopPropagation();const s=e.offsetX-this.markerHalfSize;this.intSatMarker.style.left=s+"px";const o=e.offsetY-this.markerHalfSize;this.intSatMarker.style.top=o+"px",this._positionToSv(s,o),this._updateColorValue(),i=this.colorPickerBackground.getBoundingClientRect()});const c=e.LX.makeContainer(["100%","auto"],"flex flex-row gap-1 items-center","",this.root),d=window.EyeDropper;d&&c.appendChild(new r(null,"eyedrop",async()=>{const e=new d;try{const t=await e.open();this.fromHexColor(t.sRGBHex)}catch(e){}},{icon:"Pipette",buttonClass:"bg-none",title:"Sample Color"}).root);const p=e.LX.makeContainer(["100%","100%"],"flex flex-col gap-2","",c);this.colorPickerTracker=e.LX.makeElement("div","lexhuetracker w-full h-4 rounded-lg relative cursor-pointer"),p.appendChild(this.colorPickerTracker),this.hueMarker=e.LX.makeElement("div",n),this.hueMarker.style.backgroundColor=`rgb(${o.css.r}, ${o.css.g}, ${o.css.b})`,this.colorPickerTracker.appendChild(this.hueMarker);const m=t=>{this.hueMarker.style.left=t+"px",this.currentColor.hsv.h=e.LX.remapRange(t,0,this.colorPickerTracker.offsetWidth-this.markerSize,0,360);const s=new f({h:this.currentColor.hsv.h,s:1,v:1});this.hueMarker.style.backgroundColor=`rgb(${s.css.r}, ${s.css.g}, ${s.css.b})`,this.colorPickerBackground.style.backgroundColor=`rgb(${s.css.r}, ${s.css.g}, ${s.css.b})`,this._updateColorValue()};let g=null,L=t=>{const s=t.movementX,o=t.x-g.x;if(0!=s&&(o>=this.markerHalfSize||s<0)&&(o<this.colorPickerTracker.offsetWidth-this.markerHalfSize||s>0)){const t=e.LX.clamp(parseInt(this.hueMarker.style.left)+s,0,this.colorPickerTracker.offsetWidth-this.markerSize);m(t)}t.stopPropagation(),t.preventDefault()},y=e=>{var t=this.root.ownerDocument;t.removeEventListener("mousemove",L),t.removeEventListener("mouseup",y),document.body.classList.remove("noevents")};if(this.colorPickerTracker.addEventListener("mousedown",t=>{const s=this.root.ownerDocument;s.addEventListener("mousemove",L),s.addEventListener("mouseup",y),document.body.classList.add("noevents"),t.stopImmediatePropagation(),t.stopPropagation();const o=e.LX.clamp(t.offsetX-this.markerHalfSize,0,this.colorPickerTracker.offsetWidth-this.markerSize);m(o),g=this.colorPickerTracker.getBoundingClientRect()}),this.useAlpha){this.alphaTracker=e.LX.makeElement("div","lexalphatracker w-full h-4 rounded-lg relative cursor-pointer"),this.alphaTracker.style.color=`rgb(${this.currentColor.css.r}, ${this.currentColor.css.g}, ${this.currentColor.css.b})`,p.appendChild(this.alphaTracker),this.alphaMarker=e.LX.makeElement("div",n),this.alphaMarker.style.backgroundColor=`rgb(${this.currentColor.css.r}, ${this.currentColor.css.g}, ${this.currentColor.css.b},${this.currentColor.css.a})`,this.alphaTracker.appendChild(this.alphaMarker);const t=t=>{this.alphaMarker.style.left=t+"px",this.currentColor.hsv.a=e.LX.remapRange(t,0,this.alphaTracker.offsetWidth-this.markerSize,0,1),this._updateColorValue(),this.alphaMarker.style.backgroundColor=`rgb(${this.currentColor.css.r}, ${this.currentColor.css.g}, ${this.currentColor.css.b},${this.currentColor.css.a})`};let s=null,o=o=>{const n=this.root.ownerDocument;n.addEventListener("mousemove",i),n.addEventListener("mouseup",a),document.body.classList.add("noevents"),o.stopImmediatePropagation(),o.stopPropagation();const r=e.LX.clamp(o.offsetX-this.markerHalfSize,0,this.alphaTracker.offsetWidth-this.markerSize);t(r),s=this.alphaTracker.getBoundingClientRect()},i=o=>{const n=o.movementX,i=o.x-s.x;if(0!=n&&(i>=this.markerHalfSize||n<0)&&(i<this.alphaTracker.offsetWidth-this.markerHalfSize||n>0)){const s=e.LX.clamp(parseInt(this.alphaMarker.style.left)+n,0,this.alphaTracker.offsetWidth-this.markerSize);t(s)}o.stopPropagation(),o.preventDefault()},a=e=>{var t=this.root.ownerDocument;t.removeEventListener("mousemove",i),t.removeEventListener("mouseup",a),document.body.classList.remove("noevents")};this.alphaTracker.addEventListener("mousedown",o)}const b=e.LX.makeContainer(["100%","auto"],"flex flex-row gap-1","",this.root);b.appendChild(new u(null,["CSS","Hex","HSV","RGB"],this.colorModel,e=>{this.colorModel=e,this._updateColorValue(null,!0)}).root),this.labelComponent=new h(null,"",null,{inputClass:"bg-none",fit:!0,disabled:!0}),b.appendChild(this.labelComponent.root);{const t=new r(null,"copy",async()=>{navigator.clipboard.writeText(this.labelComponent.value()),t.root.querySelector("input[type='checkbox']").style.pointerEvents="none",e.LX.doAsync(()=>{t.swap&&t.swap(!0),t.root.querySelector("input[type='checkbox']").style.pointerEvents="auto"},3e3)},{swap:"Check",icon:"Copy",buttonClass:"bg-none",className:"ml-auto",title:"Copy"});t.root.querySelector(".swap-on svg").classList.add("text-success"),b.appendChild(t.root)}this._updateColorValue(t,!0),e.LX.doAsync(this._placeMarkers.bind(this)),this.onPopover=this._placeMarkers.bind(this)}_placeMarkers(){this._svToPosition(this.currentColor.hsv.s,this.currentColor.hsv.v);const t=e.LX.remapRange(this.currentColor.hsv.h,0,360,0,this.colorPickerTracker.offsetWidth-this.markerSize);if(this.hueMarker.style.left=t+"px",this.useAlpha){const t=e.LX.remapRange(this.currentColor.hsv.a,0,1,0,this.alphaTracker.offsetWidth-this.markerSize);this.alphaMarker.style.left=t+"px"}}_svToPosition(t,s){this.intSatMarker.style.left=`${e.LX.remapRange(t,0,1,-this.markerHalfSize,this.colorPickerBackground.offsetWidth-this.markerHalfSize)}px`,this.intSatMarker.style.top=`${e.LX.remapRange(1-s,0,1,-this.markerHalfSize,this.colorPickerBackground.offsetHeight-this.markerHalfSize)}px`}_positionToSv(t,s){this.currentColor.hsv.s=e.LX.remapRange(t,-this.markerHalfSize,this.colorPickerBackground.offsetWidth-this.markerHalfSize,0,1),this.currentColor.hsv.v=1-e.LX.remapRange(s,-this.markerHalfSize,this.colorPickerBackground.offsetHeight-this.markerHalfSize,0,1)}_updateColorValue(e,t=!1){this.currentColor.set(e??this.currentColor.hsv),this.callback&&!t&&this.callback(this.currentColor),this.intSatMarker.style.backgroundColor=this.currentColor.hex,this.useAlpha&&(this.alphaTracker.style.color=`rgb(${this.currentColor.css.r}, ${this.currentColor.css.g}, ${this.currentColor.css.b})`);const s=(e,t=2)=>e.toFixed(t).replace(/([0-9]+(\.[0-9]+[1-9])?)(\.?0+$)/,"$1");if("CSS"==this.colorModel){const{r:e,g:t,b:o,a:n}=this.currentColor.css;this.labelComponent.set(`rgb${this.useAlpha?"a":""}(${e},${t},${o}${this.useAlpha?","+s(n):""})`)}else if("Hex"==this.colorModel)this.labelComponent.set((this.useAlpha?this.currentColor.hex:this.currentColor.hex.substr(0,7)).toUpperCase());else if("HSV"==this.colorModel){const{h:e,s:t,v:o,a:n}=this.currentColor.hsv,i=[Math.floor(e)+"º",Math.floor(100*t)+"%",Math.floor(100*o)+"%"];this.useAlpha&&i.push(s(n)),this.labelComponent.set(i.join(" "))}else{const{r:e,g:t,b:o,a:n}=this.currentColor.rgb,i=[s(e),s(t),s(o)];this.useAlpha&&i.push(s(n)),this.labelComponent.set(i.join(" "))}}fromHexColor(t){this.currentColor.setHex(t);const{h:s,s:o,v:n}=this.currentColor.hsv;this._svToPosition(o,n);const i=new f({h:s,s:1,v:1});this.hueMarker.style.backgroundColor=this.colorPickerBackground.style.backgroundColor=`rgb(${i.css.r}, ${i.css.g}, ${i.css.b})`,this.hueMarker.style.left=e.LX.remapRange(s,0,360,-this.markerHalfSize,this.colorPickerTracker.offsetWidth-this.markerHalfSize)+"px",this._updateColorValue(t)}}e.LX.ColorPicker=L;class y{static activeElement=null;root;side="bottom";align="center";sideOffset=0;alignOffset=0;avoidCollisions=!0;reference;_windowPadding=4;_trigger;_parent;_onClick;constructor(t,s,o={}){if(y.activeElement)return void y.activeElement.destroy();this._trigger=t,t&&(t.classList.add("triggered"),t.active=this),this.side=o.side??this.side,this.align=o.align??this.align,this.sideOffset=o.sideOffset??this.sideOffset,this.alignOffset=o.alignOffset??this.alignOffset,this.avoidCollisions=o.avoidCollisions??!0,this.reference=o.reference,this.root=e.LX.makeElement("div","lexpopover fixed bg-background rounded-lg border-color p-1 left-0 top-0"),this.root.dataset.side=this.side,this.root.tabIndex="1";const n=(t??this.reference).closest("dialog");n&&"true"==n.dataset.modal?this._parent=n:this._parent=e.LX.root,this._parent.appendChild(this.root),this.root.addEventListener("keydown",e=>{"Escape"==e.key&&(e.preventDefault(),e.stopPropagation(),this.destroy())}),s&&(s=[].concat(s)).forEach(e=>{const t=e.root??e;this.root.appendChild(t),e.onPopover&&e.onPopover()}),y.activeElement=this,e.LX.doAsync(()=>{this._adjustPosition(),this._trigger&&(this.root.focus(),this._onClick=e=>{e.target&&(this.root.contains(e.target)||e.target==this._trigger)||this.destroy()},document.body.addEventListener("mousedown",this._onClick,!0),document.body.addEventListener("focusin",this._onClick,!0))},10)}destroy(){this._trigger&&(this._trigger.classList.remove("triggered"),delete this._trigger.active,document.body.removeEventListener("mousedown",this._onClick,!0),document.body.removeEventListener("focusin",this._onClick,!0)),this.root.remove(),y.activeElement=null}_adjustPosition(){const t=[0,0];{const e=this.reference??this._trigger;console.assert(e,"Popover needs a trigger or reference element!");const s=e.getBoundingClientRect();let o=!0;switch(this.side){case"left":t[0]+=s.x-this.root.offsetWidth-this.sideOffset,o=!1;break;case"right":t[0]+=s.x+s.width+this.sideOffset,o=!1;break;case"top":t[1]+=s.y-this.root.offsetHeight-this.sideOffset,o=!0;break;case"bottom":t[1]+=s.y+s.height+this.sideOffset,o=!0}switch(this.align){case"start":o?t[0]+=s.x:t[1]+=s.y;break;case"center":o?t[0]+=s.x+.5*s.width-.5*this.root.offsetWidth:t[1]+=s.y+.5*s.height-.5*this.root.offsetHeight;break;case"end":o?t[0]+=s.x-this.root.offsetWidth+s.width:t[1]+=s.y-this.root.offsetHeight+s.height}o?t[0]+=this.alignOffset:t[1]+=this.alignOffset}if(this.avoidCollisions&&(t[0]=e.LX.clamp(t[0],0,window.innerWidth-this.root.offsetWidth-this._windowPadding),t[1]=e.LX.clamp(t[1],0,window.innerHeight-this.root.offsetHeight-this._windowPadding)),this._parent instanceof HTMLDialogElement){let e=this._parent.getBoundingClientRect();t[0]-=e.x,t[1]-=e.y}this.root.style.left=`${t[0]}px`,this.root.style.top=`${t[1]}px`}}e.LX.Popover=y;e.LX.PopConfirm=class{_popover=null;constructor(t,s={}){const o=s.confirmText??"Yes",n=s.cancelText??"No",i=s.title??"Confirm",a=s.content??"Are you sure you want to proceed?",r=s.onConfirm,l=s.onCancel,c=e.LX.makeContainer(["auto","auto"],"tour-step-container");{const t=e.LX.makeContainer(["100%","auto"],"flex flex-row","",c);e.LX.makeContainer(["100%","auto"],"p-1 font-medium text-base",i,t)}e.LX.makeContainer(["100%","auto"],"p-1 text-base",a,c,{maxWidth:"400px"});const d=e.LX.makeContainer(["100%","auto"],"flex flex-row text-base","",c),h=e.LX.makeContainer(["100%","auto"],"text-base","",d),u=new e.LX.Panel;h.appendChild(u.root),u.sameLine(2,"justify-end"),u.addButton(null,n,()=>{l&&l(),this._popover?.destroy()}),u.addButton(null,o,()=>{r&&r(),this._popover?.destroy()},{buttonClass:"accent"}),this._popover?.destroy(),this._popover=new e.LX.Popover(null,[c],{reference:t,side:s.side??"top",align:s.align,sideOffset:s.sideOffset,alignOffset:s.alignOffset})}};class b extends a{picker;_skipTextUpdate=!1;_popover=void 0;constructor(t,s,o,i={}){(s=s??"#000000").constructor===String&&s.includes("oklch")&&(s=e.LX.oklchToHex(s));const a=i.useAlpha??(s.constructor===Object&&"a"in s||s.constructor===String&&[5,9].includes(s.length)),r=new f(s);s=a?r.hex:r.hex.substring(0,7),super(e.ComponentType.COLOR,t,s,i),this.onGetValue=()=>{const e=new f(s);return i.useRGB?e.rgb:s},this.onSetValue=(e,r,l)=>{const c=new f(e);if(d.style.color=s=c.hex.substring(0,7),a&&(u.style.color=s=c.hex),this._skipTextUpdate||p.set(s,!0,l),!r){let e=s;i.useRGB&&(e=c.rgb,a||delete e.a),this._trigger(new n(t,e,l),o)}},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=`calc( 100% - ${t})`};var l=document.createElement("span");l.className="lexcolor",this.root.appendChild(l),this.picker=new L(s,{colorModel:i.useRGB?"RGB":"Hex",useAlpha:a,onChange:e=>{this.set(e.hex)}});let c=e.LX.makeContainer(["18px","18px"],"flex flex-row rounded overflow-hidden","",l);c.tabIndex="1",c.addEventListener("click",e=>{this.disabled||(this._popover=new y(c,[this.picker]))});let d=document.createElement("div");d.className="lexcolorsample",d.style.color=s,c.appendChild(d);let u=null;a?(u=document.createElement("div"),u.className="lexcolorsample",u.style.color=s,c.appendChild(u)):d.style.width="18px";const p=new h(null,s,e=>{this._skipTextUpdate=!0,this.set(e),delete this._skipTextUpdate,this.picker.fromHexColor(e)},{width:"calc( 100% - 24px )",disabled:this.disabled});p.root.style.marginLeft="6px",l.appendChild(p.root),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Color=f,e.LX.ColorPicker=L,e.LX.ColorInput=b;class C extends a{constructor(t,s,o={}){const i=!o.noSelection;let a=i&&(o.toggle??!1),l=document.createElement("div");l.className="lexcombobuttons flex justify-center",o.skipReset=!0,o.float&&(l.className=e.LX.mergeClass(l.className,`justify-${o.float}`));let c=[],d=e.LX.makeElement("div","flex w-max bg-secondary pad-sm rounded-lg gap-1","",l);for(let t of s){if(!t.value)throw"Set 'value' for each button!";const s=e=>{c=[],i&&(a?n.classList.toggle("selected"):(l.querySelectorAll("button").forEach(e=>e.classList.remove("selected")),n.classList.add("selected"))),l.querySelectorAll("button").forEach(e=>{e.classList.contains("selected")&&c.push(e.dataset.value)}),!a&&c.length>1?console.error("Enable _options.toggle_ to allow selecting multiple options in ComboButtons."):(c=c[0],this.set(t.value,!1,n.classList.contains("selected")))};let n=new r(t.name??null,t.value,s,{title:t.icon?t.value:"",icon:t.icon,disabled:t.disabled,buttonClass:e.LX.mergeClass("combo w-auto",o.buttonClass)}).root.querySelector("button");n.id=t.id??"",n.dataset.value=t.value,i&&(t.selected||o.selected?.includes(t.value))&&(n.classList.add("selected"),c=c.concat([t.value])),d.appendChild(n)}c.length>1?a||(o.toggle=!0,a=i,console.warn(`Multiple options selected in '${t}' ComboButtons. Enabling _toggle_ mode.`)):c=c[0],super(e.ComponentType.BUTTONS,t,null,o),this.onGetValue=()=>c,this.onSetValue=(e,o,r)=>{if(i&&null==r&&(l.querySelectorAll("button").forEach(e=>e.classList.remove("selected")),l.querySelectorAll("button").forEach(e=>{c&&c.indexOf(e.dataset.value)>-1&&e.classList.add("selected")})),!o&&e.constructor!=Array){const o=r,i=s.filter(t=>t.value==e)[0]?.callback;this._trigger(new n(t,a?[e,o]:e,null),i)}},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=`calc( 100% - ${t})`},this.root.appendChild(l),e.LX.doAsync(this.onResize.bind(this))}}e.LX.ComboButtons=C;class v extends a{count;constructor(t,s,o,i={}){super(e.ComponentType.COUNTER,t,s,i),this.onGetValue=()=>this.count,this.onSetValue=(s,i,r)=>{this.count=e.LX.clamp(s,a,l),h.value=this.count,i||this._trigger(new n(t,s,r),o)},this.count=s;const a=i.min??0,l=i.max??100,c=i.step??1,d=document.createElement("div");d.className="flex flex-row border-color bg-card rounded-lg shadow",this.root.appendChild(d);const h=e.LX.makeElement("input","lexcounter w-12 bg-card px-2 text-foreground","",d);h.type="number",h.value=s,h.disabled=this.disabled;const u=new r(null,"",(e,t)=>{let s=c??1;t.shiftKey&&(s*=10),this.set(this.count-s,!1,t)},{disabled:this.disabled,className:`p-0 ${this.disabled?"":"hover:bg-secondary"} border-l-color border-r-color`,buttonClass:"px-0 bg-none h-7",icon:"Minus"});d.appendChild(u.root);const p=new r(null,"",(e,t)=>{let s=c??1;t.shiftKey&&(s*=10),this.set(this.count+s,!1,t)},{disabled:this.disabled,className:`p-0 ${this.disabled?"":"hover:bg-secondary"} rounded-r-lg`,buttonClass:"px-0 bg-none h-7",icon:"Plus"});d.appendChild(p.root)}}e.LX.Counter=v;class x{element;canvas;constructor(t,s={}){let o=document.createElement("div");o.className=e.LX.mergeClass("curve [&_canvas]:rounded",s.className),o.style.minHeight="50px",o.style.width=s.width||"100%",o.style.minWidth="50px",o.style.minHeight="20px",o.bgcolor=s.bgColor||e.LX.getCSSVariable("background"),o.pointscolor=s.pointsColor||e.LX.getCSSVariable("primary"),o.activepointscolor=s.activePointsColor||e.LX.getCSSVariable("primary/50"),o.linecolor=s.lineColor||"#555",o.value=t||[],o.xrange=s.xrange||[0,1],o.yrange=s.yrange||[0,1],o.defaulty=null!=s.defaulty?s.defaulty:0,o.no_overlap=s.noOverlap||!1,o.show_samples=s.showSamples||0,o.allow_add_values=s.allowAddValues??!0,o.draggable_x=s.draggableX??!0,o.draggable_y=s.draggableY??!0,o.smooth=(s.smooth&&"number"==typeof s.smooth?s.smooth:.3)||!1,o.move_out=s.moveOutAction??e.LX.CURVE_MOVEOUT_DELETE,e.LX.addSignal("@on_new_color_scheme",(t,n)=>{o.bgcolor=s.bgColor||e.LX.getCSSVariable("background"),o.pointscolor=s.pointsColor||e.LX.getCSSVariable("primary"),o.activepointscolor=s.activePointsColor||e.LX.getCSSVariable("primary/50"),this.redraw()}),this.element=o;let n=document.createElement("canvas");function i(e){return[n.width*(e[0]-o.xrange[0])/o.xrange[1],n.height*(e[1]-o.yrange[0])/o.yrange[1]]}function a(e){return[e[0]*o.xrange[1]/n.width+o.xrange[0],e[1]*o.yrange[1]/n.height+o.yrange[0]]}n.width=s.width||200,n.height=s.height||50,o.appendChild(n),this.canvas=n,o.addEventListener("mousedown",function(t){document.addEventListener("mousemove",c),document.addEventListener("mouseup",d);var s=n.getBoundingClientRect(),h=t.clientX-s.left,m=t.clientY-s.top;if(r=function(e,t){for(var s=1e5,n=-1,a=0;a<o.value.length;a++){var r=u([e,t],i(o.value[a]));r<s&&r<8&&(s=r,n=a)}return n}(h,n.height-m),t.button==e.LX.MOUSE_LEFT_CLICK&&-1==r&&o.allow_add_values){var g=a([h,n.height-m]);o.value.push(g),p(),r=o.value.indexOf(g)}l=[h,m],o.redraw(),t.preventDefault(),t.stopPropagation()}),o.getValueAt=function(e){if(e<o.xrange[0]||e>o.xrange[1])return o.defaulty;let t=[o.xrange[0],o.defaulty],s=0;for(let n=0;n<o.value.length;n+=1){let i=o.value[n];if(e==i[0])return i[1];if(e<i[0])return s=(e-t[0])/(i[0]-t[0]),t[1]*(1-s)+i[1]*s;t=i}let n=[o.xrange[1],o.defaulty];return s=(e-t[0])/(n[0]-t[0]),t[1]*(1-s)+n[1]*s},o.resample=function(e){let t=[],s=(o.xrange[1]-o.xrange[0])/e;for(let e=o.xrange[0];e<=o.xrange[1];e+=s)t.push(o.getValueAt(e));return t},o.addValue=function(e){for(let t=0;t<o.value;t++){if(!(o.value[t][0]<e[0]))return o.value.splice(t,0,e),void this.redraw()}o.value.push(e),this.redraw()};let r=-1;o.redraw=function(t={}){t.value&&(o.value=t.value),t.xrange&&(o.xrange=t.xrange),t.yrange&&(o.yrange=t.yrange),t.smooth&&(o.smooth=t.smooth);var s=n.getContext("2d");if(!s)return;s.setTransform(1,0,0,1,0,0),s.translate(0,n.height),s.scale(1,-1),s.fillStyle=o.bgcolor,s.fillRect(0,0,n.width,n.height),s.strokeStyle=o.linecolor,s.beginPath();var a=i([o.xrange[0],o.defaulty]);s.moveTo(a[0],a[1]);let l=[a[0],a[1]];for(var c in o.value){a=i(o.value[c]),l.push(a[0]),l.push(a[1]),o.smooth||s.lineTo(a[0],a[1])}a=i([o.xrange[1],o.defaulty]),l.push(a[0]),l.push(a[1]),o.smooth?e.LX.drawSpline(s,l,o.smooth):(s.lineTo(a[0],a[1]),s.stroke());for(var d=0;d<o.value.length;d+=1){a=i(o.value[d]);const e=d==r;s.fillStyle=e?o.activepointscolor:o.pointscolor,s.beginPath(),s.arc(a[0],a[1],e?4:3,0,2*Math.PI),s.fill()}if(o.show_samples){var h=o.resample(o.show_samples);s.fillStyle="#888";for(d=0;d<h.length;d+=1){a=i([d*((o.xrange[1]-o.xrange[0])/o.show_samples)+o.xrange[0],h[d]]),s.beginPath(),s.arc(a[0],a[1],2,0,2*Math.PI),s.fill()}}};var l=[0,0];function c(t){var s=n.getBoundingClientRect(),i=t.clientX-s.left,c=t.clientY-s.top;i<0?i=0:i>n.width&&(i=n.width),c<0?c=0:c>n.height&&(c=n.height);const m=[t.clientX-s.left,t.clientY-s.top];if(-1!=r&&u(m,[i,c])>.5*n.height){if(o.move_out==e.LX.CURVE_MOVEOUT_DELETE)o.value.splice(r,1);else{const e=[m[0]-i,m[1]-c];let t=o.value[r];t[0]=0==e[0]?t[0]:e[0]<0?o.xrange[0]:o.xrange[1],t[1]=0==e[1]?t[1]:e[1]<0?o.yrange[1]:o.yrange[0]}d(t)}else{var g=a([-(o.draggable_x?l[0]-i:0),o.draggable_y?l[1]-c:0]);if(-1!=r){var f=o.xrange[0],L=o.xrange[1];o.no_overlap&&(r>0&&(f=o.value[r-1][0]),r<o.value.length-1&&(L=o.value[r+1][0]));var y=o.value[r];y[0]+=g[0],y[1]+=g[1],y[0]<f?y[0]=f:[0]>L&&(y[0]=L),y[1]<o.yrange[0]?y[1]=o.yrange[0]:y[1]>o.yrange[1]&&(y[1]=o.yrange[1])}p(),o.redraw(),l[0]=i,l[1]=c,h(t),t.preventDefault(),t.stopPropagation()}}function d(e){r=-1,o.redraw(),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),h(e),e.preventDefault(),e.stopPropagation()}function h(e){s.callback&&s.callback.call(o,o.value,e)}function u(e,t){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function p(){var e=null;-1!=r&&(e=o.value[r]),o.value.sort(function(e,t){return e[0]-t[0]}),e&&(r=o.value.indexOf(e))}return o.redraw(),this}redraw(e={}){this.element.redraw(e)}}class _ extends a{curveInstance;constructor(t,s,o,i={}){let a=JSON.parse(JSON.stringify(s));super(e.ComponentType.CURVE,t,a,i),this.onGetValue=()=>JSON.parse(JSON.stringify(l.element.value)),this.onSetValue=(e,s,i)=>{l.element.value=JSON.parse(JSON.stringify(e)),l.redraw(),s||this._trigger(new n(t,l.element.value,i),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";r.style.width=`calc( 100% - ${t})`};var r=document.createElement("div");r.className="lexcurve",this.root.appendChild(r),i.callback=(e,s)=>{this._trigger(new n(t,e,s),o)},i.name=t;let l=new x(s,i);r.appendChild(l.element),this.curveInstance=l;new ResizeObserver(e=>{for(const t of e)l.canvas.width=t.contentRect.width,l.redraw()}).observe(r),e.LX.doAsync(this.onResize.bind(this))}}e.LX.CanvasCurve=x,e.LX.Curve=_;class w{root;day=-1;month=-1;year=-1;monthName="";firstDay=-1;daysInMonth=-1;calendarDays=[];currentDate;range;untilToday;fromToday;skipPrevMonth;skipNextMonth;onChange;onPreviousMonth;onNextMonth;constructor(t,s={}){if(this.root=e.LX.makeContainer(["256px","auto"],"p-1 flex flex-col gap-2 text-sm"),this.onChange=s.onChange,this.onPreviousMonth=s.onPreviousMonth,this.onNextMonth=s.onNextMonth,this.untilToday=s.untilToday,this.fromToday=s.fromToday,this.range=s.range,this.skipPrevMonth=s.skipPrevMonth,this.skipNextMonth=s.skipNextMonth,t)this.fromDateString(t);else{const e=new Date;this.month=e.getMonth()+1,this.year=e.getFullYear(),this.fromMonthYear(this.month,this.year)}}_getCurrentDate(){return{day:this.day,month:this.month,year:this.year,fullDate:this.getFullDate()}}_previousMonth(e){this.month=Math.max(1,this.month-1),1==this.month&&(this.month=12,this.year--),this.fromMonthYear(this.month,this.year),!e&&this.onPreviousMonth&&this.onPreviousMonth(this.currentDate)}_nextMonth(e){this.month=Math.min(this.month+1,13),13==this.month&&(this.month=1,this.year++),this.fromMonthYear(this.month,this.year),!e&&this.onNextMonth&&this.onNextMonth(this.currentDate)}refresh(){this.root.innerHTML="";{const t=e.LX.makeContainer(["100%","auto"],"flex flex-row p-1","",this.root);if(!this.skipPrevMonth){const s=e.LX.makeIcon("Left",{title:"Previous Month",iconClass:"border-color p-1 rounded hover:bg-secondary",svgClass:"sm"});t.appendChild(s),s.addEventListener("click",()=>{this._previousMonth()})}if(e.LX.makeContainer(["100%","auto"],"text-center font-medium select-none",`${this.monthName} ${this.year}`,t),!this.skipNextMonth){const s=e.LX.makeIcon("Right",{title:"Next Month",iconClass:"border-color p-1 rounded hover:bg-secondary",svgClass:"sm"});t.appendChild(s),s.addEventListener("click",()=>{this._nextMonth()})}}{const t=document.createElement("table");t.className="w-full",this.root.appendChild(t);{const e=document.createElement("thead");t.appendChild(e);const s=document.createElement("tr");for(const e of["Mo","Tu","We","Th","Fr","Sa","Su"]){const t=document.createElement("th");t.className="text-muted-foreground text-xs font-normal w-10 select-none",t.innerHTML=`<span>${e}</span>`,s.appendChild(t)}e.appendChild(s)}{const s=document.createElement("tbody");t.appendChild(s);let o=this.range?e.LX.dateFromDateString(this.range[0]):null,n=this.range?e.LX.dateFromDateString(this.range[1]):null;for(let e=0;e<6;e++){const t=document.createElement("tr"),i=this.calendarDays.slice(7*e,7*e+7);for(const e of i){const s=document.createElement("th");s.className="leading-8 text-xs font-normal rounded select-none cursor-pointer shrink-0 grow-0";const i=new Date(`${this.month}/${e.day}/${this.year}`),a=new Date,r=!this.untilToday||i.getTime()<a.getTime(),l=!this.fromToday||(i.getFullYear()>a.getFullYear()||i.getFullYear()===a.getFullYear()&&i.getMonth()>a.getMonth()||i.getFullYear()===a.getFullYear()&&i.getMonth()===a.getMonth()&&i.getDate()>=a.getDate()),c=e.currentMonth&&r&&l,d=this.currentDate&&e.day==this.currentDate.day&&this.month==this.currentDate.month&&this.year==this.currentDate.year&&e.currentMonth,h=c&&o&&e.day==o.getDate()&&this.month==o.getMonth()+1&&this.year==o.getFullYear(),u=c&&n&&e.day==n.getDate()&&this.month==n.getMonth()+1&&this.year==n.getFullYear();!this.range&&d||this.range&&(h||u)?s.className+=" bg-primary text-primary-foreground":this.range&&c&&i>o&&i<n?s.className+=" bg-accent text-accent-foreground":s.className+=` ${c?"text-secondary-foreground":"text-muted-foreground"} hover:bg-secondary`,s.innerHTML=`<span>${e.day}</span>`,t.appendChild(s),c?s.addEventListener("click",()=>{this.day=e.day,this.currentDate=this._getCurrentDate(),this.onChange&&this.onChange(this.currentDate)}):void 0!==this.range||e.currentMonth||s.addEventListener("click",()=>{e?.prevMonth?this._previousMonth():this._nextMonth()})}s.appendChild(t)}}}}fromDateString(e){const t=e.split("/");this.day=parseInt(t[0]),this.month=parseInt(t[1]),this.monthName=this.getMonthName(this.month-1),this.year=parseInt(t[2]),this.currentDate=this._getCurrentDate(),this.fromMonthYear(this.month,this.year)}fromMonthYear(e,t){e=Math.max(e-1,0),t=t??(new Date).getFullYear();const s=new Date(t,e,1).getDay(),o=0===s?6:s-1,n=new Date(t,e+1,0).getDate(),i=new Date(0===e?t-1:t,(0===e?11:e-1)+1,0).getDate(),a=[];for(let e=o-1;e>=0;e--)a.push({day:i-e,currentMonth:!1,prevMonth:!0});for(let e=1;e<=n;e++)a.push({day:e,currentMonth:!0});const r=42-a.length;for(let e=1;e<=r;e++)a.push({day:e,currentMonth:!1,nextMonth:!0});this.monthName=this.getMonthName(e),this.firstDay=o,this.daysInMonth=n,this.calendarDays=a,this.refresh()}getMonthName(e,t="en-US"){return new Intl.DateTimeFormat(t,{month:"long"}).format(new Date(2e3,e,1))}getFullDate(e,t,s){return`${e??this.monthName} ${t??this.day}${this._getOrdinalSuffix(t??this.day)}, ${s??this.year}`}setRange(e){console.assert(e.constructor===Array,"Date Range must be in Array format"),this.range=e,this.refresh()}setMonth(e){this.month=e,this.fromMonthYear(this.month,this.year)}_getOrdinalSuffix(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}}e.LX.Calendar=w;class k{root;fromCalendar;toCalendar;from;to;_selectingRange=!1;constructor(t,s={}){this.root=e.LX.makeContainer(["auto","auto"],"flex flex-row"),console.assert(t&&t.constructor===Array,"Range cannot be empty and has to be an Array!");let o=null,n=!1;{const s=e.LX.dateFromDateString(t[0]),i=e.LX.dateFromDateString(t[1]);if(s>i){const e=t[0];t[0]=t[1],t[1]=e,n=!0}o=(n?i.getMonth():s.getMonth())+2}this.from=t[0],this.to=t[1];const i=e=>{const t=`${e.day}/${e.month}/${e.year}`;this._selectingRange?(this.to=t,this._selectingRange=!1):(this.from=this.to=t,this._selectingRange=!0);const o=[this.from,this.to];this.fromCalendar.setRange(o),this.toCalendar.setRange(o),s.onChange&&s.onChange(o)};this.fromCalendar=new w(this.from,{skipNextMonth:!0,onChange:i,onPreviousMonth:()=>{this.toCalendar._previousMonth()},range:t}),this.toCalendar=new w(this.to,{skipPrevMonth:!0,onChange:i,onNextMonth:()=>{this.fromCalendar._nextMonth()},range:t}),console.assert(o&&"New Month must be valid"),this.toCalendar.setMonth(o),this.root.appendChild(this.fromCalendar.root),this.root.appendChild(this.toCalendar.root)}getFullDate(){const t=e.LX.dateFromDateString(this.from),s=this.fromCalendar.getMonthName(t.getMonth()),o=e.LX.dateFromDateString(this.to),n=this.toCalendar.getMonthName(o.getMonth());return`${this.fromCalendar.getFullDate(s,t.getDate(),t.getFullYear())} to ${this.toCalendar.getFullDate(n,o.getDate(),o.getFullYear())}`}}e.LX.CalendarRange=k;class S extends a{calendar;_popover=void 0;constructor(t,s,o,i={}){super(e.ComponentType.DATE,t,null,i);const a=s?.constructor===Array;if(!a&&i.today){const e=new Date;s=`${e.getDate()}/${e.getMonth()+1}/${e.getFullYear()}`}this.onGetValue=()=>s,this.onSetValue=(e,i,r)=>{a||this.calendar.fromDateString(e),s=e,c(this.calendar.getFullDate()),i||this._trigger(new n(t,e,r),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=`calc( 100% - ${t})`};const l=e.LX.makeContainer(["auto","auto"],"lexdate flex flex-row");this.root.appendChild(l),this.calendar=a?new k(s,{onChange:e=>{this.set(e)},...i}):new w(s,{onChange:e=>{const t=`${e.day}/${e.month}/${e.year}`;this.set(t)},...i});const c=t=>{const s=!!t;l.innerHTML="";const o=(t=t??"Pick a date").split(" to "),n=a?o[0]:t,i=e.LX.makeIcon("Calendar"),c=new r(null,n,()=>{this._popover=new y(c.root,[this.calendar])},{disabled:this.disabled,buttonClass:`outline flex flex-row px-3 ${s?"":"text-muted-foreground"} justify-between`});if(c.root.querySelector("button").appendChild(i),c.root.style.width="100%",l.appendChild(c.root),a){const t=e.LX.makeIcon("ArrowRight");e.LX.makeContainer(["32px","auto"],"content-center",t.innerHTML,l);const n=o[1],i=e.LX.makeIcon("Calendar"),a=new r(null,n,()=>{this._popover=new y(a.root,[this.calendar])},{disabled:this.disabled,buttonClass:`outline flex flex-row px-3 ${s?"":"text-muted-foreground"} justify-between`});a.root.querySelector("button").appendChild(i),a.root.style.width="100%",l.appendChild(a.root)}};s?c(this.calendar.getFullDate()):c(),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Calendar=w,e.LX.CalendarRange=k,e.LX.DatePicker=S;class E{element;canvas;constructor(t,s={}){let o=document.createElement("div");o.className=e.LX.mergeClass("dial",s.className),o.style.width=o.style.height=s.size||"100%",o.style.minWidth=o.style.minHeight="50px",o.bgcolor=s.bgColor||e.LX.getCSSVariable("background"),o.pointscolor=s.pointsColor||e.LX.getCSSVariable("primary/50"),o.linecolor=s.lineColor||"#555",o.value=t||[],o.xrange=s.xrange||[0,1],o.yrange=s.yrange||[0,1],o.defaulty=null!=s.defaulty?s.defaulty:0,o.no_overlap=s.noOverlap||!1,o.show_samples=s.showSamples||0,o.allow_add_values=s.allowAddValues??!0,o.draggable_x=s.draggableX??!0,o.draggable_y=s.draggableY??!0,o.smooth=(s.smooth&&"number"==typeof s.smooth?s.smooth:.3)||!1,o.move_out=s.moveOutAction??e.LX.CURVE_MOVEOUT_DELETE,e.LX.addSignal("@on_new_color_scheme",(t,n)=>{o.bgcolor=s.bgColor||e.LX.getCSSVariable("background"),o.pointscolor=s.pointsColor||e.LX.getCSSVariable("primary/50"),this.redraw()}),this.element=o;let n=document.createElement("canvas");function i(e){return[n.width*(e[0]-o.xrange[0])/o.xrange[1],n.height*(e[1]-o.yrange[0])/o.yrange[1]]}function a(e){return[e[0]*o.xrange[1]/n.width+o.xrange[0],e[1]*o.yrange[1]/n.height+o.yrange[0]]}n.width=n.height=s.size||200,o.appendChild(n),this.canvas=n,o.addEventListener("mousedown",function(t){document.addEventListener("mousemove",c),document.addEventListener("mouseup",d);var s=n.getBoundingClientRect(),h=t.clientX-s.left,m=t.clientY-s.top;if(r=function(e,t){for(var s=1e5,n=-1,a=0;a<o.value.length;a++){var r=u([e,t],i(o.value[a]));r<s&&r<8&&(s=r,n=a)}return n}(h,n.height-m),t.button==e.LX.MOUSE_LEFT_CLICK&&-1==r&&o.allow_add_values){var g=a([h,n.height-m]);o.value.push(g),p(),r=o.value.indexOf(g)}l=[h,m],o.redraw(),t.preventDefault(),t.stopPropagation()}),o.getValueAt=function(e){if(e<o.xrange[0]||e>o.xrange[1])return o.defaulty;for(var t=[o.xrange[0],o.defaulty],s=0,n=0;n<o.value.length;n+=1){var i=o.value[n];if(e==i[0])return i[1];if(e<i[0])return s=(e-t[0])/(i[0]-t[0]),t[1]*(1-s)+i[1]*s;t=i}return i=[o.xrange[1],o.defaulty],s=(e-t[0])/(i[0]-t[0]),t[1]*(1-s)+i[1]*s},o.resample=function(e){for(var t=[],s=(o.xrange[1]-o.xrange[0])/e,n=o.xrange[0];n<=o.xrange[1];n+=s)t.push(o.getValueAt(n));return t},o.addValue=function(e){for(var t=0;t<o.value;t++){if(!(o.value[t][0]<e[0]))return o.value.splice(t,0,e),void this.redraw()}o.value.push(e),this.redraw()};var r=-1;o.redraw=function(e={}){e.value&&(o.value=e.value),e.xrange&&(o.xrange=e.xrange),e.yrange&&(o.yrange=e.yrange),e.smooth&&(o.smooth=e.smooth);var t=n.getContext("2d");if(!t)return;t.setTransform(1,0,0,1,0,0),t.translate(0,n.height),t.scale(1,-1),t.fillStyle=o.bgcolor,t.fillRect(0,0,n.width,n.height),t.strokeStyle=o.linecolor,t.beginPath();var s=i([o.xrange[0],o.defaulty]);t.moveTo(s[0],s[1]);let a=[s[0],s[1]];for(var l in o.value){s=i(o.value[l]),a.push(s[0]),a.push(s[1])}s=i([o.xrange[1],o.defaulty]),a.push(s[0]),a.push(s[1]);s=i([0,0]),t.fillStyle="gray",t.beginPath(),t.arc(s[0],s[1],3,0,2*Math.PI),t.fill();for(var c=0;c<o.value.length;c+=1){s=i(o.value[c]);const e=c==r;t.fillStyle=e?"white":o.pointscolor,t.beginPath(),t.arc(s[0],s[1],e?4:3,0,2*Math.PI),t.fill()}if(o.show_samples){var d=o.resample(o.show_samples);t.fillStyle="#888";for(c=0;c<d.length;c+=1){s=i([c*((o.xrange[1]-o.xrange[0])/o.show_samples)+o.xrange[0],d[c]]),t.beginPath(),t.arc(s[0],s[1],2,0,2*Math.PI),t.fill()}}};var l=[0,0];function c(t){var s=n.getBoundingClientRect(),i=t.clientX-s.left,c=t.clientY-s.top;i<0?i=0:i>n.width&&(i=n.width),c<0?c=0:c>n.height&&(c=n.height);const m=[t.clientX-s.left,t.clientY-s.top];if(-1!=r&&u(m,[i,c])>.5*n.height){if(o.move_out==e.LX.CURVE_MOVEOUT_DELETE)o.value.splice(r,1);else{const e=[m[0]-i,m[1]-c];let t=o.value[r];t[0]=0==e[0]?t[0]:e[0]<0?o.xrange[0]:o.xrange[1],t[1]=0==e[1]?t[1]:e[1]<0?o.yrange[1]:o.yrange[0]}d(t)}else{var g=a([-(o.draggable_x?l[0]-i:0),o.draggable_y?l[1]-c:0]);if(-1!=r){var f=o.xrange[0],L=o.xrange[1];o.no_overlap&&(r>0&&(f=o.value[r-1][0]),r<o.value.length-1&&(L=o.value[r+1][0]));var y=o.value[r];y[0]+=g[0],y[1]+=g[1],y[0]<f?y[0]=f:y[0]>L&&(y[0]=L),y[1]<o.yrange[0]?y[1]=o.yrange[0]:y[1]>o.yrange[1]&&(y[1]=o.yrange[1])}p(),o.redraw(),l[0]=i,l[1]=c,h(t),t.preventDefault(),t.stopPropagation()}}function d(e){r=-1,o.redraw(),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),h(e),e.preventDefault(),e.stopPropagation()}function h(e){s.callback&&s.callback.call(o,o.value,e)}function u(e,t){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function p(){var e=null;-1!=r&&(e=o.value[r]),o.value.sort(function(e,t){return e[0]-t[0]}),e&&(r=o.value.indexOf(e))}return o.redraw(),this}redraw(e={}){this.element.redraw(e)}}e.LX.CanvasDial=E;class M extends a{dialInstance;constructor(t,s,o,i={}){let a=JSON.parse(JSON.stringify(s));super(e.ComponentType.DIAL,t,a,i),this.onGetValue=()=>JSON.parse(JSON.stringify(l.element.value)),this.onSetValue=(e,s,i)=>{l.element.value=JSON.parse(JSON.stringify(e)),l.redraw(),s||this._trigger(new n(t,l.element.value,i),o)},this.onResize=t=>{const s=this.root.domName?.style.width??"0px";r.style.width=`calc( 100% - ${s})`,e.LX.flushCss(r),l.element.style.height=l.element.offsetWidth+"px",l.canvas.width=l.element.offsetWidth,r.style.width=l.element.offsetWidth+"px",l.canvas.height=l.canvas.width,l.redraw()};var r=document.createElement("div");r.className="lexcurve",this.root.appendChild(r),i.callback=(e,s)=>{this._trigger(new n(t,e,s),o)},i.name=t;let l=new E(s,i);r.appendChild(l.element),this.dialInstance=l,e.LX.doAsync(this.onResize.bind(this))}}e.LX.CanvasDial=E,e.LX.Dial=M;class T extends a{constructor(t,s,o={}){super(e.ComponentType.FILE,t,null,o);let n=o.local??!0,i=o.type??"text",a=o.read??!0;this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=`calc( 100% - ${t})`};let l=document.createElement("input");if(l.className="lexfileinput",l.type="file",l.disabled=this.disabled,this.root.appendChild(l),o.placeholder&&(l.placeholder=o.placeholder),l.addEventListener("change",function(e){const t=e.target.files;if(t.length)if(a){o.onBeforeRead&&o.onBeforeRead();const e=new FileReader;"text"===i?e.readAsText(t[0]):"buffer"===i?e.readAsArrayBuffer(t[0]):"bin"===i?e.readAsBinaryString(t[0]):"url"===i&&e.readAsDataURL(t[0]),e.onload=e=>{s.call(this,e.target?.result,t[0])}}else s(t[0])}),l.addEventListener("cancel",function(e){s(null)}),n){let t=null;const s=new r(null,"",()=>{t||(t=new e.LX.Dialog("Load Settings",e=>{e.addSelect("Type",["text","buffer","bin","url"],i,e=>{i=e}),e.addButton(null,"Reload",()=>{l.dispatchEvent(new Event("change"))})},{onclose:e=>{e.remove(),t=null}}))},{skipInlineCount:!0,title:"Settings",disabled:this.disabled,icon:"Settings"});this.root.appendChild(s.root)}e.LX.doAsync(this.onResize.bind(this))}}e.LX.FileInput=T;class A extends a{data;formData={};primaryButton;constructor(t,s,o,n={}){if(s.constructor!=Object)return void console.error("Form data must be an Object");n.hideName=!0,super(e.ComponentType.FORM,t,null,n),this.onGetValue=()=>this.formData,this.onSetValue=(t,s,o)=>{this.formData=t;const n=i.querySelectorAll(".lexcomponent");for(let o=0;o<n.length;++o){if(n[o].jsInstance.type!=e.ComponentType.TEXT)continue;let i=n[o].querySelector(".lexcomponentname").innerText,r=n[o].querySelector(".lextext input");r.value=t[i]??"",a._dispatchEvent(r,"focusout",s)}};let i=document.createElement("div");i.className="flex flex-col gap-1",i.style.width="100%",this.root.appendChild(i);for(let t in s){let o=s[t];if(o.constructor!=Object){const n=e.LX.deepCopy(o);o={value:n},s[t]=o}if(o.width="100%",o.placeholder=o.placeholder??o.label??`Enter ${t}`,o.ignoreValidation=!0,!n.skipLabels){const e=new h(null,o.label??t,null,{disabled:!0,inputClass:"formlabel text-xs bg-none text-muted-foreground"});i.appendChild(e.root)}o.textComponent=new h(null,o.constructor==Object?o.value:o,(e,s)=>{this.formData[t]=e,o.submit&&s?.constructor===KeyboardEvent&&this.submit()},o),i.appendChild(o.textComponent.root),this.formData[t]=o.constructor==Object?o.value:o}const l=e.LX.makeContainer(["100%","auto"],"flex flex-row mt-2","",i);if(n.secondaryActionName||n.secondaryActionCallback){const e=new r(null,n.secondaryActionName??"Cancel",(e,t)=>{n.secondaryActionCallback&&n.secondaryActionCallback(this.formData,t)},{width:"100%",minWidth:"0",buttonClass:n.secondaryButtonClass??"secondary"});l.appendChild(e.root)}this.primaryButton=new r(null,n.primaryActionName??"Submit",(t,n)=>{this.syncInputs();const i=[];for(let t in s){let o=s[t];const n=o.pattern,a=n?.fieldMatchName?this.formData[n.fieldMatchName]:void 0;if(!o.textComponent.valid(void 0,a)){const s={entry:t,type:"input_not_valid",messages:[]};n&&(s.messages=e.LX.validateValueAtPattern(this.formData[t],n,a)),i.push(s)}}o&&o(this.formData,i,n)},{width:"100%",minWidth:"0",buttonClass:n.primaryButtonClass??"primary"}),l.appendChild(this.primaryButton.root),n.skipEnterSubmit||this.root.addEventListener("keydown",e=>{if("Enter"!==e.key||e.shiftKey)return;"TEXTAREA"!==e.target.tagName&&(e.preventDefault(),this.submit())}),this.data=s}submit(){this.syncInputs(),this.primaryButton?.click()}syncInputs(){for(const e in this.data){const t=this.data[e].textComponent;t instanceof h&&(t.syncFromDOM(),this.formData[e]=t.value())}}}e.LX.Form=A;class X extends a{setLayers;constructor(t,s,o,i={}){super(e.ComponentType.LAYERS,t,s,i),this.onGetValue=()=>s,this.onSetValue=(e,i,a)=>{s=e,this.setLayers(s),i||this._trigger(new n(t,s,a),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=`calc( 100% - ${t})`};const a=e.LX.makeElement("div","lexlayers grid","",this.root),r=i.maxBits??16;this.setLayers=e=>{a.innerHTML="";let t=e.toString(2),s=t.length;for(let e=0;e<r-s;++e)t="0"+t;for(let s=0;s<r;++s){let o=document.createElement("button");if(o.className="lexlayer size-6 text-secondary-foreground text-center content-center place-self-center cursor-pointer font-semibold text-xs rounded-lg select-none \n disabled:pointer-events-none disabled:opacity-50",o.disabled=this.disabled,null!=e){const e=t[r-s-1];null!=e&&"1"==e&&o.classList.add("selected")}o.innerText=s+1,o.title="Bit "+s+", value "+(1<<s),a.appendChild(o),o.addEventListener("click",t=>{t.stopPropagation(),t.stopImmediatePropagation(),t.target.classList.toggle("selected");const o=e^1<<s;this.set(o,!1,t)})}},this.setLayers(s),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Layers=X;class z extends a{_updateValues;constructor(t,s,o,i,a={}){super(e.ComponentType.LIST,t,o,a),this.onGetValue=()=>o,this.onSetValue=(e,a,l)=>{r.querySelectorAll(".lexlistitem").forEach(e=>e.classList.remove("selected"));let c=null;for(let t=0;t<s.length;++t){const o=s[t];if(o==e||o.constructor==Array&&o[0]==e){c=t;break}}c?(r.children[c].classList.toggle("selected"),o=e,a||this._trigger(new n(t,e,l),i)):console.error(`Cannot find item ${e} in List.`)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";r.style.width=`calc( 100% - ${t})`},this._updateValues=a=>{s=a,r.innerHTML="";for(let a=0;a<s.length;++a){let l=null,c=s[a];c.constructor===Array&&(l=c[1],c=c[0]);let d=document.createElement("button");d.className="lexlistitem disabled:pointer-events-none disabled:opacity-50 "+(o==c?"selected":""),d.disabled=this.disabled,l&&d.appendChild(e.LX.makeIcon(l)),d.innerHTML+=`<span>${c}</span>`,d.addEventListener("click",e=>{r.querySelectorAll(".lexlistitem").forEach(e=>e.classList.remove("selected")),d.classList.toggle("selected"),o=c,this._trigger(new n(t,c,e),i)}),r.appendChild(d)}};let r=document.createElement("div");r.className="bg-background flex flex-col gap-1 rounded-xl border-color p-2",this.root.appendChild(r),this._updateValues(s),e.LX.doAsync(this.onResize.bind(this))}}e.LX.List=z;class P{x;y;constructor(e,t){this.x=e??0,this.y=t??e??0}get xy(){return[this.x,this.y]}get yx(){return[this.y,this.x]}set(e,t){this.x=e,this.y=t}add(e,t=new P){return t.set(this.x+e.x,this.y+e.y),t}sub(e,t=new P){return t.set(this.x-e.x,this.y-e.y),t}mul(e,t=new P){return e.constructor==Number&&(e=new P(e)),t.set(this.x*e.x,this.y*e.y),t}div(e,t=new P){return e.constructor==Number&&(e=new P(e)),t.set(this.x/e.x,this.y/e.y),t}abs(e=new P){return e.set(Math.abs(this.x),Math.abs(this.y)),e}dot(e){return this.x*e.x+this.y*e.y}len2(){return this.dot(this)}len(){return Math.sqrt(this.len2())}nrm(e=new P){return e.set(this.x,this.y),e.mul(1/this.len(),e)}dst(e){return e.sub(this).len()}clp(t,s,o=new P){return o.set(e.LX.clamp(this.x,t,s),e.LX.clamp(this.y,t,s)),o}fromArray(e){this.x=e[0],this.y=e[1]}toArray(){return this.xy}}e.LX.vec2=P;class N{static COLORS=[[255,0,0],[0,255,0],[0,0,255],[0,128,128],[128,0,128],[128,128,0],[255,128,0],[255,0,128],[0,128,255],[128,0,255]];static GRID_SIZE=64;canvas;imageCanvas=null;root;circular;showNames;size;points;callback;weights=[];weightsObj={};currentPosition=new P(0,0);circleCenter=[0,0];circleRadius=1;margin=8;dragging=!1;_valuesChanged=!0;_selectedPoint=null;_precomputedWeightsGridSize=0;_precomputedWeights=null;constructor(t,s,o={}){this.circular=o.circular??!1,this.showNames=o.showNames??!0,this.size=o.size??[200,200],this.points=t??[],this.callback=s,this._valuesChanged=!0,this._selectedPoint=null,this.root=e.LX.makeContainer(["auto","auto"]),this.root.tabIndex="1",this.root.addEventListener("mousedown",function(e){var t=n.root.ownerDocument;return t.addEventListener("mouseup",a),t.addEventListener("mousemove",i),e.stopPropagation(),e.preventDefault(),n.dragging=!0,!0});const n=this;function i(t){if(!n.dragging)return;const s=n.margin,o=n.root.getBoundingClientRect();let i=new P;i.set(t.x-o.x-.5*n.size[0],t.y-o.y-.5*n.size[1]);var a=n.currentPosition;if(a.set(e.LX.clamp(i.x/(.5*n.size[0]-s),-1,1),e.LX.clamp(i.y/(.5*n.size[1]-s),-1,1)),n.circular){const e=new P(0,0);a.dst(e)>1&&(a=a.nrm())}return n.renderToCanvas(n.canvas.getContext("2d",{willReadFrequently:!0})),n.computeWeights(a),n.callback&&n.callback(n.weightsObj,n.weights,a),!0}function a(e){n.dragging=!1;var t=n.root.ownerDocument;t.removeEventListener("mouseup",a),t.removeEventListener("mousemove",i)}this.canvas=document.createElement("canvas"),this.canvas.width=this.size[0],this.canvas.height=this.size[1],this.root.appendChild(this.canvas);const r=this.canvas.getContext("2d",{willReadFrequently:!0});this.renderToCanvas(r)}computeWeights(e){if(!this.points.length)return;let t=this._precomputedWeights;t&&!this._valuesChanged||(t=this.precomputeWeights());let s=this.weights;s.length=this.points.length;for(var o=0;o<s.length;++o)s[o]=0;const n=N.GRID_SIZE;let i=0,a=new P;for(var r=0;r<n;++r)for(var l=0;l<n;++l){a.set(l/n*2-1,r/n*2-1);var c=2*l+r*n*2,d=t[c];e.dst(a)<t[c+1]+.001&&(s[d]+=1,i++)}for(o=0;o<s.length;++o)s[o]/=i,this.weightsObj[this.points[o].name]=s[o];return s}precomputeWeights(){this._valuesChanged=!1;const e=this.points.length,t=N.GRID_SIZE,s=2*t*t;let o=new P;this._precomputedWeights&&this._precomputedWeights.length==s||(this._precomputedWeights=new Float32Array(s));let n=this._precomputedWeights;this._precomputedWeightsGridSize=t;for(let s=0;s<t;++s)for(let i=0;i<t;++i){let a=-1,r=1e5;for(let n=0;n<e;++n){o.set(i/t*2-1,s/t*2-1);let e=new P;e.fromArray(this.points[n].pos);let l=o.dst(e);l>r||(a=n,r=l)}n[2*i+2*s*t]=a,n[2*i+2*s*t+1]=r}return n}precomputeWeightsToImage(e){if(!this.points.length)return null;const t=N.GRID_SIZE;var s=this._precomputedWeights;s&&!this._valuesChanged&&this._precomputedWeightsGridSize==t||(s=this.precomputeWeights());var o=this.imageCanvas;o||(o=this.imageCanvas=document.createElement("canvas")),o.width=o.height=t;var n=o.getContext("2d",{willReadFrequently:!0});if(!n)return;var i=this.weights;i.length=this.points.length;for(var a=0;a<i.length;++a)i[a]=0;let r=0,l=n.getImageData(0,0,t,t),c=new P;for(var d=0;d<t;++d)for(var h=0;h<t;++h){c.set(h/t*2-1,d/t*2-1);const o=4*h+d*t*4,n=2*h+d*t*2,a=s[n],p=N.COLORS[a%N.COLORS.length];var u=e.dst(c)<s[n+1]+.001;u&&(i[a]+=1,r++),l.data[o]=p[0]+(u?128:0),l.data[o+1]=p[1]+(u?128:0),l.data[o+2]=p[2]+(u?128:0),l.data[o+3]=255}for(let e=0;e<i.length;++e)i[e]/=r;return n.putImageData(l,0,0),o}addPoint(t,s=null){if(this.findPoint(t))return void console.warn("CanvasMap2D.addPoint: There is already a point with that name");s||(s=[this.currentPosition.x,this.currentPosition.y]),s[0]=e.LX.clamp(s[0],-1,1),s[1]=e.LX.clamp(s[1],-1,1);const o={name:t,pos:s};return this.points.push(o),this._valuesChanged=!0,o}removePoint(e){const t=this.points.findIndex(t=>t.name==e);t>-1&&(this.points.splice(t,1),this._valuesChanged=!0)}findPoint(e){return this.points.find(t=>t.name==e)}clear(){this.points.length=0,this._precomputedWeights=null,this._selectedPoint=null}renderToCanvas(t){if(!t)return;const s=this.margin,o=this.size[0],n=this.size[1];t.fillStyle="black",t.strokeStyle="#BBB",t.clearRect(0,0,o,n),this.circular?(this.circleCenter[0]=.5*o,this.circleCenter[1]=.5*n,this.circleRadius=.5*n-s,t.lineWidth=1,t.beginPath(),t.arc(this.circleCenter[0],this.circleCenter[1],this.circleRadius,0,2*Math.PI),t.fill(),t.stroke(),t.beginPath(),t.moveTo(this.circleCenter[0]+.5,this.circleCenter[1]-this.circleRadius),t.lineTo(this.circleCenter[0]+.5,this.circleCenter[1]+this.circleRadius),t.moveTo(this.circleCenter[0]-this.circleRadius,this.circleCenter[1]),t.lineTo(this.circleCenter[0]+this.circleRadius,this.circleCenter[1]),t.stroke()):(t.fillRect(s,s,o-2*s,n-2*s),t.strokeRect(s,s,o-2*s,n-2*s));var i=this.precomputeWeightsToImage(this.currentPosition);i&&(t.globalAlpha=.5,t.imageSmoothingEnabled=!1,this.circular?(t.save(),t.beginPath(),t.arc(this.circleCenter[0],this.circleCenter[1],this.circleRadius,0,2*Math.PI),t.clip(),t.drawImage(i,this.circleCenter[0]-this.circleRadius,this.circleCenter[1]-this.circleRadius,2*this.circleRadius,2*this.circleRadius),t.restore()):t.drawImage(i,s,s,o-2*s,n-2*s),t.imageSmoothingEnabled=!0,t.globalAlpha=1);for(let i=0;i<this.points.length;++i){const a=this.points[i];let r=.5*a.pos[0]+.5,l=.5*a.pos[1]+.5;r=r*(o-2*s)+s,l=l*(n-2*s)+s,r=e.LX.clamp(r,s,o-s),l=e.LX.clamp(l,s,n-s),t.fillStyle=a==this._selectedPoint?"#CDF":"#BCD",t.beginPath(),t.arc(r,l,3,0,2*Math.PI),t.fill(),this.showNames&&t.fillText(a.name,r+5,l+5)}t.fillStyle="white",t.beginPath();var a=.5*this.currentPosition.x+.5,r=.5*this.currentPosition.y+.5;a=a*(o-2*s)+s,r=r*(n-2*s)+s,a=e.LX.clamp(a,s,o-s),r=e.LX.clamp(r,s,n-s),t.arc(a,r,4,0,2*Math.PI),t.fill()}}e.LX.CanvasMap2D=N;class I extends a{map2d;_popover=null;constructor(t,s,o,n={}){super(e.ComponentType.MAP2D,t,null,n),this.onGetValue=()=>this.map2d.weightsObj,this.onSetValue=(e,t,s)=>{},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";i.style.width=`calc( 100% - ${t})`};var i=document.createElement("div");i.className="lexmap2d",this.root.appendChild(i),this.map2d=new N(s,o,n);const a=e.LX.makeIcon(n.mapIcon??"SquareMousePointer"),l=new r(null,"Open Map",()=>{this._popover=new y(l.root,[this.map2d])},{buttonClass:"outline justify-between",disabled:this.disabled});l.root.querySelector("button").appendChild(a),i.appendChild(l.root),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Map2D=I;class R{domEl;data;options;selected=[];_forceClose=!1;_callbacks={};constructor(e,t,s={}){if(this.domEl=e,this.data=t,this.options=s,t.constructor===Object)this._createItem(null,t);else for(let e of t)this._createItem(null,e)}_createItem(t,s,o=0,n){const i=this,a=this.domEl.querySelector(".lexnodetreefilter");if(s.children=s.children??[],a&&""!=a.value&&!s.id.includes(a.value)){for(var l=0;l<s.children.length;++l)this._createItem(s,s.children[l],o+1,n);return}const c=this.domEl.querySelector("ul");s.visible=s.visible??!0,s.parent=t;let d=s.children.length>0,h=this.selected.indexOf(s)>-1||s.selected;if(this.options.onlyFolders){let e=!1;s.children.forEach(t=>{e=e||"folder"==t.type}),d=!!e}let u=document.createElement("li");u.className=`lextreeitem inline-flex outline-none text-sm items-center h-7 cursor-pointer truncate rounded-lg select-none datalevel${o} ${d?"parent":""} ${h?" selected":""}`,u.id=e.LX.getSupportedDOMName(s.id),u.tabIndex="0",u.treeData=s,s.treeEl=u;let p=this.options.skipDefaultIcon??1?null:"Dot";if(d&&(p=s.closed?"Right":"Down"),p&&u.appendChild(e.LX.makeIcon(p,{iconClass:"hierarchy",svgClass:"sm"})),p=s.icon,p)if(s.icon.includes(".")){const e="https://raw.githubusercontent.com/jxarco/lexgui.js/master/";u.innerHTML+=`<img src="${e+s.icon}">`}else{const t=s.icon.split(" "),o=e.LX.makeIcon(t[0],{iconClass:"tree-item-icon mr-2",svgClass:"md"+(t.length>1?` ${t.slice(0).join(" ")}`:"")});u.appendChild(o)}u.innerHTML+=s.rename?"":s.id,u.style.paddingLeft=3+15*(o+1)+"px",c.appendChild(u);const m=t&&(s.metadata?.draggable??this.options.defaultDraggable??!0);m&&u.setAttribute("draggable","true"),u.addEventListener("click",e=>{if(f)return void(f=!1);e.shiftKey||(c.querySelectorAll("li").forEach(e=>{e.classList.remove("selected")}),this.selected.length=0);const t=this.selected.indexOf(s);if(u.classList.toggle("selected",-1==t),t>-1?this.selected.splice(t,1):this.selected.push(s),d&&s.id.length>1){s.closed=!1;const t=i._callbacks.caretChanged;if(void 0!==t){t({type:"caret",items:[s],domEvent:e,userInitiated:!0})}i.frefresh(s.id)}const o=i._callbacks.select;if(void 0!==o){o({type:"select",items:[s],result:this.selected,domEvent:e,userInitiated:!0})}}),u.addEventListener("dblclick",function(e){(i.options.rename??1)&&(s.rename=!0,i.refresh());const t=i._callbacks.dblClick;if(void 0!==t){t({type:"dbl_click",items:[s],domEvent:e,userInitiated:!0})}}),u.addEventListener("contextmenu",async t=>{t.preventDefault();const o=i._callbacks.contextMenu;if(!o)return;const n={type:"context_menu",items:this.selected,from:s,domEvent:t,userInitiated:!0},a=await o(n),r=this.selected.length>1,l=this.options.useDefaultContextMenuItems??!0;e.LX.addContextMenu(this.options.contextMenuTitle??(r?"Selected Nodes":s.id),t,e=>{if(a?.length){for(const t of a)e.add(t.name,{callback:t.callback});l&&e.add("")}l&&(e.add("Select Children",()=>{const e=t=>{if(!t.closed)for(let s of t.children??[]){if(!s)continue;this.domEl.querySelector("#"+s.id).classList.add("selected"),this.selected.push(s),e(s)}};this.domEl.querySelectorAll(".selected").forEach(e=>e.classList.remove("selected")),this.selected.length=0,e(s);const o=this._callbacks.select;if(void 0!==o){o({type:"select",items:[s],result:this.selected,domEvent:t,userInitiated:!0})}}),e.add("Delete",{callback:()=>{const e=this._callbacks.beforeDelete,t=this._callbacks.delete,o=(...e)=>{let o=[];this.selected.length?o.push(...i.deleteNodes(this.selected)):i.deleteNode(s)&&o.push(s),this.refresh();t&&t({type:"delete",items:o,userInitiated:!0},...e)};if(e){e({type:"delete",items:this.selected.length?this.selected:[s],userInitiated:!0},o)}else o()}}))})}),u.addEventListener("keydown",t=>{if(!s.rename)if(t.preventDefault(),"Delete"==t.key){const e=this._callbacks.beforeDelete,s=this._callbacks.delete,o=(...e)=>{const o=[];for(let e of this.selected)i.deleteNode(e)&&o.push(e);if(this.selected.length=0,this.refresh(),o.length){s&&s({type:"delete",items:o,domEvent:t,userInitiated:!0},...e)}};if(e){e({type:"delete",items:this.selected,domEvent:t,userInitiated:!0},o)}else o()}else if("ArrowUp"==t.key||"ArrowDown"==t.key){var o=this.selected.length>1?"ArrowUp"==t.key?this.selected.shift():this.selected.pop():this.selected[0],n=this.domEl.querySelector("#"+e.LX.getSupportedDOMName(o.id)),a="ArrowUp"==t.key?n.previousSibling:n.nextSibling;a&&a.click()}});const g=document.createElement("input");g.toggleAttribute("hidden",!s.rename),g.className="text-foreground bg-none text-sm border-none outline-none",g.value=s.id,u.appendChild(g),s.rename&&(u.classList.add("selected"),g.focus()),g.addEventListener("keyup",function(t){if("Enter"==t.key){const t=i._callbacks.beforeRename,o=i._callbacks.rename,n=s.id;this.value=this.value.replace(/\s/g,"_");const a=(...t)=>{s.id=e.LX.getSupportedDOMName(this.value),delete s.rename,i.frefresh(s.id),c.querySelector(`#${s.id}`).classList.add("selected");const a={type:"rename",items:[s],oldName:n,newName:this.value,userInitiated:!0};o&&o(a,...t)};if(t){t({type:"rename",items:[s],oldName:n,newName:this.value,userInitiated:!0},a)}else a()}else"Escape"==t.key&&(delete s.rename,i.frefresh(s.id))}),g.addEventListener("blur",function(e){delete s.rename,i.refresh()}),m&&u.addEventListener("dragstart",e=>{window.__tree_node_dragged=s}),u.addEventListener("dragover",e=>{e.preventDefault()},!1),u.addEventListener("dragenter",e=>{e.target.classList.add("draggingover")}),u.addEventListener("dragend",e=>{e.target.classList.remove("draggingover")}),u.addEventListener("dragleave",e=>{e.target.classList.remove("draggingover")}),u.addEventListener("drop",e=>{e.preventDefault();let t=window.__tree_node_dragged;if(!t)return t=window.__av_item_dragged,void(t&&(t._nodeTarget=s));e.target.classList.remove("draggingover");let o=s;if(t.id==o.id)return void console.warn("Cannot parent node to itself!");const n=function(e,t){var s=!1;for(var o of t.children){if(o.id==e.id)return!0;s=s||n(e,o)}return s};if(n(o,t))return void console.warn("Cannot parent node to a current child!");const a=this._callbacks.beforeMove,r=this._callbacks.move,l=(...s)=>{const n=t.parent.children.findIndex(e=>e.id==t.id),a=t.parent.children.splice(n,1);o.children.push(a[0]),i.refresh(),delete window.__tree_node_dragged;r&&r({type:"move",items:[t],to:o,domEvent:e,userInitiated:!0},...s)};if(a){a({type:"move",items:[t],to:o,domEvent:e,userInitiated:!0},l)}else l()});let f=!1;d&&u.querySelector("a.hierarchy").addEventListener("click",function(e){if(f=!0,e.stopImmediatePropagation(),e.stopPropagation(),e.altKey){const e=function(t){for(var s of(t.closed=!t.closed,t.children))e(s)};e(s)}else s.closed=!s.closed;const t=i._callbacks.caretChanged;if(void 0!==t){t({type:"caret",items:[s],domEvent:e,userInitiated:!0})}i.frefresh(s.id)});const L=e.LX.makeElement("div","flex flex-row ml-auto mr-2");if(u.appendChild(L),s.actions)for(let e=0;e<s.actions.length;++e){const t=s.actions[e],o=new r(null,"",(e,o)=>{o.stopPropagation(),t.callback&&t.callback(s,e,o)},{icon:t.icon,swap:t.swap,title:t.name,hideName:!0,className:"p-0 min-h-fit",buttonClass:"px-0 h-full bg-none"});L.appendChild(o.root)}if(!s.skipVisibility){const e=new r(null,"",(e,t)=>{t.stopPropagation(),s.visible=void 0!==s.visible&&!s.visible;const o=this._callbacks.visibleChanged;if(void 0!==o){o({type:"visibility",items:[s],domEvent:t,userInitiated:!0})}},{icon:s.visible?"Eye":"EyeOff",swap:s.visible?"EyeOff":"Eye",title:"Toggle visible",className:"p-0 min-h-fit",buttonClass:"px-0 h-full bg-none"});L.appendChild(e.root)}const y=function(e,t){if(e.id==t)return!0;let s=!1;for(var o of e?.children??[])s=s||y(o,t);return s},b=y(s,n);if(!s.closed||b)for(l=0;l<s.children.length;++l){let e=s.children[l];this.options.onlyFolders&&"folder"!=e.type||this._createItem(s,e,o+1,n)}}refresh(e,t){if(this.data=e??this.data,this.domEl.querySelector("ul").innerHTML="",this.data.constructor===Object)this._createItem(null,this.data,0,t);else for(let e of this.data)this._createItem(null,e,0,t)}frefresh(e){this.refresh();var t=this.domEl.querySelector(`#${e}`);t&&t.focus()}select(t,s){const o=this.domEl.querySelector(".lexnodetreefilter");if(o&&(o.value=""),this.refresh(null,t),this.domEl.querySelectorAll(".selected").forEach(e=>e.classList.remove("selected")),void 0===t){if(void 0===s)return void(this.selected.length=0);t=s.at(-1)}let n=null;if(void 0!==s){let e=this.data;for(const t of s){const s=e.children.find(e=>e.id===t);if(!s)break;e=s}n=e.treeEl,console.assert(n,"NodeTree: No domEl in item "+t)}else void 0!==t&&(n=this.domEl.querySelector("#"+e.LX.getSupportedDOMName(t)),console.assert(n,"NodeTree: Can't select node "+t));n||console.assert(n,"NodeTree: Can't select node "+t),n.classList.add("selected"),this.selected=[n.treeData],n.focus()}deleteNodes(e){const t=[];for(const s of e)this.deleteNode(s)&&t.push(s);return t}deleteNode(e){const t=this.data.constructor===Array;if(e.parent){let t=e.parent.children;const s=t.indexOf(e);t.splice(s,1)}else{if(!t)return console.warn("NodeTree: Can't delete root node from object data!"),!1;{const t=this.data.indexOf(e);console.assert(t>-1,"NodeTree: Can't delete root node "+e.id+" from data array!"),this.data.splice(t,1)}}return!0}}e.LX.NodeTree=R;class D extends a{innerTree;constructor(t,s,o={}){o.hideName=!0,super(e.ComponentType.TREE,t,null,o);let n=e.LX.makeElement("div","lextree p-1 rounded-lg w-full my-0 mx-auto font-medium text-sm min-h-3","",this.root);t&&e.LX.makeElement("span","block p-1 select-none text-base font-medium whitespace-nowrap",t,n);let i=e.LX.makeElement("div","lextreetools flex items-center bg-secondary px-2 rounded-lg gap-2 my-1");if(t||(i.className+=" notitle"),o.icons)for(let t of o.icons){const s=e.LX.makeIcon(t.icon,{title:t.name});s.addEventListener("click",t.callback),i.appendChild(s)}o.filter=o.filter??!0;let a=null;if(o.filter){a=document.createElement("input"),a.className="lexnodetreefilter",a.setAttribute("placeholder","Filter.."),a.style.width="100%",a.addEventListener("input",()=>{this.innerTree.refresh()});let t=e.LX.makeIcon("Search");i.appendChild(a),i.appendChild(t)}(o.icons||o.filter)&&n.appendChild(i);let r=e.LX.makeElement("ul","flex flex-col gap-1 ps-0");r.addEventListener("contextmenu",function(e){e.preventDefault()}),n.appendChild(r),this.innerTree=new R(n,s,o)}on(e,t){this.innerTree._callbacks[e]=t}}e.LX.Tree=D;class O extends a{constructor(t,s,o,i={}){const a=i.pattern??"xxx-xxx",r=(a.match(/x/g)||[]).length;(s=String(s)).length||(s="x".repeat(r)),super(e.ComponentType.OTP,t,s,i),this.onGetValue=()=>+s,this.onSetValue=(e,i,a)=>{d(s=e),i||this._trigger(new n(t,e,a),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=`calc( 100% - ${t})`};const l=document.createElement("div");l.className="lexotp flex flex-row items-center",this.root.appendChild(l);const c=a.split("-"),d=t=>{l.innerHTML="";let s=0,o=0;for(let n=0;n<c.length;++n){const i=c[n];for(let n=0;n<i.length;++n){let a=t[s++];a="x"==a?"":a;const r=e.LX.makeContainer(["36px","30px"],"lexotpslot border-t-color border-b-color border-l-color px-3 cursor-text select-none font-medium outline-none",a,l);r.tabIndex="1",this.disabled&&r.classList.add("disabled");const c=s;0==n?r.className+=" rounded-l":n==i.length-1&&(r.className+=" rounded-r border-r-color"),r.addEventListener("click",()=>{if(this.disabled)return;l.querySelectorAll(".lexotpslot").forEach(e=>e.classList.remove("active"));const e=l.querySelectorAll(".lexotpslot")[o];e.classList.add("active"),e.focus()}),r.addEventListener("blur",()=>{this.disabled||e.LX.doAsync(()=>{l.contains(document.activeElement)||l.querySelectorAll(".lexotpslot").forEach(e=>e.classList.remove("active"))},10)}),r.addEventListener("keyup",e=>{if(!this.disabled)if(/[^0-9]+/g.test(e.key))if("ArrowLeft"==e.key||"ArrowRight"==e.key){const t="ArrowLeft"==e.key?-1:1,s=l.querySelectorAll(".lexotpslot")[o+t];s&&(l.querySelectorAll(".lexotpslot")[o].classList.remove("active"),s.classList.add("active"),s.focus(),o+=t)}else"Enter"!=e.key||t.includes("x")||this.set(t);else{const s=e.key;console.assert(!Number.isNaN(parseInt(s))),r.innerHTML=s,t=t.substring(0,c-1)+s+t.substring(c);const n=l.querySelectorAll(".lexotpslot")[o+1];n?(l.querySelectorAll(".lexotpslot")[o].classList.remove("active"),n.classList.add("active"),n.focus(),o++):this.set(t)}})}n<c.length-1&&e.LX.makeContainer(["auto","auto"],"mx-2","-",l)}console.assert(s==t.length,"OTP Value/Pattern Mismatch!")};d(s)}}e.LX.OTPInput=O;class H extends a{constructor(t,s,o,i={}){super(e.ComponentType.PAD,t,null,i),this.onGetValue=()=>l.value.xy,this.onSetValue=(e,s,i)=>{l.value.set(e[0],e[1]),c(l.value),s||this._trigger(new n(t,l.value.xy,i),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=`calc( 100% - ${t})`};let a=document.createElement("div");a.className="lexpad",this.root.appendChild(a);let r=document.createElement("div");r.id="lexpad-"+t,r.className="lexinnerpad data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 border-color",r.style.width=i.padSize??"96px",r.style.height=i.padSize??"96px",r.dataset.disabled=this.disabled.toString(),a.appendChild(r);let l=document.createElement("div");l.className="lexpadthumb opacity-inherit",l.value=new P(s[0],s[1]),l.min=i.min??0,l.max=i.max??1,r.appendChild(l);let c=t=>{const[s,o]=[r.offsetWidth,r.offsetHeight],n=new P(e.LX.remapRange(t.x,l.min,l.max,0,1),e.LX.remapRange(t.y,l.min,l.max,0,1));l.style.transform=`translate(calc( ${s*n.x}px - 50% ), calc( ${o*n.y}px - 50%)`};r.addEventListener("mousedown",function(e){if(document.activeElement==l)return;var t=d.root.ownerDocument;t.addEventListener("mousemove",h),t.addEventListener("mouseup",u),document.body.classList.add("nocursor"),document.body.classList.add("noevents"),e.stopImmediatePropagation(),e.stopPropagation(),l.classList.add("active"),i.onPress&&i.onPress.bind(l)(e,l)});let d=this;function h(s){const i=r.getBoundingClientRect(),a=new P(s.x-i.x,s.y-i.y);a.clp(0,r.offsetWidth,a);const[c,h]=[r.offsetWidth,r.offsetHeight],u=a.div(new P(r.offsetWidth,r.offsetHeight));l.style.transform=`translate(calc( ${c*u.x}px - 50% ), calc( ${h*u.y}px - 50%)`,l.value=new P(e.LX.remapRange(u.x,0,1,l.min,l.max),e.LX.remapRange(u.y,0,1,l.min,l.max)),d._trigger(new n(t,l.value.xy,s),o),s.stopPropagation(),s.preventDefault()}function u(e){var t=d.root.ownerDocument;t.removeEventListener("mousemove",h),t.removeEventListener("mouseup",u),document.body.classList.remove("nocursor"),document.body.classList.remove("noevents"),l.classList.remove("active"),i.onRelease&&i.onRelease.bind(l)(e,l)}e.LX.doAsync(()=>{this.onResize(),c(l.value)})}}e.LX.Pad=H;class B extends a{constructor(t,s,o={}){super(e.ComponentType.PROGRESS,t,s,o),this.onGetValue=()=>a.value,this.onSetValue=(s,i,l)=>{s=e.LX.clamp(s,a.min,a.max),this.root.querySelector("meter").value=s,r(),this.root.querySelector("span")&&(this.root.querySelector("span").innerText=s),i||this._trigger(new n(t,s,l),o.callback)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";i.style.width=`calc( 100% - ${t})`};const i=e.LX.makeElement("div","flex justify-center items-center gap-2","",this.root);let a=e.LX.makeElement("meter","lexprogressbar outline-none rounded-lg select-none");a.id="lexprogressbar-"+t,a.step="any",a.min=o.min??0,a.max=o.max??1,a.low=o.low??a.low,a.high=o.high??a.high,a.optimum=o.optimum??a.optimum,a.value=s,i.appendChild(a);const r=()=>{let t=e.LX.getCSSVariable("color-blue-500");null!=a.low&&a.value<a.low?t=e.LX.getCSSVariable("destructive"):null!=a.high&&a.value<a.high&&(t=e.LX.getCSSVariable("warning")),a.style.background=`color-mix(in srgb, ${t} 20%, transparent)`};if(o.showValue){const o=document.getElementById("progressvalue-"+t);o&&o.remove(),e.LX.makeElement("span","w-12 flex-auto-keep text-center",s,i).id="progressvalue-"+t}if(o.editable){a.classList.add("editable");let t=t=>{var n=this.root.ownerDocument;n.addEventListener("mousemove",s),n.addEventListener("mouseup",o),document.body.classList.add("noevents"),a.classList.add("grabbing"),t.stopImmediatePropagation(),t.stopPropagation();const i=a.getBoundingClientRect(),r=e.LX.round(e.LX.remapRange(t.offsetX,0,i.width,a.min,a.max));this.set(r,!1,t)},s=t=>{if(0!=t.movementX){const s=a.getBoundingClientRect(),o=e.LX.round(e.LX.remapRange(t.offsetX-s.x,0,s.width,a.min,a.max));this.set(o,!1,t)}t.stopPropagation(),t.preventDefault()},o=e=>{var t=this.root.ownerDocument;t.removeEventListener("mousemove",s),t.removeEventListener("mouseup",o),document.body.classList.remove("noevents"),a.classList.remove("grabbing")};a.addEventListener("mousedown",t)}r(),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Progress=B;class $ extends a{constructor(t,s,o,i,a={}){super(e.ComponentType.RADIO,t,null,a);let r=null;this.onGetValue=()=>{const e=l.querySelectorAll("button");return r?[r,e[r]]:void 0},this.onSetValue=(e,t,s)=>{e=e[0]??e,console.assert(e.constructor==Number,"RadioGroup _value_ must be an Array index!");const a=l.querySelectorAll("button");a.forEach(e=>{e.checked=!1,e.classList.remove("checked")});const r=a[e];r.checked=!r.checked,r.classList.toggle("checked"),t||this._trigger(new n(null,[e,o[e]],s),i)};var l=document.createElement("div");l.className=e.LX.mergeClass("lexradiogroup flex flex-col",a.className),this.root.appendChild(l),e.LX.makeElement("span","font-medium mb-2",s,l);for(let e=0;e<o.length;++e){const t=document.createElement("div");t.className="lexradiogroupitem flex items-center gap-2 px-6 py-1",l.appendChild(t);const s=document.createElement("button");s.className="flex p-0 rounded-lg cursor-pointer",s.disabled=this.disabled,t.appendChild(s),s.addEventListener("click",t=>{this.set(e,!1,t)});const n=document.createElement("span");s.appendChild(n);const i=document.createElement("span");i.innerHTML=o[e],t.appendChild(i)}a.selected&&(console.assert(a.selected.constructor==Number,"RadioGroup _selected_ must be an Array index!"),r=a.selected,this.set(r,!0))}}e.LX.RadioGroup=$;class V extends a{_maxSlider=null;_labelTooltip=null;setLimits;constructor(t,s,o,i={}){const r=e.LX.deepCopy(s);super(e.ComponentType.RANGE,t,e.LX.deepCopy(r),i);const l=s.constructor==Array&&2==s.length;l&&(s=r[0],i.fill=!1),this.onGetValue=()=>{let e=s;return l?e=[s,r[1]]:i.left&&(e=+d.max-s+ +d.min),e},this.onSetValue=(a,h,u)=>{let p="";const m=i.max-i.min;if(l&&this._maxSlider){d.value=s=e.LX.clamp(+a[0],+d.min,+d.max),this._maxSlider.value=r[1]=e.LX.clamp(+a[1],+d.min,+d.max);const t=s/m-.5,o=r[1]/m-.5,n=e.LX.remapRange(s,i.min,i.max,0,1),l=e.LX.remapRange(r[1],i.min,i.max,0,1);d.style.setProperty("--range-min-value",100*n+"%"),d.style.setProperty("--range-max-value",100*l+"%"),d.style.setProperty("--range-fix-min-offset",-t+"rem"),d.style.setProperty("--range-fix-max-offset",`${o}rem`),c.dataset.tooltipOffsetX=""+(c.offsetWidth*n+c.offsetWidth*(l-n)*.5-.5*c.offsetWidth),p=`${s} - ${r[1]}`}else{if(isNaN(a))return;d.value=s=e.LX.clamp(+a,+d.min,+d.max);const t=.5*e.LX.remapRange(s,i.min,i.max,0,1);c.dataset.tooltipOffsetX=""+(c.offsetWidth*t-.5*c.offsetWidth),p=`${s}`}if(c.dataset.tooltipContent=p,this._labelTooltip&&(this._labelTooltip.innerHTML=p),!h){let e=s;l?e=[s,r[1]]:i.left&&(e=+d.max-s+ +d.min),this._trigger(new n(t,e,u),o)}},this.onResize=t=>{const o=this.root.domName?.style.width??"0px";if(c.style.width=i.inputWidth??`calc( 100% - ${o})`,l){const t=i.max-i.min,o=s/t-.5,n=r[1]/t-.5;d.style.setProperty("--range-min-value",100*e.LX.remapRange(s,i.min,i.max,0,1)+"%"),d.style.setProperty("--range-max-value",100*e.LX.remapRange(r[1],i.min,i.max,0,1)+"%"),d.style.setProperty("--range-fix-min-offset",-o+"rem"),d.style.setProperty("--range-fix-max-offset",`${n}rem`)}};const c=document.createElement("div");c.className="lexrange relative py-3",this.root.appendChild(c);let d=document.createElement("input");if(d.className=e.LX.mergeClass("lexrangeslider"+(l?" range pointer-events-none":""),i.className),d.min=i.min??0,d.max=i.max??100,d.step=i.step??1,d.type="range",d.disabled=this.disabled,s.constructor==Number&&(s=e.LX.clamp(s,+d.min,+d.max)),i.left&&(s=+d.max-s+ +d.min,d.classList.add("left")),(i.fill??1)||d.classList.add("no-fill"),d.value=s,c.appendChild(d),d.addEventListener("input",e=>{this.set(l?[Math.min(e.target.valueAsNumber,r[1]),r[1]]:e.target.valueAsNumber,!1,e)},{passive:!1}),l||(d.addEventListener("mousedown",function(e){i.onPress&&i.onPress.bind(d)(e,d)},!1),d.addEventListener("mouseup",function(e){i.onRelease&&i.onRelease.bind(d)(e,d)},!1)),this.setLimits=(e,t,s)=>{d.min=e??d.min,d.max=t??d.max,d.step=s??d.step,a._dispatchEvent(d,"input",!0)},e.LX.doAsync(()=>{this.onResize();let t=0;if(l){const o=e.LX.remapRange(s,i.min,i.max,0,1),n=e.LX.remapRange(r[1],i.min,i.max,0,1);t=c.offsetWidth*o+c.offsetWidth*(n-o)*.5-.5*c.offsetWidth}else{const o=.5*e.LX.remapRange(s,i.min,i.max,0,1);t=c.offsetWidth*o-.5*c.offsetWidth}e.LX.asTooltip(c,`${s}${l?`- ${r[1]}`:""}`,{offsetX:t,callback:e=>{this._labelTooltip=e}})}),r.constructor==Array){let t=e.LX.makeElement("input",e.LX.mergeClass("lexrangeslider no-fill pointer-events-none overlap absolute left-0",i.className));t.min=i.min??0,t.max=i.max??100,t.step=i.step??1,t.type="range",t.disabled=this.disabled,this._maxSlider=t;let o=r[1];t.value=o=e.LX.clamp(o,+t.min,+t.max),c.appendChild(t),t.addEventListener("input",e=>{r[1]=Math.max(s,+e.target.valueAsNumber),this.set([s,r[1]],!1,e)},{passive:!1})}}}e.LX.RangeInput=V;class F extends a{constructor(t,s,o,i={}){const a=i.allowHalf??!1;a||(s=Math.floor(s)),super(e.ComponentType.RATE,t,s,i),this.onGetValue=()=>s,this.onSetValue=(e,i,a)=>{h(s=e),i||this._trigger(new n(t,e,a),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";r.style.width=`calc( 100% - ${t})`};const r=document.createElement("div");r.className="lexrate relative data-[disabled=true]:pointer-events-none",r.dataset.disabled=this.disabled.toString(),this.root.appendChild(r);const l=e.LX.makeContainer(["fit-content","auto"],"flex flex-row gap-1","",r),c=e.LX.makeContainer(["fit-content","auto"],"absolute top-0 flex flex-row gap-1 pointer-events-none","",r),d=e.LX.makeContainer(["fit-content","auto"],"absolute top-0 flex flex-row gap-1 pointer-events-none","",r);l.addEventListener("mousemove",e=>{const t=e.target,s=t.dataset.idx;if(void 0!==s){const o=t.getBoundingClientRect(),n=a&&e.offsetX<.5*o.width;h(s-(n?.5:0))}},!1),l.addEventListener("mouseleave",e=>{h(s)},!1);for(let t=0;t<5;++t){const s=e.LX.makeIcon("Star",{svgClass:"lg fill-current text-accent"});s.dataset.idx=t+1,l.appendChild(s),s.addEventListener("click",e=>{const t=e.target,s=t.getBoundingClientRect(),o=a&&e.offsetX<.5*s.width;this.set(parseFloat(t.dataset.idx)-(o?.5:0))},!1);const o=e.LX.makeIcon("Star",{svgClass:"lg fill-current text-yellow-400"});c.appendChild(o);const n=e.LX.makeIcon("StarHalf",{svgClass:"lg fill-current text-yellow-400"});d.appendChild(n)}const h=e=>{for(let t=0;t<5;++t){const s=e>t+.5,o=c.childNodes[t],n=d.childNodes[t];if(s)o.style.opacity=1;else{o.style.opacity=0;const s=a&&e>t;n.style.opacity=s?1:0}}};h(s),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Rate=F;class W extends a{constructor(t,s,o,n={}){super(e.ComponentType.SIZE,t,s,n),this.onGetValue=()=>{const e=[];for(let t=0;t<this.root.dimensions.length;++t)e.push(this.root.dimensions[t].value());return e},this.onSetValue=(e,t,s)=>{for(let s=0;s<this.root.dimensions.length;++s)this.root.dimensions[s].set(e[s],t)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";i.style.width=`calc( 100% - ${t})`},this.root.aspectRatio=2==s.length?s[0]/s[1]:null,this.root.dimensions=[];const i=e.LX.makeElement("div","flex","",this.root);for(let t=0;t<s.length;++t){const a=new e.LX.Panel;if(this.root.dimensions[t]=a.addNumber(null,s[t],e=>{const s=this.value();if(this.root.locked){const o=0==t?1/this.root.aspectRatio:this.root.aspectRatio,n=(1+t)%2;s[n]=e*o,this.root.dimensions[n].set(s[n],!0)}o&&o(s)},{min:0,disabled:this.disabled,precision:n.precision,className:"flex-auto-fill"}),i.appendChild(this.root.dimensions[t].root),t+1!=s.length){const t=e.LX.makeIcon("X",{svgClass:"text-foreground font-bold"});i.appendChild(t)}}if(n.units&&e.LX.makeElement("span","text-muted-foreground align-center content-center font-medium flex-auto-keep select-none",n.units,i),this.root.aspectRatio){const e=new r(null,"",e=>{if(this.root.locked=e,e){const e=this.value();this.root.aspectRatio=e[0]/e[1]}},{title:"Lock Aspect Ratio",icon:"LockOpen",swap:"Lock",className:"flex-auto-keep",buttonClass:"h-auto bg-none p-0"});i.appendChild(e.root)}e.LX.doAsync(this.onResize.bind(this))}}e.LX.SizeInput=W;class q{static ITEMS_PER_PAGE_VALUES=[8,12,24,48,96];root;pagesRoot;page=1;pages=1;_alwaysShowEdges=!0;_useEllipsis=!0;_maxButtons=3;_itemsPerPage=12;_itemsPerPageValues=q.ITEMS_PER_PAGE_VALUES;onChange=()=>{};onItemsPerPageChange=()=>{};constructor(t={}){if(this.pages=t.pages??1,this.page=e.LX.clamp(t.page??1,1,this.pages),this._alwaysShowEdges=t.alwaysShowEdges??this._alwaysShowEdges,this._useEllipsis=t.useEllipsis??this._useEllipsis,this._maxButtons=t.maxButtons??this._maxButtons,this._itemsPerPage=t.itemsPerPage??this._itemsPerPage,-1===this._itemsPerPageValues.indexOf(this._itemsPerPage)&&(this._itemsPerPageValues.push(this._itemsPerPage),this._itemsPerPageValues=this._itemsPerPageValues.sort((e,t)=>e<t?-1:e>t?1:0)),"function"==typeof t.onChange&&(this.onChange=t.onChange),"function"==typeof t.onItemsPerPageChange&&(this.onItemsPerPageChange=t.onItemsPerPageChange),this.root=e.LX.makeContainer(["auto","auto"],e.LX.mergeClass("flex flex-row gap-2",t.className)),t.allowChangeItemsPerPage){const t=e.LX.makeContainer(["auto","auto"],"flex flex-row items-center","",this.root),s=new u(null,q.ITEMS_PER_PAGE_VALUES,this._itemsPerPage,e=>{this._itemsPerPage=e,this.onItemsPerPageChange?.(this._itemsPerPage)},{overflowContainer:null});t.appendChild(s.root)}this.pagesRoot=e.LX.makeContainer(["auto","auto"],"flex flex-row overflow-scroll","",this.root),this.refresh()}setPage(t){const s=e.LX.clamp(t,1,this.pages);s!==this.page&&(this.page=s,this.refresh(),this._emitChange())}setPages(e){this.pages=Math.max(1,e),this.page>this.pages&&(this.page=this.pages),this.refresh()}next(){this.setPage(this.page+1)}prev(){this.setPage(this.page-1)}refresh(){this.pagesRoot.innerHTML="",this._makeButton(e.LX.makeIcon("ChevronLeft").innerHTML,1===this.page,()=>this.prev(),"bg-none "+(1===this.page?"":"hover:bg-secondary"));const t=e.LX.makeContainer(["auto","auto"],"flex flex-row items-center","",this.pagesRoot),s=this._maxButtons+2;if(this.pages<=s)for(let e=1;e<=this.pages;e++)this._makePageButton(t,e);else{const o=this.page,n=this.pages,i=1,a=n,r=this._alwaysShowEdges?1:0,l=s-2,c=Math.floor(l/2);let d=Math.max(1+r,o-c),h=Math.min(n-r,o+c);d<=2&&(d=1+r,h=d+l-1),h>=n-1&&(h=n-r,d=h-l+1),this._alwaysShowEdges&&this._makePageButton(t,i),this._useEllipsis&&d>2&&e.LX.makeElement("span","h-6 px-2 text-lg font-semibold whitespace-nowrap","...",t);for(let e=d;e<=h;e++)this._makePageButton(t,e);this._useEllipsis&&h<n-1&&e.LX.makeElement("span","h-6 px-2 text-lg font-semibold whitespace-nowrap","...",t),this._alwaysShowEdges&&this._makePageButton(t,a)}this._makeButton(e.LX.makeIcon("ChevronRight").innerHTML,this.page===this.pages,()=>this.next(),"bg-none "+(this.page===this.pages?"":"hover:bg-secondary"))}_emitChange(){this.onChange?.(this.page),this.root.dispatchEvent(new CustomEvent("change",{detail:{page:this.page}}))}_makeButton(e,t,s,o,n){const i=new r(null,e,s,{disabled:t,buttonClass:o});return i.root.querySelector("button").style.paddingInline="0.5rem",(n=n??this.pagesRoot).appendChild(i.root),i.root}_makePageButton(e,t){const s="h-8 "+(t===this.page?"primary text-primary-foreground":"ghost");return this._makeButton(String(t),!1,()=>this.setPage(t),s,e)}}e.LX.Pagination=q;class U extends a{data;filter;customFilters;activeCustomFilters;rowOffsetCount=0;_currentFilter;_toggleColumns;_sortColumns;_resetCustomFiltersBtn=null;_hiddenColumns=[];_paginator;_showSelectedNumber;_centered;get centered(){return this._centered}set centered(e){this._setCentered(e)}_rowsPerPage=-1;get rowsPerPage(){return this._rowsPerPage}set rowsPerPage(e){this._setRowsPerPage(e)}constructor(t,s,o={}){if(!s)throw"Data is needed to create a table!";super(e.ComponentType.TABLE,t,null,o),this.onResize=e=>{const t=this.root.domName?.style.width??"0px";n.style.width=`calc( 100% - ${t})`};const n=document.createElement("div");n.className="lextable",this.root.appendChild(n),this._centered=o.centered??!1,!0===this._centered&&n.classList.add("centered"),this.data=s,this.filter=o.filter??!1,this.customFilters=o.customFilters??null,this.activeCustomFilters={},this._toggleColumns=o.toggleColumns??!1,this._sortColumns=o.sortColumns??!0,this._showSelectedNumber=o.showSelectedNumber??!0,this._currentFilter=o.filterValue,this._hiddenColumns=o.hiddenColumns??[],s.head=s.head??[],s.body=s.body??[],s.checkMap={},s.colVisibilityMap={},s.head.forEach((e,t)=>{const o=this._hiddenColumns.indexOf(e),n=!this._toggleColumns||-1===o;s.colVisibilityMap[t]=n}),o.pagination&&(this._rowsPerPage=o.rowsPerPage??12,this._paginator=new q({pages:this._getNumPages(),itemsPerPage:this._rowsPerPage,allowChangeItemsPerPage:o.allowChangeItemsPerPage??!0,onChange:this._onChangePage.bind(this),onItemsPerPageChange:e=>{this.rowsPerPage=e}}));const i=e=>{const t=e.match(/^(\d{1,2})[\/-](\d{1,2})[\/-](\d{2}|\d{4})$/);if(!t)return null;let s=Number(t[1]),o=Number(t[2])-1,n=Number(t[3]);n<100&&(n+=2e3);const i=new Date(n,o,s);return i.getFullYear()!==n||i.getMonth()!==o||i.getDate()!==s?null:i},a=(e,t,s,o)=>{const n=s[e],a=o[e],r=i(n),l=i(a);if(r&&l)return r.getTime()<l.getTime()?-t:r.getTime()>l.getTime()?t:0;const c=Number(n),d=Number(a);return isNaN(c)||isNaN(d)?n<a?-t:n>a?t:0:c<d?-t:c>d?t:0},l=(e,t)=>{s.body=s.body.sort(a.bind(this,e,t)),this.refresh()},c=this;if(this.filter||this.customFilters||this._toggleColumns){const t=e.LX.makeContainer(["100%","auto"],"flex flex-row mb-2");if(this.filter){const s=e.LX.deepCopy(o);s.placeholder=`Filter ${this.filter}...`,s.skipComponent=!0,s.trigger="input",s.inputClass="outline";let n=new h(null,this._currentFilter??"",e=>{this._currentFilter=e,this.refresh()},s);t.appendChild(n.root)}if(null!==this.customFilters){const s=e.LX.makeIcon("CirclePlus",{svgClass:"sm"}),o='<div class="lexcontainer border-r-color place-self-center mx-1" style="width: 1px; height: 70%;"></div>';for(let n of this.customFilters)n.component=new r(null,s.innerHTML+n.name,t=>{const i=n.component.root.querySelector("button");if(n.options){const t=n.options.map((t,a)=>{const r={name:t,checked:!!this.activeCustomFilters[t],callback:(t,a,r)=>{a?this.activeCustomFilters[t]=n.name:delete this.activeCustomFilters[t];const l=Object.keys(this.activeCustomFilters).filter(e=>this.activeCustomFilters[e]==n.name),c=l.reduce((t,s)=>t+e.LX.badge(s,"xs secondary"),"");i.innerHTML=s.innerHTML+n.name+(l.length?o:"")+c,this.refresh()}};return r});e.LX.addDropdownMenu(n.component.root,t,{side:"bottom",align:"start"})}else if("range"==n.type){console.assert(null!=n.min&&null!=n.max,"Range filter needs min and max values!");const t=e.LX.makeContainer(["240px","auto"],"text-base"),a=new e.LX.Panel({className:"flex flex-col gap-2"});e.LX.makeContainer(["100%","auto"],"px-3 p-2 pb-0 text-base font-medium",n.name,t),n.start=n.start??n.min,n.end=n.end??n.max,a.refresh=()=>{a.clear(),a.sameLine(2,"justify-center"),a.addNumber(null,n.start,t=>{n.start=t;const a=n.start!=n.min||n.end!=n.max;i.innerHTML=s.innerHTML+n.name+(a?o+e.LX.badge(`${n.start} - ${n.end} ${n.units??""}`,"xs secondary"):""),a&&this._resetCustomFiltersBtn?.root.classList.remove("hidden"),this.refresh()},{skipSlider:!0,min:n.min,max:n.max,step:n.step,units:n.units}),a.addNumber(null,n.end,t=>{n.end=t;const a=n.start!=n.min||n.end!=n.max;i.innerHTML=s.innerHTML+n.name+(a?o+e.LX.badge(`${n.start} - ${n.end} ${n.units??""}`,"xs secondary"):""),a&&this._resetCustomFiltersBtn?.root.classList.remove("hidden"),this.refresh()},{skipSlider:!0,min:n.min,max:n.max,step:n.step,units:n.units}),a.addButton(null,"Reset",()=>{n.start=n.min,n.end=n.max,i.innerHTML=s.innerHTML+n.name,a.refresh(),this.refresh()},{buttonClass:"ghost"})},a.refresh(),t.appendChild(a.root),new y(n.component.root,[t],{side:"bottom"})}else if("date"==n.type){const t=e.LX.makeContainer(["auto","auto"],"text-base"),a=new e.LX.Panel;e.LX.makeContainer(["100%","auto"],"px-3 p-2 pb-0 text-base font-medium",n.name,t),a.refresh=()=>{if(a.clear(),!n.default){const e=new Date,t=`${e.getDate()}/${e.getMonth()+1}/${e.getFullYear()}`;n.default=[t,t]}const t=new k(n.value??n.default,{onChange:a=>{n.value=a,i.innerHTML=s.innerHTML+n.name+(o+e.LX.badge(`${t.getFullDate()}`,"xs secondary")),this._resetCustomFiltersBtn?.root.classList.remove("hidden"),this.refresh()}});a.attach(t)},a.refresh(),t.appendChild(a.root),new y(n.component.root,[t],{side:"bottom"})}},{buttonClass:"sm outline dashed"}),t.appendChild(n.component.root);this._resetCustomFiltersBtn=new r(null,"resetButton",()=>{this.activeCustomFilters={},this._resetCustomFiltersBtn?.root.classList.add("hidden");for(let e of this.customFilters??[])e.component.root.querySelector("button").innerHTML=s.innerHTML+e.name,"range"==e.type?(e.start=e.min,e.end=e.max):"date"==e.type&&delete e.value;this.refresh()},{title:"Reset filters",tooltip:!0,icon:"X",buttonClass:"ghost"}),t.appendChild(this._resetCustomFiltersBtn?.root),this._resetCustomFiltersBtn?.root.classList.add("hidden")}if(this._toggleColumns){const o=e.LX.makeIcon("Settings2"),n=new r("toggleColumnsBtn",o.innerHTML+"View",(t,o)=>{const n=s.head.map((e,t)=>{const o={name:e,icon:"Check",callback:()=>{s.colVisibilityMap[t]=!s.colVisibilityMap[t];d.querySelectorAll(`tr > *:nth-child(${t+this.rowOffsetCount+1})`).forEach(e=>{e.style.display="none"===e.style.display?"":"none"})}};return s.colVisibilityMap[t]||delete o.icon,o});e.LX.addDropdownMenu(o.target,n,{side:"bottom",align:"end"})},{hideName:!0,buttonClass:"outline"});t.appendChild(n.root),n.root.style.marginLeft="auto"}n.appendChild(t)}const d=e.LX.makeElement("table",o.tableClass,"",n);this.refresh=()=>{this._currentFilter=this._currentFilter??"",d.innerHTML="",this.rowOffsetCount=0;{const t=document.createElement("thead");t.className="lextablehead",d.appendChild(t);const n=document.createElement("tr");if(o.sortable){const e=document.createElement("th");e.style.width="0px",n.appendChild(e),this.rowOffsetCount++}if(o.selectable){const t=document.createElement("th");t.style.width="0px";const o=document.createElement("input");o.type="checkbox",o.className="lexcheckbox primary",o.checked=s.checkMap[":root"]??!1,t.appendChild(o),o.addEventListener("change",function(){s.checkMap[":root"]=this.checked;const t=d.querySelector("tbody");for(const e of t.childNodes){const t=e.getAttribute("rowId");t&&(s.checkMap[t]=this.checked,e.querySelector("input[type='checkbox']").checked=this.checked)}const o=c.getSelectedRows();e.LX.emitSignal("@rows_selected_changed",o.length)}),this.rowOffsetCount++,n.appendChild(t)}for(const t of s.head){const i=document.createElement("th");i.innerHTML=`<span>${t}</span>`,i.querySelector("span").appendChild(e.LX.makeIcon("MenuArrows",{svgClass:"sm"}));const a=s.head.indexOf(t);this._centered?.indexOf&&(this._centered.indexOf(a)>-1||this._centered.indexOf(t)>-1)&&i.classList.add("centered");const r=[];if(o.columnActions)for(let e of o.columnActions)e.name?r.push({name:e.name,icon:e.icon,className:e.className,callback:()=>{const t=this.data.body.map(e=>[e[a]]);e.callback(t,d)&&this.refresh()}}):console.warn("Invalid column action (missing name):",e);this._sortColumns&&(r.length>0&&r.push(null),r.push({name:"Asc",icon:"ArrowUpZA",callback:l.bind(this,a,1)},{name:"Desc",icon:"ArrowDownZA",callback:l.bind(this,a,-1)})),this._toggleColumns&&(r.length>0&&r.push(null),r.push({name:"Hide",icon:"EyeOff",callback:()=>{s.colVisibilityMap[a]=!1;d.querySelectorAll(`tr > *:nth-child(${a+this.rowOffsetCount+1})`).forEach(e=>{e.style.display="none"===e.style.display?"":"none"})}})),i.addEventListener("click",t=>{0!==r.length&&e.LX.addDropdownMenu(t.target,r,{side:"bottom",align:"start"})}),n.appendChild(i)}if(o.rowActions){const e=document.createElement("th");e.className="sm",n.appendChild(e)}t.appendChild(n)}{const t=document.createElement("tbody");t.className="lextablebody",d.appendChild(t);let n=null,i=!1,a=null;document.addEventListener("mouseup",t=>{if(null===n)return;document.removeEventListener("mousemove",r);const o=d.rows[n];if(o.dY=0,o.classList.remove("dragging"),Array.from(d.rows).forEach(e=>{e.style.transform="",e.style.transition="none"}),e.LX.flushCss(o),a){const t=this._paginator?(this._paginator.page-1)*this.rowsPerPage:0,o=n-1+t,i=a[1]-1+t;e.LX.emitSignal("@on_table_sort",{instance:this,fromIdx:o,targetIdx:i});const r=s.body[o];let l=0;if(o==i)return;if(o>i)for(let e=o;e>i;--e)s.body[e]=s.body[e-1];else{l=1;for(let e=o;e<i;++e)s.body[e]=s.body[e+1]}s.body[i]=r;const c=a[0].parentNode;e.LX.insertChildAtIndex(c,a[0],i+l-t),a=null}n=null,e.LX.doAsync(()=>{Array.from(d.rows).forEach(e=>{e.style.transition="transform 0.2s ease-in"})})});let r=e=>{if(!n)return;const t=d.rows[n];t.dY=t.dY??0,t.dY+=e.movementY,t.style.transform=`translateY(${t.dY}px)`};const l=[];for(let t=0;t<s.body.length;++t){const o=s.body[t];if(this.filter){const t=s.head.indexOf(this.filter);if(t>-1){if(!e.LX.stripHTML(o[t]).toLowerCase().includes(this._currentFilter.toLowerCase()))continue}}if(Object.keys(this.activeCustomFilters).length){let t={};this._resetCustomFiltersBtn?.root.classList.remove("hidden");for(let n in this.activeCustomFilters){const i=this.activeCustomFilters[n];t[i]=t[i]??!1;const a=s.head.indexOf(i);if(a>-1){const s=o[a],r=e.LX.stripTags(s)??s;t[i]=t[i]||r===n}}if(!Object.values(t).reduce((e,t)=>e&&t,!0))continue}if(this.customFilters){let t={};for(let n of this.customFilters){const i=n.name;if("range"==n.type){t[i]=t[i]??!1;const e=s.head.indexOf(i);if(e>-1){const s=parseFloat(o[e]),a=n.start??n.min,r=n.end??n.max;t[i]=t[i]||s>=a&&s<=r}}else if("date"==n.type){t[i]=t[i]??!1;const a=s.head.indexOf(i);if(a>-1){if(!n.value){t[i]=!0;continue}n.value=n.value??n.default;const s=o[a],r=e.LX.dateFromDateString(s),l=e.LX.dateFromDateString(n.value[0]),c=e.LX.dateFromDateString(n.value[1]);t[i]=t[i]||r>=l&&r<=c}}}if(!Object.values(t).reduce((e,t)=>e&&t,!0))continue}l.push(o)}this._paginator&&this._paginator.setPages(this._getNumPages(l.length));const h=this._paginator?(this._paginator.page-1)*this.rowsPerPage:0,u=this._paginator?Math.min(h+this.rowsPerPage,l.length):l.length;for(let p=h;p<u;++p){const h=l[p],u=this.data.body.indexOf(h),m=document.createElement("tr"),g=this._makeRowId(h);if(m.setAttribute("rowId",g),o.sortable){const t=document.createElement("td");t.style.width="0px";const s=e.LX.makeIcon("GripVertical");t.appendChild(s),s.draggable=!0,s.addEventListener("dragstart",e=>{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),n=m.rowIndex,m.classList.add("dragging"),document.addEventListener("mousemove",r)},!1),m.addEventListener("mouseenter",function(t){if(t.preventDefault(),null!=n&&this.rowIndex!=n&&i!=this.rowIndex){i=this.rowIndex;const t=d.rows[n],s=""!=this.style.transform;this.rowIndex>n?(a=[t,s?this.rowIndex-1:this.rowIndex],this.style.transform=s?"":`translateY(-${this.offsetHeight}px)`):(a=[t,s?this.rowIndex+1:this.rowIndex],this.style.transform=s?"":`translateY(${this.offsetHeight}px)`),e.LX.doAsync(()=>{i=!1})}}),m.appendChild(t)}if(o.selectable){const t=document.createElement("td"),o=document.createElement("input");o.type="checkbox",o.className="lexcheckbox primary",o.checked=s.checkMap[g],t.appendChild(o),o.addEventListener("change",function(){s.checkMap[g]=this.checked;const t=d.querySelector("thead input[type='checkbox']");if(console.assert(t,"Header checkbox not found!"),this.checked){Array.from(d.querySelectorAll("tbody input[type='checkbox']")).filter(e=>!e.checked).length||(t.checked=s.checkMap[":root"]=!0)}else t.checked=s.checkMap[":root"]=!1;const o=c.getSelectedRows();e.LX.emitSignal("@rows_selected_changed",o.length)}),m.appendChild(t)}for(let e=0;e<h.length;++e){const t=h[e],o=document.createElement("td");o.innerHTML=`${t}`;const n=s.head[e];this._centered?.indexOf&&(this._centered.indexOf(e)>-1||this._centered.indexOf(n)>-1)&&o.classList.add("centered"),m.appendChild(o)}if(o.rowActions){const t=document.createElement("td");t.style.width="0px";const n=document.createElement("div");n.className="lextablebuttons",t.appendChild(n);for(const t of o.rowActions){let i=null;"delete"==t?(i=e.LX.makeIcon("Trash3",{title:"Delete Row"}),i.addEventListener("click",()=>{s.body.splice(u,1),this.refresh()})):"menu"==t?(i=e.LX.makeIcon("EllipsisVertical",{title:"Menu"}),i.addEventListener("click",function(t){if(!o.onMenuAction)return;const n=o.onMenuAction(u,s);console.assert(n.length,"Add items to the Menu Action Dropdown!"),e.LX.addDropdownMenu(t.target,n,{side:"bottom",align:"end"})})):(console.assert(t.constructor==Object),i=e.LX.makeIcon(t.icon,{title:t.title}),t.callback&&i.addEventListener("click",e=>{t.callback(u,h,d,e)&&this.refresh()})),console.assert(i),n.appendChild(i)}m.appendChild(t)}t.appendChild(m)}if(o.selectable){const t=this.getSelectedRows();e.LX.emitSignal("@rows_selected_changed",t.length)}if(0==t.childNodes.length){const e=document.createElement("tr"),o=document.createElement("td");o.setAttribute("colspan",s.head.length+this.rowOffsetCount+1),o.className="empty-row",o.innerHTML="No results.",e.appendChild(o),t.appendChild(e)}}for(const e in s.colVisibilityMap){const t=parseInt(e);if(!s.colVisibilityMap[t]){d.querySelectorAll(`tr > *:nth-child(${t+this.rowOffsetCount+1})`).forEach(e=>{e.style.display="none"===e.style.display?"":"none"})}}};const u=this._showSelectedNumber&&o.selectable;if(u||this._paginator){const t=e.LX.makeContainer(["100%","auto"],"flex flex-row px-3 my-1 align-center","",n);if(u){const s=e.LX.makeContainer(["100%","auto"],"flex justify-start items-center","0 row(s) selected.",t);e.LX.addSignal("@rows_selected_changed",(e,t)=>{this._showSelectedNumber&&(s.innerHTML=0===t?"":`${t??0} row(s) selected.`)})}if(this._paginator){e.LX.makeContainer(["100%","auto"],"flex justify-end","",t).appendChild(this._paginator.root)}}this.refresh(),e.LX.doAsync(this.onResize.bind(this))}getSelectedRows(){const e=[];for(const t of this.data.body){const s=this._makeRowId(t);!0===this.data.checkMap[s]&&e.push(t)}return e}_makeRowId(t){return e.LX.getSupportedDOMName(t.join("-")).substr(0,32)}_onChangePage(e){this.refresh()}_getNumPages(e){return-1===this.rowsPerPage?1:(e=e??this.data.body?.length,Math.ceil((e??0)/this.rowsPerPage))}_setRowsPerPage(e){this._rowsPerPage=e,this.refresh()}_setCentered(e){if(e.constructor==Boolean){this.root.querySelector(".lextable").classList.toggle("centered",e)}else e=Array.isArray(e)?e:[e];this._centered=e,this.refresh()}}e.LX.Table=U;class j extends a{tabs;tabDOMs;constructor(t,s,o={}){if(o.hideName=!0,super(e.ComponentType.TABS,t,null,o),s.constructor!=Array)throw"Param @tabs must be an Array!";if(!s.length)throw"Tab list cannot be empty!";const n=o.vertical??!0,i=!n&&(o.showNames??!1);this.tabDOMs={};let a=document.createElement("div");a.className="lextabscontainer",n||(a.className+=" horizontal");let r=document.createElement("div");r.className="tabs",a.appendChild(r),this.root.appendChild(a),s.findIndex(e=>!0===e.selected)<0&&(s[0].selected=!0);for(let t of s){console.assert(t.name);let s=document.createElement("div");s.className="lextab "+(t.selected?"selected":""),s.innerHTML=i?t.name:"",s.appendChild(e.LX.makeIcon(t.icon??"Hash",{title:t.name,iconClass:t.iconClass,svgClass:"lg"+(t.svgClass?" "+t.svgClass:"")})),this.tabDOMs[t.name]=s;let o=document.createElement("div");if(o.id=t.name.replace(/\s/g,""),o.className="components",o.toggleAttribute("hidden",!t.selected),a.appendChild(o),s.addEventListener("click",e=>{r.querySelectorAll(".lextab").forEach(e=>{e.classList.remove("selected")}),s.classList.add("selected"),a.querySelectorAll(".components").forEach(e=>{e.toggleAttribute("hidden",!0)});const n=a.querySelector("#"+o.id);n?.toggleAttribute("hidden"),t.onSelect&&t.onSelect(this,o)}),r.appendChild(s),t.onCreate){const s=new e.LX.Panel;s.queue(o),t.onCreate.call(this,s,o),s.clearQueue()}}this.tabs=s}select(e){const t=this.tabDOMs[e];t&&t.click()}}e.LX.TabSections=j;class G extends a{generateTags;constructor(t,s,o,i={}){let a=s.replace(/\s/g,"").split(","),r=e.LX.deepCopy(a);super(e.ComponentType.TAGS,t,r,i),this.options.skipDuplicates=i.skipDuplicates??!0,this.onGetValue=()=>e.LX.deepCopy(s),this.onSetValue=(e,s,i)=>{a=[].concat(e),this.generateTags(a),s||this._trigger(new n(t,a,i),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=`calc( 100% - ${t})`};const l=document.createElement("div");l.className="inline-flex flex-wrap gap-1 bg-card/50 rounded-lg pad-xs [&_input]:w-2/3",this.root.appendChild(l),this.generateTags=t=>{l.innerHTML="";for(let s=0;s<t.length;++s){const o=t[s],n=e.LX.mergeClass("lextag bg-primary px-2 py-1 rounded-xl min-w-2 justify-center text-primary-foreground gap-1 text-sm select-none",i.tagClass),a=e.LX.makeElement("span",n,o);if(!this.disabled){const s=e.LX.makeIcon("X",{svgClass:"sm"});a.appendChild(s),s.addEventListener("click",e=>{a.remove(),t.splice(t.indexOf(o),1),this.set(t,!1,e)})}l.appendChild(a)}if(this.disabled)return;let s=document.createElement("input");s.value="",s.placeholder="Add tag...",l.appendChild(s),s.onkeydown=e=>{if(" "==e.key||"Enter"==e.key){const o=s.value.replace(/\s/g,"");if(e.preventDefault(),!o.length||i.skipDuplicates&&t.indexOf(o)>-1)return;t.push(o),this.set(t,!1,e),l.querySelector("input")?.focus()}}},this.generateTags(a),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Tags=G;class Z extends a{constructor(t,s,o,i={}){super(e.ComponentType.TEXTAREA,t,s,i),this.onGetValue=()=>s,this.onSetValue=(e,i,a)=>{r.value=s=e,i||this._trigger(new n(t,e,a),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=i.inputWidth??`calc( 100% - ${t})`};let a=document.createElement("div");a.className="lextextarea",a.style.display="flex",this.root.appendChild(a);let r=e.LX.makeElement("textarea",e.LX.mergeClass("w-full text-sm text-foreground bg-card border-color disabled:pointer-events-none disabled:opacity-50 rounded-lg outline-none pad-md",i.inputClass??""));r.value=s??"",r.style.textAlign=i.float??"",r.disabled=this.disabled,Object.assign(r.style,i.style??{}),i.fitHeight&&r.classList.add("field-sizing-content"),(i.resize??1)||r.classList.add("resize-none"),a.appendChild(r),i.placeholder&&r.setAttribute("placeholder",i.placeholder);const l=i.trigger??"default",c=i.submitOnEnterKey??!0;if("default"==l?(r.addEventListener("keydown",function(e){if(c&&"Enter"==e.key&&!e.shiftKey)return e.preventDefault(),!1}),r.addEventListener("keyup",function(e){(c&&"Enter"==e.key&&!e.shiftKey||"Escape"==e.key)&&(e.preventDefault(),r.blur())}),r.addEventListener("focusout",e=>{this.set(e.target?.value,!1,e)})):"input"==l&&r.addEventListener("input",e=>{this.set(e.target?.value,!1,e)}),i.icon){const t=e.LX.makeIcon(i.icon,{iconClass:"absolute z-1 ml-2",svgClass:"sm"});a.appendChild(t)}e.LX.doAsync(()=>{a.style.height=i.height??"",this.onResize()},10)}}e.LX.TextArea=Z;class Y extends a{constructor(t,s={}){console.assert(0!==t.length,"Can't create Title Component without text!"),super(e.ComponentType.TITLE,null,null,s);const o="lextitle !w-fit bg-muted text-foreground text-sm font-semibold leading-normal m-3 flex content-center rounded-xl select-none";if(this.root.className=e.LX.mergeClass(o,s.className),s.icon){let t=e.LX.makeIcon(s.icon,{iconClass:"mr-2"});t.querySelector("svg").style.color=s.iconColor||"",this.root.appendChild(t)}let n=document.createElement("span");if(n.innerText=t,this.root.appendChild(n),null!=s.link){let n=e.LX.makeElement("a",`${o} link`,t);n.href=s.link,n.target=s.target??"",this.root.replaceWith(n),this.root=n}Object.assign(this.root.style,s.style??{})}}e.LX.Title=Y;class K extends a{constructor(t,s,o,i={}){if(!t&&!i.label)throw"Set Component Name or at least a label!";super(e.ComponentType.TOGGLE,t,s,i),this.onGetValue=()=>r.checked,this.onSetValue=(e,i,a)=>{e!=s&&(r.checked=s=e,this.root.querySelector(".lextogglesubmenu")?.toggleAttribute("hidden",!e),i||this._trigger(new n(t,e,a),o))},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=i.inputWidth??`calc( 100% - ${t})`};var a=document.createElement("div");a.className="flex flex-row gap-2 items-center",this.root.appendChild(a);let r=e.LX.makeElement("input",e.LX.mergeClass("lextoggle relative inline-grid place-content-center cursor-pointer shrink-0 select-none disabled:pointer-events-none disabled:opacity-50",i.className));r.type="checkbox",r.checked=s,r.iValue=s,r.disabled=this.disabled,a.appendChild(r);let l=document.createElement("span");if(l.className="font-medium w-full overflow-hidden truncate",l.innerHTML=i.label??"On",a.appendChild(l),r.addEventListener("change",e=>{this.set(r.checked,!1,e)}),i.suboptions){let t=e.LX.makeElement("div","lextogglesubmenu w-full p-2");t.toggleAttribute("hidden",!r.checked);const s=new e.LX.Panel;s.queue(t),i.suboptions.call(this,s),s.clearQueue(),this.root.appendChild(t)}e.LX.doAsync(this.onResize.bind(this))}}e.LX.Toggle=K;class J extends a{locked=!1;setLimits;constructor(t,s,o,i,l={}){t=e.LX.clamp(t,2,4),o=o??new Array(t).fill(0),super(e.ComponentType.VECTOR,s,e.LX.deepCopy(o),l),this.onGetValue=()=>{let e=this.root.querySelectorAll("input[type='number']"),t=[];for(var s of e)t.push(+s.value);return t},this.onSetValue=(t,a,r)=>{if(c.length==t.length){for(let s=0;s<c.length;++s){let n=t[s];n=e.LX.clamp(n,+c[s].min,+c[s].max),n=e.LX.round(n,l.precision)??0,c[s].value=o[s]=n}a||this._trigger(new n(s,o,r),i)}else console.error("Input length does not match vector length.")},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";d.style.width=`calc( 100% - ${t})`},this.setLimits=(e,t,s)=>{};const c=[];var d=document.createElement("div");d.className="lexvector flex",this.root.appendChild(d);const h=this;for(let u=0;u<t;++u){let p=document.createElement("div");p.className="vecbox",p.innerHTML="<span class='"+e.LX.Panel.VECTOR_COMPONENTS[u]+"'></span>";let m=document.createElement("input");m.className="vecinput v"+t,m.min=l.min??-1e24,m.max=l.max??1e24,m.step=l.step??"any",m.type="number",m.id="vec"+t+"_"+e.LX.guidGenerator(),m.idx=u,m.disabled=this.disabled,c[u]=m,p.appendChild(m),o[u].constructor==Number&&(o[u]=e.LX.clamp(o[u],+m.min,+m.max),o[u]=e.LX.round(o[u],l.precision)),m.value=m.iValue=o[u];const g=e.LX.makeIcon("MoveVertical",{iconClass:"drag-icon hidden-opacity",svgClass:"sm"});function f(t){if(document.activeElement!=m&&t.button==e.LX.MOUSE_LEFT_CLICK){var s=h.root.ownerDocument;s.addEventListener("mousemove",L),s.addEventListener("mouseup",y),document.body.classList.add("noevents"),g.classList.remove("hidden-opacity"),t.stopImmediatePropagation(),t.stopPropagation(),document.pointerLockElement||p.requestPointerLock(),l.onPress&&l.onPress.bind(m)(t,m)}}function L(t){let s=-t.movementY;if(0!=s){let o=l.step??1;if(t.shiftKey?o=10:t.altKey&&(o=.1),h.locked)for(let t of c)t.value=e.LX.round(+t.valueAsNumber+o*s,l.precision),a._dispatchEvent(t,"change");else m.value=e.LX.round(+m.valueAsNumber+o*s,l.precision),a._dispatchEvent(m,"change")}t.stopPropagation(),t.preventDefault()}function y(e){var t=h.root.ownerDocument;t.removeEventListener("mousemove",L),t.removeEventListener("mouseup",y),document.body.classList.remove("noevents"),g.classList.add("hidden-opacity"),document.pointerLockElement&&document.exitPointerLock(),l.onRelease&&l.onRelease.bind(m)(e,m)}p.appendChild(g),m.addEventListener("wheel",function(t){if(t.preventDefault(),m!==document.activeElement)return;let s=l.step??1;if(t.shiftKey?s=10:t.altKey&&(s=.1),h.locked)for(let o of c)o.value=e.LX.round(+o.valueAsNumber-s*(t.deltaY>0?1:-1),l.precision),a._dispatchEvent(o,"change");else m.value=e.LX.round(+m.valueAsNumber-s*(t.deltaY>0?1:-1),l.precision),a._dispatchEvent(m,"change")},{passive:!1}),m.addEventListener("change",t=>{if(isNaN(t.target.value))return;let s=e.LX.clamp(t.target.value,+m.min,+m.max);if(s=e.LX.round(s,l.precision),this.locked)for(let e of c)e.value=s,o[e.idx]=s;else m.value=s,o[t.target.idx]=s;this.set(o,!1,t)},!1),p.addEventListener("mousedown",f),d.appendChild(p)}if(void 0===l.min&&void 0===l.max||(this.setLimits=(e,t,s)=>{for(let o of c)o.min=e??o.min,o.max=t??o.max,o.step=s??o.step;this.set(o,!0)}),!l.skipLock){const b=new r(null,"",e=>{this.locked=e},{title:"Lock",icon:"LockOpen",swap:"Lock",buttonClass:"h-auto bg-none p-0"});d.appendChild(b.root)}e.LX.doAsync(this.onResize.bind(this))}}e.LX.Vector=J;class Q{name;components;closed;root;content;grabber;panel;onclick;oncontextmenu;constructor(t,s={}){this.name=t;var o=document.createElement("div");s.id&&(o.id=s.id),o.className=e.LX.mergeClass("lexbranch bg-secondary/50 dark:bg-card text-secondary-foreground dark:text-card-foreground w-full rounded-lg my-0 mx-auto",s.className);var n=this;this.closed=s.closed??!1,this.root=o,this.components=[],this.panel=null;const i=e.LX.makeElement("div","lexbranchtitle flex cursor-pointer select-none pad-lg text-lg","",o);if(s.icon){const t=e.LX.makeIcon(s.icon,{iconClass:"mr-2"});i.appendChild(t)}i.innerHTML+=t||"Branch";const a=e.LX.makeIcon("Right",{iconClass:"switch-branch-button",svgClass:"sm"});i.appendChild(a);var r=e.LX.makeElement("div","lexbranchcontent pad-xs","",o);r.id=t.replace(/\s/g,""),this.content=r,this._addBranchSeparator(),this.closed&&(i.classList.add("closed"),o.classList.add("closed"),this.grabber.setAttribute("hidden",!0),e.LX.doAsync(()=>{this.content.setAttribute("hidden",!0)},10)),this.onclick=function(){i.classList.toggle("closed"),i.parentElement.classList.toggle("closed"),n.content.toggleAttribute("hidden"),n.grabber.toggleAttribute("hidden"),e.LX.emitSignal("@on_branch_closed",i.classList.contains("closed"))},this.oncontextmenu=function(t){t.preventDefault(),t.stopPropagation(),i.parentElement.classList.contains("dialog")||e.LX.addContextMenu("Dock",t,e=>{t.preventDefault(),e.add("Floating",n._onMakeFloating.bind(n))},{icon:"WindowRestore"})},i.addEventListener("click",this.onclick),i.addEventListener("contextmenu",this.oncontextmenu)}_onMakeFloating(){const t=new e.LX.Dialog(this.name,e=>{for(let t of this.components)e.root.appendChild(t.root)},{dockable:!0}),s=Array.from(this.root.parentElement.childNodes).indexOf(this.root);console.assert(s>=0,"Branch not found!"),t.branchData={name:this.name,components:this.components,closed:this.closed,panel:this.panel,childIndex:s},this.root.remove()}_addBranchSeparator(){const t=document.createElement("div");t.className="lexcomponentseparator",t.style.width="100%",t.style.background="none";const s=document.createElement("div");s.innerHTML="▾",t.appendChild(s),e.LX.doAsync(()=>{s.style.marginLeft=parseFloat(e.LX.DEFAULT_NAME_WIDTH)/100*this.content.offsetWidth+"px"},10);const o=document.createElement("div");o.style.width="1px",o.style.marginLeft="6px",o.style.marginTop="2px",o.style.height="0px",s.appendChild(o),s.addEventListener("mousedown",function(e){var t=n.root.ownerDocument;t.addEventListener("mouseup",a),t.addEventListener("mousemove",i),e.stopPropagation(),e.preventDefault();const s=n.root.offsetHeight-n.root.children[0].offsetHeight;o.style.height=s-3+"px",document.body.classList.add("nocursor")}),this.grabber=s;let n=this;function i(t){let o=t.movementX;if(0!=o){const t=parseFloat(s.style.marginLeft);s.style.marginLeft=e.LX.clamp(t+o,32,n.content.offsetWidth-32)+"px"}}function a(e){n._updateComponents(),o.style.height="0px";var t=n.root.ownerDocument;t.removeEventListener("mouseup",a),t.removeEventListener("mousemove",i),document.body.classList.remove("nocursor")}this.content.appendChild(t)}_updateComponents(){var t=this.grabber.style.marginLeft;for(let s=0;s<this.components.length;s++){let o=this.components[s];const n=o.root;if(n.children.length<2)continue;let i=n.children[0],a=n.children[1];switch(i.style.width=t,i.style.minWidth=t,o.type){case e.LX.BaseComponent.CUSTOM:case e.LX.BaseComponent.ARRAY:continue}a.style.width="-moz-calc( 100% - "+t+" )",a.style.width="-webkit-calc( 100% - "+t+" )",a.style.width="calc( 100% - "+t+" )"}}}e.LX.Branch=Q;class ee{root;branches;components;signals;queuedContainer;_branchOpen;_currentBranch;_queue;_inlineComponentsLeft;_inlineQueuedContainer;_inlineExtraClass;_inlineContainer;_inlineComponents;constructor(t={}){const s=e.LX.makeElement("div",e.LX.mergeClass("lexpanel m-0 pad-md overflow-hidden overflow-y-scroll text-foreground scrollbar-hidden",t.className));t.id&&(s.id=t.id),s.style.width=t.width||"100%",s.style.height=t.height||"100%",Object.assign(s.style,t.style??{}),this.root=s,this.branches=[],this.signals=[],this.components={},this._branchOpen=!1,this._currentBranch=null,this._queue=[],this._inlineComponentsLeft=-1,this._inlineQueuedContainer=null,this._inlineExtraClass=null,this._inlineComponents=[]}get(e){return this.components[e]}getValue(e){let t=this.components[e];if(!t)throw"No component called "+e;return t.value()}setValue(e,t,s){let o=this.components[e];if(!o)throw"No component called "+e;return o.set(t,s)}attach(e){console.assert(e,"No content to attach!"),e.parent=this,this.root.appendChild(e.root?e.root:e)}clear(){this.branches=[],this._branchOpen=!1,this._currentBranch=null;for(let t in this.components)if(this.components[t].options&&this.components[t].options.signal){const s=this.components[t].options.signal;for(let o=0;o<e.LX.signals[s].length;o++)e.LX.signals[s][o]==this.components[t]&&(e.LX.signals[s]=[...e.LX.signals[s].slice(0,o),...e.LX.signals[s].slice(o+1)])}if(this.signals)for(let t=0;t<this.signals.length;t++){let s=Object.values(this.signals[t])[0],o=s.options.signal;for(let t=0;t<e.LX.signals[o].length;t++)e.LX.signals[o][t]==s&&(e.LX.signals[o]=[...e.LX.signals[o].slice(0,t),...e.LX.signals[o].slice(t+1)])}this.components={},this.root.innerHTML=""}sameLine(e,t){this._inlineQueuedContainer=this.queuedContainer,this._inlineComponentsLeft=e??1/0,this._inlineExtraClass=t??null}endLine(e){if(e=e??this._inlineExtraClass,-1!=this._inlineComponentsLeft){this._inlineComponentsLeft=-1,this._inlineContainer||(this._inlineContainer=document.createElement("div"),this._inlineContainer.className="lexinlinecomponents",e&&(this._inlineContainer.className+=` ${e}`));for(let e of this._inlineComponents){e.constructor==Array?this._inlineQueuedContainer?this._inlineContainer.appendChild(e[0]):e[1].appendChild(e[0]):this._inlineContainer.appendChild(e)}this._inlineQueuedContainer?this._inlineQueuedContainer.appendChild(this._inlineContainer):this._currentBranch?this._currentBranch.content.appendChild(this._inlineContainer):this.root.appendChild(this._inlineContainer),this._inlineComponents=[],this._inlineContainer=null,this._inlineExtraClass=null}else console.warn("No pending components to be inlined!")}branch(e,t={}){this._branchOpen&&this.merge();var s=new Q(e,t);return s.panel=this,this._branchOpen=!0,this._currentBranch=s,this.branches.push(s),this.root.appendChild(s.root),t.filter&&this._addFilter(t.filter,{callback:this._searchComponents.bind(this,s.name)}),s}merge(){this._branchOpen=!1,this._currentBranch=null}_pick(e,t){return void 0===e?t:e}_attachComponent(e,t={}){null!=e.name&&(this.components[e.name]=e),e.options.signal&&!e.name&&(this.signals||(this.signals=[]),this.signals.push({[e.options.signal]:e}));const s=s=>{t.container?t.container.appendChild(s):this.queuedContainer?this.queuedContainer.appendChild(s):this._currentBranch?(t.skipComponent||this._currentBranch.components.push(e),this._currentBranch.content.appendChild(s)):(s.className+=" nobranch w-full",this.root.appendChild(s))},o=e=>{this.queuedContainer?this._inlineComponents.push([e,this.queuedContainer]):this._inlineComponents.push(e)};return this._inlineComponentsLeft>0&&!t.skipInlineCount?(o(e.root),this._inlineComponentsLeft--,this._inlineComponentsLeft||this.endLine()):s(e.root),e}_addFilter(t,s={}){s.placeholder=t.constructor==String?t:"Filter properties..",s.skipComponent=s.skipComponent??!0,s.skipInlineCount=!0;const o=new h(null,void 0,null,s).root;o.className+=" lexfilter";let n=document.createElement("input");n.className="lexinput-filter",n.setAttribute("placeholder",s.placeholder),n.style.width="100%",n.value=s.filterValue||"";let i=e.LX.makeIcon("Search");return o.appendChild(i),o.appendChild(n),n.addEventListener("input",e=>{s.callback&&s.callback(n.value,e)}),o}_searchComponents(e,t){for(let s of this.branches){if(s.name!==e)continue;for(let e of s.components)e.domEl.classList.contains("lexfilter")||e.domEl.remove();this.queue(s.content);const o=!t.length;for(let e of s.components){if(!o){if(!e.name)continue;if(!e.name.toLowerCase().includes(t))continue}this.queuedContainer.appendChild(e.domEl)}return void this.clearQueue()}}getBranch(e){return e?this.branches.find(t=>t.name==e):this._currentBranch}queue(e){!e&&this._currentBranch&&(e=this._currentBranch.root),this.queuedContainer&&this._queue.push(this.queuedContainer),this.queuedContainer=e}clearQueue(){this._queue&&this._queue.length?this.queuedContainer=this._queue.pop():delete this.queuedContainer}addSeparator(){var t=document.createElement("div");t.className="lexseparator";let s=new a(e.ComponentType.SEPARATOR);s.root=t,this._currentBranch?(this._currentBranch.content.appendChild(t),this._currentBranch.components.push(s)):this.root.appendChild(t)}addTitle(e,t={}){const s=new Y(e,t);return this._attachComponent(s)}addText(e,t,s,o={}){const n=new h(e,t,s,o);return this._attachComponent(n)}addTextArea(e,t,s,o={}){const n=new Z(e,t,s,o);return this._attachComponent(n)}addLabel(t,s={}){s.disabled=!0,s.inputClass=e.LX.mergeClass("bg-none",s.inputClass);const o=this.addText(null,t,null,s);return o.type=e.ComponentType.LABEL,o}addButton(e,t,s,o={}){const n=new r(e,t,s,o);return this._attachComponent(n)}addComboButtons(e,t,s={}){const o=new C(e,t,s);return this._attachComponent(o)}addCard(e,t={}){const s=new m(e,t);return this._attachComponent(s)}addForm(e,t,s,o={}){const n=new A(e,t,s,o);return this._attachComponent(n)}addContent(t,s,o={}){if(console.assert(s,"Empty content!"),s.constructor==String){const e=document.createElement("div");e.innerHTML=s,s=e.childElementCount>1?e:e.firstElementChild}o.hideName=!0;let n=new a(e.ComponentType.CONTENT,t,null,o);return n.root.appendChild(s),this._attachComponent(n)}async addImage(t,s,o={}){console.assert(0!==s.length,"Empty src/url for Image!");let n=document.createElement("div");n.className="leximage",n.style.width="100%";let i=document.createElement("img");i.src=s,Object.assign(i.style,o.style??{}),n.appendChild(i);let r=new a(e.ComponentType.IMAGE,t,null,o);return r.root.appendChild(n),i.decode(),this._attachComponent(r)}addSelect(e,t,s,o,n={}){const i=new u(e,t,s,o,n);return this._attachComponent(i)}addCurve(e,t,s,o={}){const n=new _(e,t,s,o);return this._attachComponent(n)}addDial(e,t,s,o={}){const n=new M(e,t,s,o);return this._attachComponent(n)}addLayers(e,t,s,o={}){const n=new X(e,t,s,o);return this._attachComponent(n)}addArray(e,t=[],s,o={}){const n=new p(e,t,s,o);return this._attachComponent(n)}addList(e,t,s,o,n={}){const i=new z(e,t,s,o,n);return this._attachComponent(i)}addTags(e,t,s,o={}){const n=new G(e,t,s,o);return this._attachComponent(n)}addCheckbox(e,t,s,o={}){const n=new g(e,t,s,o);return this._attachComponent(n)}addToggle(e,t,s,o={}){const n=new K(e,t,s,o);return this._attachComponent(n)}addRadioGroup(e,t,s,o,n={}){const i=new $(e,t,s,o,n);return this._attachComponent(i)}addColor(e,t,s,o={}){const n=new b(e,t,s,o);return this._attachComponent(n)}addRange(e,t,s,o={}){const n=new V(e,t,s,o);return this._attachComponent(n)}addNumber(e,t,s,o={}){const n=new d(e,t,s,o);return this._attachComponent(n)}static VECTOR_COMPONENTS={0:"x",1:"y",2:"z",3:"w"};_addVector(e,t,s,o,n={}){const i=new J(e,t,s,o,n);return this._attachComponent(i)}addVector2(e,t,s,o){return this._addVector(2,e,t,s,o)}addVector3(e,t,s,o){return this._addVector(3,e,t,s,o)}addVector4(e,t,s,o){return this._addVector(4,e,t,s,o)}addSize(e,t,s,o={}){const n=new W(e,t,s,o);return this._attachComponent(n)}addOTP(e,t,s,o={}){const n=new O(e,t,s,o);return this._attachComponent(n)}addPad(e,t,s,o={}){const n=new H(e,t,s,o);return this._attachComponent(n)}addProgress(e,t,s={}){const o=new B(e,t,s);return this._attachComponent(o)}addFile(e,t,s={}){const o=new T(e,t,s);return this._attachComponent(o)}addTree(e,t,s={}){const o=new D(e,t,s);return this._attachComponent(o)}addTabSections(e,t,s={}){const o=new j(e,t,s);return this._attachComponent(o)}addCounter(e,t,s,o={}){const n=new v(e,t,s,o);return this._attachComponent(n)}addTable(e,t,s={}){const o=new U(e,t,s);return this._attachComponent(o)}addDate(e,t,s,o={}){const n=new S(e,t,s,o);return this._attachComponent(n)}addMap2D(e,t,s,o={}){const n=new I(e,t,s,o);return this._attachComponent(n)}addRate(e,t,s,o={}){const n=new F(e,t,s,o);return this._attachComponent(n)}}e.LX.Panel=ee;class te{area;options;buttons;constructor(e,t,s={}){this.area=e,this.options=s,this.buttons={},this._buildButtons(t,s)}_buildButtons(t,s={}){s.className="lexoverlaybuttons flex justify-start gap-2 bg-card m-2 p-1 rounded-2xl border-color";let o=this.area.addPanel(s),n=null;const i=e.LX.makeElement("div","lexoverlaybuttonscontainer absolute flex top-0 w-full pointer-events-none");i.appendChild(o.root),this.area.attach(i);const a=s.float;let r="";if(a){for(let e=0;e<a.length;e++){switch(a[e]){case"h":case"t":case"l":break;case"v":r+=" vertical";break;case"m":r+=" middle";break;case"b":r+=" bottom";break;case"c":r+=" center";break;case"r":r+=" right"}}i.className+=` ${r}`}const l=(e,t,s)=>{const i={width:"auto",selectable:e.selectable,selected:e.selected,icon:e.icon,img:e.img,className:e.class??"",buttonClass:e.buttonClass??"x",title:e.name,overflowContainerX:o.root,swap:e.swap};t&&(n||(n=document.createElement("div"),n.className="lexoverlaygroup flex flex-none bg-secondary rounded-xl",o.queuedContainer=n),i.parent=n);let a=e.callback,r=null;r=e.options?o.addSelect(null,e.options,e.value??e.name,a,i):o.addButton(null,e.name,function(t,s){if(e.selectable)if(e.group){let t=e.selected;e.group.forEach(e=>e.selected=!1),e.selected=!t}else e.selected=!e.selected;a&&a(t,s,r.root)},i),this.buttons[e.name]=r,n&&s&&(o.root.appendChild(n),n=null,o.clearQueue())};!function(){o.clear();for(let e of t){if(null===e){const e=document.createElement("div");e.className="lexoverlayseparator"+r,o.root.appendChild(e);continue}if(e.constructor===Array)for(let t=0;t<e.length;++t){let s=e[t];s.group=e,l(s,!0,t==e.length-1)}else l(e)}if(a){var e=0;o.root.childNodes.forEach(t=>{e+=t.offsetHeight}),i.className.includes("middle")&&(i.style.top="-moz-calc( 50% - "+.5*e+"px )",i.style.top="-webkit-calc( 50% - "+.5*e+"px )",i.style.top="calc( 50% - "+.5*e+"px )")}}()}}e.LX.AreaOverlayButtons=te;class se{offset=0;root;size;resize=!1;sections=[];panels=[];minWidth=0;minHeight=0;maxWidth=1/0;maxHeight=1/0;layout;type;parentArea;splitBar;splitExtended;overlayButtons;onresize;_autoVerticalResizeObserver;_root;constructor(t={}){var s=document.createElement("div");t.id&&(s.id=t.id),s.className=e.LX.mergeClass("lexarea m-0 bg-background text-foreground",t.className);var o=t.width||"100%",n=t.height||"100%";this.setLimitBox(t.minWidth,t.minHeight,t.maxWidth,t.maxHeight),o.constructor==Number&&(o=`${o}px`),n.constructor==Number&&(n=`${n}px`),s.style.width=o,s.style.height=n,this.root=s,this.size=[this.root.offsetWidth,this.root.offsetHeight];let i=document.getElementById("lexroot");i&&!t.skipAppend&&i.appendChild(this.root),t.layout&&this.setLayout(t.layout);let a=t.overlay;if(a){this.root.classList.add("overlay-"+a),t.left?this.root.style.left=t.left:t.right?this.root.style.right=t.right:t.top?this.root.style.top=t.top:t.bottom&&(this.root.style.bottom=t.bottom);if((t.draggable??!0)&&e.LX.makeDraggable(s,t),t.resizeable&&s.classList.add("resizeable"),t.resize){this.splitBar=document.createElement("div");let r="left"==a||"right"==a?"horizontal":"vertical";if(this.type=a,this.splitBar.className="lexsplitbar "+r,"right"==a)this.splitBar.style.width=e.LX.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.left=-e.LX.DEFAULT_SPLITBAR_SIZE/2+"px";else if("left"==a){let p=Math.min(document.body.clientWidth-e.LX.DEFAULT_SPLITBAR_SIZE,this.root.clientWidth);this.splitBar.style.width=e.LX.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.left=p+e.LX.DEFAULT_SPLITBAR_SIZE/2+"px"}else if("top"==a){let m=Math.min(document.body.clientHeight-e.LX.DEFAULT_SPLITBAR_SIZE,this.root.clientHeight);this.splitBar.style.height=e.LX.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.top=m+e.LX.DEFAULT_SPLITBAR_SIZE/2+"px"}else"bottom"==a&&(this.splitBar.style.height=e.LX.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.top=-e.LX.DEFAULT_SPLITBAR_SIZE/2+"px");this.splitBar.addEventListener("mousedown",d),this.root.appendChild(this.splitBar);const l=this;let c=[0,0];function d(e){const t=l.root.ownerDocument;t.addEventListener("mousemove",h),t.addEventListener("mouseup",u),c[0]=e.x,c[1]=e.y,e.stopPropagation(),e.preventDefault(),document.body.classList.add("nocursor"),l.splitBar.classList.add("nocursor")}function h(t){switch(l.type){case"right":var s=c[0]-t.x,o=l.root.offsetWidth+s;l.root.style.width=o+"px";break;case"left":s=c[0]-t.x,o=Math.min(document.body.clientWidth-e.LX.DEFAULT_SPLITBAR_SIZE,l.root.offsetWidth-s);l.root.style.width=o+"px",l.splitBar.style.left=o+e.LX.DEFAULT_SPLITBAR_SIZE/2+"px";break;case"top":s=c[1]-t.y,o=Math.min(document.body.clientHeight-e.LX.DEFAULT_SPLITBAR_SIZE,l.root.offsetHeight-s);l.root.style.height=o+"px",l.splitBar.style.top=o+e.LX.DEFAULT_SPLITBAR_SIZE/2+"px";break;case"bottom":s=c[1]-t.y,o=l.root.offsetHeight+s;l.root.style.height=o+"px"}c[0]=t.x,c[1]=t.y,t.stopPropagation(),t.preventDefault(),l.onresize&&l.onresize(l.root.getBoundingClientRect())}function u(e){const t=l.root.ownerDocument;t.removeEventListener("mousemove",h),t.removeEventListener("mouseup",u),document.body.classList.remove("nocursor"),l.splitBar.classList.remove("nocursor")}}}}attach(e){if(this.sections.length)return void this.sections[1].attach(e);if(!e)throw"no content to attach";e.parent=this;let t=e.root?e.root:e;this.root.appendChild(t)}setLayout(t){if(this.layout=e.LX.deepCopy(t),!t.splits)return void console.warn("Area layout has no splits!");const s=(e,t)=>{if(t.className&&(e.root.className+=` ${t.className}`),!t.splits)return;const o=t.type??"horizontal",n=t.resize??!0,i=t.minimizable??!1,[a,r]=e.split({type:o,resize:n,minimizable:i,sizes:[t.splits[0].size,t.splits[1].size]});s(a,t.splits[0]),s(r,t.splits[1])};s(this,t)}split(t={}){this.sections.length&&(this.offset=this.root.childNodes[0].offsetHeight,this._root=this.sections[0].root,this.root=this.sections[1].root);const s=t.type??"horizontal",o=t.sizes||["50%","50%"],n="auto"===t.sizes||t.sizes&&"auto"==t.sizes[0]&&"auto"==t.sizes[1],i=this.root.getBoundingClientRect();if(!o[1]||"auto"!=o[0]&&"auto"==o[1]){let e=o[0],s=t.top?t.top:0;e.constructor==Number&&(e+=s,e=`${e}px`),o[1]="calc( 100% - "+e+" )"}let a=t.minimizable??!1,r=(t.resize??!0)||a,l=t.fixedSize??!r,c=0,d=[],h=[];if(this.offset=0,r&&(this.resize=r,this.splitBar=document.createElement("div"),this.splitBar.className="lexsplitbar "+s,"horizontal"==s?this.splitBar.style.width=e.LX.DEFAULT_SPLITBAR_SIZE+"px":this.splitBar.style.height=e.LX.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.addEventListener("mousedown",function(e){const t=m.root.ownerDocument;t.addEventListener("mousemove",g),t.addEventListener("mouseup",f),e.stopPropagation(),e.preventDefault()}),c=e.LX.DEFAULT_SPLITBAR_SIZE/2),"horizontal"==s){if(this.root.style.display="flex",l)d[0]=`calc(${o[0]} - ${c}px)`,h[0]=`calc(${o[1]} - ${c}px)`;else{const t=i.width,s=e.LX.parsePixelSize(o[0],t)/t*100,n=e.LX.parsePixelSize(o[1],t)/t*100;d[0]=`calc(${s}% - ${c}px)`,h[0]=`calc(${n}% - ${c}px)`}d[1]="100%",h[1]="100%"}else{if(n)d[1]="auto",h[1]="auto";else if(l)d[1]="auto"==o[0]?"auto":`calc(${o[0]} - ${c}px)`,h[1]="auto"==o[1]?"auto":`calc(${o[1]} - ${c}px)`;else{const t=i.height,s=e.LX.parsePixelSize(o[0],t)/t*100,n=e.LX.parsePixelSize(o[1],t)/t*100;d[1]="auto"==o[0]?"auto":`calc(${s}% - ${c}px)`,h[1]="auto"==o[1]?"auto":`calc(${n}% - ${c}px)`}d[0]="100%",h[0]="100%"}let u=new se({width:d[0],height:d[1],skipAppend:!0,className:"split"+(t.menubar||t.sidebar?"":" origin")}),p=new se({width:h[0],height:h[1],skipAppend:!0,className:"split"});if(!(l||i.width&&i.height)){const t=new ResizeObserver(i=>{console.assert(1==i.length,"AreaResizeObserver: more than one entry");const a=i[0].contentRect;if(a.width&&a.height){if(this._update([a.width,a.height],!1),!n){if("horizontal"==s){const t=a.width,s=e.LX.parsePixelSize(o[0],t)/t*100,n=e.LX.parsePixelSize(o[1],t)/t*100;d[0]=`calc(${s}% - ${c}px)`,h[0]=`calc(${n}% - ${c}px)`}else{const t=a.height,s=e.LX.parsePixelSize(o[0],t)/t*100,n=e.LX.parsePixelSize(o[1],t)/t*100;d[1]="auto"==o[0]?"auto":`calc(${s}% - ${c}px)`,h[1]="auto"==o[1]?"auto":`calc(${n}% - ${c}px)`}u.root.style.width=d[0],u.root.style.height=d[1],p.root.style.width=h[0],p.root.style.height=h[1]}u._update(),p._update(),t.disconnect()}});e.LX.doAsync(()=>{t.observe(this.root)},100)}if(n&&"vertical"==s&&(this._autoVerticalResizeObserver=new ResizeObserver(t=>{for(const s of t){const t=e.LX.getComputedSize(s.target);p.root.style.height="calc(100% - "+t.height+"px )"}}),this._autoVerticalResizeObserver.observe(u.root)),r&&a&&(this.splitExtended=!1,p.root.addEventListener("animationend",t=>{const o=getComputedStyle(p.root).opacity;p.root.classList.remove(t.animationName+"-"+s),p.root.style.opacity=o,e.LX.flushCss(p.root)}),this.splitBar.addEventListener("contextmenu",t=>{t.preventDefault(),e.LX.addContextMenu(null,t,e=>{e.add("Extend",{disabled:this.splitExtended,callback:()=>{this.extend()}}),e.add("Reduce",{disabled:!this.splitExtended,callback:()=>{this.reduce()}})})})),u.parentArea=this,p.parentArea=this,this.root.appendChild(u.root),r&&this.root.appendChild(this.splitBar),this.root.appendChild(p.root),this.sections=[u,p],this.type=s,this._update(i.width||i.height?[i.width,i.height]:void 0),!r)return this.sections;const m=this;function g(e){const t=m.root.getBoundingClientRect();e.x<t.x||e.x>t.x+t.width||e.y<t.y||e.y>t.y+t.height||("horizontal"==m.type?m._moveSplit(-e.movementX):m._moveSplit(-e.movementY),e.stopPropagation(),e.preventDefault())}function f(e){const t=m.root.ownerDocument;t.removeEventListener("mousemove",g),t.removeEventListener("mouseup",f)}return this.sections}setLimitBox(e=0,t=0,s=1/0,o=1/0){this.minWidth=e,this.minHeight=t,this.maxWidth=s,this.maxHeight=o,0!=e&&(this.root.style.minWidth=`${e}px`),0!=t&&(this.root.style.minHeight=`${t}px`),s!=1/0&&(this.root.style.maxWidth=`${s}px`),o!=1/0&&(this.root.style.maxHeight=`${o}px`)}setSize(t){let[s,o]=t;null!=s&&s.constructor==Number&&(s=`${s}px`),null!=o&&o.constructor==Number&&(o=`${o}px`),s&&(this.root.style.width=s),o&&(this.root.style.height=o),this.onresize&&this.onresize(this.root.getBoundingClientRect()),e.LX.doAsync(()=>{this.size=[this.root.clientWidth,this.root.clientHeight],this.propagateEvent("onresize")},150)}extend(){if(this.splitExtended)return;let[t,s]=this.sections;this.splitExtended=!0,t.root.classList.add(`maximize-${this.type}`),s.root.classList.add(`minimize-${this.type}`),s.root.classList.add(`fadeout-${this.type}`),s.root.classList.remove(`fadein-${this.type}`),"vertical"==this.type?(this.offset=s.root.offsetHeight,this._moveSplit(-1/0,!0)):(this.offset=s.root.offsetWidth-8,this._moveSplit(-1/0,!0,8)),e.LX.doAsync(()=>{this.propagateEvent("onresize")},100)}reduce(){if(!this.splitExtended)return;this.splitExtended=!1;let[t,s]=this.sections;t.root.classList.add(`minimize-${this.type}`),s.root.classList.add(`maximize-${this.type}`),s.root.classList.add(`fadein-${this.type}`),s.root.classList.remove(`fadeout-${this.type}`),this._moveSplit(this.offset),e.LX.doAsync(()=>{this.propagateEvent("onresize")},100)}hide(){this.root.classList.add("hidden")}show(){this.root.classList.remove("hidden")}toggle(e){this.root.classList.toggle("hidden",e)}propagateEvent(e){for(let t=0;t<this.sections.length;t++){const s=this.sections[t];s[e]&&s[e].call(this,s.root.getBoundingClientRect()),s.propagateEvent(e)}}addPanel(e){let t=new ee(e);return this.attach(t),this.panels.push(t),t}addMenubar(t,s={}){let o=new l(t,s);e.LX.menubars.push(o);const[n,i]=this.split({type:"vertical",sizes:["48px",null],resize:!1,menubar:!0});return o.siblingArea=i,n.attach(o),n.isMenubar=!0,(s.sticky??1)&&(n.root.className+=" sticky top-0 z-100"),s.parentClass&&(n.root.className=e.LX.mergeClass(n.root.className,s.parentClass)),o}addSidebar(t,s={}){let o=new e.LX.Sidebar({callback:t,...s});t&&t(o),o.update(),e.LX.sidebars.push(o);const n=s.side??"left";console.assert("left"==n||"right"==n,"Invalid sidebar side: "+n);const i="left"==n,a=s.width??"16rem",r=i?[a,null]:[null,a],[l,c]=this.split({type:"horizontal",sizes:r,resize:!1,sidebar:!0});o.siblingArea=i?c:l;let d=i?l:c;return d.attach(o),d.isSidebar=!0,s.parentClass&&(d.root.className=e.LX.mergeClass(d.root.className,s.parentClass)),o}addOverlayButtons(e,t={}){return this.sections.length?this.sections[1].addOverlayButtons(e,t):(console.assert(e.constructor==Array&&0!==e.length),this.root.style.position="relative",this.overlayButtons=new te(this,e,t),this.overlayButtons)}addTabs(e={}){const t=new c(this,e);return e.folding&&(this.parentArea?._disableSplitResize(),this.root.style.paddingTop="4px"),t}_moveSplit(t,s=!1,o=0){if(!this.type)throw"No split area";if(void 0===t)return;this._autoVerticalResizeObserver&&this._autoVerticalResizeObserver.disconnect();const n=this.sections[0];var i=n.root;i.classList.contains("origin")||(i=i.parentElement);const a=this.sections[1],r=a.root,l="- "+e.LX.DEFAULT_SPLITBAR_SIZE+"px";let c=null;if(s||(c=i.style.transition,i.style.transition=r.style.transition="none"),"horizontal"==this.type){var d=Math.max(r.offsetWidth+t,parseInt(a.minWidth));o&&(d=o);const e=d/this.size[0]*100,s=Math.max(0,100-e);i.style.width=`-moz-calc(${s}% ${l})`,i.style.width=`-webkit-calc( ${s}% ${l})`,i.style.width=`calc( ${s}% ${l})`,r.style.width=`${e}%`,r.style.width=`${e}%`,r.style.width=`${e}%`,n.maxWidth!=1/0&&(r.style.minWidth=`calc( 100% - ${parseInt(n.maxWidth)}px )`)}else{const s=this.size[1];d=Math.max(r.offsetHeight+t+a.offset,parseInt(a.minHeight));d=Math.min(s-e.LX.DEFAULT_SPLITBAR_SIZE,d),o&&(d=o);const c=d/s*100,h=Math.max(0,100-c);i.style.height=`-moz-calc(${h}% ${l})`,i.style.height=`-webkit-calc( ${h}% ${l})`,i.style.height=`calc( ${h}% ${l})`,r.style.height=`${c}%`,r.style.height=`${c}%`,r.style.height=`${c}%`,n.maxHeight!=1/0&&(r.style.minHeight=`calc( 100% - ${parseInt(n.maxHeight)}px )`)}s||(i.style.transition=r.style.transition=c),e.LX.doAsync(()=>{this._update(),this.propagateEvent("onresize")},10)}_disableSplitResize(){this.resize=!1,this.splitBar.remove(),delete this.splitBar}_update(e,t=!0){if(e)this.size=e;else{const e=this.root.getBoundingClientRect();this.size=[e.width,e.height]}if(t)for(var s=0;s<this.sections.length;s++)this.sections[s]._update()}}function oe(t,s=!0){t="light"==t?"light":"dark",document.documentElement.setAttribute("data-mode",t),document.documentElement.classList.toggle("dark","dark"==t),s&&localStorage.setItem("lxColorScheme",t),e.LX.emitSignal("@on_new_color_scheme",t)}function ne(){return document.documentElement.getAttribute("data-mode")??"dark"}function ie(e,t){if(!/^#(?:[A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e))throw`Invalid Hex Color: ${e}`;3!==(e=e.replace(/^#/,"")).length&&4!==e.length||(e=e.split("").map(e=>e+e).join(""));const s=parseInt(e,16),o=(s>>(8===e.length?24:16)&255)/255,n=(s>>(8===e.length?16:8)&255)/255,i=(s>>(8===e.length?8:0)&255)/255,a=(8===e.length?255&s:4===e.length?parseInt(e.slice(-2),16):255)/255;return{r:o,g:n,b:i,a:t?t/100:a}}function ae(e){let{r:t,g:s,b:o,a:n}=e;n=n??1;const i=Math.max(t,s,o),a=i-Math.min(t,s,o);let r=0;0!==a&&(r=i===t?(s-o)/a%6:i===s?(o-t)/a+2:(t-s)/a+4,r*=60,r<0&&(r+=360));return{h:r,s:0===i?0:a/i,v:i,a:n}}e.LX.Area=se,e.LX.twMerge=t.extendTailwindMerge({extend:{classGroups:{pad:[{pad:["xs","sm","md","lg","xl","2xl"]}]}}}),e.LX.clamp=function(e,t,s){return Math.min(Math.max(e,t),s)},e.LX.round=function(e,t){return 0==t?Math.floor(e):+e.toFixed(t??2).replace(/([0-9]+(\.[0-9]+[1-9])?)(\.?0+$)/,"$1")},e.LX.remapRange=function(e,t,s,o,n){return(e-t)*(n-o)/(s-t)+o},"undefined"!=typeof performance?e.LX.getTime=performance.now.bind(performance):"undefined"!=typeof Date&&Date.now?e.LX.getTime=Date.now.bind(Date):e.LX.getTime=function(){return(new Date).getTime()},e.LX.doAsync=function(e,t){setTimeout(e,t??0)},e.LX.flushCss=function(e){e.offsetHeight},e.LX.deleteElement=function(e){e&&e.remove()},e.LX.toCamelCase=function(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(e,t)=>t.toUpperCase())},e.LX.toTitleCase=function(e){return e.replace(/-/g," ").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())},e.LX.toKebabCase=function(e){return e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())},e.LX.getSupportedDOMName=function(e){console.assert("string"==typeof e,"getSupportedDOMName: Text is not a string!");let t=e.trim();return t=t.replace(/\//g,"_slash_").replace(/@/g,"_at_").replace(/\+/g,"_plus_").replace(/\./g,"_dot_"),t=t.replace(/[^a-zA-Z0-9_-]/g,"_"),/^[0-9]/.test(t)&&(t="_"+t),t},e.LX.has=function(t){return e.LX.extensions.indexOf(t)>-1},e.LX.getExtension=function(e){return e.includes(".")?e.split(".").pop():null},e.LX.stripHTML=function(e){const t=document.createElement("div");return t.innerHTML=e,t.textContent||t.innerText||""},e.LX.stripTags=function(e,t){t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");const s=/<\/?([a-z0-9]*)\b[^>]*>?/gi,o=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;let n=e;for(n="<"===n.substring(n.length-1)?n.substring(0,n.length-1):n;;){const e=n;if(n=e.replace(o,"").replace(s,function(e,s){return t.indexOf("<"+s.toLowerCase()+">")>-1?e:""}),e===n)return n}},e.LX.parsePixelSize=function e(t,s){if(t.constructor===Number)return t;if(t.constructor===String){const o=parseFloat(t);if(t.endsWith("px"))return o;if(t.endsWith("%"))return o/100*s;if(t.endsWith("rem")||t.endsWith("em")){return o*16}if(t.endsWith("vw"))return o/100*window.innerWidth;if(t.endsWith("vh"))return o/100*window.innerHeight;if(t.startsWith("calc(")){const o=t.slice(5,-1).split(/([+\-])/);let n=0,i="+";for(let t of o)if(t=t.trim(),"+"===t||"-"===t)i=t;else{let o=e(t,s);n="+"===i?n+o:n-o}return n}}throw"Bad size format!"},e.LX.deepCopy=function(e){return JSON.parse(JSON.stringify(e))},e.LX.concatTypedArray=function(e,t){let s=new t(e.reduce((e,t)=>e+t.length,0)),o=0;for(let t=0;t<e.length;++t)s.set(e[t],o),o+=e[t].length;return s},e.LX.setThemeColor=function(t){document.documentElement.className=`theme-${t}`;const s=e.LX.getMode();document.documentElement.classList.toggle("dark","dark"==s)},e.LX.setMode=oe,e.LX.getMode=ne,e.LX.switchMode=function(){oe("dark"==ne()?"light":"dark")},e.LX.setSystemMode=function(){oe(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),localStorage.removeItem("lxColorScheme"),e.LX._mqlPrefersDarkScheme&&(e.LX._mqlPrefersDarkScheme.removeEventListener("change",e.LX._onChangeSystemTheme),e.LX._mqlPrefersDarkScheme.addEventListener("change",e.LX._onChangeSystemTheme))},e.LX.setCSSVariable=function(e,t){document.querySelector(":root").style.setProperty("--"+e,t)},e.LX.getCSSVariable=function(t){const[s,o]=t.split("/"),n=document.querySelector(":root"),i=getComputedStyle(n);let a=i.getPropertyValue("--"+s);if(!a)return"";if(a.includes("light-dark")){a="light"==i.getPropertyValue("color-scheme")?a.substring(a.indexOf("(")+1,a.indexOf(",")).replace(/\s/g,""):a.substring(a.indexOf(",")+1,a.indexOf(")")).replace(/\s/g,"")}if(o){if(a.includes("/"))return a;if(a.startsWith("rgb(")||a.startsWith("hsl(")||a.startsWith("oklch(")||a.startsWith("lab(")||a.startsWith("lch("))return a.replace(/\)$/,` / ${parseFloat(o)/100})`);if(a.startsWith("#")){const t=e.LX.hexToRgb(a,o);return e.LX.rgbToHex(t)}}return a},e.LX.switchSpacing=function(){const t=document.documentElement.getAttribute("data-spacing")??"default";document.documentElement.setAttribute("data-spacing","default"==t?"compact":"default"),e.LX.emitSignal("@on_new_spacing_layout",t)},e.LX.getBase64Image=function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");return s&&s.drawImage(e,0,0),t.toDataURL("image/png")},e.LX.hexToRgb=ie,e.LX.hexToHsv=function(e){return ae(ie(e))},e.LX.rgbToHex=function(t,s=255){const o=[t.r,t.g,t.b];return null!=t.a&&o.push(t.a),"#"+o.map(t=>{const o=(t=Math.floor(e.LX.clamp(t*s,0,s))).toString(16);return 1===o.length?"0"+o:o}).join("")},e.LX.oklchToHex=function(t){const s=t.match(/oklch\(\s*([\d.]+)%\s+([\d.]+)\s+([\d.]+)\s*\)/);if(!s)return console.error("Invalid OKLCH format"),"#000";let[,o,n,i]=s;const a=parseFloat(o)/100,r=parseFloat(i)*Math.PI/180,l=parseFloat(n)*Math.cos(r),c=parseFloat(n)*Math.sin(r),d=(a+.3963377774*l+.2158037573*c)**3,h=(a-.1055613458*l-.0638541728*c)**3,u=(a-.0894841775*l-1.291485548*c)**3;let p=4.0767416621*d-3.3077115913*h+.2309699292*u,m=-1.2684380046*d+2.6097574011*h-.3413193965*u,g=-.0041960863*d-.7034186147*h+1.707614701*u;const f=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055;return p=f(p),m=f(m),g=f(g),e.LX.rgbToHex({r:p,g:m,b:g})},e.LX.rgbToCss=function(e){return{r:Math.floor(255*e.r),g:Math.floor(255*e.g),b:Math.floor(255*e.b),a:e.a}},e.LX.rgbToHsv=ae,e.LX.hsvToRgb=function(e){const{h:t,s:s,v:o,a:n}=e,i=o*s,a=i*(1-Math.abs(t/60%2-1)),r=o-i;let l=0,c=0,d=0;return t<60?(l=i,c=a,d=0):t<120?(l=a,c=i,d=0):t<180?(l=0,c=i,d=a):t<240?(l=0,c=a,d=i):t<300?(l=a,c=0,d=i):(l=i,c=0,d=a),{r:l+r,g:c+r,b:d+r,a:n}},e.LX.dateFromDateString=function(e){const t=e.split("/"),s=parseInt(t[0]),o=parseInt(t[1]),n=parseInt(t[2]);return new Date(`${o}/${s}/${n}`)},e.LX.measureRealWidth=function(t,s=8){var o=document.createElement("span");o.className="lexinputmeasure",o.innerHTML=t,document.body.appendChild(o);var n=o.getBoundingClientRect();return e.LX.deleteElement(o),n.width+s},e.LX.guidGenerator=function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+"-"+e()+"-"+e()},e.LX.escapeRegExp=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},e.LX.wildcardToRegExp=function(e){const t=e.replace(/([.+^${}()|[\]\\])/g,"\\$1").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^"+t+"$","i")},e.LX.buildTextPattern=function(e={}){let t=[];e.lowercase&&t.push("(?=.*[a-z])"),e.uppercase&&t.push("(?=.*[A-Z])"),e.digit&&t.push("(?=.*\\d)"),e.specialChar&&t.push("(?=.*[@#$%^&+=!])"),e.noSpaces&&t.push("(?!.*\\s)"),e.email&&t.push("(^[^s@]+@[^s@]+.[^s@]+$)");let s=e.minLength||0,o=e.maxLength||"",n=`^${t.join("")}.{${s},${o}}$`;return e.asRegExp?new RegExp(n):n},e.LX.validateValueAtPattern=function(e,t={},...s){const o=[],n=t.minLength||0,i=t.maxLength;return e.length<n?o.push(`Must be at least ${n} characters long.`):void 0!==i&&e.length>i&&o.push(`Must be no more than ${i} characters long.`),t.lowercase&&!/[a-z]/.test(e)&&o.push("Must contain at least one lowercase letter (a-z)."),t.uppercase&&!/[A-Z]/.test(e)&&o.push("Must contain at least one uppercase letter (A-Z)."),t.digit&&!/\d/.test(e)&&o.push("Must contain at least one number (0-9)."),t.noSpaces&&/\s/.test(e)&&o.push("Must NOT contain any spaces."),t.specialChar&&!/[@#$%^&+=!]/.test(e)&&o.push("Must contain at least one special character (e.g., @, #, $, %, ^, &, +, =, !)."),t.email&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)&&o.push("Must have a valid email format."),t.fieldMatchName&&e!==s[0]&&o.push(`Must match ${t.fieldMatchName} field.`),o},e.LX.makeDraggable=function(t,s={}){let o=0,n=0,i=null,a=s.targetClass,r=s.dragMargin??3,l=(s,i,a)=>{const l=t.parentElement?t.parentElement.getBoundingClientRect():{x:0,y:0,width:0,height:0},c="fixed"==t.style.position?new P(l.x,l.y):new P;a=a??s.clientX-o-l.x,i=i??s.clientY-n-l.y,t.style.left=e.LX.clamp(a,r+c.x,c.x+l.width-t.offsetWidth-r)+"px",t.style.top=e.LX.clamp(i,r+c.y,c.y+l.height-t.offsetHeight-r)+"px",t.style.translate="none"};s.autoAdjust&&l(null,parseInt(t.style.left),parseInt(t.style.top));let c=e.LX.guidGenerator();t["draggable-id"]=c;let d=s.onMove?e=>{i&&s.onMove&&s.onMove(i)}:e=>{i&&l(e)},h=s.onDragStart;t.setAttribute("draggable","true"),t.addEventListener("mousedown",function(e){i=e.target.classList.contains(a)||!a?e.target:null}),t.addEventListener("dragstart",function(a){if(a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation(),!i)return;var r=new Image;r.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",a.dataTransfer&&(a.dataTransfer.setDragImage(r,0,0),a.dataTransfer.effectAllowed="move");const l=a.target.getBoundingClientRect(),c=i.parentElement.getBoundingClientRect(),u="fixed"==i.style.position?new P(c.x,c.y):new P;o=a.clientX-l.x-u.x,n=a.clientY-l.y-u.y,document.addEventListener("mousemove",d),i.eventCatched=!0,(s.updateLayers??1)&&(e.LX.activeDraggable&&(e.LX.activeDraggable.style.zIndex=e.LX.DRAGGABLE_Z_INDEX),e.LX.activeDraggable=t,e.LX.activeDraggable.style.zIndex=e.LX.DRAGGABLE_Z_INDEX+1),h&&h(i,a)},!1),document.addEventListener("mouseup",e=>{i&&(i=null,document.removeEventListener("mousemove",d))})},e.LX.makeCollapsible=function(t,s,o,n={}){t.classList.add("collapsible");const i=n.collapsed??!0,a=e.LX.makeIcon("Right");a.classList.add("collapser"),i&&(a.dataset.collapsed="true",s.style.display="none"),a.style.marginLeft="auto",a.style.marginRight="0.2rem",a.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),this.dataset.collapsed?(delete this.dataset.collapsed,s.style.display=n.display??"block"):(this.dataset.collapsed="true",s.style.display="none")}),t.appendChild(a),(o=o??t.parentElement).appendChild(s)},e.LX.makeCodeSnippet=function(t,s,o={}){if(!e.LX.has("CodeEditor"))return void console.error("Import the CodeEditor component to create snippets!");const n=document.createElement("div");n.className=e.LX.mergeClass("lexcodesnippet relative rounded-xl overflow-hidden",o.className),n.style.width=s?s[0]:"auto",n.style.height=s?s[1]:"auto";const i=new se({xskipAppend:!0});return new e.LX.CodeEditor(i,{skipInfo:!0,disableEdition:!0,allowAddScripts:!1,name:o.tabName,onReady:e=>{if(e.setText(t,o.language??"Plain Text"),o.linesAdded){const t=e.root.querySelector(".code");for(let e of o.linesAdded){const s=e;if(s.constructor==Number)t.childNodes[s-1].classList.add("added");else if(s.constructor==Array)for(let e=s[0]-1;e<=s[1]-1;e++)t.childNodes[e].classList.add("added")}}if(o.linesRemoved){const t=e.root.querySelector(".code");for(let e of o.linesRemoved){const s=e;if(s.constructor==Number)t.childNodes[s-1].classList.add("removed");else if(s.constructor==Array)for(let e=s[0]-1;e<=s[1]-1;e++)t.childNodes[e].classList.add("removed")}}if(o.windowMode){const t=document.createElement("div");t.className="lexwindowbuttons";const s=document.createElement("span");s.style.background="#ee4f50";const o=document.createElement("span");o.style.background="#f5b720";const n=document.createElement("span");n.style.background="#53ca29",t.appendChild(s),t.appendChild(o),t.appendChild(n);e.root.querySelector(".lexareatabs").prepend(t)}(o.lineNumbers??1)||e.root.classList.add("no-gutter")}}),n.appendChild(i.root),n},e.LX.makeKbd=function(t,s=!0,o=""){const n={Ctrl:"⌃",Enter:"↩",Shift:"⇧",CapsLock:"⇪",Meta:"⌘",Option:"⌥",Alt:"⌥",Tab:"⇥",ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→",Space:"␣"},i=e.LX.makeContainer(["auto","auto"],"text-muted-foreground font-sans text-xs inline-flex\n ml-auto pointer-events-none select-none items-center justify-center gap-1");for(const a of t)e.LX.makeContainer(["auto","auto"],"bg-muted px-1 rounded-sm "+o,s?n[a]??a:a,i);return i},e.LX.makeBreadcrumb=function(t,s={}){const o=e.LX.makeContainer(["auto","auto"],"flex flex-row gap-1"),n=s.separatorIcon??"ChevronRight",i=s.maxItems??4,a=t.length-i;if(a>0){const e={name:"...",ellipsis:t.splice(1,a+1).map(e=>e.name).join("/")};t.splice(1,0,e)}for(let s=0;s<t.length;++s){const i=t[s];if(console.assert(i.name,"Breadcrumb item must have a name!"),0!=s){const t=e.LX.makeIcon(n,{svgClass:"sm text-foreground separator"});o.appendChild(t)}const a=s==t.length-1,r=e.LX.makeContainer(["auto","auto"],"p-1 flex flex-row gap-1 items-center "+(a?"text-foreground":"text-muted-foreground"));o.appendChild(r);let l=e.LX.makeElement("p","",i.name);if(i.icon&&r.appendChild(e.LX.makeIcon(i.icon,{svgClass:"sm"})),void 0!==i.items){const t=e.LX.makeContainer(["auto","auto"],""+(a?"text-foreground":"text-muted-foreground"));e.LX.listen(t,"click",t=>{e.LX.addDropdownMenu(t.target,i.items,{side:"bottom",align:"start"})}),t.append(l),r.appendChild(t)}else if(void 0!==i.url){let t=e.LX.makeElement("a","decoration-none hover:underline underline-offset-4 "+(a?"text-foreground":"text-muted-foreground"),"",r);t.href=i.url,t.appendChild(l)}else r.appendChild(l);i.ellipsis&&e.LX.asTooltip(r,i.ellipsis,{side:"bottom",offset:4})}return o},e.LX.makeIcon=function(t,s={}){let o=null;const n=function(o){const n=s.svgClass;if(n&&n.length){const t=e.LX.twMerge(...o.classList,...n.split(" "));o.classList.remove(...o.classList),t.split(" ").forEach(e=>o.classList.add(e))}const i=e.LX.makeElement("a",e.LX.mergeClass("lexicon",s.iconClass));return i.title=s.title??"",i.appendChild(o),o.dataset.name=t,i};if(t.includes("@")){const e=t.split("@");t=e[0],s.variant=e[1]}let i=e.LX.ICONS[t];const a=window.lucide,r=a[t]??a[e.LX.LucideIconAlias[t]];if(i){i.constructor!=Array&&(i=e.LX.ICONS[i]);const a=s.variant??"regular";i=("solid"==a?e.LX.ICONS[`${t}@solid`]:i)??i;const l=i[3];if(a==l||!r||"regular"==l){if(o=document.createElementNS("http://www.w3.org/2000/svg","svg"),o.classList.add("text-inherit"),o.setAttribute("viewBox",`0 0 ${i[0]} ${i[1]}`),i[5]){const e=i[5].svgClass;e?.split(" ").forEach(e=>{o.classList.add(e)});const t=i[5].svgAttributes;t?.split(" ").forEach(e=>{const t=e.split("=");o.setAttribute(t[0],t[1])})}const e=document.createElement("path");if(e.classList.add("text-inherit"),e.setAttribute("fill","currentColor"),e.setAttribute("d",i[4]),o.appendChild(e),i[5]){const t=i[5].pathClass;t?.split(" ").forEach(t=>{e.classList.add(t)});const s=i[5].pathAttributes;s?.split(" ").forEach(t=>{const s=t.split("=");e.setAttribute(s[0],s[1])})}const t="\x3c!-- This icon might belong to a collection from Iconify - https://iconify.design/ - or !Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e";return o.innerHTML+=t,n(o)}}return console.assert(r,`No existing icon named _${t}_`),o=a.createElement(r,s),n(o)},e.LX.registerIcon=function(t,s,o="none",n=[]){const i=(new DOMParser).parseFromString(s,"image/svg+xml").documentElement,a=i.querySelector("path"),r=i.getAttribute("viewBox").split(" "),l=a.getAttribute("d");let c=[],d=[];for(const e of i.attributes)switch(e.name){case"transform":case"fill":case"stroke-width":case"stroke-linecap":case"stroke-linejoin":c.push(`${e.name}=${e.value}`)}for(const e of a.attributes)switch(e.name){case"transform":case"fill":case"stroke-width":case"stroke-linecap":case"stroke-linejoin":d.push(`${e.name}=${e.value}`)}const h=[parseInt(r[2]),parseInt(r[3]),n,o,l,{svgAttributes:c.length?c.join(" "):null,pathAttributes:d.length?d.join(" "):null}];e.LX.ICONS[t]&&console.warn(`${t} will be added/replaced in LX.ICONS`),e.LX.ICONS[t]=h},e.LX.registerCommandbarEntry=function(t,s){e.LX.extraCommandbarEntries.push({name:t,callback:s})},e.LX.message=function(t,s,o={}){if(!t)throw"No message to show";return o.modal=!0,new e.LX.Dialog(s,e=>{e.addTextArea(null,t,null,{disabled:!0,fitHeight:!0})},o)},e.LX.popup=function(t,s,o={}){if(!t)throw"No message to show";o.size=o.size??["max-content","auto"];const n=o.timeout||3e3,i=new e.LX.Dialog(s,e=>{e.addTextArea(null,t,null,{disabled:!0,fitHeight:!0})},o);return setTimeout(()=>{i.close()},Math.max(n,150)),i},e.LX.prompt=function t(s,o,n,i={}){i.modal=!0,i.className="prompt";let a="";const r=()=>{i.required&&""===a?(s+=s.includes("You must fill the input text.")?"":"\nYou must fill the input text.",l.close(),t(s,o,n,i)):(n&&n.call(e.LX,a),l.close())},l=new e.LX.Dialog(o,t=>{e.LX.makeElement("p","max-h-64 p-2 break-word overflow-scroll",s,t),(i.input??1)&&t.addText(null,i.input||a,(e,t)=>{a=e,t?.constructor===KeyboardEvent&&r()},{placeholder:"..."}),t.sameLine(2),t.addButton(null,"Cancel",()=>{i.on_cancel&&i.on_cancel(),l.close()},{width:"50%",buttonClass:"destructive"}),t.addButton(null,i.accept||"Continue",()=>{r()},{width:"50%",buttonClass:"primary"})},i);return(i.input??1)&&l.root.querySelector("input").focus(),l},e.LX.toast=function(t,s,o={}){if(!t)throw"The toast needs at least a title!";const n=e.LX.notifications;console.assert(n);const i=e.LX.makeElement("li","lextoast flex flex-row relative w-full border-color overflow-hidden select-none pointer-events-auto touch-none rounded-lg p-3","",n),[a,r]=o.position?o.position.split("-"):["bottom","right"];switch(n.style.right="unset",n.style.left="unset",n.style.top="unset",n.style.bottom="unset",n.style.placeSelf="unset",a){case"top":i.style.translate="0 -30px",n.style.top="1rem",n.style.flexDirection="column";break;case"bottom":i.style.translate="0 calc(100% + 30px)",n.style.top="auto",n.style.bottom="1rem",n.style.flexDirection="column-reverse"}switch(r){case"left":n.style.left="1rem";break;case"center":n.style.placeSelf="center",n.style.justifySelf="anchor-center";break;case"right":n.style.right="1rem"}i.classList.add(a),i.classList.add(r),e.LX.doAsync(()=>{n.offsetWidth>n.iWidth&&(n.iWidth=Math.min(n.offsetWidth,480),n.style.width=n.iWidth+"px"),i.dataset.open=!0},10);const l=e.LX.makeElement("div","grid h-fit max-w-lg gap-1 items-center mr-6 [&_div]:truncate [&_svg]:shrink-0","",i);if(e.LX.makeElement("div","flex flex-row gap-2 text-sm text-foreground items-center min-w-0",t,l),s&&e.LX.makeElement("div","text-secondary-foreground text-xs",s,l),o.action){const t=new ee;t.addButton(null,o.action.name??"Accept",o.action.callback.bind(e.LX,i),{width:"auto",maxWidth:"150px",className:"right",buttonClass:"outline sm"}),i.appendChild(t.root.childNodes[0])}if(i.close=function(){this.dataset.open="false",e.LX.doAsync(()=>{this.remove(),e.LX.notifications.childElementCount||(e.LX.notifications.style.width="unset",e.LX.notifications.iWidth=0)},500)},o.closable??1){const t=e.LX.makeIcon("X",{iconClass:"absolute top-2 right-2 text-sm"});t.addEventListener("click",()=>{i.close()}),i.appendChild(t)}const c=o.timeout??3e3;-1!=c&&e.LX.doAsync(()=>{i.close()},c)},e.LX.badge=function(t,s,o={}){const n=document.createElement("div");n.innerHTML=t;const i=["lexbadge","inline-flex","items-center","justify-center","rounded-full","border","px-2","py-0.5","text-xs","font-medium","w-fit","whitespace-nowrap","shrink-0","overflow-hidden","border-transparent","gap-1","min-w-5","bg-card text-foreground"];if(n.className=s?e.LX.twMerge(...i,...s.split(" ")):i.join(" "),Object.assign(n.style,o.style??{}),o.callback){const t=e.LX.makeIcon("ArrowUpRight",{svgClass:"xs"});t.querySelector("svg").style.marginLeft="-0.25rem",n.innerHTML+=t.innerHTML,n.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),o.callback()})}return o.parent&&(o.parent.classList.add("lexbadge-parent"),o.parent.appendChild(n)),o.asElement?n:n.outerHTML},e.LX.makeElement=function(e,t,s,o,n={}){const i=document.createElement(e);return i.className=t??"",i.innerHTML=s??"",Object.assign(i.style,n),o&&(o.attach?o.attach(i):o.appendChild(i)),i},e.LX.makeContainer=function(t,s,o,n,i={}){const a=e.LX.makeElement("div","lexcontainer "+(s??""),o,n,i);return a.style.width=t&&t[0]?t[0]:"100%",a.style.height=t&&t[1]?t[1]:"100%",a},e.LX.asTooltip=function(t,s,o={}){console.assert(t,"You need a trigger to generate a tooltip!"),t.dataset.disableTooltip=!(o.active??1);let n=null;const i=o.offset,a=o.offsetX??i??0,r=o.offsetY??i??6;t.addEventListener("mouseenter",function(i){if("true"==t.dataset.disableTooltip)return;n=e.LX.makeElement("div","lextooltip fixed bg-secondary-foreground text-secondary text-xs px-2 py-1 rounded-lg pointer-events-none data-closed:opacity-0",t.dataset.tooltipContent??s);const l=t.closest("dialog"),c=l??e.LX.root;e.LX.root.querySelectorAll(".lextooltip").forEach(e=>e.remove()),c.appendChild(n),e.LX.doAsync(()=>{const s=[0,0],i=parseFloat(t.dataset.tooltipOffsetX??a),d=parseFloat(t.dataset.tooltipOffsetY??r),h=t.getBoundingClientRect();let u=!0;switch(o.side??"top"){case"left":s[0]+=h.x-n.offsetWidth-i,u=!1;break;case"right":s[0]+=h.x+h.width+i,u=!1;break;case"top":s[1]+=h.y-n.offsetHeight-d,u=!0;break;case"bottom":s[1]+=h.y+h.height+d,u=!0}if(u?s[0]+=h.x+.5*h.width-.5*n.offsetWidth+i:s[1]+=h.y+.5*h.height-.5*n.offsetHeight+d,s[0]=e.LX.clamp(s[0],0,window.innerWidth-n.offsetWidth-4),s[1]=e.LX.clamp(s[1],0,window.innerHeight-n.offsetHeight-4),l){let e=c.getBoundingClientRect();s[0]-=e.x,s[1]-=e.y}n.style.left=`${s[0]}px`,n.style.top=`${s[1]}px`,o.callback&&o.callback(n,t)})}),t.addEventListener("mouseleave",function(e){n&&n.remove()})},e.LX.insertChildAtIndex=function(e,t,s=1/0){s>=e.children.length?e.appendChild(t):e.insertBefore(t,e.children[s])},e.LX.getComputedSize=function(e){return{width:e.offsetWidth,height:e.offsetHeight}},e.LX.listen=function(e,t,s,o){e[o=o??"_on"+t]=s,e.addEventListener(t,s)},e.LX.ignore=function(e,t,s){const o=e[s=s??"_on"+t];e.removeEventListener(t,o)},e.LX.getParentArea=function(e){let t=e.parentElement;for(;t;){if(t.classList.contains("lexarea"))return t;t=t.parentElement}},e.LX.hasClass=function(e,t){return!!(t=[].concat(t)).filter(t=>e.classList.contains(t)).length},e.LX.addClass=function(e,t){if(!t)return;const s=t.split(" ");e.classList.add(...s)},e.LX.removeClass=function(e,t){if(!t)return;const s=t.split(" ");e.classList.remove(...s)},e.LX.toggleClass=function(e,t,s){t&&e.classList.toggle(t,s)},e.LX.mergeClass=function(t,s){return s&&(t=[t,s].join(" ")),e.LX.twMerge(...t.split(" "))},e.LX.lastChar=function(e){return e[e.length-1]},Object.assign(e.LX,{request(e){var t=e.dataType||"text";"json"==t||"xml"==t?t="text":"binary"==t&&(t="arraybuffer",e.mimeType="application/octet-stream");var s=new XMLHttpRequest;s.open(e.data?"POST":"GET",e.url,!0),t&&(s.responseType=t),e.mimeType&&s.overrideMimeType(e.mimeType),e.nocache&&s.setRequestHeader("Cache-Control","no-cache"),s.onload=function(t){var s=this.response;if(200==this.status){if("json"==e.dataType)try{s=JSON.parse(s)}catch(o){if(!e.error)throw o;e.error(o)}else if("xml"==e.dataType)try{s=(new DOMParser).parseFromString(s,"text/xml")}catch(o){if(!e.error)throw o;e.error(o)}e.success&&e.success.call(this,s,this)}else{var o="Error "+this.status;e.error&&e.error(o)}},s.onerror=function(t){e.error&&e.error(t)};var o=new FormData;if(e.data)for(var n in e.data)o.append(n,e.data[n]);return s.send(o),s},requestFileAsync:async(e,t,s=!1)=>new Promise((o,n)=>{const i="arraybuffer"===(t=t??"arraybuffer")?"application/octet-stream":void 0;var a=new XMLHttpRequest;return a.open("GET",e,!0),a.responseType=t,i&&a.overrideMimeType(i),s&&a.setRequestHeader("Cache-Control","no-cache"),a.onload=function(){var e=this.response;if(200==this.status)o(e);else{var t="Error "+this.status;n(t)}},a.onerror=function(e){n(e)},a.send(),a}),requestText(e,t,s){return this.request({url:e,dataType:"text",success:t,error:s})},requestJSON(e,t,s){return this.request({url:e,dataType:"json",success:t,error:s})},requestBinary(e,t,s){return this.request({url:e,dataType:"binary",success:t,error:s})},requireScript(e,t,s,o,n){if(!e)throw"invalid URL";e.constructor===String&&(e=[e]);var i=e.length,a=[];for(var r in e){var l=document.createElement("script");l.num=r,l.type="text/javascript",l.src=e[r]+(n?"?version="+n:""),l.original_src=e[r],l.async=!1,l.onload=function(e){i--,a.push(this),i?o&&o(this.original_src,this.num):t&&t(a)},s&&(l.onerror=function(e){s(e,this.original_src,this.num)}),document.getElementsByTagName("head")[0].appendChild(l)}},loadScriptSync:e=>new Promise((t,s)=>{const o=document.createElement("script");o.src=e,o.async=!1,o.onload=()=>t(1),o.onerror=()=>s(new Error(`Failed to load ${e}`)),document.head.appendChild(o)}),downloadURL(t,s){const o=new FileReader,n=function(e){var t=document.createElement("a");t.href=e,t.download=s,document.body.appendChild(t),t.click(),document.body.removeChild(t)};t.includes("http")?e.LX.request({url:t,dataType:"blob",success:e=>{o.readAsDataURL(e),o.onload=e=>{n(e.currentTarget.result)}}}):n(t)},downloadFile:function(e,t,s){if(t){s||(s=t.constructor===String?"text/plain":"application/octet-stream");var o=null;o=t.constructor!==File&&t.constructor!==Blob?new Blob([t],{type:s}):t;var n=URL.createObjectURL(o),i=document.createElement("a");i.setAttribute("href",n),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(function(){URL.revokeObjectURL(n)},6e4)}else console.warn("No file provided to download")}}),e.LX.formatBytes=function(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,t)).toFixed(2)+" "+["B","KB","MB","GB","TB"][t]},e.LX.compareThreshold=function(e,t,s,o){return Math.abs(e-t)>=o||Math.abs(e-s)>=o},e.LX.compareThresholdRange=function(e,t,s,o){return e>=s&&e<=o||t>=s&&t<=o||e<=s&&t>=o},e.LX.getControlPoints=function(e,t,s,o,n,i,a){var r=Math.sqrt(Math.pow(s-e,2)+Math.pow(o-t,2)),l=a*r/(r+Math.sqrt(Math.pow(n-s,2)+Math.pow(i-o,2))),c=a-l;return[s+l*(e-n),o+l*(t-i),s-c*(e-n),o-c*(t-i)]},e.LX.drawSpline=function(t,s,o){t.save();for(var n=[],i=s.length,a=0;a<i-4;a+=2)n=n.concat(e.LX.getControlPoints(s[a],s[a+1],s[a+2],s[a+3],s[a+4],s[a+5],o));for(a=2;a<s.length-5;a+=2)t.beginPath(),t.moveTo(s[a],s[a+1]),t.bezierCurveTo(n[2*a-2],n[2*a-1],n[2*a],n[2*a+1],s[a+2],s[a+3]),t.stroke(),t.closePath();t.beginPath(),t.moveTo(s[0],s[1]),t.quadraticCurveTo(n[0],n[1],s[2],s[3]),t.stroke(),t.closePath(),t.beginPath(),t.moveTo(s[i-2],s[i-1]),t.quadraticCurveTo(n[2*i-10],n[2*i-9],s[i-4],s[i-3]),t.stroke(),t.closePath(),t.restore()};class re{root;imageElement=void 0;fallbackElement=void 0;constructor(t){let s="lexavatar bg-card items-center flex flex-row relative size-8 shrink-0 overflow-hidden rounded-full";if(this.root=e.LX.makeElement("div"),t.imgSource){const s="aspect-square size-full object-cover",o=e.LX.makeElement("img",t.imgClass?e.LX.twMerge(...s.split(" "),...t.imgClass.split(" ")):s,"",this.root);o.src=t.imgSource,o.alt=t.imgAlt,this.imageElement=o}else if(t.fallback){const o="size-full text-sm font-semibold place-self-center text-center content-center",n=e.LX.makeElement("span",t.fallbackClass?e.LX.twMerge(...o.split(" "),...t.fallbackClass.split(" ")):o,t.fallback,this.root);this.fallbackElement=n,s+=" border-color"}this.root.className=t.className?e.LX.twMerge(...s.split(" "),...t.className.split(" ")):s}}e.LX.Avatar=re;class le{root;constructor(t={}){const s=t.icon??"LoaderCircle",o=t.size??"md",n=e.LX.mergeClass("flex",t.iconClass),i=e.LX.mergeClass(`animate-spin ${o}`,t.svgClass);this.root=e.LX.makeIcon(s,{iconClass:n,svgClass:i})}html(){return this.root.innerHTML}destroy(){this.root.remove()}}e.LX.Spinner=le;class ce{static _last_id=0;id;root;panel;title;size=[];branchData;close=()=>{};_oncreate;constructor(t,s,o={}){s||console.warn("Content is empty, add some components using 'callback' parameter!"),this._oncreate=s,this.id=e.LX.guidGenerator();const n=o.size??[],i=o.position??[],a=o.draggable??!0,r=o.dockable??!1,l=o.modal??!1;let c=document.createElement("dialog");c.className=e.LX.mergeClass("lexdialog absolute outline-none border-color m-0 p-0 min-w-3xs min-h-max overflow-hidden rounded-xl bg-background",o.className),c.id=o.id??"dialog"+ce._last_id++,c.dataset.modal=l,e.LX.root.appendChild(c),e.LX.doAsync(()=>{l?c.showModal():c.show()},10);let d=this;const h=document.createElement("div");if(t&&(h.className="lexdialogtitle flex w-full outline-none items-center justify-between font-semibold text-xl text-secondary-foreground pad-xl select-none",h.innerHTML=t,h.setAttribute("draggable","false"),c.appendChild(h)),o.closable??1){this.close=()=>{o.onBeforeClose&&o.onBeforeClose(this),o.onclose?o.onclose(this.root):(c.close(),e.LX.doAsync(()=>{d.panel.clear(),c.remove()},150))};const s=e.LX.makeIcon("X",{title:"Close",iconClass:"lexdialogcloser text-lg text-secondary-foreground cursor-pointer z-1 select-none"});s.addEventListener("click",this.close);const n=e.LX.makeIcon("Minus",{title:"Dock",iconClass:"ml-auto mr-2"});n.addEventListener("click",()=>{const e=this.branchData,t=e.panel,s=t.root.childElementCount,o=t.branch(e.name,{closed:e.closed});o.components=e.components;for(let e of o.components)o.content.appendChild(e.root);e.childIndex<s&&t.root.insertChildAtIndex(o.root,e.childIndex),this.close()}),t?(r&&h.appendChild(n),h.appendChild(s)):(s.classList.add("notitle"),c.appendChild(s))}const u=new e.LX.Panel({className:"lexdialogcontent w-full p-1 text-secondary-foreground text-sm ml-0 break-all"});t||u.root.classList.add("notitle"),s&&s.call(this,u),c.appendChild(u.root),u.root.querySelectorAll(".lexbranch").forEach(e=>e.classList.add("dialog")),this.panel=u,this.root=c,this.title=h,a&&e.LX.makeDraggable(c,Object.assign({targetClass:"lexdialogtitle"},o)),n.length&&"string"!=typeof n[0]&&(n[0]+="px"),n.length&&"string"!=typeof n[1]&&(n[1]+="px"),c.style.width=n[0]?n[0]:"25%",c.style.height=n[1]?n[1]:"auto",c.style.translate=o.position?"unset":"-50% -50%",o.size&&(this.size=n),c.style.left=i[0]??"50%",c.style.top=i[1]??"50%",u.root.style.height=t?"calc( 100% - "+(h.offsetHeight+30)+"px )":"calc(100%)"}destroy(){this.root.remove()}refresh(){this.panel.root.innerHTML="",this._oncreate.call(this,this.panel)}setPosition(e,t){this.root.style.left=`${e}px`,this.root.style.top=`${t}px`}setTitle(e){const t=this.root.querySelector(".lexdialogtitle");t&&(t.innerText=e)}}e.LX.Dialog=ce;class de extends ce{constructor(t,s,o,n={}){n.closable=!1,n.draggable=!1,n.modal=!0,super(void 0,i=>{i.root.className=e.LX.mergeClass(i.root.className,"pad-2xl flex flex-col gap-2"),e.LX.makeContainer(["100%","100%"],"text-lg font-medium text-foreground px-2",t,i),i.addTextArea(null,s,null,{disabled:!0,fitHeight:!0,inputClass:"bg-none text-sm text-muted-foreground"}),i.sameLine(2,"justify-end"),i.addButton(null,n.cancelText??"Cancel",()=>{n.cancelCallback&&n.cancelCallback(),this.destroy()},{buttonClass:"outline"}),i.addButton(null,n.continueText??"Continue",()=>{this.destroy(),o&&o()},{buttonClass:"primary"})},n)}}e.LX.AlertDialog=de;class he{root;items;colors;_parent;constructor(t,s,o={}){if(document.body.querySelectorAll(".lexcontextmenu").forEach(e=>e.remove()),this.root=document.createElement("div"),this.root.className="lexcontextmenu",this.root.addEventListener("mouseleave",function(){this.remove()}),this.items=[],this.colors={},s){let e={};e[s]=[],e.className="cmtitle",e.icon=o.icon,this.items.push(e)}const n=t.target.closest("dialog");n&&"true"==n.dataset.modal?this._parent=n:this._parent=e.LX.root,this._parent.appendChild(this.root);const i=[t.x-48,t.y-8];if(this._parent instanceof HTMLDialogElement){let e=this._parent.getBoundingClientRect();i[0]-=e.x,i[1]-=e.y}this.root.style.left=`${i[0]}px`,this.root.style.top=`${i[1]}px`}_adjustPosition(e,t,s=!1){let o=e.getBoundingClientRect(),n=parseInt(e.style.left),i=parseInt(e.style.top);if(s){let s=window.innerWidth-o.right;s<0&&(n=e.offsetLeft+(s-t)),s=window.innerHeight-(o.top+o.height),s<0&&(i=e.offsetTop+(s-t+20))}else{let s=o.width;o.left<0?n=t:window.innerWidth-o.right<0&&(n=window.innerWidth-s-t),o.top<0?i=t:o.top+o.height>window.innerHeight&&(e.style.marginTop="",i=window.innerHeight-o.height-t)}e.style.left=`${n}px`,e.style.top=`${i}px`}_createSubmenu(e,t,s,o){this.root.querySelectorAll(".lexcontextmenu").forEach(e=>e.remove());let n=document.createElement("div");n.className="lexcontextmenu",s.appendChild(n);for(let s=0;s<e[t].length;++s){const i=e[t][s],a=Object.keys(i)[0];this._createEntry(i,a,n,o)}const i=s.getBoundingClientRect();n.style.left=i.x+i.width+"px",n.style.marginTop="-31px",this._adjustPosition(n,6)}_createEntry(t,s,o,n){const i=t[s].length;let a=document.createElement("div");a.className="lexmenuboxentry"+(t.className?" "+t.className:""),a.id=t.id??"eId"+e.LX.getSupportedDOMName(s),a.innerHTML="";const r=t.icon;r&&a.appendChild(e.LX.makeIcon(r,{svgClass:"sm"}));const l=t.disabled;if(a.innerHTML+="<div class='lexentryname"+(l?" disabled":"")+"'>"+s+"</div>",o.appendChild(a),this.colors[s]&&(a.style.borderColor=this.colors[s]),""==s)return void(a.className+=" cmseparator");if(a.addEventListener("click",o=>{if(o.stopPropagation(),o.stopImmediatePropagation(),l)return;const r=t.callback;r&&(r.call(this,s,a),this.root.remove()),i&&"click"==e.LX.OPEN_CONTEXTMENU_ENTRY&&this._createSubmenu(t,s,a,++n)}),!i)return;const c=e.LX.makeIcon("Menu",{svgClass:"sm"});a.appendChild(c),"mouseover"==e.LX.OPEN_CONTEXTMENU_ENTRY&&a.addEventListener("mouseover",e=>{"true"!=a.dataset.built&&(a.dataset.built="true",this._createSubmenu(t,s,a,++n),e.stopPropagation())}),a.addEventListener("mouseleave",()=>{n=-1,o.querySelectorAll(".lexcontextmenu").forEach(e=>e.remove())})}onCreate(){e.LX.doAsync(()=>this._adjustPosition(this.root,6))}add(t,s={}){s.constructor==Function&&(s={callback:s});const o=(t+="").split("/"),n=o[o.length-1];this.colors[n]=s.color;let i=0;const a=(e,t)=>{if(null==e)return;let n=null;if(t.forEach(t=>{const s=Object.keys(t).find(t=>t==e);s&&(n=t[s])}),n)a(o[i++],n);else{let n={};n[e]=[];const r=o[i++];r||(n.id=s.id,n.icon=s.icon,n.callback=s.callback,n.disabled=s.disabled??!1),t.push(n),a(r,n[e])}};a(o[i++],this.items);const r=e=>{let t=Object.keys(e)[0],s=e[t];if(s.length){if(null==s.find(e=>Object.keys(e)[0]==t)){let s={};s[t]=[],s.className="cmtitle",e[t].unshift(s)}for(let s of e[t]){let e=Object.keys(s)[0];for(let t=0;t<s[e].length;++t)r(s)}}};for(let e of this.items)r(e);for(let t of this.items){let s=Object.keys(t)[0],o="eId"+e.LX.getSupportedDOMName(s);const n="#"+(t.id??o);this.root.querySelector(n)||this._createEntry(t,s,this.root,-1)}}setColor(t,s){"#"!==s[0]&&(s=e.LX.rgbToHex(s)),this.colors[t]=s}}e.LX.ContextMenu=he,e.LX.addContextMenu=function(e,t,s,o={}){const n=new he(t,e,o);return s&&s(n),n.onCreate(),n};class ue{static currentMenu=null;root;side="bottom";align="center";sideOffset=0;alignOffset=0;avoidCollisions=!0;onBlur;event;inPlace=!1;_trigger;_items=[];_parent;_windowPadding=4;_onClick;_radioGroup;invalid=!1;constructor(t,s,o={}){if(console.assert(t,"DropdownMenu needs a DOM element as trigger!"),ue.currentMenu||!s?.length)return ue.currentMenu?.destroy(),void(this.invalid=!0);this._trigger=t,t.classList.add("triggered"),t.ddm=this,this._items=s,this.side=o.side??"bottom",this.align=o.align??"center",this.sideOffset=o.sideOffset??0,this.alignOffset=o.alignOffset??0,this.avoidCollisions=o.avoidCollisions??!0,this.onBlur=o.onBlur,this.event=o.event,this.root=document.createElement("div"),this.root.id="root",this.root.dataset.side=this.side,this.root.tabIndex="1",this.root.className="lexdropdownmenu";const n=t.closest("dialog");n&&"true"==n.dataset.modal?this._parent=n:this._parent=e.LX.root,this._parent.appendChild(this.root),this._create(this._items),ue.currentMenu=this,e.LX.doAsync(()=>{this._adjustPosition(),this.root.focus(),this._onClick=e=>{(!e.target||null==e.target.closest(".lexdropdownmenu")&&e.target!=this._trigger)&&this.destroy(!0)},document.body.addEventListener("mousedown",this._onClick,!0),document.body.addEventListener("focusin",this._onClick,!0)},10)}destroy(e=!1){this._trigger.classList.remove("triggered"),delete this._trigger.ddm,document.body.removeEventListener("mousedown",this._onClick,!0),document.body.removeEventListener("focusin",this._onClick,!0),this._parent.querySelectorAll(".lexdropdownmenu").forEach(e=>{e.remove()}),ue.currentMenu=null,e&&this.onBlur&&this.onBlur()}_create(t,s){if(s){const t=s.getBoundingClientRect();let o=document.createElement("div");o.tabIndex="1",o.className="lexdropdownmenu",o.dataset.id=s.dataset.id,o.dataset.side="right",this._parent.appendChild(o),o.currentParent=s,s=o,e.LX.doAsync(()=>{const s=[t.x+t.width,t.y];if(this._parent instanceof HTMLDialogElement){let e=this._parent.getBoundingClientRect();s[0]-=e.x,s[1]-=e.y}this.avoidCollisions&&(s[0]=e.LX.clamp(s[0],0,window.innerWidth-o.offsetWidth-this._windowPadding),s[1]=e.LX.clamp(s[1],0,window.innerHeight-o.offsetHeight-this._windowPadding)),o.style.left=`${s[0]}px`,o.style.top=`${s[1]}px`},10)}else s=this.root;let o=t.filter(e=>null!=e?.icon||null!=e?.checked).length>0;for(let e of t)this._createItem(e,s,o)}_createItem(t,s,o){if(!t)return void this._addSeparator(s);const n=t.name??t,i=e.LX.getSupportedDOMName(n);if(s.querySelector("#"+i))return;const a=document.createElement("div");if(a.className=e.LX.mergeClass("lexdropdownmenuitem flex flex-row pad-md rounded-lg gap-2 truncate cursor-pointer select-none"+(t.name||t.options?"":" label")+(t.disabled?" disabled":""),t.className),a.dataset.id=i,a.innerHTML=`<span class="ellipsis-overflow">${n}</span>`,a.tabIndex="1",s.appendChild(a),t.constructor===String)return;if(t.submenu){const t=e.LX.makeIcon("Right",{svgClass:"sm"});a.appendChild(t)}else if(t.kbd){t.kbd=[].concat(t.kbd);const s=e.LX.makeKbd(t.kbd,t.useKbdSpecialKeys??!0);a.appendChild(s),document.addEventListener("keydown",e=>{if(!this._trigger.ddm)return;e.preventDefault();let s=t.kbd.join("");s=1==s.length?s.toLowerCase():s,s==e.key&&a.click()})}const r=t.disabled??!1;if(void 0!==this._radioGroup){if(t.name===this._radioGroup.selected){const t=e.LX.makeIcon("Circle",{svgClass:"2xs fill-current"});a.prepend(t)}a.setAttribute("data-radioname",this._radioGroup.name)}else if(t.icon){const s=t.icon.constructor===String?e.LX.makeIcon(t.icon,{svgClass:r?"text-muted-foreground":t.svgClass??t.className}):t.icon;a.prepend(s)}else null==t.checked&&o&&a.classList.add("pl-8");if(!r){if(null!=t.checked){const e=new g(i+"_entryChecked",t.checked,e=>{const s=t.callback;t.checked=e,s&&s.call(this,n,e,a)},{className:"primary"}),s=e.root.querySelector("input");s.classList.add("ml-auto"),a.appendChild(s),a.addEventListener("click",t=>{"checkbox"!=t.target.type&&(s.checked=!s.checked,e.set(s.checked))})}else a.addEventListener("click",e=>{const s=a.getAttribute("data-radioname");s&&(this._trigger[s]=n);const o=t.callback;o&&o.call(this,n,a,s),!t.options&&(t.closeOnClick??1)&&this.destroy(!0)});if(a.addEventListener("mouseover",e=>{let o=a.dataset.id;if(!o)return;let n=s;for(;n;)o+="/"+n.dataset.id,n=n.currentParent?.parentElement;if(this._parent.querySelectorAll(".lexdropdownmenu").forEach(e=>{o.includes(e.dataset.id)||(e.currentParent.built=!1,e.remove())}),t.submenu&&this.inPlace){if(a.built)return;a.built=!0,this._create(t.submenu,a)}e.stopPropagation()}),t.options){console.assert(this._trigger[t.name]&&"An item of the radio group must be selected!"),this._radioGroup={name:t.name,selected:this._trigger[t.name]};for(let e of t.options)this._createItem(e,s,o);delete this._radioGroup,this._addSeparator()}}}_adjustPosition(){const t=[0,0],s=this._trigger.getBoundingClientRect();if(this.event)t[0]=this.event.x,t[1]=this.event.y;else{let e=!0;switch(this.side){case"left":t[0]+=s.x-this.root.offsetWidth-this.sideOffset,e=!1;break;case"right":t[0]+=s.x+s.width+this.sideOffset,e=!1;break;case"top":t[1]+=s.y-this.root.offsetHeight-this.sideOffset,e=!0;break;case"bottom":t[1]+=s.y+s.height+this.sideOffset,e=!0}switch(this.align){case"start":e?t[0]+=s.x:t[1]+=s.y;break;case"center":e?t[0]+=s.x+.5*s.width-.5*this.root.offsetWidth:t[1]+=s.y+.5*s.height-.5*this.root.offsetHeight;break;case"end":e?t[0]+=s.x-this.root.offsetWidth+s.width:t[1]+=s.y-this.root.offsetHeight+s.height}e?t[0]+=this.alignOffset:t[1]+=this.alignOffset}if(this._parent instanceof HTMLDialogElement){let e=this._parent.getBoundingClientRect();t[0]-=e.x,t[1]-=e.y}this.avoidCollisions&&(t[0]=e.LX.clamp(t[0],0,window.innerWidth-this.root.offsetWidth-this._windowPadding),t[1]=e.LX.clamp(t[1],0,window.innerHeight-this.root.offsetHeight-this._windowPadding)),this.root.style.left=`${t[0]}px`,this.root.style.top=`${t[1]}px`,this.inPlace=!0}_addSeparator(e=null){const t=document.createElement("div");t.className="separator",e=e??this.root,e?.appendChild(t)}}function pe(e,t,s={}){const o=new ue(e,t,s);return o.invalid?null:o}e.LX.DropdownMenu=ue,e.LX.addDropdownMenu=pe;class me{root;constructor(t={}){const s=document.createElement("footer");s.className=e.LX.mergeClass("lexfooter bg-background p-2 w-full leading-6 [&_p]:text-xs",t.className);const o=document.createElement("div");if(o.style.minHeight="48px",o.className="w-full",s.appendChild(o),t.columns&&t.columns.constructor==Array){const e=document.createElement("div");e.className="grid text-center",e.style.gridTemplateColumns="1fr ".repeat(t.columns.length),o.appendChild(e);for(let s of t.columns){const t=document.createElement("div");t.className="col",e.appendChild(t);const o=document.createElement("h2");if(o.innerHTML=s.title,t.appendChild(o),!s.items||!s.items.length)continue;const n=document.createElement("ul");t.appendChild(n);for(let e of s.items){const t=document.createElement("li");t.innerHTML=`<a class="" href="${e.link}">${e.title}</a>`,n.appendChild(t)}}}if(t.credits||t.socials){const s=document.createElement("div");if(s.className="credits-and-socials",o.appendChild(s),t.credits){const e=document.createElement("p");e.innerHTML=t.credits,s.appendChild(e)}if(t.socials){const o=document.createElement("div");o.className="socials flex flex-row gap-1 my-2 justify-end";for(let s of t.socials){const t=e.LX.makeIcon(s.icon,{title:s.title,svgClass:"xl"});t.href=s.link,t.target="_blank",o.appendChild(t)}s.appendChild(o)}}(t.parent??document.body).appendChild(s),s.previousElementSibling&&(s.previousElementSibling.style.flexGrow="1"),this.root=s}}e.LX.Footer=me;class ge extends ce{static TOP=0;static BOTTOM=1;dockPosition=ge.TOP;minimized=!1;constructor(t,s,o={}){o.draggable=o.draggable??!1,o.closable=o.closable??!1;super(t,s,o);let n=this;e.LX.addSignal("@on_branch_closed",this.panel,e=>{this.dockPosition==ge.BOTTOM&&(this.root.style.top=`calc(100% - ${this.root.offsetHeight+3}px)`)}),this.root.classList.add("pocket"),this.root.style.translate="none",this.root.style.top="0",this.root.style.left="unset",o.position||(this.root.style.right="3px",this.root.style.top="3px"),this.panel.root.style.width="100%",this.panel.root.style.height="100%";const i=this.title;if(i.tabIndex=-1,i.addEventListener("click",e=>{i.eventCatched?i.eventCatched=!1:(this.size&&(this.minimized?this.root.style.height=this.size[1]:this.root.style.height="auto"),this.root.classList.toggle("minimized"),this.minimized=!this.minimized,this.dockPosition==ge.BOTTOM&&(n.root.style.top=this.root.classList.contains("minimized")?`calc(100% - ${n.title.offsetHeight+6}px)`:`calc(100% - ${n.root.offsetHeight+3}px)`))}),!o.draggable){const e=o.float;if(e)for(let t=0;t<e.length;t++){switch(e[t]){case"b":this.root.style.top=`calc(100% - ${this.root.offsetHeight+3}px)`;break;case"l":this.root.style.right="unset",this.root.style.left=o.position?o.position[1]:"3px"}}this.root.classList.add("dockable"),i.addEventListener("keydown",function(e){e.ctrlKey&&(n.root.style.right="unset","ArrowLeft"==e.key?n.root.style.left="0px":"ArrowRight"==e.key?n.root.style.left=`calc(100% - ${n.root.offsetWidth+3}px)`:"ArrowUp"==e.key?(n.root.style.top="0px",n.dockPosition=ge.TOP):"ArrowDown"==e.key&&(n.root.style.top=`calc(100% - ${n.root.offsetHeight+3}px)`,n.dockPosition=ge.BOTTOM))})}}}e.LX.PocketDialog=ge;class fe{side="left";root;_onClick;constructor(t,s,o={}){this.side=o.side??this.side,this.root=document.createElement("div"),this.root.dataset.side=this.side,this.root.tabIndex="1",this.root.role="dialog",this.root.className="lexsheet fixed z-1000 bg-primary overflow-hidden",document.body.appendChild(this.root),this.root.addEventListener("keydown",e=>{"Escape"==e.key&&(e.preventDefault(),e.stopPropagation(),this.destroy())}),s&&(s=[].concat(s)).forEach(e=>{const t=e.root??e;this.root.appendChild(t),e.onSheet&&e.onSheet()}),e.LX.doAsync(()=>{switch(e.LX.modal.toggle(!1),this.side){case"left":this.root.style.left="0",this.root.style.width=t,this.root.style.height="100%";break;case"right":this.root.style.right="0",this.root.style.width=t,this.root.style.height="100%";break;case"top":this.root.style.left="0",this.root.style.top="0",this.root.style.width="100%",this.root.style.height=t;break;case"bottom":this.root.style.left="0",this.root.style.bottom="0",this.root.style.width="100%",this.root.style.height=t}document.documentElement.setAttribute("data-scale",`sheet-${this.side}`),this.root.focus(),this._onClick=e=>{e.target&&this.root.contains(e.target)||this.destroy()},document.body.addEventListener("mousedown",this._onClick,!0),document.body.addEventListener("focusin",this._onClick,!0)},10)}destroy(){document.documentElement.setAttribute("data-scale",""),document.body.removeEventListener("mousedown",this._onClick,!0),document.body.removeEventListener("focusin",this._onClick,!0),this.root.remove(),e.LX.modal.toggle(!0)}}e.LX.Sheet=fe;class Le{root;callback;items=[];icons={};groups={};side;collapsable;collapsed;filterString;filter;header;content;footer;resizeObserver=void 0;siblingArea=void 0;currentGroup;collapseQueue;collapseContainer;_collapseWidth;_displaySelected=!0;get displaySelected(){return this._displaySelected}set displaySelected(e){this._displaySelected=e,e||this.root.querySelectorAll(".lexsidebarentry").forEach(e=>e.classList.remove("selected"))}constructor(t={}){const s=navigator&&/Android|iPhone/i.test(navigator.userAgent);if(this.root=document.createElement("div"),this.root.className=e.LX.mergeClass("lexsidebar flex flex-col pad-xl size-full scrollbar-hidden",t.className),this.callback=t.callback??null,this.side=t.side??"left",this.collapsable=t.collapsable??!0,this.collapsed=t.collapsed??s,this._displaySelected=t.displaySelected??!1,this._collapseWidth=t.collapseToIcons??1?"58px":"0px",this.filterString="",e.LX.doAsync(()=>{if(this.root.parentElement.ogWidth=this.root.parentElement.style.width,this.root.parentElement.style.transition=this.collapsed?"":"width 0.25s ease-out",this.resizeObserver=new ResizeObserver(e=>{for(const t of e)this.siblingArea?.setSize(["calc(100% - "+t.contentRect.width+"px )",null])}),this.collapsed){if(this.root.classList.toggle("collapsed",this.collapsed),this.root.parentElement.style.width=this._collapseWidth,!this.resizeObserver)throw"Wait until ResizeObserver has been created!";this.resizeObserver.observe(this.root.parentElement),e.LX.doAsync(()=>{this.resizeObserver?.unobserve(this.root.parentElement),this.root.querySelectorAll(".lexsidebarentrycontent").forEach(e=>e.dataset.disableTooltip=`${!this.collapsed}`)},10)}},10),!t.skipHeader&&(this.header=t.header??this._generateDefaultHeader(t),console.assert(this.header.constructor===HTMLDivElement,"Use an HTMLDivElement to build your custom header"),this.header.className="lexsidebarheader w-full h-[48px] flex rounded-lg p-2 mb-2 text-sm cursor-pointer items-center select-none",this.root.appendChild(this.header),this.collapsable)){const o=e.LX.makeIcon("left"==this.side?"PanelLeft":"PanelRight",{title:"Toggle Sidebar",iconClass:"toggler"});if(this.header.appendChild(o),s){const s=new se({skipAppend:!0}),n=e.LX.deepCopy(t);n.collapsed=!1,n.collapsable=!1,s.addSidebar(this.callback,n),o.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),new e.LX.Sheet("256px",[s],{side:this.side})})}else o.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.toggleCollapsed()})}if(t.filter){const e=new h(null,"",(e,t)=>{this.filterString=e,this.update()},{inputClass:"outline",placeholder:"Search...",icon:"Search",className:"lexsidebarfilter"});this.filter=e.root,this.root.appendChild(this.filter)}this.content=document.createElement("div"),this.content.className="lexsidebarcontent overflow-mask flex flex-col overflow-x-hidden overflow-y-scroll flex-auto-fill w-full",this.root.appendChild(this.content),t.skipFooter||(this.footer=t.footer??this._generateDefaultFooter(t),console.assert(this.footer.constructor===HTMLDivElement,"Use an HTMLDivElement to build your custom footer"),this.footer.className="lexsidebarfooter w-full h-[48px] flex rounded-lg p-2 mt-2 text-sm cursor-pointer items-center select-none",this.root.appendChild(this.footer))}_generateDefaultHeader(t={}){const s=document.createElement("div");s.addEventListener("click",e=>{this.collapsed?(e.preventDefault(),e.stopPropagation(),this.toggleCollapsed()):t.onHeaderPressed&&t.onHeaderPressed(e)});const o=new e.LX.Avatar({imgSource:t.headerImage,fallback:t.headerIcon?e.LX.makeIcon(t.headerIcon,{svgClass:"xl"}).innerHTML:void 0,className:"rounded-lg"});s.appendChild(o.root);{const o=document.createElement("div");o.className="infodefault",s.appendChild(o);const n=e.LX.makeElement("span","truncate text-sm font-semibold");n.innerHTML=t.headerTitle??"",o.appendChild(n);const i=e.LX.makeElement("span","truncate text-xs");i.innerHTML=t.headerSubtitle??"",o.appendChild(i)}if(t.onHeaderPressed&&!this.collapsable){const t=e.LX.makeIcon("MenuArrows");s.appendChild(t)}return s}_generateDefaultFooter(t={}){const s=document.createElement("div");s.addEventListener("click",e=>{t.onFooterPressed&&t.onFooterPressed(e,s)});const o=new e.LX.Avatar({imgSource:t.footerImage,fallback:t.footerIcon?e.LX.makeIcon(t.footerIcon,{svgClass:"xl"}).innerHTML:void 0,className:"rounded-lg"});s.appendChild(o.root);{const o=document.createElement("div");o.className="infodefault",s.appendChild(o);const n=e.LX.makeElement("span","truncate text-sm font-semibold");n.innerHTML=t.footerTitle??"",o.appendChild(n);const i=e.LX.makeElement("span","truncate text-xs");i.innerHTML=t.footerSubtitle??"",o.appendChild(i)}if(t.onFooterPressed){const t=e.LX.makeIcon("MenuArrows");s.appendChild(t)}return s}toggleCollapsed(t){if(this.collapsable){if(this.collapsed=t??!this.collapsed,this.collapsed?(this.root.classList.add("collapsing"),this.root.parentElement.style.width=this._collapseWidth):(this.root.classList.remove("collapsing"),this.root.classList.remove("collapsed"),this.root.parentElement.style.width=this.root.parentElement.ogWidth),!this.resizeObserver)throw"Wait until ResizeObserver has been created!";this.resizeObserver.observe(this.root.parentElement),e.LX.doAsync(()=>{this.root.classList.toggle("collapsed",this.collapsed),this.resizeObserver?.unobserve(this.root.parentElement),this.root.querySelectorAll(".lexsidebarentrycontent").forEach(e=>e.dataset.disableTooltip=`${!this.collapsed}`)},250)}}separator(){this.currentGroup=null,this.add("")}group(e,t){this.currentGroup=e,this.groups[e]=t}add(e,t={}){t.constructor==Function&&(t={callback:t});const s=e.split("/"),o=s[s.length-1];this.icons[o]=t.icon;let n=0;const i=(e,o)=>{if(null==e)return;let a=null;if(o.forEach(t=>{const s=Object.keys(t).find(t=>t==e);s&&(a=t[s])}),a)i(s[n++],a);else{let a={};a[e]=[];const r=s[n++];r||(a.callback=t.callback,a.group=this.currentGroup,a.options=t),o.push(a),i(r,a[e])}};i(s[n++],this.items)}select(t){let s=e.LX.getSupportedDOMName(t);const o=this.items.find(e=>e.name===s);o&&o.dom.click()}update(){this.content.innerHTML="";for(let e of this.items)delete e.dom;for(let t of this.items){const s=t.options??{};if(t.dom)continue;let o=t.name=Object.keys(t)[0];if(this.filterString.length&&!o.toLowerCase().includes(this.filterString.toLowerCase()))continue;let n=e.LX.getSupportedDOMName(o),i=null,a=e.LX.makeElement("div",e.LX.mergeClass("lexsidebarentry w-full rounded-lg cursor-pointer select-none",s.className));if(a.id=n,this.displaySelected&&s.selected&&a.classList.add("selected"),t.group){const s=t.group.replace(/\s/g,"").replaceAll(".","");if(i=this.content.querySelector("#"+s),i){if(!i.classList.contains("lexsidebargroup"))throw"Bad id: "+t.group}else{i=e.LX.makeElement("div","lexsidebargroup flex flex-col gap-0.5"),i.id=s,this.content.appendChild(i);let o=e.LX.makeElement("div","lexsidebargrouptitle");if(i.appendChild(o),e.LX.makeElement("div","",t.group,o),null!=this.groups[t.group]){const s=e.LX.makeIcon(this.groups[t.group].icon,{svgClass:"sm"});o.appendChild(s),s.addEventListener("click",e=>{this.groups[t.group].callback&&this.groups[t.group].callback(t.group,e)})}}}if(""==n){let e=document.createElement("div");e.className="lexsidebarseparator",this.content.appendChild(e);continue}this.collapseContainer?(this.collapseContainer.appendChild(a),this.collapseQueue--,this.collapseQueue||delete this.collapseContainer):i?i.appendChild(a):this.content.appendChild(a);let r=document.createElement("div");if(r.className="lexsidebarentrycontent",a.appendChild(r),t.dom=a,"checkbox"==s.type){t.value=s.value??!1;const e=new ee;t.checkbox=e.addCheckbox(null,t.value,(e,n)=>{n.preventDefault(),n.stopPropagation();const i=s.callback;t.value=e,i&&i.call(this,o,e,n)},{className:"primary",label:o,signal:"@checkbox_"+o}),r.appendChild(e.root.childNodes[0])}else{if(s.icon){const t=e.LX.makeIcon(s.icon,{iconClass:"lexsidebarentryicon"});r.appendChild(t),e.LX.asTooltip(r,o,{side:"right",offset:16,active:!1})}if(e.LX.makeElement("a","grid-column-start-2",o,r),s.swap){r.classList.add("swap","inline-grid"),r.querySelector("a")?.classList.add("swap-off");const t=document.createElement("input");t.className="p-0 border-0",t.type="checkbox",r.prepend(t);const o=e.LX.makeIcon(s.swap,{iconClass:"lexsidebarentryicon swap-on"});r.appendChild(o)}s.content&&r.appendChild(s.content)}const l=null!=s.collapsable?s.collapsable:s.collapsable||t[o].length;if(a.addEventListener("click",e=>{if(e.target&&e.target.classList.contains("lexcheckbox"))return;let n;if(l)r.querySelector(".collapser")?.click();else if(t.checkbox)t.value=!t.value,t.checkbox.set(t.value,!0),n=t.value;else if(s.swap&&!(e.target instanceof HTMLInputElement)){const e=r.querySelector("input");e.checked=!e.checked,n=e.checked}const i=s.callback;i&&i.call(this,o,n??a,e),this.displaySelected&&!s.skipSelection&&(this.root.querySelectorAll(".lexsidebarentry").forEach(e=>e.classList.remove("selected")),a.classList.add("selected"))}),s.action){const t=e.LX.makeIcon(s.action.icon??"Ellipsis",{title:s.action.name});r.appendChild(t),t.addEventListener("click",e=>{e.preventDefault(),e.stopImmediatePropagation();const t=s.action.callback;t&&t.call(this,o,e)})}else if(l){const t=document.createElement("div");t.className="collapsablecontainer",Object.assign(t.style,{width:"100%",display:"none"}),e.LX.makeCollapsible(r,t,i??this.content),this.collapseQueue=s.collapsable,this.collapseContainer=t}if(!t[o].length)continue;let c=e.LX.makeElement("div","lexsidebarsubentrycontainer flex flex-col self-center w-full ml-4 px-4 select-none");l?(this.collapseContainer.appendChild(c),delete this.collapseContainer):i?(c.classList.add("collapsablecontainer"),i.appendChild(c)):this.content.appendChild(c);for(let s=0;s<t[o].length;++s){const n=t[o][s],i=n.options??{},a=n.name=Object.keys(n)[0];if(this.filterString.length&&!a.toLowerCase().includes(this.filterString.toLowerCase()))continue;let r=document.createElement("div");if(r.innerHTML=`<span>${a}</span>`,i.action){const t=e.LX.makeIcon(i.action.icon??"Ellipsis",{title:i.action.name});r.appendChild(t),t.addEventListener("click",e=>{e.preventDefault(),e.stopImmediatePropagation();const t=i.action.callback;t&&t.call(this,a,e)})}if(r.className="lexsidebarentry w-full rounded-lg cursor-pointer select-none",r.id=a,i.content){const t=e.LX.makeElement("div");t.appendChild(i.content),r.appendChild(t)}c.appendChild(r),r.addEventListener("click",e=>{const t=i.callback;t&&t.call(this,a,r,e),this.displaySelected&&!i.skipSelection&&(this.root.querySelectorAll(".lexsidebarentry").forEach(e=>e.classList.remove("selected")),r.classList.add("selected"))})}}}}e.LX.Sidebar=Le;class ye{root;constructor(t){if(this.root=e.LX.makeContainer(["auto","auto"],"flex flex-row lexskeleton"),t.constructor===String)this.root.innerHTML=t;else{t=[].concat(t);for(let e of t)this.root.appendChild(e)}}destroy(){this.root.dataset.closed=!0,e.LX.doAsync(()=>{this.root.remove(),this.root=null},200)}}e.LX.Skeleton=ye;class be{static ACTIVE_TOURS=[];steps;currentStep=0;useModal;offset;horizontalOffset;verticalOffset;radius;tourContainer;tourMask=void 0;_popover=null;constructor(t,s={}){this.steps=t||[],this.useModal=s.useModal??!0,this.offset=s.offset??8,this.horizontalOffset=s.horizontalOffset,this.verticalOffset=s.verticalOffset,this.radius=s.radius??12,this.tourContainer=document.querySelector(".tour-container"),this.tourContainer||(this.tourContainer=e.LX.makeContainer(["100%","100%"],"tour-container"),this.tourContainer.style.display="none",document.body.appendChild(this.tourContainer),window.addEventListener("resize",()=>{for(const e of be.ACTIVE_TOURS)e._showStep(0)}))}begin(){this.currentStep=0,this.tourContainer.style.display="block",be.ACTIVE_TOURS.push(this),this._showStep(0)}stop(){this.useModal&&(this.tourMask?.remove(),this.tourMask=void 0),this._popover?.destroy();const e=be.ACTIVE_TOURS.indexOf(this);-1!==e&&be.ACTIVE_TOURS.splice(e,1),this.tourContainer.innerHTML="",this.tourContainer.style.display="none"}_showStep(e=1){this.currentStep+=e;const t=this.steps[this.currentStep];if(!t)return void this.stop();const s=this.steps[this.currentStep-1],o=this.steps[this.currentStep+1];this.useModal&&this._generateMask(t.reference),this._createHighlight(t,s,o)}_generateMask(t){this.tourContainer.innerHTML="",this.tourMask=e.LX.makeContainer(["100%","100%"],"tour-mask absolute inset-0"),this.tourContainer.appendChild(this.tourMask);const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.style.width="100%",s.style.height="100%",this.tourMask?.appendChild(s);const o=document.createElementNS("http://www.w3.org/2000/svg","clipPath");function n(e,t){const s=Math.ceil(e);return[s,t-(s-e)]}o.setAttribute("id","svgTourClipPath"),s.appendChild(o);const i=t.getBoundingClientRect(),[a,r]=n(i.x,i.width),[l,c]=n(i.y,i.height),d=this.verticalOffset??this.offset,h=this.horizontalOffset??this.offset;{const e=document.createElementNS("http://www.w3.org/2000/svg","rect");e.setAttribute("x","0"),e.setAttribute("y","0"),e.setAttribute("width",`${Math.max(0,a-h)}`),e.setAttribute("height",`${window.innerHeight}`),e.setAttribute("stroke","none"),o.appendChild(e)}{const e=document.createElementNS("http://www.w3.org/2000/svg","rect");e.setAttribute("x",""+(a-h)),e.setAttribute("y","0"),e.setAttribute("width",`${Math.max(0,r+2*h)}`),e.setAttribute("height",`${Math.max(0,l-d)}`),e.setAttribute("stroke","none"),o.appendChild(e)}{const e=document.createElementNS("http://www.w3.org/2000/svg","rect");e.setAttribute("x",""+(a-h)),e.setAttribute("y",`${l+c+d}`),e.setAttribute("width",`${Math.max(0,r+2*h)}`),e.setAttribute("height",`${Math.max(0,window.innerHeight-l-c-d)}`),e.setAttribute("stroke","none"),o.appendChild(e)}{const e=document.createElementNS("http://www.w3.org/2000/svg","rect");e.setAttribute("x",`${a+r+h}`),e.setAttribute("y","0"),e.setAttribute("width",`${Math.max(0,window.innerWidth-a-r)}`),e.setAttribute("height",`${Math.max(0,window.innerHeight)}`),e.setAttribute("stroke","none"),o.appendChild(e)}const u=e.LX.makeContainer(["0","0"],"tour-ref-mask absolute");u.style.left=a-h-1+"px",u.style.top=l-d-1+"px",u.style.width=`${r+2*h+2}px`,u.style.height=`${c+2*d+2}px`,this.tourContainer.appendChild(u);const p=document.createElementNS("http://www.w3.org/2000/svg","mask");p.setAttribute("id","svgTourReferenceMask"),s.appendChild(p);{const e=document.createElementNS("http://www.w3.org/2000/svg","rect");e.setAttribute("width",`${r+2*h+2}`),e.setAttribute("height",`${c+2*d+2}`),e.setAttribute("stroke","none"),e.setAttribute("fill","white"),p.appendChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","rect");t.setAttribute("rx",`${this.radius}`),t.setAttribute("width",`${r+2*h+2}`),t.setAttribute("height",`${c+2*d+2}`),t.setAttribute("stroke","none"),t.setAttribute("fill","black"),p.appendChild(t)}}_createHighlight(t,s,o){const n=e.LX.makeContainer(["auto","auto"],"tour-step-container");{const s=e.LX.makeContainer(["100%","auto"],"flex flex-row","",n);e.LX.makeContainer(["70%","auto"],"p-2 font-medium text-base",t.title,s);const o=e.LX.makeContainer(["30%","auto"],"flex flex-row p-2 justify-end","",s),i=e.LX.makeIcon("X");o.appendChild(i),e.LX.listen(i,"click",()=>{this.stop()})}e.LX.makeContainer(["100%","auto"],"p-2 text-sm",t.content,n,{maxWidth:"400px"});const i=e.LX.makeContainer(["100%","auto"],"flex flex-row","",n);{const t=e.LX.makeContainer(["50%","auto"],"p-2 gap-1 place-self-center flex flex-row","",i);for(let s=0;s<this.steps.length;s++){const o=e.LX.makeElement("span");o.className="size-3 rounded-full bg-accent inline-flex data-active:bg-primary",s===this.currentStep&&(o.dataset.active="true"),t.appendChild(o)}}const a=e.LX.makeContainer(["50%","auto"],"text-base","",i),r=new ee;let l=1;s&&l++,l>1&&r.sameLine(2,"justify-end"),s&&r.addButton(null,"Previous",()=>{this._showStep(-1)},{buttonClass:"ghost"}),o?r.addButton(null,"Next",()=>{this._showStep(1)},{buttonClass:"accent"}):r.addButton(null,"Finish",()=>{this.stop()},{buttonClass:"primary"}),a.appendChild(r.root);const c=("left"===t.side||"right"===t.side?this.horizontalOffset:this.verticalOffset)??this.offset,d="start"===t.align||"end"===t.align?c:0;this._popover?.destroy(),this._popover=new y(null,[n],{reference:t.reference,side:t.side,align:t.align,sideOffset:c,alignOffset:"start"===t.align?-d:d})}}if(e.LX.Tour=be,!e.LX)throw"Missing LX namespace!";function Ce(e){return/[^\w\s]/.test(e)}function ve(e){return/\w/.test(e)}function xe(e,t){if(!e?.icon)return"FileCode text-neutral-500";if("string"==typeof e.icon)return e.icon;if(t&&e.icon[t])return e.icon[t];return Object.values(e.icon)[0]||"FileCode text-neutral-500"}e.LX.extensions.push("CodeEditor");class _e{static languages=new Map;static extensionMap=new Map;static registerLanguage(e){_e.languages.set(e.name,e);for(const t of e.extensions)_e.extensionMap.set(t,e.name)}static getLanguage(e){return _e.languages.get(e)}static getLanguageByExtension(e){const t=_e.extensionMap.get(e);return t?_e.languages.get(t):void 0}static getRegisteredLanguages(){return Array.from(_e.languages.keys())}static initialState(){return{stack:["root"]}}static tokenizeLine(e,t,s){const o=[],n=[...s.stack];let i=0;for(;i<e.length;){const s=n[n.length-1],a=t.states[s];if(!a){o.push({type:"text",value:e.slice(i)}),i=e.length;break}let r=!1;for(const t of a){const s=new RegExp(t.match.source,"y"+t.match.flags.replace(/[gy]/g,""));s.lastIndex=i;const a=s.exec(e);if(a){if(0===a[0].length)continue;if(o.push({type:t.type,value:a[0]}),i+=a[0].length,t.next)n.push(t.next);else if(t.pop){const e="number"==typeof t.pop?t.pop:1;for(let t=0;t<e&&n.length>1;t++)n.pop()}r=!0;break}}if(!r){const t=o[o.length-1];t&&"text"===t.type?t.value+=e[i]:o.push({type:"text",value:e[i]}),i++}}return{tokens:_e._mergeTokens(o),state:{stack:n}}}static _mergeTokens(e){if(0===e.length)return e;const t=[e[0]];for(let s=1;s<e.length;s++){const o=t[t.length-1];e[s].type===o.type?o.value+=e[s].value:t.push(e[s])}return t}}function we(e){return new RegExp("\\b(?:"+e.join("|")+")\\b")}e.LX.Tokenizer=_e;const ke={blockComment:[{match:/\*\//,type:"comment",pop:!0},{match:/[^*]+/,type:"comment"},{match:/\*/,type:"comment"}],doubleString:[{match:/\\./,type:"string"},{match:/"/,type:"string",pop:!0},{match:/[^"\\]+/,type:"string"}],singleString:[{match:/\\./,type:"string"},{match:/'/,type:"string",pop:!0},{match:/[^'\\]+/,type:"string"}]},Se=[{match:/0[bB][01]+(?:[uU][lL]{0,2}|[lL]{1,2}[uU]?)?\b/,type:"number"},{match:/0[xX][0-9a-fA-F]+(?:[uU][lL]{0,2}|[lL]{1,2}[uU]?)?\b/,type:"number"},{match:/0[oO][0-7]+(?:[uU][lL]{0,2}|[lL]{1,2}[uU]?)?\b/,type:"number"},{match:/\d+\.?\d*(?:[eE][+-]?\d+)?(?:[fFdDmMlLuUiI]|[uU][lL]{0,2}|[lL]{1,2}[uU]?)?\b/,type:"number"},{match:/\.\d+(?:[eE][+-]?\d+)?(?:[fFdDmM])?\b/,type:"number"}],Ee=[{match:/[a-zA-Z_$]\w*(?=\s*[<(])/,type:"method"},{match:/[a-zA-Z_$]\w*/,type:"text"},{match:/[{}()\[\];,.:?!&|<>=+\-*/%^~@#]/,type:"symbol"},{match:/\s+/,type:"text"}];function Me(e){return{templateString:[{match:/\\./,type:"string"},{match:/`/,type:"string",pop:!0},{match:/\$\{/,type:"symbol",next:"templateExpr"},{match:/[^`\\$]+/,type:"string"},{match:/\$/,type:"string"}],templateExpr:[{match:/\}/,type:"symbol",pop:!0},{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},{match:/`/,type:"string",next:"templateString"},...Se,{match:we(e),type:"keyword"},...Ee]}}_e.registerLanguage({name:"Plain Text",extensions:["txt"],states:{root:[{match:/.+/,type:"text"}]},reservedWords:[],icon:"FileText text-neutral-500"});const Te=["var","let","const","this","in","of","true","false","null","undefined","new","function","class","extends","super","import","export","from","default","async","typeof","instanceof","void","delete","debugger","NaN","static","constructor","Infinity","abstract"],Ae=["for","if","else","switch","case","return","while","do","continue","break","await","yield","throw","try","catch","finally","with"],Xe=["document","console","window","navigator","performance","Math","JSON","Promise","Array","Object","String","Number","Boolean","RegExp","Error","Map","Set","WeakMap","WeakSet","Symbol","Proxy","Reflect"];_e.registerLanguage({name:"JavaScript",extensions:["js","mjs","cjs"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/`/,type:"string",next:"templateString"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},...Se,{match:we(Te),type:"keyword"},{match:we(Xe),type:"builtin"},{match:we(Ae),type:"statement"},{match:/(?<=\b(?:class|enum)\s+)[A-Z][a-zA-Z0-9_]*/,type:"type"},...Ee],...ke,...Me(["var","let","const","this","true","false","null","undefined","new","typeof","instanceof","void"])},reservedWords:[...Te,...Ae,...Xe],icon:"Js text-yellow-500"});const ze=[...Te,"as","interface","type","enum","namespace","declare","private","protected","implements","readonly","keyof","infer","is","asserts","override","satisfies"],Pe=["string","number","boolean","any","unknown","never","void","null","undefined","object","symbol","bigint","Promise","Record","Partial","Required","Readonly","Pick","Omit","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","Awaited"];_e.registerLanguage({name:"TypeScript",extensions:["ts","tsx"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/`/,type:"string",next:"templateString"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},...Se,{match:we(ze),type:"keyword"},{match:we(Pe),type:"type"},{match:we(Xe),type:"builtin"},{match:we(Ae),type:"statement"},{match:/(?<=\b(?:class|enum|interface|type|extends|implements)\s+)[A-Z][a-zA-Z0-9_]*/,type:"type"},{match:/(?<=<\s*)[A-Z][a-zA-Z0-9_]*(?=\s*(?:[,>]|extends|=))/,type:"type"},{match:/(?<=,\s*)[A-Z][a-zA-Z0-9_]*(?=\s*(?:[,>]|extends|=))/,type:"type"},{match:/(?<=:\s*)[A-Z][a-zA-Z0-9_]*/,type:"type"},...Ee],...ke,...Me(["var","let","const","this","true","false","null","undefined","new","typeof","instanceof","void"])},reservedWords:[...ze,...Pe,...Xe,...Ae],icon:"Ts text-blue-600"});const Ne=["bool","i32","u32","f16","f32","vec2","vec3","vec4","vec2i","vec3i","vec4i","vec2u","vec3u","vec4u","vec2f","vec3f","vec4f","mat2x2f","mat2x3f","mat2x4f","mat3x2f","mat3x3f","mat3x4f","mat4x2f","mat4x3f","mat4x4f","array","struct","ptr","atomic","sampler","sampler_comparison","texture_1d","texture_2d","texture_2d_array","texture_3d","texture_cube","texture_cube_array","texture_multisampled_2d","texture_depth_2d","texture_depth_2d_array","texture_depth_cube","texture_depth_cube_array","texture_depth_multisampled_2d","texture_storage_1d","texture_storage_2d","texture_storage_2d_array","texture_storage_3d","texture_external","var","let","const","override","fn","type","alias","true","false"],Ie=["if","else","switch","case","default","for","loop","while","break","continue","discard","return","function","private","workgroup","uniform","storage","read","write","read_write","bitcast"],Re=["position","vertex_index","instance_index","front_facing","frag_depth","local_invocation_id","local_invocation_index","global_invocation_id","workgroup_id","num_workgroups","abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","clamp","cos","cosh","cross","degrees","determinant","distance","dot","exp","exp2","floor","fma","fract","inverseSqrt","length","log","log2","max","min","mix","normalize","pow","radians","reflect","refract","round","saturate","sign","sin","sinh","smoothstep","sqrt","step","tan","tanh","transpose","trunc","textureSample","textureSampleBias","textureSampleLevel","textureSampleGrad","textureSampleCompare","textureSampleCompareLevel","textureSampleBaseClampToEdge","textureLoad","textureStore","textureGather","textureGatherCompare","textureDimensions","textureNumLayers","textureNumLevels","textureNumSamples","pack4x8snorm","pack4x8unorm","pack2x16snorm","pack2x16unorm","pack2x16float","unpack4x8snorm","unpack4x8unorm","unpack2x16snorm","unpack2x16unorm","unpack2x16float","atomicLoad","atomicStore","atomicAdd","atomicSub","atomicMax","atomicMin","atomicAnd","atomicOr","atomicXor","atomicExchange","atomicCompareExchangeWeak","dpdx","dpdxCoarse","dpdxFine","dpdy","dpdyCoarse","dpdyFine","fwidth","fwidthCoarse","fwidthFine","select","arrayLength","countLeadingZeros","countOneBits","countTrailingZeros","extractBits","firstLeadingBit","firstTrailingBit","insertBits","reverseBits","storageBarrier","workgroupBarrier","workgroupUniformLoad"];_e.registerLanguage({name:"WGSL",extensions:["wgsl"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/#\w+/,type:"preprocessor"},...Se,{match:we(Ne),type:"keyword"},{match:we(Re),type:"builtin"},{match:we(Ie),type:"statement"},{match:/@\w+/,type:"text"},...Ee],...ke},reservedWords:[...Ne,...Re,...Ie],icon:"AlignLeft text-orange-500"});const De=["true","false","int","float","double","bool","void","uint","struct","mat2","mat3","mat4","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","vec2","vec3","vec4","ivec2","ivec3","ivec4","uvec2","uvec3","uvec4","dvec2","dvec3","dvec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler2DShadow","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","samplerCubeArray","samplerCubeArrayShadow","isampler2D","usampler2D","isampler3D","usampler3D","lowp","mediump","highp","precision","in","out","inout","uniform","varying","attribute","const","layout","centroid","flat","smooth","noperspective","patch","sample","buffer","shared","coherent","volatile","restrict","readonly","writeonly"],Oe=["if","else","switch","case","default","for","while","do","break","continue","return","discard"],He=["radians","degrees","sin","cos","tan","asin","acos","atan","pow","exp","log","exp2","log2","sqrt","inversesqrt","abs","sign","floor","ceil","fract","mod","min","max","clamp","mix","step","smoothstep","length","distance","dot","cross","normalize","reflect","refract","matrixCompMult","lessThan","lessThanEqual","greaterThan","greaterThanEqual","equal","notEqual","any","all","not","texture","textureProj","textureLod","textureGrad","texelFetch"];_e.registerLanguage({name:"GLSL",extensions:["glsl"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/#\w+/,type:"preprocessor"},...Se,{match:we(De),type:"keyword"},{match:we(He),type:"builtin"},{match:we(Oe),type:"statement"},...Ee],...ke},reservedWords:[...De,...He,...Oe],icon:"AlignLeft text-neutral-500"});const Be=["bool","int","uint","dword","half","float","double","min16float","min10float","min16int","min12int","min16uint","float1","float2","float3","float4","int1","int2","int3","int4","uint1","uint2","uint3","uint4","bool1","bool2","bool3","bool4","half1","half2","half3","half4","float1x1","float1x2","float1x3","float1x4","float2x1","float2x2","float2x3","float2x4","float3x1","float3x2","float3x3","float3x4","float4x1","float4x2","float4x3","float4x4","vector","matrix","string","void","struct","class","interface","true","false","sampler","sampler1D","sampler2D","sampler3D","samplerCUBE","sampler_state","Texture1D","Texture2D","Texture3D","TextureCube","Texture1DArray","Texture2DArray","TextureCubeArray","Buffer","AppendStructuredBuffer","ConsumeStructuredBuffer","StructuredBuffer","RWStructuredBuffer","ByteAddressBuffer","RWByteAddressBuffer","RWTexture1D","RWTexture2D","RWTexture3D","RWTexture1DArray","RWTexture2DArray","cbuffer","tbuffer","in","out","inout","uniform","extern","static","volatile","precise","shared","groupshared","linear","centroid","nointerpolation","noperspective","sample","const","row_major","column_major"],$e=["if","else","for","while","do","switch","case","default","break","continue","discard","return","typedef","register","packoffset"],Ve=["SV_Position","SV_Target","SV_Depth","SV_VertexID","SV_InstanceID","SV_PrimitiveID","SV_DispatchThreadID","SV_GroupID","SV_GroupThreadID","SV_GroupIndex","SV_Coverage","SV_IsFrontFace","SV_RenderTargetArrayIndex","POSITION","NORMAL","TEXCOORD","COLOR","TANGENT","BINORMAL"];_e.registerLanguage({name:"HLSL",extensions:["hlsl","fx","fxh","vsh","psh"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/#\w+/,type:"preprocessor"},...Se,{match:we(Be),type:"keyword"},{match:we(Ve),type:"builtin"},{match:we($e),type:"statement"},...Ee],...ke},reservedWords:[...Be,...Ve,...$e],icon:"AlignLeft text-purple-500"});const Fe=["False","def","None","True","in","is","and","lambda","nonlocal","not","or"],We=["if","elif","else","for","while","try","except","finally","with","match","case","break","continue","return","raise","pass","import","from","as","global","nonlocal","assert","del","yield"],qe=["abs","all","any","ascii","bin","bool","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],Ue=["int","float","complex","bool","str","bytes","bytearray","list","tuple","set","frozenset","dict","object","type","ArithmeticError","AssertionError","AttributeError","BaseException","BufferError","EOFError","Exception","FloatingPointError","GeneratorExit","ImportError","ModuleNotFoundError","IndentationError","IndexError","KeyError","KeyboardInterrupt","LookupError","MemoryError","NameError","NotImplementedError","OSError","OverflowError","RecursionError","ReferenceError","RuntimeError","StopAsyncIteration","StopIteration","SyntaxError","TabError","SystemError","SystemExit","TypeError","UnboundLocalError","UnicodeError","UnicodeEncodeError","UnicodeDecodeError","UnicodeTranslateError","ValueError","ZeroDivisionError"];_e.registerLanguage({name:"Python",extensions:["py"],lineComment:"#",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/#.*/,type:"comment"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},...Se,{match:we(Fe),type:"keyword"},{match:we(Ue),type:"type"},{match:we(qe),type:"builtin"},{match:we(We),type:"statement"},...Ee],...ke},reservedWords:[...Fe,...Ue,...qe,...We],icon:"Python text-cyan-600"});const je=["abstract","and","array","as","callable","class","clone","const","enum","extends","final","fn","function","global","implements","include","include_once","instanceof","insteadof","interface","namespace","new","null","or","private","protected","public","readonly","require","require_once","static","trait","use","var","xor","from","$this"],Ge=["if","else","elseif","endif","switch","case","default","endswitch","for","endfor","foreach","endforeach","while","endwhile","do","break","continue","return","try","catch","finally","throw","declare","enddeclare","goto","yield","match"],Ze=["int","float","string","bool","array","object","callable","iterable","void","never","mixed","static","self","parent","Exception","Error","Throwable","DateTime","DateTimeImmutable","Closure","Generator","JsonSerializable"],Ye=["echo","print","isset","empty","unset","eval","die","exit","count","sizeof","in_array","array_merge","array_push","array_pop","strlen","strpos","substr","str_replace","explode","implode","json_encode","json_decode","var_dump","print_r"];_e.registerLanguage({name:"PHP",extensions:["php"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},...Se,{match:we(je),type:"keyword"},{match:we(Ze),type:"type"},{match:we(Ye),type:"builtin"},{match:we(Ge),type:"statement"},...Ee],...ke},reservedWords:[...je,...Ze,...Ye,...Ge],icon:"Php text-purple-700"});const Ke=["int","float","double","bool","long","short","char","void","const","enum","extern","register","sizeof","static","struct","typedef","union","volatile","true","false"],Je=["break","continue","do","else","for","goto","if","return","switch","while"];_e.registerLanguage({name:"C",extensions:["c","h"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/#\w+/,type:"preprocessor"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},...Se,{match:we(Ke),type:"keyword"},{match:we(Je),type:"statement"},...Ee],...ke},reservedWords:[...Ke,...Je],icon:{c:"C text-sky-400",h:"C text-fuchsia-500"}});const Qe=[...Ke,"wchar_t","static_cast","dynamic_cast","new","delete","auto","class","nullptr","NULL","signed","unsigned","namespace","static","private","public"],et=[...Je,"case","using","glm","spdlog","default"],tt=["uint8_t","uint16_t","uint32_t","uint64_t","int8_t","int16_t","int32_t","int64_t","size_t","ptrdiff_t"],st=["std","string","vector","map","set","unordered_map","unordered_set","array","tuple","optional","variant","cout","cin","cerr","clog"];_e.registerLanguage({name:"C++",extensions:["cpp","hpp"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/#\w+/,type:"preprocessor"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},...Se,{match:we(Qe),type:"keyword"},{match:we(tt),type:"type"},{match:we(st),type:"builtin"},{match:we(et),type:"statement"},...Ee],...ke},reservedWords:[...Qe,...tt,...st,...et],icon:{cpp:"CPlusPlus text-sky-400",hpp:"CPlusPlus text-fuchsia-500"}}),_e.registerLanguage({name:"JSON",extensions:["json","jsonc","bml"],states:{root:[{match:/"/,type:"string",next:"doubleString"},{match:/\btrue\b|\bfalse\b|\bnull\b/,type:"keyword"},{match:/-?\d+\.?\d*(?:[eE][+-]?\d+)?/,type:"number"},{match:/[{}[\]:,]/,type:"symbol"},{match:/\s+/,type:"text"}],...ke},reservedWords:[],icon:"Json text-yellow-600"}),_e.registerLanguage({name:"XML",extensions:["xml","xaml","xsd","xsl"],lineComment:"\x3c!--",states:{root:[{match:/<!--/,type:"comment",next:"xmlComment"},{match:/<\?/,type:"preprocessor",next:"processingInstruction"},{match:/<\/[a-zA-Z][\w:-]*>/,type:"keyword"},{match:/<[a-zA-Z][\w:-]*/,type:"keyword",next:"tag"},{match:/[^<]+/,type:"text"}],tag:[{match:/\/?>/,type:"keyword",pop:!0},{match:/[a-zA-Z][\w:-]*(?==)/,type:"type"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},{match:/[^"'>/]+/,type:"text"}],xmlComment:[{match:/-->/,type:"comment",pop:!0},{match:/[^-]+/,type:"comment"},{match:/-/,type:"comment"}],processingInstruction:[{match:/\?>/,type:"preprocessor",pop:!0},{match:/[^?]+/,type:"preprocessor"},{match:/\?/,type:"preprocessor"}],...ke},reservedWords:[],icon:"Rss text-orange-600"});_e.registerLanguage({name:"HTML",extensions:["html"],lineComment:"\x3c!--",states:{root:[{match:/<!--/,type:"comment",next:"xmlComment"},{match:/<!DOCTYPE/i,type:"preprocessor"},{match:/<\/[a-zA-Z][\w-]*>/,type:"keyword"},{match:/<script\b/i,type:"keyword",next:"scriptTag"},{match:/<style\b/i,type:"keyword",next:"styleTag"},{match:/<[a-zA-Z][\w-]*/,type:"keyword",next:"tag"},{match:/[^<]+/,type:"text"}],tag:[{match:/\/?>/,type:"keyword",pop:!0},{match:/[a-zA-Z][\w-]*(?==)/,type:"type"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},{match:/[^"'>/]+/,type:"text"}],scriptTag:[{match:/\/>/,type:"keyword",pop:!0},{match:/>/,type:"keyword",next:"scriptContent"},{match:/[a-zA-Z][\w-]*(?==)/,type:"type"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},{match:/[^"'>/]+/,type:"text"}],scriptContent:[{match:/<\/script>/i,type:"keyword",pop:2},{match:/[^<]+/,type:"text"},{match:/</,type:"text"}],styleTag:[{match:/\/>/,type:"keyword",pop:!0},{match:/>/,type:"keyword",next:"styleContent"},{match:/[a-zA-Z][\w-]*(?==)/,type:"type"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},{match:/[^"'>/]+/,type:"text"}],styleContent:[{match:/<\/style>/i,type:"keyword",pop:2},{match:/[^<]+/,type:"text"},{match:/</,type:"text"}],xmlComment:[{match:/-->/,type:"comment",pop:!0},{match:/[^-]+/,type:"comment"},{match:/-/,type:"comment"}],...ke},reservedWords:["html","head","body","title","meta","link","script","style","div","span","p","a","img","ul","ol","li","table","tr","td","th","form","input","button","select","option","textarea","label","h1","h2","h3","h4","h5","h6","header","footer","nav","section","article","aside","main","figure","figcaption","video","audio","source","canvas","svg"],icon:"Code text-orange-500"});const ot=["inherit","initial","unset","revert","revert-layer","auto","none","hidden","visible","collapse","block","inline","inline-block","flex","inline-flex","grid","inline-grid","contents","list-item","static","relative","absolute","fixed","sticky","solid","dashed","dotted","double","groove","ridge","inset","outset","bold","bolder","lighter","normal","italic","oblique","uppercase","lowercase","capitalize","left","right","center","top","bottom","start","end","stretch","space-between","space-around","space-evenly","repeat","no-repeat","repeat-x","repeat-y","cover","contain","pointer","default","move","text","not-allowed","transparent","currentColor"];_e.registerLanguage({name:"CSS",extensions:["css","scss","sass","less"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/@[\w-]+/,type:"statement"},{match:/#[\w-]+/,type:"keyword"},{match:/\.[\w-]+/,type:"keyword"},{match:/::?[\w-]+(?:\([^)]*\))?/,type:"keyword"},{match:/\[[\w-]+(?:[~|^$*]?=(?:"[^"]*"|'[^']*'|[\w-]+))?\]/,type:"type"},{match:/{/,type:"symbol",next:"properties"},{match:/}/,type:"symbol"},{match:/[,>+~*]/,type:"symbol"},{match:/[\w-]+/,type:"keyword"},{match:/\s+/,type:"text"}],properties:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/}/,type:"symbol",pop:!0},{match:/[\w-]+(?=\s*:)/,type:"type"},{match:/:/,type:"symbol"},{match:we(ot),type:"string"},{match:/;/,type:"symbol"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},{match:/#[a-fA-F0-9]{3,8}\b/,type:"string"},{match:/-?\d+\.?\d*(?:px|em|rem|%|vh|vw|vmin|vmax|pt|cm|mm|in|pc|ex|ch|fr|deg|rad|grad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?/,type:"number"},{match:/!important\b/,type:"builtin"},{match:/[\w-]+\(/,type:"method"},{match:/--[\w-]+/,type:"type"},{match:/[(),]/,type:"symbol"},{match:/{/,type:"symbol",next:"properties"},{match:/[\w-]+/,type:"text"},{match:/\s+/,type:"text"}],...ke},reservedWords:["color","background","border","margin","padding","font","display","position","width","height","top","left","right","bottom","flex","grid","z-index","opacity","transform","transition","animation","content","visibility",...ot,"hover","active","focus","visited","link","before","after","first-child","last-child","nth-child","not","root","disabled","checked"],icon:"Hash text-blue-500"}),_e.registerLanguage({name:"Markdown",extensions:["md","markdown"],states:{root:[{match:/^#{1,6}\s+.+/,type:"keyword"},{match:/^\*\*\*.+$/,type:"symbol"},{match:/\*\*[^*]+\*\*/,type:"keyword"},{match:/\*[^*]+\*/,type:"type"},{match:/__[^_]+__/,type:"keyword"},{match:/_[^_]+_/,type:"type"},{match:/`[^`]+`/,type:"string"},{match:/```/,type:"comment",next:"codeBlock"},{match:/^\s*[-*+]\s+/,type:"symbol"},{match:/^\s*\d+\.\s+/,type:"symbol"},{match:/\[([^\]]+)\]\(([^)]+)\)/,type:"builtin"},{match:/^>\s+/,type:"comment"},{match:/.+/,type:"text"}],codeBlock:[{match:/```/,type:"comment",pop:!0},{match:/.+/,type:"string"}]},reservedWords:[],icon:"Markdown text-red-500"});const nt=["if","else","for","in","do","goto","call","exit","setlocal","endlocal","set","echo","rem","pause","cd","pushd","popd","shift","start"],it=["dir","copy","move","del","ren","md","rd","type","find","findstr","tasklist","taskkill","ping","ipconfig","netstat","cls","title","color"];_e.registerLanguage({name:"Batch",extensions:["bat","cmd"],lineComment:"rem",states:{root:[{match:/^rem\s+.*/i,type:"comment"},{match:/^::.*/,type:"comment"},{match:/"/,type:"string",next:"doubleString"},{match:/%[\w]+%/,type:"type"},{match:/\b\d+\b/,type:"number"},{match:we([...nt,...nt.map(e=>e.toUpperCase())]),type:"keyword"},{match:we(it),type:"builtin"},{match:/@echo/,type:"statement"},{match:/[a-zA-Z_]\w*/,type:"text"},{match:/[<>|&()@]/,type:"symbol"},{match:/\s+/,type:"text"}],...ke},reservedWords:[...nt,...it],icon:"Terminal text-gray-300"});const at=["project","cmake_minimum_required","add_executable","add_library","target_link_libraries","target_include_directories","set","option","if","else","elseif","endif","foreach","endforeach","while","endwhile","function","endfunction","macro","endmacro","find_package","include","message","install","add_subdirectory","configure_file"];_e.registerLanguage({name:"CMake",extensions:["cmake","txt","cmake-cache"],lineComment:"#",states:{root:[{match:/#.*/,type:"comment"},{match:/"/,type:"string",next:"doubleString"},{match:/\$\{[^}]+\}/,type:"type"},{match:/\b\d+\.?\d*\b/,type:"number"},{match:we([...at,...at.map(e=>e.toUpperCase())]),type:"keyword"},{match:/\b[A-Z_][A-Z0-9_]*\b/,type:"builtin"},{match:/[a-zA-Z_]\w*/,type:"text"},{match:/[(){}]/,type:"symbol"},{match:/\s+/,type:"text"}],...ke},reservedWords:[...at],icon:"AlignLeft text-neutral-500"});const rt=["as","break","const","continue","crate","else","enum","extern","false","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","Self","static","struct","super","trait","true","type","unsafe","use","where","while","async","await","dyn","abstract","become","box","do","final","macro","override","priv","typeof","unsized","virtual","yield"],lt=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","bool","char","str","String","Vec","Option","Result","Box"],ct=["println","print","eprintln","eprint","format","panic","assert","assert_eq","assert_ne","debug_assert","vec","Some","None","Ok","Err"];_e.registerLanguage({name:"Rust",extensions:["rs"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/"/,type:"string",next:"doubleString"},{match:/'(?:\\.|[^'])+'/,type:"string"},{match:/r#*"/,type:"string",next:"rawString"},...Se,{match:/#\[[\w:]+\]/,type:"preprocessor"},{match:we(rt),type:"keyword"},{match:we(lt),type:"type"},{match:we(ct),type:"builtin"},{match:/![a-zA-Z_]\w*/,type:"preprocessor"},...Ee],rawString:[{match:/"#*/,type:"string",pop:!0},{match:/[^"]+/,type:"string"},{match:/"/,type:"string"}],...ke},reservedWords:[...rt,...lt,...ct],icon:"Rust text-orange-400"});class dt{onChange=void 0;_lines=[""];get lineCount(){return this._lines.length}constructor(e){this.onChange=e}getLine(e){return this._lines[e]??""}getText(e="\n"){return this._lines.join(e)}setText(e){this._lines=e.split(/\r?\n/),0===this._lines.length&&(this._lines=[""]),this.onChange&&this.onChange(this)}getCharAt(e,t){const s=this._lines[e];if(!(!s||t<0||t>=s.length))return s[t]}getWordAt(e,t){const s=this._lines[e];if(!s||t<0||t>s.length)return["",t,t];let o=t;for(;o>0&&ve(s[o-1]);)o--;let n=t;for(;n<s.length&&ve(s[n]);)n++;return[s.substring(o,n),o,n]}getIndent(e){const t=function(e){const t=e.search(/\S|$/);return t<e.length?t:-1}(this._lines[e]??"");return-1===t?this._lines[e]?.length??0:t}findNext(e,t,s){if(!e)return null;for(let o=t;o<this._lines.length;o++){const n=o===t?s:0,i=this._lines[o].indexOf(e,n);if(-1!==i)return{line:o,col:i}}for(let o=0;o<=t;o++){const n=o===t?s:this._lines[o].length,i=this._lines[o].indexOf(e);if(-1!==i&&i<n)return{line:o,col:i}}return null}insert(e,t,s){const o=s.split(/\r?\n/),n=this._lines[e]??"",i=n.substring(0,t),a=n.substring(t);if(1===o.length)this._lines[e]=i+o[0]+a;else{this._lines[e]=i+o[0];for(let t=1;t<o.length-1;t++)this._lines.splice(e+t,0,o[t]);this._lines.splice(e+o.length-1,0,o[o.length-1]+a)}return this.onChange&&this.onChange(this),{type:"insert",line:e,col:t,text:s}}delete(e,t,s){let o=s,n="",i=e,a=t;for(;o>0&&i<this._lines.length;){const e=this._lines[i],t=e.length-a;if(o<=t)n+=e.substring(a,a+o),this._lines[i]=e.substring(0,a)+e.substring(a+o),o=0;else{n+=e.substring(a)+"\n",o-=t+1;const s=this._lines[i+1]??"";this._lines[i]=e.substring(0,a)+s,this._lines.splice(i+1,1)}}return this.onChange&&this.onChange(this),{type:"delete",line:e,col:t,text:n}}insertLine(e,t=""){const s=e+1;return this._lines.splice(s,0,t),this.onChange&&this.onChange(this),{type:"insert",line:Math.max(e,0),col:e>=0?this._lines[e]?.length??0:0,text:"\n"+t}}removeLine(e){const t=this._lines[e];return this._lines.splice(e,1),0===this._lines.length&&(this._lines=[""]),this.onChange&&this.onChange(this),{type:"delete",line:Math.max(e-1,0),col:e>0?this._lines[e-1]?.length??0:0,text:"\n"+t}}replaceLine(e,t){const s=this._lines[e];return this._lines[e]=t,this.onChange&&this.onChange(this),{type:"replaceLine",line:e,col:0,text:t,oldText:s}}applyInverse(e){return"insert"===e.type?this.delete(e.line,e.col,e.text.length):"replaceLine"===e.type?this.replaceLine(e.line,e.oldText):this.insert(e.line,e.col,e.text)}}class ht{_undoStack=[];_redoStack=[];_pendingOps=[];_pendingCursorsBefore=[];_pendingCursorsAfter=[];_lastPushTime=0;_groupThresholdMs;_maxSteps;constructor(e=2e3,t=200){this._groupThresholdMs=e,this._maxSteps=t}record(e,t){const s=Date.now();s-this._lastPushTime>this._groupThresholdMs&&this._pendingOps.length>0&&this._flush(),0===this._pendingOps.length&&(this._pendingCursorsBefore=t.map(e=>({...e}))),this._pendingOps.push(e),this._pendingCursorsAfter=t.map(e=>({...e})),this._lastPushTime=s,this._redoStack.length=0}flush(e){e&&this._pendingOps.length>0&&(this._pendingCursorsAfter=e.map(e=>({...e}))),this._flush()}undo(e,t){this.flush(t);const s=this._undoStack.pop();if(!s)return null;const o=[];for(let t=s.operations.length-1;t>=0;t--){const n=e.applyInverse(s.operations[t]);o.unshift(n)}return this._redoStack.push({operations:o,cursorsBefore:s.cursorsBefore,cursorsAfter:s.cursorsAfter}),{cursors:s.cursorsBefore}}redo(e){const t=this._redoStack.pop();if(!t)return null;const s=[];for(let o=0;o<t.operations.length;o++){const n=e.applyInverse(t.operations[o]);s.push(n)}return this._undoStack.push({operations:s,cursorsBefore:t.cursorsBefore,cursorsAfter:t.cursorsAfter}),{cursors:t.cursorsAfter}}canUndo(){return this._undoStack.length>0||this._pendingOps.length>0}canRedo(){return this._redoStack.length>0}clear(){this._undoStack.length=0,this._redoStack.length=0,this._pendingOps.length=0,this._lastPushTime=0}_flush(){if(0!==this._pendingOps.length)for(this._undoStack.push({operations:[...this._pendingOps],cursorsBefore:[...this._pendingCursorsBefore],cursorsAfter:[...this._pendingCursorsAfter]}),this._pendingOps.length=0,this._pendingCursorsBefore=[],this._pendingCursorsAfter=[];this._undoStack.length>this._maxSteps;)this._undoStack.shift()}}function ut(e,t){return e.line===t.line&&e.col===t.col}function pt(e,t){return e.line<t.line||e.line===t.line&&e.col<t.col}function mt(e){return pt(e.anchor,e.head)?e.anchor:e.head}function gt(e){return pt(e.anchor,e.head)?e.head:e.anchor}function ft(e){return ut(e.anchor,e.head)}class Lt{cursors=[];constructor(){this.cursors=[{anchor:{line:0,col:0},head:{line:0,col:0}}]}getPrimary(){return this.cursors[0]}set(e,t){this.cursors=[{anchor:{line:e,col:t},head:{line:e,col:t}}]}moveLeft(e,t=!1){for(const s of this.cursors)this._moveHead(s,e,-1,0,t);this._merge()}moveRight(e,t=!1){for(const s of this.cursors)this._moveHead(s,e,1,0,t);this._merge()}moveUp(e,t=!1){for(const s of this.cursors)this._moveVertical(s,e,-1,t);this._merge()}moveDown(e,t=!1){for(const s of this.cursors)this._moveVertical(s,e,1,t);this._merge()}moveToLineStart(e,t=!1,s=!1){for(const o of this.cursors){const n=o.head.line,i=e.getIndent(n),a=o.head.col===i||s?0:i;o.head={line:n,col:a},t||(o.anchor={...o.head})}this._merge()}moveToLineEnd(e,t=!1){for(const s of this.cursors){const o=s.head.line;s.head={line:o,col:e.getLine(o).length},t||(s.anchor={...s.head})}this._merge()}moveWordLeft(e,t=!1){for(const s of this.cursors){const{line:o,col:n}=s.head;if(0===n&&o>0)s.head={line:o-1,col:e.getLine(o-1).length};else{const t=e.getLine(o);let i=n;for(;i>0&&/\s/.test(t[i-1]);)i--;if(i>0&&ve(t[i-1]))for(;i>0&&ve(t[i-1]);)i--;else if(i>0)for(;i>0&&Ce(t[i-1]);)i--;s.head={line:o,col:i}}t||(s.anchor={...s.head})}this._merge()}moveWordRight(e,t=!1){for(const s of this.cursors){const{line:o,col:n}=s.head,i=e.getLine(o);if(n>=i.length&&o<e.lineCount-1)s.head={line:o+1,col:0};else{let e=n;for(;e<i.length&&/\s/.test(i[e]);)e++;if(e<i.length&&ve(i[e]))for(;e<i.length&&ve(i[e]);)e++;else if(e<i.length&&Ce(i[e]))for(;e<i.length&&Ce(i[e]);)e++;s.head={line:o,col:e}}t||(s.anchor={...s.head})}this._merge()}selectAll(e){const t=e.lineCount-1;this.cursors=[{anchor:{line:0,col:0},head:{line:t,col:e.getLine(t).length}}]}addCursor(e,t){this.cursors.push({anchor:{line:e,col:t},head:{line:e,col:t}}),this._merge()}removeSecondaryCursors(){this.cursors=[this.cursors[0]]}sortedIndicesBottomUp(){return this.cursors.map((e,t)=>t).sort((e,t)=>{const s=this.cursors[e].head,o=this.cursors[t].head;return o.line!==s.line?o.line-s.line:o.col-s.col})}adjustOthers(e,t,s,o,n=0){for(let i=0;i<this.cursors.length;i++){if(i===e)continue;const a=this.cursors[i];0!==n&&a.head.line>t?a.head={line:a.head.line+n,col:a.head.col}:a.head.line===t&&a.head.col>=s&&(a.head={line:a.head.line+n,col:a.head.col+o}),0!==n&&a.anchor.line>t?a.anchor={line:a.anchor.line+n,col:a.anchor.col}:a.anchor.line===t&&a.anchor.col>=s&&(a.anchor={line:a.anchor.line+n,col:a.anchor.col+o})}}hasSelection(e=0){const t=this.cursors[e];return!!t&&!ut(t.anchor,t.head)}getSelectedText(e,t=0){const s=this.cursors[t];if(!s||ft(s))return"";const o=mt(s),n=gt(s);if(o.line===n.line)return e.getLine(o.line).substring(o.col,n.col);const i=[];i.push(e.getLine(o.line).substring(o.col));for(let t=o.line+1;t<n.line;t++)i.push(e.getLine(t));return i.push(e.getLine(n.line).substring(0,n.col)),i.join("\n")}getCursorPositions(){return this.cursors.map(e=>({...e.head}))}_moveHead(e,t,s,o,n){const{line:i,col:a}=e.head;if(!n&&!ft(e)){const t=s<0?mt(e):gt(e);return e.head={...t},void(e.anchor={...t})}if(s<0)a>0?e.head={line:i,col:a-1}:i>0&&(e.head={line:i-1,col:t.getLine(i-1).length});else if(s>0){a<t.getLine(i).length?e.head={line:i,col:a+1}:i<t.lineCount-1&&(e.head={line:i+1,col:0})}n||(e.anchor={...e.head})}_moveVertical(e,t,s,o){const{line:n,col:i}=e.head,a=n+s;if(a<0||a>=t.lineCount)return;const r=t.getLine(a).length;e.head={line:a,col:Math.min(i,r)},o||(e.anchor={...e.head})}_merge(){if(this.cursors.length<=1)return;this.cursors.sort((e,t)=>e.head.line!==t.head.line?e.head.line-t.head.line:e.head.col-t.head.col);const e=[this.cursors[0]];for(let t=1;t<this.cursors.length;t++){const s=e[e.length-1],o=this.cursors[t];ut(s.head,o.head)||e.push(o)}this.cursors=e}}class yt{_symbols=new Map;_lineSymbols=[];_scopeStack=[{name:"global",type:"global",line:0}];_lineScopes=[];get currentScope(){return this._scopeStack[this._scopeStack.length-1]?.name??"global"}get currentScopeType(){return this._scopeStack[this._scopeStack.length-1]?.type??"global"}getScopeAtLine(e){return this._lineScopes[e]??[{name:"global",type:"global",line:0}]}getSymbols(e){return this._symbols.get(e)??[]}getAllSymbolNames(){return Array.from(this._symbols.keys())}getAllSymbols(){const e=[];for(const t of this._symbols.values())e.push(...t);return e}getLineSymbols(e){return this._lineSymbols[e]??[]}updateScopeForLine(e,t){const s=(t.match(/\{/g)||[]).length,o=(t.match(/\}/g)||[]).length;this._lineScopes[e]=[...this._scopeStack];for(let e=0;e<o;e++)this._scopeStack.length>1&&this._scopeStack.pop();for(let t=0;t<s;t++)this._scopeStack.push({name:"anonymous",type:"anonymous",line:e})}nameCurrentScope(e,t){if(this._scopeStack.length>0){const s=this._scopeStack[this._scopeStack.length-1];"anonymous"!==s.name&&"anonymous"!==s.type||(s.name=e,s.type=t)}}removeLineSymbols(e){const t=this._lineSymbols[e];if(t){for(const s of t){const t=this._symbols.get(s.name);if(!t)continue;const o=t.findIndex(t=>t.line===e&&t.kind===s.kind&&t.scope===s.scope);-1!==o&&t.splice(o,1),0===t.length&&this._symbols.delete(s.name)}this._lineSymbols[e]=[]}}addSymbol(e){this._symbols.has(e.name)||this._symbols.set(e.name,[]),this._symbols.get(e.name).push(e),this._lineSymbols[e.line]||(this._lineSymbols[e.line]=[]),this._lineSymbols[e.line].push(e)}resetScopes(){this._scopeStack=[{name:"global",type:"global",line:0}],this._lineScopes=[]}clear(){this._symbols.clear(),this._lineSymbols=[],this.resetScopes()}}const bt=globalThis,Ct={keyword:"cm-kwd",statement:"cm-std",type:"cm-typ",builtin:"cm-bln",string:"cm-str",comment:"cm-com",number:"cm-dec",method:"cm-mtd",symbol:"cm-sym",enum:"cm-enu",preprocessor:"cm-ppc",variable:"cm-var"};e.LX.Area,e.LX.Panel,e.LX.Tabs,e.LX.NodeTree;class vt{static SIZE=10;root;thumb;_vertical;_thumbPos=0;_thumbRatio=0;_lastMouse=0;_onDrag=null;get visible(){return!this.root.classList.contains("hidden")}get isVertical(){return this._vertical}constructor(t,s){this._vertical=t,this._onDrag=s,this.root=e.LX.makeElement("div","lexcodescrollbar hidden "+(t?"vertical":"horizontal")),this.thumb=e.LX.makeElement("div"),this.thumb.addEventListener("mousedown",e=>this._onMouseDown(e)),this.root.appendChild(this.thumb)}setThumbRatio(t){this._thumbRatio=e.LX.clamp(t,0,1);const s=this._thumbRatio<1;this.root.classList.toggle("hidden",!s),s&&(this._vertical?this.thumb.style.height=100*this._thumbRatio+"%":this.thumb.style.width=100*this._thumbRatio+"%")}syncToScroll(e,t){if(t<=0)return;const s=(this._vertical?this.root.offsetHeight:this.root.offsetWidth)-(this._vertical?this.thumb.offsetHeight:this.thumb.offsetWidth);s<=0||(this._thumbPos=e/t*s,this._applyPosition())}applyDragDelta(t,s){const o=(this._vertical?this.root.offsetHeight:this.root.offsetWidth)-(this._vertical?this.thumb.offsetHeight:this.thumb.offsetWidth);return o<=0?0:(this._thumbPos=e.LX.clamp(this._thumbPos+t,0,o),this._applyPosition(),this._thumbPos/o*s)}_applyPosition(){this._vertical?this.thumb.style.top=this._thumbPos+"px":this.thumb.style.left=this._thumbPos+"px"}_onMouseDown(e){const t=document;this._lastMouse=this._vertical?e.clientY:e.clientX;const s=e=>{const t=this._vertical?e.clientY:e.clientX,s=t-this._lastMouse;this._lastMouse=t,this._onDrag?.(s),e.stopPropagation(),e.preventDefault()},o=()=>{t.removeEventListener("mousemove",s),t.removeEventListener("mouseup",o)};t.addEventListener("mousemove",s),t.addEventListener("mouseup",o),e.stopPropagation(),e.preventDefault()}}class xt{static __instances=[];language;symbolTable;area;baseArea;codeArea;explorerArea;tabs;root;codeScroller;codeSizer;cursorsLayer;selectionsLayer;lineGutter;vScrollbar;hScrollbar;searchBox=null;searchLineBox=null;autocomplete=null;currentTab=null;statusPanel;leftStatusPanel;rightStatusPanel;explorer=null;charWidth=0;lineHeight=0;fontSize=0;xPadding=64;_cachedTabsHeight=0;_cachedStatusPanelHeight=0;skipInfo=!1;disableEdition=!1;skipTabs=!1;useFileExplorer=!1;useAutoComplete=!0;allowAddScripts=!0;allowClosingTabs=!0;allowLoadingFiles=!0;tabSize=4;highlight="Plain Text";newTabOptions=null;customSuggestions=[];explorerName="EXPLORER";onSave;onRun;onCtrlSpace;onCreateStatusPanel;onContextMenu;onNewTab;onSelectTab;onReady;onCreateFile;onCodeChange;_inputArea;_lineStates=[];_lineElements=[];_openedTabs={};_loadedTabs={};_storedTabs={};_focused=!1;_composing=!1;_keyChain=null;_wasPaired=!1;_lastAction="";_blinkerInterval=null;_cursorVisible=!0;_cursorBlinkRate=550;_clickCount=0;_lastClickTime=0;_lastClickLine=-1;_isSearchBoxActive=!1;_isSearchLineBoxActive=!1;_searchMatchCase=!1;_lastTextFound="";_lastSearchPos=null;_discardScroll=!1;_isReady=!1;_lastMaxLineLength=0;_lastLineCount=0;_isAutoCompleteActive=!1;_selectedAutocompleteIndex=0;_displayObservers;static CODE_MIN_FONT_SIZE=9;static CODE_MAX_FONT_SIZE=22;static PAIR_KEYS={'"':'"',"'":"'","`":"`","(":")","{":"}","[":"]"};get doc(){return this.currentTab.doc}get undoManager(){return this.currentTab.undoManager}get cursorSet(){return this.currentTab.cursorSet}get codeContainer(){return this.currentTab.dom}static getInstances(){return xt.__instances}constructor(t,s={}){if(bt.editor=this,xt.__instances.push(this),this.skipInfo=s.skipInfo??this.skipInfo,this.disableEdition=s.disableEdition??this.disableEdition,this.skipTabs=s.skipTabs??this.skipTabs,this.useFileExplorer=(s.fileExplorer??this.useFileExplorer)&&!this.skipTabs,this.useAutoComplete=s.autocomplete??this.useAutoComplete,this.allowAddScripts=s.allowAddScripts??this.allowAddScripts,this.allowClosingTabs=s.allowClosingTabs??this.allowClosingTabs,this.allowLoadingFiles=s.allowLoadingFiles??this.allowLoadingFiles,this.highlight=s.highlight??this.highlight,this.newTabOptions=s.newTabOptions,this.customSuggestions=s.customSuggestions??[],this.explorerName=s.explorerName??this.explorerName,this.onSave=s.onSave,this.onRun=s.onRun,this.onCtrlSpace=s.onCtrlSpace,this.onCreateStatusPanel=s.onCreateStatusPanel,this.onContextMenu=s.onContextMenu,this.onNewTab=s.onNewTab,this.onSelectTab=s.onSelectTab,this.onReady=s.onReady,this.onCodeChange=s.onCodeChange,this.language=_e.getLanguage(this.highlight)??_e.getLanguage("Plain Text"),this.symbolTable=new yt,this.useFileExplorer){let[s,o]=t.split({sizes:["15%","85%"]});this.explorerArea=s;let n=new e.LX.Panel;n.addTitle(this.explorerName);let i=[];this.explorer=n.addTree(null,i,{filter:!1,rename:!1,skipDefaultIcon:!0}),this.explorer.on("dblClick",e=>{const t=e.items[0].id;this.loadTab(t)}),this.explorer.on("beforeDelete",(e,t)=>{}),s.attach(n),t=o}t.root.className=e.LX.mergeClass(t.root.className,"codebasearea overflow-hidden flex relative"),this.baseArea=t,this.area=new e.LX.Area({className:"lexcodeeditor flex flex-col outline-none overflow-hidden size-full select-none bg-inherit relative",skipAppend:!0});const o="lexcodearea scrollbar-hidden flex flex-row flex-auto-fill";if(this.skipTabs?(this.codeArea=new e.LX.Area({className:o,skipAppend:!0}),this.area.attach(this.codeArea)):(this.tabs=this.area.addTabs({contentClass:o,onclose:e=>{delete this._openedTabs[e]}}),e.LX.addClass(this.tabs.root.parentElement,"rounded-t-lg"),this.disableEdition||this.tabs.root.parentElement.addEventListener("dblclick",e=>{this.allowAddScripts&&(e.preventDefault(),this._onCreateNewFile())}),this.codeArea=this.tabs.area),this.root=this.area.root,t.attach(this.root),this.codeScroller=this.codeArea.root,this.lineGutter=e.LX.makeElement("div","w-16 overflow-hidden absolute top-0 bg-inherit z-10 "+(this.skipTabs?"":"mt-8"),null,this.codeScroller),this.codeSizer=e.LX.makeElement("div","pseudoparent-tabs w-full",null,this.codeScroller),this.cursorsLayer=e.LX.makeElement("div","cursors",null,this.codeSizer),this.selectionsLayer=e.LX.makeElement("div","selections",null,this.codeSizer),!this.disableEdition){this.vScrollbar=new vt(!0,e=>{const t=this.codeScroller.scrollHeight-this.codeScroller.clientHeight;this.codeScroller.scrollTop=this.vScrollbar.applyDragDelta(e,t),this._discardScroll=!0}),this.root.appendChild(this.vScrollbar.root),this.hScrollbar=new vt(!1,e=>{const t=this.codeScroller.scrollWidth-this.codeScroller.clientWidth;this.codeScroller.scrollLeft=this.hScrollbar.applyDragDelta(e,t),this._discardScroll=!0}),this.root.appendChild(this.hScrollbar.root),this.codeScroller.addEventListener("scroll",()=>{this._discardScroll?this._discardScroll=!1:this._syncScrollBars()});let e=0,t=0;this.codeScroller.addEventListener("touchstart",s=>{e=s.touches[0].clientX,t=s.touches[0].clientY},{passive:!0}),this.codeScroller.addEventListener("touchmove",s=>{const o=s.touches[0].clientX,n=s.touches[0].clientY,i=e-o,a=t-n;this.codeScroller.scrollLeft+=i,this.codeScroller.scrollTop+=a,e=o,t=n},{passive:!0}),this.codeScroller.addEventListener("wheel",e=>{if(e.ctrlKey)return e.preventDefault(),void this._applyFontSizeOffset(e.deltaY<0?1:-1);e.shiftKey&&(this.codeScroller.scrollLeft+=e.deltaY>0?10:-10)},{passive:!1})}if(new ResizeObserver(()=>{this.currentTab&&this.resize(!0)}).observe(this.codeArea.root),!this.disableEdition){this.useAutoComplete&&(this.autocomplete=e.LX.makeElement("div","autocomplete"),this.codeArea.attach(this.autocomplete));const t="searchbox bg-card min-w-96 absolute z-100 top-8 right-2 rounded-lg border-color overflow-y-scroll opacity-0";{const s=e.LX.makeElement("div",t,null,this.codeArea),o=new e.LX.Panel;s.appendChild(o.root),o.sameLine();const n=o.addText(null,"",null,{placeholder:"Find",inputClass:"bg-secondary"});o.addButton(null,"MatchCaseButton",e=>{this._searchMatchCase=e,this._doSearch()},{icon:"CaseSensitive",selectable:!0,buttonClass:"link",title:"Match Case",tooltip:!0}),o.addButton(null,"up",()=>this._doSearch(null,!0),{icon:"ArrowUp",buttonClass:"ghost",title:"Previous Match",tooltip:!0}),o.addButton(null,"down",()=>this._doSearch(),{icon:"ArrowDown",buttonClass:"ghost",title:"Next Match",tooltip:!0}),o.addButton(null,"x",this._doHideSearch.bind(this),{icon:"X",buttonClass:"ghost",title:"Close",tooltip:!0}),o.endLine();const i=n.root.querySelector("input");i?.addEventListener("keyup",e=>{"Escape"==e.key?this._doHideSearch():"Enter"==e.key&&this._doSearch(e.target.value,!!e.shiftKey)}),this.searchBox=s}{const s=e.LX.makeElement("div",t,null,this.codeArea),o=new e.LX.Panel;s.appendChild(o.root),o.sameLine();const n=o.addText(null,"",e=>{i.value=":"+e.replaceAll(":",""),this._doGotoLine(parseInt(i.value.slice(1)))},{className:"flex-auto-fill",placeholder:"Go to line",trigger:"input"});o.addButton(null,"x",this._doHideSearch.bind(this),{icon:"X",title:"Close",buttonClass:"ghost",tooltip:!0}),o.endLine();const i=n.root.querySelector("input");i.addEventListener("keyup",e=>{"Escape"==e.key&&this._doHideSearch()}),o.addText(null,"Type a line number to go to (from 0 to 0).",null,{disabled:!0,inputClass:"text-xs bg-none",signal:"@line-number-range"}),this.searchLineBox=s}}this._inputArea=e.LX.makeElement("textarea","absolute opacity-0 w-[1px] h-[1px] top-0 left-0 overflow-hidden resize-none","",this.root),this._inputArea.setAttribute("autocorrect","off"),this._inputArea.setAttribute("autocapitalize","off"),this._inputArea.setAttribute("spellcheck","false"),this._inputArea.tabIndex=0,this._inputArea.addEventListener("keydown",this._onKeyDown.bind(this)),this._inputArea.addEventListener("compositionstart",()=>this._composing=!0),this._inputArea.addEventListener("compositionend",e=>{this._composing=!1,this._inputArea.value="",e.data&&this._doInsertChar(e.data)}),this._inputArea.addEventListener("input",()=>{if(this._composing)return;const e=this._inputArea.value;e&&(this._inputArea.value="",this._doInsertChar(e))}),this._inputArea.addEventListener("focus",()=>this._setFocused(!0)),this._inputArea.addEventListener("blur",()=>this._setFocused(!1)),this.codeArea.root.addEventListener("mousedown",this._onMouseDown.bind(this)),this.codeArea.root.addEventListener("contextmenu",this._onMouseDown.bind(this)),this.statusPanel=this._createStatusPanel(s),this.statusPanel&&this.area.root.appendChild(this.statusPanel.root),this.allowAddScripts&&(this.onCreateFile=s.onCreateFile,this.addTab("+",{selected:!1,title:"Create file"})),(s.defaultTab??1)&&(this.addTab(s.name||"untitled",{language:this.highlight,title:s.title}),this._renderAllLines(),this._renderCursors()),this._init()}_init(){if(this._displayObservers)return;this._isReady=!1;const e=this.root,t=async()=>{this._isReady||null!==e.offsetParent&&e.clientWidth>0&&e.clientHeight>0&&(s.disconnect(),o.disconnect(),await this._setupEditorWhenVisible())},s=new IntersectionObserver(e=>{for(const s of e)s.isIntersecting&&t()});s.observe(e);const o=new ResizeObserver(()=>{t()});o.observe(e),this._displayObservers={intersectionObserver:s,resizeObserver:o}}clear(){console.assert(this.rightStatusPanel&&this.leftStatusPanel,"No panels to clear."),this.rightStatusPanel.clear(),this.leftStatusPanel.clear()}addExplorerItem(e){this.explorer&&(this.explorer.innerTree.data.find((t,s)=>t.id===e.id)||this.explorer.innerTree.data.push(e))}setText(e){this.currentTab&&(this.doc.setText(e),this.cursorSet.set(0,0),this.undoManager.clear(),this._lineStates=[],this._renderAllLines(),this._renderCursors(),this._renderSelections(),this.resize(!0))}appendText(e){const t=this.cursorSet.getPrimary(),{line:s,col:o}=t.head,n=this.doc.insert(s,o,e);this.undoManager.record(n,this.cursorSet.getCursorPositions());const i=e.split(/\r?\n/);1===i.length?t.head={line:s,col:o+e.length}:t.head={line:s+i.length-1,col:i[i.length-1].length},t.anchor={...t.head},this._rebuildLines(),this._renderCursors(),this._renderSelections(),this.resize(),this._scrollCursorIntoView()}getText(){return this.doc.getText()}setLanguage(t,s){const o=_e.getLanguage(t);o&&(this.language=o,this.currentTab&&(this.currentTab.language=t,this.skipTabs||this.tabs.setIcon(this.currentTab.name,xe(o,s))),this._lineStates=[],this._renderAllLines(),e.LX.emitSignal("@highlight",t))}focus(){this._inputArea.focus()}addTab(t,s={}){const o="+"===t,n=e.LX.makeElement("div","code"),i=s.language??"Plain Text",a=_e.getLanguage(i),r=e.LX.getExtension(t),l=o?null:xe(a,r),c=s.selected??!0,d={name:t,dom:n,doc:new dt(this.onCodeChange),cursorSet:new Lt,undoManager:new ht,language:i,title:s.title??t};return this._openedTabs[t]=d,this._loadedTabs[t]=d,this.useFileExplorer&&!o&&(this.addExplorerItem({id:t,skipVisibility:!0,icon:l}),this.explorer.innerTree.frefresh(t)),this.skipTabs||this.tabs.add(t,n,{selected:c,icon:l,fixed:o,title:d.title,onSelect:this._onSelectTab.bind(this,o),onContextMenu:this._onContextMenuTab.bind(this,o),allowDelete:this.allowClosingTabs,indexOffset:s.indexOffset}),this.codeSizer.appendChild(n),s.text&&(d.doc.setText(s.text),d.cursorSet.set(0,0),d.undoManager.clear(),this._renderAllLines(),this._renderCursors(),this._renderSelections(),this._resetGutter()),c&&(this.currentTab=d,this._updateDataInfoPanel("@tab-name",t),this.setLanguage(i,r)),d}loadTab(e){if(this._openedTabs[e])return void this.tabs.select(e);const t=this._loadedTabs[e];if(t)return this._openedTabs[e]=t,this.tabs.add(e,t.dom,{selected:!0,title:t.title,onSelect:this._onSelectTab.bind(this),onContextMenu:this._onContextMenuTab.bind(this),allowDelete:this.allowClosingTabs}),this.codeSizer.appendChild(t.dom),this.currentTab=t,void this._updateDataInfoPanel("@tab-name",e);this.addTab(e,this._storedTabs[e]??null)}closeTab(e){if(!this.allowClosingTabs)return;this.tabs.delete(e);const t=this._openedTabs[e];if(t&&(t.dom.remove(),delete this._openedTabs[e]),this.currentTab?.name===e){const e=Object.keys(this._openedTabs).filter(e=>"+"!==e);e.length>0?this.tabs.select(e[0]):this.currentTab=null}}setCustomSuggestions(e){e&&e.constructor===Array?this.customSuggestions=e:console.warn("suggestions should be a string array!")}loadFile(t,s={}){const o=(t,o)=>{t=t.replaceAll("\r","").replaceAll(/\t|\\t/g," ".repeat(this.tabSize));const n=e.LX.getExtension(o),i=s.language??_e.getLanguage(s.language)??_e.getLanguageByExtension(n)??_e.getLanguage("Plain Text"),a=i.name;this.useFileExplorer||this.skipTabs?(this._storedTabs[o]={text:t,title:s.title??o,language:a,...s},this.useFileExplorer&&(this.addExplorerItem({id:o,skipVisibility:!0,icon:xe(i,n)}),this.explorer.innerTree.frefresh(o))):(this.addTab(o,{selected:!0,title:s.title??o,language:a}),this.doc.setText(t),this.setLanguage(a,n),this.cursorSet.set(0,0),this.undoManager.clear(),this._renderCursors(),this._renderSelections(),this._resetGutter()),s.callback&&s.callback(o,t)};if("string"==typeof t){const n=t,i=s.filename??n.substring(n.lastIndexOf("/")+1);e.LX.request({url:n,success:e=>{o(e,i)}})}else{const e=new FileReader;e.readAsText(t),e.onload=e=>{const s=e.currentTarget.result;o(s,t.name)}}}async loadFiles(t,s,o=!1){if(!t||0===t.length)return void s?.(this,[],0);const n=[];for(const s of t)try{const t=await e.LX.requestFileAsync(s,"text"),o=s.substring(s.lastIndexOf("/")+1),i=t.replaceAll("\r","").replaceAll(/\t|\\t/g," ".repeat(this.tabSize)),a=e.LX.getExtension(o),r=_e.getLanguageByExtension(a)??_e.getLanguage("Plain Text"),l=r.name;this.useFileExplorer||this.skipTabs?(this._storedTabs[o]={text:i,title:o,language:l},this.useFileExplorer&&(this.addExplorerItem({id:o,skipVisibility:!0,icon:xe(r,a)}),this.explorer.innerTree.frefresh(o))):(this.addTab(o,{selected:0===n.length,title:o,language:l}),0===n.length&&(this.doc.setText(i),this.setLanguage(l,a),this.cursorSet.set(0,0),this.undoManager.clear(),this._renderCursors(),this._renderSelections(),this._resetGutter())),n.push({filePath:s,name:o,success:!0})}catch(e){console.error(`[LX.CodeEditor] Failed to load file: ${s}`,e),n.push({filePath:s,success:!1,error:e})}s?.(this,n,n.length)}async _setupEditorWhenVisible(){const t=window.localStorage.getItem("lexcodeeditor-font-size");if(t)await this._setFontSize(parseInt(t),!1);else{const e=document.querySelector(":root"),t=getComputedStyle(e);this.fontSize=parseInt(t.getPropertyValue("--code-editor-font-size")),await this._measureChar()}e.LX.emitSignal("@font-size",this.fontSize),e.LX.doAsync(()=>{this._isReady||(this._isReady=!0,this.onReady&&this.onReady(this),console.log(`[LX.CodeEditor] Ready! (font size: ${this.fontSize}px, char size: ${this.charWidth}px)`))},20)}_onSelectTab(t,s,o){this.disableEdition||(t?this._onNewTab(s):(this.currentTab=this._openedTabs[o],this._updateDataInfoPanel("@tab-name",o),this.language=_e.getLanguage(this.currentTab.language)??_e.getLanguage("Plain Text"),e.LX.emitSignal("@highlight",this.currentTab.language),this._renderAllLines(),this._afterCursorMove(),!t&&this.onSelectTab&&this.onSelectTab(o,this)))}_onNewTab(t){if(this.onNewTab)return void this.onNewTab(t);const s=this.newTabOptions??[{name:"Create file",icon:"FilePlus",callback:this._onCreateNewFile.bind(this)},{name:"Load file",icon:"FileUp",disabled:!this.allowLoadingFiles,callback:this._doLoadFromFile.bind(this)}];e.LX.addDropdownMenu(t.target,s,{side:"bottom",align:"start"})}_onCreateNewFile(){let e={};if(this.onCreateFile&&(e=this.onCreateFile(this),!e))return;const t=e.name??"unnamed.js";this.addTab(t,{selected:!0,title:t,indexOffset:e.indexOffset,language:e.language??"JavaScript"}),this._renderAllLines(),this._renderCursors(),this._renderSelections(),this._resetGutter()}_onContextMenuTab(t=!1,s,o){t||e.LX.addDropdownMenu(s.target,[{name:"Close",kbd:"MWB",disabled:!this.allowClosingTabs,callback:()=>{this.closeTab(o)}},{name:"Close Others",disabled:!this.allowClosingTabs,callback:()=>{for(const e of Object.keys(this.tabs.tabs))"+"!==e&&e!==o&&this.closeTab(e)}},{name:"Close All",disabled:!this.allowClosingTabs,callback:()=>{for(const e of Object.keys(this.tabs.tabs))"+"!==e&&this.closeTab(e)}},null,{name:"Copy Path",icon:"Copy",callback:()=>{navigator.clipboard.writeText(this._openedTabs[o].path??"")}}],{side:"bottom",align:"start",event:s})}async _measureChar(){const t=e.LX.makeContainer(null,"lexcodeeditor","",document.body),s=e.LX.makeContainer(null,"code","",t),o=document.createElement("pre");s.appendChild(o);const n=document.createElement("span");n.className="codechar",n.style.visibility="hidden",n.textContent="M",o.appendChild(n);const i=getComputedStyle(n),a=i.fontFamily,r=i.fontSize,l=i.fontWeight||"normal",c=`${i.fontStyle||"normal"} ${l} ${r} ${a}`;try{await document.fonts.load(c)}catch(e){console.warn("[LX.CodeEditor] Failed to load font:",c,e)}requestAnimationFrame(()=>{const s=n.getBoundingClientRect();this.charWidth=s.width||7,this.lineHeight=parseFloat(getComputedStyle(this.root).getPropertyValue("--code-editor-row-height"))||20,e.LX.deleteElement(t),this._renderCursors(),this._renderSelections(),this.resize(!0)})}_createStatusPanel(t={}){if(this.skipInfo)return;let s=new e.LX.Panel({className:"lexcodetabinfo bg-inherit flex flex-row flex-auto-keep",height:"auto"});this.onCreateStatusPanel&&this.onCreateStatusPanel(s,this);let o=this.leftStatusPanel=new e.LX.Panel({id:"FontSizeZoomStatusComponent",className:"pad-xs content-center items-center flex-auto-keep",width:"auto",height:"auto"});o.sameLine(),o.addButton(null,"ZoomOutButton",this._decreaseFontSize.bind(this),{icon:"ZoomOut",buttonClass:"ghost sm",title:"Zoom Out",tooltip:!0}),o.addLabel(this.fontSize,{fit:!0,signal:"@font-size"}),o.addButton(null,"ZoomInButton",this._increaseFontSize.bind(this),{icon:"ZoomIn",buttonClass:"ghost sm",title:"Zoom In",tooltip:!0}),o.endLine("justify-start"),s.attach(o.root);let n=this.rightStatusPanel=new e.LX.Panel({className:"pad-xs content-center items-center",height:"auto"});n.sameLine(),n.addLabel(this.currentTab?.title??"",{id:"EditorFilenameStatusComponent",fit:!0,inputClass:"text-xs",signal:"@tab-name"}),n.addButton(null,"Ln 1, Col 1",this._doOpenLineSearch.bind(this),{id:"EditorSelectionStatusComponent",buttonClass:"outline xs",fit:!0,signal:"@cursor-data"});const i=n.addButton(null,"Spaces: "+this.tabSize,(t,s)=>{const o=e=>{this.tabSize=parseInt(e),this._rebuildLines(),this._updateDataInfoPanel("@tab-spaces",`Spaces: ${this.tabSize}`)},n=e.LX.addDropdownMenu(i.root,["2","4","8"].map(e=>({name:e,className:"w-full place-content-center",callback:o})),{side:"top",align:"end"});e.LX.addClass(n.root,"min-w-16! items-center")},{id:"EditorIndentationStatusComponent",buttonClass:"outline xs",signal:"@tab-spaces"}),a=n.addButton("<b>{ }</b>",this.highlight,(t,s)=>{const o=e.LX.addDropdownMenu(a.root,_e.getRegisteredLanguages().map(e=>{const t=xe(_e.getLanguage(e)),s=t?t.split(" "):[];return{name:e,icon:s[0],className:"w-full text-xs px-3",svgClass:s.slice(1).join(" "),callback:e=>this.setLanguage(e)}}),{side:"top",align:"end"});e.LX.addClass(o.root,"min-w-min! items-center")},{id:"EditorLanguageStatusComponent",nameWidth:"auto",buttonClass:"outline xs",signal:"@highlight",title:""});n.endLine("justify-end"),s.attach(n.root);const r={"Font Size Zoom":t.statusShowFontSizeZoom??!0,"Editor Filename":t.statusShowEditorFilename??!0,"Editor Selection":t.statusShowEditorSelection??!0,"Editor Indentation":t.statusShowEditorIndentation??!0,"Editor Language":t.statusShowEditorLanguage??!0},l=e=>{const t=s.root.querySelector(`#${e.replaceAll(" ","")}StatusComponent`);console.assert(t,`${e} has no status button!`),t.classList.toggle("hidden",!r[e])};for(const[e,t]of Object.entries(r))l(e);return s.root.addEventListener("contextmenu",t=>{if(t.target&&(t.target.classList.contains("lexpanel")||t.target.classList.contains("lexinlinecomponents")))return;const s=Object.keys(r).map((e,t)=>{const s={name:e,icon:"Check",callback:()=>{r[e]=!r[e],l(e)}};return r[e]||delete s.icon,s});e.LX.addDropdownMenu(t.target,s,{side:"top",align:"start"})}),s}_updateDataInfoPanel(t,s){this.skipInfo||(this.cursorSet.cursors.length>1&&(s=""),e.LX.emitSignal(t,s))}_tokenizeLine(e){const t=e>0?this._lineStates[e-1]??_e.initialState():_e.initialState(),s=this.doc.getLine(e),o=_e.tokenizeLine(s,this.language,t),n=this.language.name.toLowerCase().replace(/[^a-z]/g,"");let i="";for(const e of o.tokens){const t=Ct[e.type],s=e.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");i+=t?`<span class="${t} ${n}">${s}</span>`:s}return{html:i||" ",endState:o.state,tokens:o.tokens}}_updateSymbolsForLine(e){const t=this.doc.getLine(e);this.symbolTable.updateScopeForLine(e,t),this.symbolTable.removeLineSymbols(e);const{tokens:s}=this._tokenizeLine(e),o=function(e,t,s,o){const n=[],i=o.currentScope,a=o.currentScopeType,r=new Set;for(const e of t)["keyword","statement","builtin","preprocessor"].includes(e.type)&&r.add(e.value);const l=new Set,c=(e,t,o=0)=>{if(!e||!e.match(/^[a-zA-Z_$][\w$]*$/))return;if(r.has(e))return;const a=`${e}@${5*Math.floor(o/5)}`;l.has(a)||(n.push({name:e,kind:t,scope:i,line:s,col:o}),l.add(a))},d=[{regex:/^\s*class\s+([A-Z_]\w*)/i,kind:"class"},{regex:/^\s*struct\s+([A-Z_]\w*)/i,kind:"struct"},{regex:/^\s*interface\s+([A-Z_]\w*)/i,kind:"interface"},{regex:/^\s*enum\s+([A-Z_]\w*)/i,kind:"enum"},{regex:/^\s*type\s+([A-Z_]\w*)\s*=/i,kind:"type"},{regex:/^\s*(?:export\s+)?(?:async\s+)?function\s+(\w+)/i,kind:"function"},{regex:/^\s*(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s+)?\([^)]*\)\s*=>/i,kind:"function"},{regex:/^\s*(?:static\s+|const\s+|virtual\s+|inline\s+|extern\s+|pub\s+|async\s+)*(\w+[\w\s\*&:<>,]*?)\s+(\w+)\s*\([^)]*\)\s*[{;]/i,kind:"typed-function"},{regex:/^\s*(?:public|private|protected|static|readonly)*\s*(\w+)\s*\([^)]*\)\s*[:{]/i,kind:"class"===a?"method":"function"}],h=[{regex:/(?:const|let|var)\s+(\w+)/gi,kind:"variable"},{regex:/(\w+)\s*:\s*(?:function|[A-Z]\w*)/gi,kind:"variable"},{regex:/this\.(\w+)\s*=/gi,kind:"property"},{regex:/new\s+([A-Z]\w+)/gi,kind:"constructor-call"},{regex:/(\w+)\s*\(/gi,kind:"method-call"}];let u=!1;for(const t of d){const s=e.match(t.regex);if(s){let n,i=t.kind;if("typed-function"===t.kind&&s[2])n=s[2],i="class"===a?"method":"function";else{if(!s[1])continue;n=s[1]}c(n,i,e.indexOf(n)),["class","function","method","enum","struct","interface"].includes(i)&&o.nameCurrentScope(n,i),u=!0;break}}if(!u)for(const t of h){const s=e.matchAll(t.regex);for(const e of s)if(e[1]){const s=e[1],o=e.index??0;c(s,t.kind,o)}}if("enum"===a){const t=e.match(/^\s*(\w+)\s*[,=]?/);t&&t[1]&&!e.includes("enum")&&c(t[1],"enum-value",e.indexOf(t[1]))}return n}(t,s,e,this.symbolTable);for(const e of o)this.symbolTable.addSymbol(e)}_renderAllLines(){if(this.currentTab){this.codeContainer.innerHTML="",this._lineElements=[],this._lineStates=[],this.symbolTable.clear();for(let e=0;e<this.doc.lineCount;e++)this._appendLineElement(e)}}_getGutterHtml(e){return`<span class="line-gutter">${e+1}</span>`}_appendLineElement(e){const{html:t,endState:s}=this._tokenizeLine(e);this._lineStates[e]=s;const o=document.createElement("pre");o.innerHTML=this._getGutterHtml(e)+t,this.codeContainer.appendChild(o),this._lineElements[e]=o,this._updateSymbolsForLine(e)}_updateLine(e){const{html:t,endState:s}=this._tokenizeLine(e),o=this._lineStates[e];if(this._lineStates[e]=s,this._lineElements[e]&&(this._lineElements[e].innerHTML=this._getGutterHtml(e)+t),this._updateSymbolsForLine(e),!this._statesEqual(o,s))for(let t=e+1;t<this.doc.lineCount;t++){const{html:e,endState:s}=this._tokenizeLine(t),o=this._lineStates[t];if(this._lineStates[t]=s,this._lineElements[t]&&(this._lineElements[t].innerHTML=this._getGutterHtml(t)+e),this._updateSymbolsForLine(t),this._statesEqual(o,s))break}}_rebuildLines(){if(this._lineElements.length===this.doc.lineCount)for(let e=0;e<this.doc.lineCount;e++)this._updateLine(e);else this._renderAllLines();this.resize()}_statesEqual(e,t){if(!e)return!1;if(e.stack.length!==t.stack.length)return!1;for(let s=0;s<e.stack.length;s++)if(e.stack[s]!==t.stack[s])return!1;return!0}_updateActiveLine(){const e=this.cursorSet.hasSelection(),t=this.cursorSet.getPrimary().head.line,s=this.cursorSet.getPrimary().head.col;for(let s=0;s<this._lineElements.length;s++)this._lineElements[s].classList.toggle("active-line",!e&&s===t);this._updateDataInfoPanel("@cursor-data",`Ln ${t+1}, Col ${s+1}`)}_renderCursors(){if(this.currentTab){this.cursorsLayer.innerHTML="";for(const e of this.cursorSet.cursors){const t=document.createElement("div");t.className="cursor",t.innerHTML=" ",t.style.left=e.head.col*this.charWidth+this.xPadding+"px",t.style.top=e.head.line*this.lineHeight+"px",this.cursorsLayer.appendChild(t)}this._updateActiveLine()}}_renderSelections(){if(this.currentTab){this.selectionsLayer.innerHTML="";for(const e of this.cursorSet.cursors){if(ft(e))continue;const t=mt(e),s=gt(e);for(let e=t.line;e<=s.line;e++){const o=this.doc.getLine(e),n=e===t.line?t.col:0,i=e===s.line?s.col:o.length;if(n===i)continue;const a=document.createElement("div");a.className="lexcodeselection",a.style.top=e*this.lineHeight+"px",a.style.left=n*this.charWidth+this.xPadding+"px",a.style.width=(i-n)*this.charWidth+"px",this.selectionsLayer.appendChild(a)}}}}_setFocused(e){this._focused=e,e?(this.cursorsLayer.classList.add("show"),this.selectionsLayer.classList.add("show"),this.selectionsLayer.classList.remove("unfocused"),this._startBlinker()):(this.cursorsLayer.classList.remove("show"),this._isSearchBoxActive?this.selectionsLayer.classList.add("show"):this.selectionsLayer.classList.add("unfocused"),this._stopBlinker())}_startBlinker(){this._stopBlinker(),this._cursorVisible=!0,this._setCursorVisibility(!0),this._blinkerInterval=setInterval(()=>{this._cursorVisible=!this._cursorVisible,this._setCursorVisibility(this._cursorVisible)},this._cursorBlinkRate)}_stopBlinker(){null!==this._blinkerInterval&&(clearInterval(this._blinkerInterval),this._blinkerInterval=null)}_resetBlinker(){this._focused&&this._startBlinker()}_setCursorVisibility(e){const t=this.cursorsLayer.querySelectorAll(".cursor");for(const s of t)s.style.opacity=e?"0.6":"0"}_onKeyDown(e){if(!this.currentTab)return;if(this._composing||"Dead"===e.key)return;if(["Control","Shift","Alt","Meta"].includes(e.key))return;const t=e.ctrlKey||e.metaKey,s=e.shiftKey,o=e.altKey;if(this._keyChain){const s=this._keyChain;if(this._keyChain=null,e.preventDefault(),t&&"k"===s)switch(e.key.toLowerCase()){case"c":return void this._commentLines();case"u":return void this._uncommentLines()}return}if(t)switch(e.key.toLowerCase()){case"a":return e.preventDefault(),this.cursorSet.selectAll(this.doc),void this._afterCursorMove();case"d":return e.preventDefault(),void this._doFindNextOcurrence();case"f":return e.preventDefault(),void this._doOpenSearch();case"g":return e.preventDefault(),void this._doOpenLineSearch();case"k":return e.preventDefault(),void(this._keyChain="k");case"s":return e.preventDefault(),void(this.onSave&&this.onSave(this.getText(),this));case"z":return e.preventDefault(),void(s?this._doRedo():this._doUndo());case"y":return e.preventDefault(),void this._doRedo();case"c":return e.preventDefault(),void this._doCopy();case"x":return e.preventDefault(),void this._doCut();case"v":return e.preventDefault(),void this._doPaste();case" ":return e.preventDefault(),void(this.onCtrlSpace&&this.onCtrlSpace(this.getText(),this))}switch(e.key){case"ArrowLeft":return e.preventDefault(),this._wasPaired=!1,t?this.cursorSet.moveWordLeft(this.doc,s):this.cursorSet.moveLeft(this.doc,s),void this._afterCursorMove();case"ArrowRight":return e.preventDefault(),this._wasPaired=!1,t?this.cursorSet.moveWordRight(this.doc,s):this.cursorSet.moveRight(this.doc,s),void this._afterCursorMove();case"ArrowUp":if(e.preventDefault(),this._isAutoCompleteActive){const e=this.autocomplete.childNodes;return e[this._selectedAutocompleteIndex]?.classList.remove("selected"),this._selectedAutocompleteIndex=(this._selectedAutocompleteIndex-1+e.length)%e.length,e[this._selectedAutocompleteIndex]?.classList.add("selected"),void e[this._selectedAutocompleteIndex]?.scrollIntoView({block:"nearest"})}return this._wasPaired=!1,o&&s?void this._duplicateLine(-1):o?void this._swapLine(-1):(this.cursorSet.moveUp(this.doc,s),void this._afterCursorMove());case"ArrowDown":if(e.preventDefault(),this._isAutoCompleteActive){const e=this.autocomplete.childNodes;return e[this._selectedAutocompleteIndex]?.classList.remove("selected"),this._selectedAutocompleteIndex=(this._selectedAutocompleteIndex+1)%e.length,e[this._selectedAutocompleteIndex]?.classList.add("selected"),void e[this._selectedAutocompleteIndex]?.scrollIntoView({block:"nearest"})}return this._wasPaired=!1,o&&s?void this._duplicateLine(1):o?void this._swapLine(1):(this.cursorSet.moveDown(this.doc,s),void this._afterCursorMove());case"Home":return e.preventDefault(),this._wasPaired=!1,this.cursorSet.moveToLineStart(this.doc,s),void this._afterCursorMove();case"End":return e.preventDefault(),this._wasPaired=!1,this.cursorSet.moveToLineEnd(this.doc,s),void this._afterCursorMove();case"Escape":if(e.preventDefault(),this._isAutoCompleteActive)return void this._doHideAutocomplete();if(this._doHideSearch())return;this.cursorSet.removeSecondaryCursors();const n=this.cursorSet.getPrimary().head;return this.cursorSet.set(n.line,n.col),void this._afterCursorMove()}switch(e.key){case"Backspace":return e.preventDefault(),void this._doBackspace(t);case"Delete":return e.preventDefault(),void this._doDelete(t);case"Enter":return e.preventDefault(),void this._doEnter(t);case"Tab":return e.preventDefault(),void this._doTab(s)}1!==e.key.length||t||(e.preventDefault(),this._doInsertChar(e.key))}_flushIfActionChanged(e){this._lastAction!==e&&(this.undoManager.flush(this.cursorSet.getCursorPositions()),this._lastAction=e)}_flushAction(){this.undoManager.flush(this.cursorSet.getCursorPositions()),this._lastAction=""}_doInsertChar(e){if(e in xt.PAIR_KEYS&&this.cursorSet.hasSelection())return void this._encloseSelection(e,xt.PAIR_KEYS[e]);this._flushIfActionChanged("insert"),this._deleteSelectionIfAny();const t=new Set;let s=!1;for(const o of this.cursorSet.sortedIndicesBottomUp()){const n=this.cursorSet.cursors[o],{line:i,col:a}=n.head,r=this.doc.getCharAt(i,a);if(this._wasPaired&&r===e){n.head={line:i,col:a+1},n.anchor={...n.head};continue}const l=this.doc.insert(i,a,e);this.undoManager.record(l,this.cursorSet.getCursorPositions());const c=e in xt.PAIR_KEYS&&(!r||/\s/.test(r)),d=c?2:1;if(c){const t=this.doc.insert(i,a+1,xt.PAIR_KEYS[e]);this.undoManager.record(t,this.cursorSet.getCursorPositions()),s=!0}n.head={line:i,col:a+1},n.anchor={...n.head},this.cursorSet.adjustOthers(o,i,a,d),t.add(i)}this._wasPaired=s;for(const e of t)this._updateLine(e);this._afterCursorMove(),/[\w$]/.test(e)?this._doOpenAutocomplete():this._doHideAutocomplete()}_getAffectedLines(){const e=this.cursorSet.getPrimary(),t=e.anchor.line,s=e.head.line;return t<=s?[t,s]:[s,t]}_commentLines(){const e=this.language.lineComment;if(!e)return;const[t,s]=this._getAffectedLines(),o=e+" ";let n=1/0;for(let e=t;e<=s;e++){0!==this.doc.getLine(e).trim().length&&(n=Math.min(n,this.doc.getIndent(e)))}n===1/0&&(n=0),this._flushAction();for(let e=t;e<=s;e++){if(0===this.doc.getLine(e).trim().length)continue;const t=this.doc.insert(e,n,o);this.undoManager.record(t,this.cursorSet.getCursorPositions()),this._updateLine(e)}this._afterCursorMove()}_uncommentLines(){const e=this.language.lineComment;if(!e)return;const[t,s]=this._getAffectedLines();this._flushAction();for(let o=t;o<=s;o++){const t=this.doc.getLine(o),s=this.doc.getIndent(o),n=t.substring(s);if(n.startsWith(e+" ")){const t=this.doc.delete(o,s,e.length+1);this.undoManager.record(t,this.cursorSet.getCursorPositions())}else if(n.startsWith(e)){const t=this.doc.delete(o,s,e.length);this.undoManager.record(t,this.cursorSet.getCursorPositions())}}this._rebuildLines(),this._afterCursorMove()}_doFindNextOcurrence(){const e=this.cursorSet.getPrimary();let t=this.cursorSet.getSelectedText(this.doc);if(!t){const{line:t,col:s}=e.head,[o,n,i]=this.doc.getWordAt(t,s);if(!o)return;return e.anchor={line:t,col:n},e.head={line:t,col:i},this._renderCursors(),void this._renderSelections()}const s=this.cursorSet.cursors[this.cursorSet.cursors.length-1],o=pt(s.anchor,s.head)?s.head:s.anchor,n=this.doc.findNext(t,o.line,o.col);if(!n)return;this.cursorSet.cursors.some(e=>{const t=pt(e.anchor,e.head)?e.anchor:e.head;return t.line===n.line&&t.col===n.col})||(this.cursorSet.cursors.push({anchor:{line:n.line,col:n.col},head:{line:n.line,col:n.col+t.length}}),this._renderCursors(),this._renderSelections(),this._scrollCursorIntoView())}_doOpenSearch(t=!1){if(!this.searchBox)return;this._doHideSearch(),e.LX.addClass(this.searchBox,"opened"),this._isSearchBoxActive=!0;const s=this.searchBox.querySelector("input");s&&(t?s.value="":this.cursorSet.hasSelection()&&(s.value=this.cursorSet.getSelectedText(this.doc)),s.selectionStart=0,s.selectionEnd=s.value.length,s.focus())}_doOpenLineSearch(){if(!this.searchLineBox)return;this._doHideSearch(),e.LX.emitSignal("@line-number-range",`Type a line number to go to (from 1 to ${this.doc.lineCount}).`),e.LX.addClass(this.searchLineBox,"opened"),this._isSearchLineBoxActive=!0;const t=this.searchLineBox.querySelector("input");t&&(t.value=":",t.focus())}_doHideSearch(){if(!this.searchBox||!this.searchLineBox)return!1;const e=this._isSearchBoxActive,t=this._isSearchLineBoxActive;return e?(this.searchBox.classList.remove("opened"),this._isSearchBoxActive=!1,this._lastSearchPos=null):t&&(this.searchLineBox.classList.remove("opened"),this._isSearchLineBoxActive=!1),e!=this._isSearchBoxActive||t!=this._isSearchLineBoxActive}_doSearch(e,t=!1,s,o=!0,n=!0){if(!(e=e??this._lastTextFound))return;const i=this.doc;let a,r;if(this._lastSearchPos)a=this._lastSearchPos.line,r=this._lastSearchPos.col+(t?-e.length:e.length);else{const e=this.cursorSet.getPrimary();a=e.head.line,r=e.head.col}const l=(s,o)=>{let n=i.getLine(s),a=e;if(this._searchMatchCase||(n=n.toLowerCase(),a=a.toLowerCase()),t){return n.substring(0,o).lastIndexOf(a)}return n.indexOf(a,o)};let c=-1,d=-1;if(t){for(let e=a;e>=0;e--){const t=l(e,e===a?r:i.getLine(e).length);if(t>-1){c=e,d=t;break}}if(-1===c)for(let e=i.lineCount-1;e>a;e--){const t=l(e,i.getLine(e).length);if(t>-1){c=e,d=t;break}}}else{for(let e=a;e<i.lineCount;e++){const t=l(e,e===a?r:0);if(t>-1){c=e,d=t;break}}if(-1===c)for(let e=0;e<a;e++){const t=l(e,0);if(t>-1){c=e,d=t;break}}}if(-1===c)return o||alert("No results!"),void(this._lastSearchPos=null);if(this._lastTextFound=e,this._lastSearchPos={line:c,col:d},s)s(d,c);else{const t=this.cursorSet.getPrimary();t.anchor={line:c,col:d},t.head={line:c,col:d+e.length},this._renderCursors(),this._renderSelections()}if(this.codeScroller.scrollTop=Math.max((c-10)*this.lineHeight,0),this.codeScroller.scrollLeft=Math.max(d*this.charWidth-this.codeScroller.clientWidth/2,0),n){const e=this.searchBox?.querySelector("input");e?.focus()}}_doGotoLine(e){Number.isNaN(e)||e<1||e>this.doc.lineCount||(this.cursorSet.set(e-1,0),this._afterCursorMove())}_encloseSelection(e,t){const s=this.cursorSet.getPrimary(),o=s.anchor,n=s.head,i=o.line<n.line||o.line===n.line&&o.col<n.col?o:n,a=i===o?n:o;if(i.line!==a.line)return;const r=i.line,l=i.col,c=a.col;this._flushAction();const d=this.doc.insert(r,l,e);this.undoManager.record(d,this.cursorSet.getCursorPositions());const h=this.doc.insert(r,c+1,t);this.undoManager.record(h,this.cursorSet.getCursorPositions()),s.anchor={line:r,col:l+1},s.head={line:r,col:c+1},this._updateLine(r),this._afterCursorMove()}_doBackspace(e){if(this._flushIfActionChanged("backspace"),this.cursorSet.hasSelection())return this._deleteSelectionIfAny(),this._rebuildLines(),void this._afterCursorMove();for(const t of this.cursorSet.sortedIndicesBottomUp()){const s=this.cursorSet.cursors[t],{line:o,col:n}=s.head;if(0!==o||0!==n)if(0===n){const e=this.doc.getLine(o-1).length,n=this.doc.delete(o-1,e,1);this.undoManager.record(n,this.cursorSet.getCursorPositions()),s.head={line:o-1,col:e},s.anchor={...s.head},this.cursorSet.adjustOthers(t,o,0,e,-1)}else if(e){const[e,i]=this.doc.getWordAt(o,n-1),a=e.length>0?i:n-1,r=n-a,l=this.doc.delete(o,a,r);this.undoManager.record(l,this.cursorSet.getCursorPositions()),s.head={line:o,col:a},s.anchor={...s.head},this.cursorSet.adjustOthers(t,o,n,-r)}else{const e=this.doc.delete(o,n-1,1);this.undoManager.record(e,this.cursorSet.getCursorPositions()),s.head={line:o,col:n-1},s.anchor={...s.head},this.cursorSet.adjustOthers(t,o,n,-1)}}this._rebuildLines(),this._afterCursorMove(),this._doOpenAutocomplete()}_doDelete(e){if(this.cursorSet.hasSelection())return this._deleteSelectionIfAny(),this._rebuildLines(),void this._afterCursorMove();this._flushIfActionChanged("delete");for(const t of this.cursorSet.sortedIndicesBottomUp()){const s=this.cursorSet.cursors[t],{line:o,col:n}=s.head,i=this.doc.getLine(o);if(!(n>=i.length&&o>=this.doc.lineCount-1))if(n>=i.length){const e=this.doc.delete(o,n,1);this.undoManager.record(e,this.cursorSet.getCursorPositions()),this.cursorSet.adjustOthers(t,o,n,0,-1)}else if(e){const[e,,s]=this.doc.getWordAt(o,n),i=e.length>0?s-n:1,a=this.doc.delete(o,n,i);this.undoManager.record(a,this.cursorSet.getCursorPositions()),this.cursorSet.adjustOthers(t,o,n,-i)}else{const e=this.doc.delete(o,n,1);this.undoManager.record(e,this.cursorSet.getCursorPositions()),this.cursorSet.adjustOthers(t,o,n,-1)}}this._rebuildLines(),this._afterCursorMove()}_doEnter(e){if(this._isAutoCompleteActive)this._doAutocompleteWord();else if(e&&this.onRun)this.onRun(this.getText(),this);else{this._deleteSelectionIfAny(),this._flushAction();for(const e of this.cursorSet.sortedIndicesBottomUp()){const t=this.cursorSet.cursors[e],{line:s,col:o}=t.head,n=this.doc.getIndent(s),i=" ".repeat(n),a=this.doc.insert(s,o,"\n"+i);this.undoManager.record(a,this.cursorSet.getCursorPositions()),t.head={line:s+1,col:n},t.anchor={...t.head},this.cursorSet.adjustOthers(e,s,o,0,1)}this._rebuildLines(),this._afterCursorMove()}}_doTab(e){if(this._isAutoCompleteActive)this._doAutocompleteWord();else{this._flushAction();for(const t of this.cursorSet.sortedIndicesBottomUp()){const s=this.cursorSet.cursors[t],{line:o,col:n}=s.head;if(e){const e=this.doc.getLine(o);let i=0;for(;i<this.tabSize&&i<e.length&&" "===e[i];)i++;if(i>0){const e=this.doc.delete(o,0,i);this.undoManager.record(e,this.cursorSet.getCursorPositions()),s.head={line:o,col:Math.max(0,n-i)},s.anchor={...s.head},this.cursorSet.adjustOthers(t,o,0,-i)}}else{const e=this.tabSize-n%this.tabSize,i=" ".repeat(e),a=this.doc.insert(o,n,i);this.undoManager.record(a,this.cursorSet.getCursorPositions()),s.head={line:o,col:n+e},s.anchor={...s.head},this.cursorSet.adjustOthers(t,o,n,e)}}this._rebuildLines(),this._afterCursorMove()}}_deleteSelectionIfAny(){let e=!1;for(const t of this.cursorSet.sortedIndicesBottomUp()){const s=this.cursorSet.cursors[t];if(ft(s))continue;const o=mt(s),n=gt(s),i=this.cursorSet.getSelectedText(this.doc,t);if(!i)continue;const a=n.line-o.line,r=0===a?n.col-o.col:o.col,l=this.doc.delete(o.line,o.col,i.length);this.undoManager.record(l,this.cursorSet.getCursorPositions()),s.head={...o},s.anchor={...o},this.cursorSet.adjustOthers(t,o.line,o.col,-r,-a),e=!0}e&&this._rebuildLines()}_doCopy(){const e=this.cursorSet.getSelectedText(this.doc);e&&navigator.clipboard.writeText(e)}_doCut(){this._flushAction();const e=this.cursorSet.getSelectedText(this.doc);if(e)navigator.clipboard.writeText(e),this._deleteSelectionIfAny();else{const e=this.cursorSet.getPrimary(),t=e.head.line,s=this.doc.getLine(t),o=t===this.doc.lineCount-1;navigator.clipboard.writeText(s+(o?"":"\n"));const n=this.doc.removeLine(t);this.undoManager.record(n,this.cursorSet.getCursorPositions());const i=Math.min(t,this.doc.lineCount-1);e.head={line:i,col:0},e.anchor={...e.head}}this._rebuildLines(),this._afterCursorMove()}_swapLine(e){const t=this.cursorSet.getPrimary(),s=t.head.line,o=s+e;if(o<0||o>=this.doc.lineCount)return;const n=this.doc.getLine(s),i=this.doc.getLine(o);this._flushAction();const a=this.doc.replaceLine(s,i);this.undoManager.record(a,this.cursorSet.getCursorPositions());const r=this.doc.replaceLine(o,n);this.undoManager.record(r,this.cursorSet.getCursorPositions()),t.head={line:o,col:t.head.col},t.anchor={...t.head},this._rebuildLines(),this._afterCursorMove()}_duplicateLine(e){const t=this.cursorSet.getPrimary(),s=t.head.line,o=this.doc.getLine(s);this._flushAction();const n=this.doc.insertLine(s,o);this.undoManager.record(n,this.cursorSet.getCursorPositions());const i=1===e?s+1:s;t.head={line:i,col:t.head.col},t.anchor={...t.head},this._rebuildLines(),this._afterCursorMove()}async _doPaste(){const e=await navigator.clipboard.readText();if(!e)return;this._flushAction(),this._deleteSelectionIfAny();const t=this.cursorSet.getPrimary(),s=this.doc.insert(t.head.line,t.head.col,e);this.undoManager.record(s,this.cursorSet.getCursorPositions());const o=e.split("\n");1===o.length?this.cursorSet.set(t.head.line,t.head.col+e.length):this.cursorSet.set(t.head.line+o.length-1,o[o.length-1].length),this._rebuildLines(),this._afterCursorMove()}_doUndo(){const e=this.undoManager.undo(this.doc,this.cursorSet.getCursorPositions());if(e){if(e.cursors.length>0){const t=e.cursors[0];this.cursorSet.set(t.line,t.col)}this._rebuildLines(),this._afterCursorMove()}}_doRedo(){const e=this.undoManager.redo(this.doc);if(e){if(e.cursors.length>0){const t=e.cursors[0];this.cursorSet.set(t.line,t.col)}this._rebuildLines(),this._afterCursorMove()}}_onMouseDown(t){if(!this.currentTab)return;if(this.searchBox&&this.searchBox.contains(t.target))return;if(this.autocomplete&&this.autocomplete.contains(t.target))return;t.preventDefault(),this._wasPaired=!1;const s=this.codeContainer.getBoundingClientRect(),o=t.clientX-s.left-this.xPadding,n=t.clientY-s.top,i=e.LX.clamp(Math.floor(n/this.lineHeight),0,this.doc.lineCount-1),a=e.LX.clamp(Math.round(o/this.charWidth),0,this.doc.getLine(i).length);if("contextmenu"===t.type)return void this._onContextMenu(t,i,a);if(0!==t.button)return;const r=Date.now();if(r-this._lastClickTime<400&&i===this._lastClickLine?this._clickCount=Math.min(this._clickCount+1,3):this._clickCount=1,this._lastClickTime=r,this._lastClickLine=i,3===this._clickCount){const e=this.cursorSet.getPrimary();e.anchor={line:i,col:0},e.head={line:i,col:this.doc.getLine(i).length}}else if(2===this._clickCount){const[,e,t]=this.doc.getWordAt(i,a),s=this.cursorSet.getPrimary();s.anchor={line:i,col:e},s.head={line:i,col:t}}else if(t.shiftKey){this.cursorSet.getPrimary().head={line:i,col:a}}else this.cursorSet.set(i,a);this._afterCursorMove(),this._inputArea.focus();const l=e=>{const t=e.clientX-s.left-this.xPadding,o=e.clientY-s.top,n=Math.max(0,Math.min(Math.floor(o/this.lineHeight),this.doc.lineCount-1)),i=Math.max(0,Math.min(Math.round(t/this.charWidth),this.doc.getLine(n).length));this.cursorSet.getPrimary().head={line:n,col:i},this._renderCursors(),this._renderSelections()},c=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",c)}_onContextMenu(t,s,o){t.preventDefault();const n=[{name:"Copy",icon:"Copy",callback:()=>this._doCopy(),kbd:["Ctrl","C"],useKbdSpecialKeys:!1}];if(this.disableEdition||(n.push({name:"Cut",icon:"Scissors",callback:()=>this._doCut(),kbd:["Ctrl","X"],useKbdSpecialKeys:!1}),n.push({name:"Paste",icon:"Paste",callback:()=>this._doPaste(),kbd:["Ctrl","V"],useKbdSpecialKeys:!1})),this.onContextMenu){const e=this.cursorSet.getSelectedText(this.doc),s=this.onContextMenu(this,e,t);if(s?.length){n.push(null);for(const e of s)n.push({name:e.path,disabled:e.disabled,callback:e.callback})}}e.LX.addDropdownMenu(t.target,n,{event:t,side:"bottom",align:"start"})}_getWordAtCursor(){const e=this.cursorSet.getPrimary().head,t=this.doc.getLine(e.line);let s=e.col,o=e.col;for(;s>0&&/[\w$]/.test(t[s-1]);)s--;for(;o<t.length&&/[\w$]/.test(t[o]);)o++;return{word:t.slice(s,o),start:s,end:o}}_doOpenAutocomplete(){if(!this.autocomplete||!this.useAutoComplete)return;this.autocomplete.innerHTML="";const{word:t}=this._getWordAtCursor();if(!t||0===t.length)return void this._doHideAutocomplete();const s=[],o=new Set,n=(e,t,n,i)=>{o.has(e)||(s.push({label:e,kind:t,scope:n,detail:i}),o.add(e))},i=this.symbolTable.getAllSymbols();for(const e of i)e.name.toLowerCase().startsWith(t.toLowerCase())&&n(e.name,e.kind,e.scope,`${e.kind} in ${e.scope}`);for(const e of this.language.reservedWords)e.toLowerCase().startsWith(t.toLowerCase())&&n(e);for(const e of this.customSuggestions){const s="string"==typeof e?e:e.label,o="object"==typeof e?e.kind:void 0,i="object"==typeof e?e.detail:void 0;s.toLowerCase().startsWith(t.toLowerCase())&&n(s,o,void 0,i)}if(0===s.length)return void this._doHideAutocomplete();s.sort((e,s)=>{const o=e.label.toLowerCase()===t.toLowerCase()?0:1,n=s.label.toLowerCase()===t.toLowerCase()?0:1;return o!==n?o-n:e.label.localeCompare(s.label)}),this._selectedAutocompleteIndex=0,s.forEach((s,o)=>{const n=document.createElement("pre");o===this._selectedAutocompleteIndex&&n.classList.add("selected");const i=s.label;let a="CaseLower",r="foo";switch(s.kind){case"class":a="CircleNodes",r="text-orange-500";break;case"struct":a="Form",r="text-orange-400";break;case"interface":a="FileType",r="text-cyan-500";break;case"enum":a="ListTree",r="text-yellow-500";break;case"enum-value":a="Dot",r="text-yellow-400";break;case"type":a="Type",r="text-teal-500";break;case"function":a="Function",r="text-purple-500";break;case"method":a="Box",r="text-fuchsia-500";break;case"variable":a="Cuboid",r="text-blue-400";break;case"property":a="Layers",r="text-blue-300";break;case"constructor-call":a="Hammer",r="text-green-500";break;case"method-call":a="PlayCircle",r="text-gray-400";break;default:a="CaseLower",r="text-gray-500"}n.appendChild(e.LX.makeIcon(a,{iconClass:"ml-1 mr-2",svgClass:"sm "+r}));const l=i.toLowerCase().indexOf(t.toLowerCase());var c=document.createElement("span");c.textContent=i.substring(0,l),n.appendChild(c);var d=document.createElement("span");d.textContent=i.substring(l,l+t.length),d.classList.add("word-highlight"),n.appendChild(d);var h=document.createElement("span");if(h.textContent=i.substring(l+t.length),n.appendChild(h),s.kind){const e=document.createElement("span");e.textContent=` (${s.kind})`,e.className="kind text-muted-foreground text-xs! ml-2",n.appendChild(e)}n.addEventListener("click",()=>{this._doAutocompleteWord()}),this.autocomplete.appendChild(n)}),this._isAutoCompleteActive=!0;const a=e=>{this.autocomplete?.contains(e.target)||this._doHideAutocomplete()};setTimeout(()=>document.addEventListener("click",a,{once:!0}),0),this.autocomplete._cleanup=()=>{document.removeEventListener("click",a)},this.autocomplete.classList.toggle("show",!0),this.autocomplete.classList.toggle("no-scrollbar",!(this.autocomplete.scrollHeight>this.autocomplete.offsetHeight));const r=this.cursorSet.getPrimary().head,l=r.col*this.charWidth+this.xPadding,c=(r.line+1)*this.lineHeight+this._cachedTabsHeight-this.codeScroller.scrollTop;this.autocomplete.style.left=l+"px",this.autocomplete.style.top=c+"px"}_doHideAutocomplete(){this.autocomplete&&this._isAutoCompleteActive&&(this.autocomplete.innerHTML="",this.autocomplete.classList.remove("show"),this._isAutoCompleteActive=!1,this.autocomplete._cleanup&&(this.autocomplete._cleanup(),delete this.autocomplete._cleanup))}_doAutocompleteWord(){const e=this._getSelectedAutoCompleteWord();if(!e)return;const t=this.cursorSet.getPrimary().head,{start:s,end:o}=this._getWordAtCursor(),n=t.line,i=this.cursorSet.getCursorPositions();if(o>s){const e=this.doc.delete(n,s,o-s);this.undoManager.record(e,i)}const a=this.doc.insert(n,s,e);this.cursorSet.set(n,s+e.length);const r=this.cursorSet.getCursorPositions();this.undoManager.record(a,r),this._rebuildLines(),this._afterCursorMove(),this._doHideAutocomplete()}_getSelectedAutoCompleteWord(){if(!this.autocomplete||!this._isAutoCompleteActive)return null;const e=this.autocomplete.childNodes[this._selectedAutocompleteIndex];var t="";for(let s of e.childNodes){const e=s;e.constructor!=HTMLSpanElement||e.classList.contains("kind")||(t+=e.textContent)}return t}_afterCursorMove(){this._renderCursors(),this._renderSelections(),this._resetBlinker(),this.resize(),this._scrollCursorIntoView()}_scrollCursorIntoView(){const e=this.cursorSet.getPrimary().head,t=e.line*this.lineHeight,s=e.col*this.charWidth;t<this.codeScroller.scrollTop?this.codeScroller.scrollTop=t:t+this.lineHeight>this.codeScroller.scrollTop+this.codeScroller.clientHeight&&(this.codeScroller.scrollTop=t+this.lineHeight-this.codeScroller.clientHeight);const o=2*vt.SIZE;s<this.codeScroller.scrollLeft?this.codeScroller.scrollLeft=s:s+o>this.codeScroller.scrollLeft+this.codeScroller.clientWidth-this.xPadding&&(this.codeScroller.scrollLeft=s+o-this.codeScroller.clientWidth+this.xPadding)}_resetGutter(){const e=this._cachedTabsHeight||(this.tabs?.root.getBoundingClientRect().height??0);this.lineGutter.style.height=`calc(100% - ${e}px)`}getMaxLineLength(){if(!this.currentTab)return 0;let e=0;for(let t=0;t<this.doc.lineCount;t++){const s=this.doc.getLine(t).length;s>e&&(e=s)}return e}resize(e=!1){if(!this.charWidth)return;this._cachedTabsHeight=this.tabs?.root.getBoundingClientRect().height??0,this._cachedStatusPanelHeight=this.statusPanel?.root.getBoundingClientRect().height??0;const t=this.getMaxLineLength(),s=this.currentTab?this.doc.lineCount:0,o=Math.floor((this.codeScroller.clientWidth-this.xPadding)/this.charWidth),n=Math.floor(this.codeScroller.clientHeight/this.lineHeight);let i=t!==this._lastMaxLineLength&&(t>=o||this._lastMaxLineLength>=o),a=s!==this._lastLineCount&&(s>=n||this._lastLineCount>=n);i=i||t<o&&this.hScrollbar?.visible,a=a||s<n&&this.vScrollbar?.visible,(e||i||a)&&(this._lastMaxLineLength=t,this._lastLineCount=s,(e||i)&&(this.codeSizer.style.minWidth=t*this.charWidth+this.xPadding+2*vt.SIZE+"px"),(e||a)&&(this.codeSizer.style.minHeight=s*this.lineHeight+2*vt.SIZE+"px"),this._resetGutter(),setTimeout(()=>this._resizeScrollBars(),10))}_resizeScrollBars(){if(!this.vScrollbar)return;const e=this._cachedTabsHeight,t=this._cachedStatusPanelHeight,s=this.codeScroller.scrollHeight;this.vScrollbar.setThumbRatio(s>0?this.codeScroller.clientHeight/s:1),this.vScrollbar.root.style.top=e+"px",this.vScrollbar.root.style.height=`calc(100% - ${e+t}px)`;const o=this.codeScroller.scrollWidth;this.hScrollbar.setThumbRatio(o>0?this.codeScroller.clientWidth/o:1),this.hScrollbar.root.style.bottom=t+"px",this.hScrollbar.root.style.width=`calc(100% - ${this.xPadding+(this.vScrollbar.visible?vt.SIZE:0)}px)`}_syncScrollBars(){this.vScrollbar&&(this.vScrollbar.syncToScroll(this.codeScroller.scrollTop,this.codeScroller.scrollHeight-this.codeScroller.clientHeight),this.hScrollbar.syncToScroll(this.codeScroller.scrollLeft,this.codeScroller.scrollWidth-this.codeScroller.clientWidth))}_doLoadFromFile(){const t=e.LX.makeElement("input","","",document.body);t.type="file",t.click(),t.addEventListener("change",e=>{const s=e.target;s.files&&s.files[0]&&this.loadFile(s.files[0]),t.remove()})}async _setFontSize(t,s=!0){this.fontSize=t;const o=document.querySelector(":root");o.style.setProperty("--code-editor-font-size",`${this.fontSize}px`),window.localStorage.setItem("lexcodeeditor-font-size",`${this.fontSize}`),await this._measureChar();const n=this.fontSize+6;o.style.setProperty("--code-editor-row-height",`${n}px`),this.lineHeight=n,s&&(this._rebuildLines(),this._afterCursorMove()),e.LX.emitSignal("@font-size",this.fontSize)}_applyFontSizeOffset(t=0){const s=e.LX.clamp(this.fontSize+t,xt.CODE_MIN_FONT_SIZE,xt.CODE_MAX_FONT_SIZE);this._setFontSize(s)}_increaseFontSize(){this._applyFontSizeOffset(1)}_decreaseFontSize(){this._applyFontSizeOffset(-1)}}e.LX.CodeEditor=xt,e.LX.init=async function(t={}){if(this.ready)return this.mainArea;await e.LX.loadScriptSync("https://unpkg.com/lucide@latest"),console.log(`LexGUI v${this.version}`);const s=e.LX.makeElement("div",e.LX.mergeClass("lexcontainer",t.rootClass));function o(e){e.preventDefault(),e.stopPropagation()}s.id="lexroot",s.tabIndex=-1,this.modal=e.LX.makeElement("div","inset-0 hidden-opacity bg-black/50 fixed z-100 transition-opacity duration-100 ease-in"),this.modal.id="modal",this.modal.toggle=function(e){this.classList.toggle("hidden-opacity",e)},this.modal.addEventListener("wheel",o,{passive:!1}),this.modal.addEventListener("touchmove",o,{passive:!1}),this.root=s,this.container=document.body,t.container&&(this.container=t.container.constructor===String?document.getElementById(t.container):t.container),this.layoutMode=t.layoutMode??"app",document.documentElement.setAttribute("data-layout",this.layoutMode),this.layoutMode,this.spacingMode=t.spacingMode??"default",document.documentElement.setAttribute("data-spacing",this.spacingMode),this.container.appendChild(this.modal),t.skipRoot?this.root=document.body:this.container.appendChild(s);{const e=document.createElement("section");e.className="notifications",this.notifications=document.createElement("ol"),this.notifications.className="fixed flex flex-col-reverse m-0 p-0 gap-1 z-1000",this.notifications.iWidth=0,e.appendChild(this.notifications),document.body.appendChild(e),this.notifications.addEventListener("mouseenter",()=>{this.notifications.classList.add("list")}),this.notifications.addEventListener("mouseleave",()=>{this.notifications.classList.remove("list")})}s.addEventListener("dragover",function(e){e.preventDefault()},!1),document.addEventListener("contextmenu",function(e){e.preventDefault()},!1),this.DEFAULT_NAME_WIDTH="30%",this.DEFAULT_SPLITBAR_SIZE=4,this.OPEN_CONTEXTMENU_ENTRY="click",this.componentResizeObserver=new ResizeObserver(e=>{for(const t of e){const e=t.target?.jsInstance;e&&e.onResize&&e.onResize(t.contentRect)}}),this.ready=!0,this.menubars=[],this.sidebars=[],this.commandbar=this._createCommandbar(this.container),t.skipRoot||t.skipDefaultArea||(this.mainArea=new se({id:t.id??"mainarea"})),this._onChangeSystemTheme=function(t){localStorage.getItem("lxColorScheme")||e.LX.setMode(t.matches?"dark":"light",!1)},this._mqlPrefersDarkScheme=window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const n=localStorage.getItem("lxColorScheme");return n?e.LX.setMode(n):this._mqlPrefersDarkScheme&&(t.autoTheme??1)&&(window.matchMedia("(prefers-color-scheme: light)").matches&&e.LX.setMode("light",!1),this._mqlPrefersDarkScheme.addEventListener("change",this._onChangeSystemTheme)),this.mainArea},e.LX.setSpacingMode=function(e){this.spacingMode=e,document.documentElement.setAttribute("data-spacing",this.spacingMode)},e.LX.setLayoutMode=function(e){this.layoutMode=e,document.documentElement.setAttribute("data-layout",this.layoutMode)},e.LX.addSignal=function(t,s,o){s[t]=o,e.LX.signals[t]||(e.LX.signals[t]=[]),e.LX.signals[t].indexOf(s)>-1||e.LX.signals[t].push(s)},e.LX.removeSignal=function(t,s){const o=e.LX.signals[t];if(o)if(s){for(let e=0;e<o.length;++e)if(o[e]==s){o.splice(e,1);break}}else delete e.LX.signals[t]},e.LX.emitSignal=function(t,s,o={}){const n=e.LX.signals[t];if(!n)return;const i=o.target;if(i)i[t]&&i[t].call(i,s);else for(let e of n)if(e instanceof a)e.set(s,o.skipCallback??!0);else if(e.constructor===Function){e(null,s)}else{const o=e[t];console.assert(o,`No callback registered with _${t}_ signal`),o.bind(e)(s)}},e.LX._createCommandbar=function(t){let s=document.createElement("dialog");s.className="commandbar absolute border-color rounded-lg m-0",s.tabIndex=-1,t.appendChild(s);let o=[],n=null;s.addEventListener("keydown",function(e){if(e.stopPropagation(),e.stopImmediatePropagation(),n=n??-1,"Escape"==e.key)s.close(),d(!0);else if("Enter"==e.key){const e=o[n];e&&(null!=e.item.checked&&(e.item.checked=!e.item.checked),s.close(),e.callback.call(window,e.item.name,e.item.checked))}else if("ArrowDown"==e.key&&n<o.length-1){n++,s.querySelectorAll(".hovered").forEach(e=>e.classList.remove("hovered"));const e=o[n];e.classList.add("hovered");let t=e.offsetHeight*(n+1)-l.offsetHeight;t>0&&l.scrollTo({top:t,behavior:"smooth"})}else if("ArrowUp"==e.key&&n>0){n--,s.querySelectorAll(".hovered").forEach(e=>e.classList.remove("hovered"));o[n].classList.add("hovered")}}),s.addEventListener("focusout",function(t){t.relatedTarget!=t.currentTarget&&(t.stopPropagation(),t.stopImmediatePropagation(),e.LX.setCommandbarState(!1),d(!0))}),t.addEventListener("keydown",t=>{if(" "==t.key&&t.ctrlKey)t.stopImmediatePropagation(),t.stopPropagation(),e.LX.setCommandbarState(!0);else for(let s of e.LX.extensions){if(!e.LX[s]||!e.LX[s].prototype.onKeyPressed)continue;const o=e.LX.CodeEditor.getInstances();for(let e of o)e.onKeyPressed(t)}});const i=e.LX.makeContainer(["100%","auto"],"flex flex-row"),a=new h(null,"",e=>{s._addElements(e.toLowerCase())},{width:"100%",icon:"Search",trigger:"input",placeholder:"Search..."});i.appendChild(a.root);const r=new se({width:"100%",skipAppend:!0,className:"cb-tabs"});{const e=(e,t)=>{};r.addTabs({parentClass:"p-2"}).add("All",document.createElement("div"),{selected:!0,onSelect:e})}const l=e.LX.makeElement("div","searchitembox overflow-y-scroll basis-full scrollbar-hidden");let c=null;const d=e=>{l.innerHTML="",o.length=0,n=null,e&&a.set("",!0)},u=function(t,s){if(!s?.length)return!1;return e.LX.stripTags(t).toLowerCase().includes(s.toLowerCase())},p=(t,i,a)=>{if(!t||t.constructor!=Object)return;t.callback&&((t,i,a,r)=>{if(!t.length)return;c&&c.classList.remove("last");let h=document.createElement("div");if(h.className="searchitem last",void 0!==r?.checked){const s=r.checked?e.LX.makeIcon("Check").innerHTML:"";h.innerHTML=s+(a+t)}else h.innerHTML=a+t;h.callback=i,h.item=r,h.addEventListener("click",s=>{null!=r.checked&&(r.checked=!r.checked),i.call(window,t,r.checked),e.LX.setCommandbarState(!1),d(!0)}),h.addEventListener("mouseenter",function(e){s.querySelectorAll(".hovered").forEach(e=>e.classList.remove("hovered")),h.classList.add("hovered"),n=o.indexOf(h)}),h.addEventListener("mouseleave",function(e){h.classList.remove("hovered")}),o.push(h),l.appendChild(h),c=h})(t.name,t.callback,i,t);const r=t.submenu??t[t.name];if(!r)return;const h=e.LX.makeIcon("ChevronRight",{svgClass:"sm text-muted-foreground separator"});i+=t.name+h.innerHTML;for(let e of r)p(e,i)};return s._addElements=t=>{d();let s=function(t){const s=[];for(let o of e.LX.menubars)for(let e of o.items)u(e.name,t)&&s.push(e);for(let o of e.LX.sidebars)for(let e of o.items)u(e.name,t)&&s.push(e);for(let o of e.LX.extraCommandbarEntries)u(o.name,t)&&s.push(o);if(e.LX.has("CodeEditor")){const o=e.LX.CodeEditor.getInstances();if(!o.length||!o[0].area.root.offsetHeight)return s;for(let n of e.LX.Tokenizer.getRegisteredLanguages()){const i=_e.getLanguage(n);if(!i)continue;const a="Language: "+n,r=i?.icon,l=(e=>{const t=e.constructor===String?e:Object.values(e)[0];return e?t.split(" "):[]})(r);let c=e.LX.makeIcon(l[0],{svgClass:`${l.slice(1).join(" ")}`}).innerHTML;c+=a+" <span class='lang-ext'>("+i.extensions+")</span>",u(a,t)&&s.push({name:c,callback:()=>{for(let e of o)e.setLanguage(n)}})}}return s}(t);function o(e,t){return e.startsWith(t)?0:e.includes(t)?1:2}s=s.sort((s,n)=>{const i=e.LX.stripTags(s.name),a=e.LX.stripTags(n.name);return o(i,t)-o(a,t)||i.localeCompare(a)}),s=s.slice(0,48);for(let e of s)p(e,"")},s.appendChild(i),s.appendChild(r.root),s.appendChild(l),s},e.LX._registerIconsAndColors=function(t="./"){e.LX.requestJSON(t+"registry/colors.json",t=>{for(const s in t){const o=t[s];Array.isArray(o)&&o.forEach(t=>{const o=`${s}-${t.scale}`,n=`<span class="flex bg-${o} w-3 h-3 rounded-full mr-2"></span>${o}`;e.LX.registerCommandbarEntry(n,()=>{navigator.clipboard.writeText(o),e.LX.toast(`${e.LX.makeIcon("CircleCheck").innerHTML} Copied ${o} to clipboard.`,null,{position:"top-center",timeout:3e3})})})}});const s=window.lucide,o={...e.LX.ICONS,...s.icons};for(const t in o){const s="regular",o=`${e.LX.makeIcon(t,{svgClass:"mr-2 pointer-events-none",variant:s}).innerHTML}${t}`;e.LX.registerCommandbarEntry(o,()=>{navigator.clipboard.writeText(t),e.LX.toast(`${e.LX.makeIcon("CircleCheck").innerHTML} Copied ${t} to clipboard.`,null,{position:"top-center",timeout:3e3})})}},e.LX.setCommandbarState=function(t,s=!0){const o=this.commandbar;e.LX.modal.toggle(!t),t?(o.style.top=`calc(15% + ${document.scrollingElement?.scrollTop??0}px)`,o.show(),o.querySelector("input").focus(),s&&o._addElements(void 0),e.LX.modal.toggle(!1)):o.close()},e.LX.REGISTER_COMPONENT=function(t,s={}){let o=e.LX.guidGenerator();ee.prototype["add"+t]=function(i,r,l){const c=Array.from(arguments).slice(3);let d=new a(e.ComponentType.CUSTOM,i,null,s);this._attachComponent(d),d.customName=t,d.customIdx=o,d.onGetValue=()=>r,d.onSetValue=(e,t,s)=>{r=e,g(),h.querySelector(".lexcustomitems").toggleAttribute("hidden",!1),t||d._trigger(new n(i,r,s),l)},d.onResize=()=>{const e=d.root.domName?.style.width??"0px";u.style.width=`calc( 100% - ${e})`};const h=d.root;let u,p,m=s.default??{};const g=()=>{u&&u.remove(),p&&p.remove(),u=document.createElement("div"),u.className="lexcustomcontainer w-full",h.appendChild(u),h.dataset.opened=!1;const o=e.LX.makeIcon(s.icon??"Box"),a=e.LX.makeIcon("Menu");let f=t+(r?"":" [empty]"),L=this.addButton(null,f,(s,o)=>{r?(h.querySelector(".lexcustomitems").toggleAttribute("hidden"),h.dataset.opened=!h.querySelector(".lexcustomitems").hasAttribute("hidden")):e.LX.addContextMenu(null,o,e=>{e.add("New "+t,()=>{r={},g(),h.querySelector(".lexcustomitems").toggleAttribute("hidden",!1),h.dataset.opened=!h.querySelector(".lexcustomitems").hasAttribute("hidden")})})},{buttonClass:"outline custom"});const y=L.root.querySelector("button");if(y.prepend(o),y.appendChild(a),u.appendChild(L.root),r&&a.addEventListener("click",t=>{t.stopImmediatePropagation(),t.stopPropagation(),e.LX.addContextMenu(null,t,e=>{e.add("Clear",()=>{r=null,g()})})}),p=document.createElement("div"),p.className="lexcustomitems",p.toggleAttribute("hidden",!0),h.appendChild(p),r){this.queue(p);const e=(e,t,o)=>{const a=s[`_set_${e}`];a?a.call(r,t):r[e]=t,d._trigger(new n(i,r,o),l)};for(let t in m){let o=null;const n=s[`_get_${t}`];if(o=n?r[t]?n.call(r):n.call(m):r[t]??m[t],o)switch(o.constructor){case String:"#"===o[0]?this.addColor(t,o,e.bind(this,t)):this.addText(t,o,e.bind(this,t));break;case Number:this.addNumber(t,o,e.bind(this,t));break;case Boolean:this.addCheckbox(t,o,e.bind(this,t));break;case Array:o.length>4?this.addArray(t,o,e.bind(this,t)):this._addVector(o.length,t,o,e.bind(this,t));break;default:console.warn(`Unsupported property type: ${o.constructor.name}`)}}s.onCreate&&s.onCreate.call(this,this,...c),this.clearQueue()}};g()}},e.AlertDialog=de,e.Area=se,e.AreaOverlayButtons=te,e.ArrayInput=p,e.Avatar=re,e.BaseComponent=a,e.Branch=Q,e.Button=r,e.Checkbox=g,e.ColorInput=b,e.ComboButtons=C,e.ContextMenu=he,e.Counter=v,e.Curve=_,e.DatePicker=S,e.Dial=M,e.Dialog=ce,e.DropdownMenu=ue,e.FileInput=T,e.Footer=me,e.Form=A,e.IEvent=n,e.Layers=X,e.List=z,e.Map2D=I,e.NodeTree=R,e.NumberInput=d,e.OTPInput=O,e.Pad=H,e.Pagination=q,e.Panel=ee,e.PocketDialog=ge,e.Popover=y,e.Progress=B,e.RadioGroup=$,e.RangeInput=V,e.Rate=F,e.Select=u,e.Sheet=fe,e.Sidebar=Le,e.SizeInput=W,e.Skeleton=ye,e.Spinner=le,e.TabSections=j,e.Table=U,e.Tabs=c,e.Tags=G,e.TextArea=Z,e.TextInput=h,e.Title=Y,e.Toggle=K,e.Tour=be,e.Tree=D,e.Vector=J,e.addDropdownMenu=pe,e.vec2=P});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("https://cdn.jsdelivr.net/npm/tailwind-merge@3.4.0/+esm")):"function"==typeof define&&define.amd?define(["exports","https://cdn.jsdelivr.net/npm/tailwind-merge@3.4.0/+esm"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).lexgui={},e.twMerge)}(this,function(e,t){"use strict";const s=globalThis;e.LX=s.LX,e.LX||(e.LX={version:"8.3.2",ready:!1,extensions:[],extraCommandbarEntries:[],signals:{},activeDraggable:null,spacingMode:"default",layoutMode:"app",MOUSE_LEFT_CLICK:0,MOUSE_MIDDLE_CLICK:1,MOUSE_RIGHT_CLICK:2,MOUSE_DOUBLE_CLICK:2,MOUSE_TRIPLE_CLICK:3,CURVE_MOVEOUT_CLAMP:0,CURVE_MOVEOUT_DELETE:1,DRAGGABLE_Z_INDEX:101},s.LX=e.LX);const o={Abc:[24,24,[],"regular","M17 15q-.425 0-.712-.288T16 14v-4q0-.425.288-.712T17 9h3q.425 0 .713.288T21 10v1h-1.5v-.5h-2v3h2V13H21v1q0 .425-.288.713T20 15zm-7.5 0V9h4q.425 0 .713.288T14.5 10v1q0 .425-.288.713T13.5 12q.425 0 .713.288T14.5 13v1q0 .425-.288.713T13.5 15zm1.5-3.75h2v-.75h-2zm0 2.25h2v-.75h-2zM3 15v-5q0-.425.288-.712T4 9h3q.425 0 .713.288T8 10v5H6.5v-1.5h-2V15zm1.5-3h2v-1.5h-2z"],Android:[128,128,[],"solid","M21.005 43.003c-4.053-.002-7.338 3.291-7.339 7.341l.005 30.736a7.34 7.34 0 0 0 7.342 7.343a7.33 7.33 0 0 0 7.338-7.342V50.34a7.345 7.345 0 0 0-7.346-7.337m59.193-27.602l5.123-9.355a1.023 1.023 0 0 0-.401-1.388a1.02 1.02 0 0 0-1.382.407l-5.175 9.453c-4.354-1.938-9.227-3.024-14.383-3.019c-5.142-.005-10.013 1.078-14.349 3.005L44.45 5.075a1.01 1.01 0 0 0-1.378-.406a1.007 1.007 0 0 0-.404 1.38l5.125 9.349c-10.07 5.193-16.874 15.083-16.868 26.438l66.118-.008c.002-11.351-6.79-21.221-16.845-26.427M48.942 29.858a2.772 2.772 0 0 1 .003-5.545a2.78 2.78 0 0 1 2.775 2.774a2.776 2.776 0 0 1-2.778 2.771m30.106-.005a2.77 2.77 0 0 1-2.772-2.771a2.793 2.793 0 0 1 2.773-2.778a2.79 2.79 0 0 1 2.767 2.779a2.767 2.767 0 0 1-2.768 2.77M31.195 44.39l.011 47.635a7.82 7.82 0 0 0 7.832 7.831l5.333.002l.006 16.264c-.001 4.05 3.291 7.342 7.335 7.342c4.056 0 7.342-3.295 7.343-7.347l-.004-16.26l9.909-.003l.004 16.263c0 4.047 3.293 7.346 7.338 7.338c4.056.003 7.344-3.292 7.343-7.344l-.005-16.259l5.352-.004a7.835 7.835 0 0 0 7.836-7.834l-.009-47.635zm83.134 5.943a7.34 7.34 0 0 0-7.341-7.339c-4.053-.004-7.337 3.287-7.337 7.342l.006 30.738a7.334 7.334 0 0 0 7.339 7.339a7.337 7.337 0 0 0 7.338-7.343z"],Clone:[512,512,[],"regular","M64 464l224 0c8.8 0 16-7.2 16-16l0-64 48 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64l64 0 0 48-64 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zM224 304l224 0c8.8 0 16-7.2 16-16l0-224c0-8.8-7.2-16-16-16L224 48c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16zm-64-16l0-224c0-35.3 28.7-64 64-64L448 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-224 0c-35.3 0-64-28.7-64-64z"],IdBadge:[384,512,[],"regular","M256 48l0 16c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-16L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-384c0-8.8-7.2-16-16-16l-64 0zM0 64C0 28.7 28.7 0 64 0L320 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zM160 320l64 0c44.2 0 80 35.8 80 80c0 8.8-7.2 16-16 16L96 416c-8.8 0-16-7.2-16-16c0-44.2 35.8-80 80-80zm-32-96a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z"],Paste:[512,512,[],"regular","M104.6 48L64 48C28.7 48 0 76.7 0 112L0 384c0 35.3 28.7 64 64 64l96 0 0-48-96 0c-8.8 0-16-7.2-16-16l0-272c0-8.8 7.2-16 16-16l16 0c0 17.7 14.3 32 32 32l72.4 0C202 108.4 227.6 96 256 96l62 0c-7.1-27.6-32.2-48-62-48l-40.6 0C211.6 20.9 188.2 0 160 0s-51.6 20.9-55.4 48zM144 56a16 16 0 1 1 32 0 16 16 0 1 1 -32 0zM448 464l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L464 243.9 464 448c0 8.8-7.2 16-16 16zM256 512l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9l-67.9-67.9c-9-9-21.2-14.1-33.9-14.1L256 128c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64z"],Trash3:[448,512,[],"regular","M170.5 51.6L151.5 80l145 0-19-28.4c-1.5-2.2-4-3.6-6.7-3.6l-93.7 0c-2.7 0-5.2 1.3-6.7 3.6zm147-26.6L354.2 80 368 80l48 0 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 304c0 44.2-35.8 80-80 80l-224 0c-44.2 0-80-35.8-80-80l0-304-8 0c-13.3 0-24-10.7-24-24S10.7 80 24 80l8 0 48 0 13.8 0 36.7-55.1C140.9 9.4 158.4 0 177.1 0l93.7 0c18.7 0 36.2 9.4 46.6 24.9zM80 128l0 304c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-304L80 128zm80 64l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16zm80 0l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16zm80 0l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16z"],FilePdf:[512,512,[],"regular","M64 464l48 0 0 48-48 0c-35.3 0-64-28.7-64-64L0 64C0 28.7 28.7 0 64 0L229.5 0c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3L384 304l-48 0 0-144-80 0c-17.7 0-32-14.3-32-32l0-80L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16zM176 352l32 0c30.9 0 56 25.1 56 56s-25.1 56-56 56l-16 0 0 32c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48 0-80c0-8.8 7.2-16 16-16zm32 80c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0 0 48 16 0zm96-80l32 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-32 0c-8.8 0-16-7.2-16-16l0-128c0-8.8 7.2-16 16-16zm32 128c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-16 0 0 96 16 0zm80-112c0-8.8 7.2-16 16-16l48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 32 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-64 0-64z"],FileWord:[384,512,[],"regular","M48 448L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm55 241.1c-3.8-12.7-17.2-19.9-29.9-16.1s-19.9 17.2-16.1 29.9l48 160c3 10.2 12.4 17.1 23 17.1s19.9-7 23-17.1l25-83.4 25 83.4c3 10.2 12.4 17.1 23 17.1s19.9-7 23-17.1l48-160c3.8-12.7-3.4-26.1-16.1-29.9s-26.1 3.4-29.9 16.1l-25 83.4-25-83.4c-3-10.2-12.4-17.1-23-17.1s-19.9 7-23 17.1l-25 83.4-25-83.4z"],FilePowerpoint:[384,512,[],"regular","M64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm72 208c-13.3 0-24 10.7-24 24l0 104 0 56c0 13.3 10.7 24 24 24s24-10.7 24-24l0-32 44 0c42 0 76-34 76-76s-34-76-76-76l-68 0zm68 104l-44 0 0-56 44 0c15.5 0 28 12.5 28 28s-12.5 28-28 28z"],FileExcel:[384,512,[],"regular","M48 448L48 64c0-8.8 7.2-16 16-16l160 0 0 80c0 17.7 14.3 32 32 32l80 0 0 288c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-293.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0L64 0zm90.9 233.3c-8.1-10.5-23.2-12.3-33.7-4.2s-12.3 23.2-4.2 33.7L161.6 320l-44.5 57.3c-8.1 10.5-6.3 25.5 4.2 33.7s25.5 6.3 33.7-4.2L192 359.1l37.1 47.6c8.1 10.5 23.2 12.3 33.7 4.2s12.3-23.2 4.2-33.7L222.4 320l44.5-57.3c8.1-10.5 6.3-25.5-4.2-33.7s-25.5-6.3-33.7 4.2L192 280.9l-37.1-47.6z"],Settings3:[640,512,[],"solid","M308.5 135.3c7.1-6.3 9.9-16.2 6.2-25c-2.3-5.3-4.8-10.5-7.6-15.5L304 89.4c-3-5-6.3-9.9-9.8-14.6c-5.7-7.6-15.7-10.1-24.7-7.1l-28.2 9.3c-10.7-8.8-23-16-36.2-20.9L199 27.1c-1.9-9.3-9.1-16.7-18.5-17.8C173.9 8.4 167.2 8 160.4 8l-.7 0c-6.8 0-13.5 .4-20.1 1.2c-9.4 1.1-16.6 8.6-18.5 17.8L115 56.1c-13.3 5-25.5 12.1-36.2 20.9L50.5 67.8c-9-3-19-.5-24.7 7.1c-3.5 4.7-6.8 9.6-9.9 14.6l-3 5.3c-2.8 5-5.3 10.2-7.6 15.6c-3.7 8.7-.9 18.6 6.2 25l22.2 19.8C32.6 161.9 32 168.9 32 176s.6 14.1 1.7 20.9L11.5 216.7c-7.1 6.3-9.9 16.2-6.2 25c2.3 5.3 4.8 10.5 7.6 15.6l3 5.2c3 5.1 6.3 9.9 9.9 14.6c5.7 7.6 15.7 10.1 24.7 7.1l28.2-9.3c10.7 8.8 23 16 36.2 20.9l6.1 29.1c1.9 9.3 9.1 16.7 18.5 17.8c6.7 .8 13.5 1.2 20.4 1.2s13.7-.4 20.4-1.2c9.4-1.1 16.6-8.6 18.5-17.8l6.1-29.1c13.3-5 25.5-12.1 36.2-20.9l28.2 9.3c9 3 19 .5 24.7-7.1c3.5-4.7 6.8-9.5 9.8-14.6l3.1-5.4c2.8-5 5.3-10.2 7.6-15.5c3.7-8.7 .9-18.6-6.2-25l-22.2-19.8c1.1-6.8 1.7-13.8 1.7-20.9s-.6-14.1-1.7-20.9l22.2-19.8zM112 176a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM504.7 500.5c6.3 7.1 16.2 9.9 25 6.2c5.3-2.3 10.5-4.8 15.5-7.6l5.4-3.1c5-3 9.9-6.3 14.6-9.8c7.6-5.7 10.1-15.7 7.1-24.7l-9.3-28.2c8.8-10.7 16-23 20.9-36.2l29.1-6.1c9.3-1.9 16.7-9.1 17.8-18.5c.8-6.7 1.2-13.5 1.2-20.4s-.4-13.7-1.2-20.4c-1.1-9.4-8.6-16.6-17.8-18.5L583.9 307c-5-13.3-12.1-25.5-20.9-36.2l9.3-28.2c3-9 .5-19-7.1-24.7c-4.7-3.5-9.6-6.8-14.6-9.9l-5.3-3c-5-2.8-10.2-5.3-15.6-7.6c-8.7-3.7-18.6-.9-25 6.2l-19.8 22.2c-6.8-1.1-13.8-1.7-20.9-1.7s-14.1 .6-20.9 1.7l-19.8-22.2c-6.3-7.1-16.2-9.9-25-6.2c-5.3 2.3-10.5 4.8-15.6 7.6l-5.2 3c-5.1 3-9.9 6.3-14.6 9.9c-7.6 5.7-10.1 15.7-7.1 24.7l9.3 28.2c-8.8 10.7-16 23-20.9 36.2L315.1 313c-9.3 1.9-16.7 9.1-17.8 18.5c-.8 6.7-1.2 13.5-1.2 20.4s.4 13.7 1.2 20.4c1.1 9.4 8.6 16.6 17.8 18.5l29.1 6.1c5 13.3 12.1 25.5 20.9 36.2l-9.3 28.2c-3 9-.5 19 7.1 24.7c4.7 3.5 9.5 6.8 14.6 9.8l5.4 3.1c5 2.8 10.2 5.3 15.5 7.6c8.7 3.7 18.6 .9 25-6.2l19.8-22.2c6.8 1.1 13.8 1.7 20.9 1.7s14.1-.6 20.9-1.7l19.8 22.2zM464 304a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"],MessagesCircle:[640,512,[],"regular","M88.2 309.1c9.8-18.3 6.8-40.8-7.5-55.8C59.4 230.9 48 204 48 176c0-63.5 63.8-128 160-128s160 64.5 160 128s-63.8 128-160 128c-13.1 0-25.8-1.3-37.8-3.6c-10.4-2-21.2-.6-30.7 4.2c-4.1 2.1-8.3 4.1-12.6 6c-16 7.2-32.9 13.5-49.9 18c2.8-4.6 5.4-9.1 7.9-13.6c1.1-1.9 2.2-3.9 3.2-5.9zM208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176c0 41.8 17.2 80.1 45.9 110.3c-.9 1.7-1.9 3.5-2.8 5.1c-10.3 18.4-22.3 36.5-36.6 52.1c-6.6 7-8.3 17.2-4.6 25.9C5.8 378.3 14.4 384 24 384c43 0 86.5-13.3 122.7-29.7c4.8-2.2 9.6-4.5 14.2-6.8c15.1 3 30.9 4.5 47.1 4.5zM432 480c16.2 0 31.9-1.6 47.1-4.5c4.6 2.3 9.4 4.6 14.2 6.8C529.5 498.7 573 512 616 512c9.6 0 18.2-5.7 22-14.5c3.8-8.8 2-19-4.6-25.9c-14.2-15.6-26.2-33.7-36.6-52.1c-.9-1.7-1.9-3.4-2.8-5.1C622.8 384.1 640 345.8 640 304c0-94.4-87.9-171.5-198.2-175.8c4.1 15.2 6.2 31.2 6.2 47.8l0 .6c87.2 6.7 144 67.5 144 127.4c0 28-11.4 54.9-32.7 77.2c-14.3 15-17.3 37.6-7.5 55.8c1.1 2 2.2 4 3.2 5.9c2.5 4.5 5.2 9 7.9 13.6c-17-4.5-33.9-10.7-49.9-18c-4.3-1.9-8.5-3.9-12.6-6c-9.5-4.8-20.3-6.2-30.7-4.2c-12.1 2.4-24.8 3.6-37.8 3.6c-61.7 0-110-26.5-136.8-62.3c-16 5.4-32.8 9.4-50 11.8C279 439.8 350 480 432 480z"],LinkOff:[640,512,["ChainBroken","ChainOff","Unlink"],"solid","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L489.3 358.2l90.5-90.5c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114l-96 96-31.9-25C430.9 239.6 420.1 175.1 377 132c-52.2-52.3-134.5-56.2-191.3-11.7L38.8 5.1zM239 162c30.1-14.9 67.7-9.9 92.8 15.3c20 20 27.5 48.3 21.7 74.5L239 162zM406.6 416.4L220.9 270c-2.1 39.8 12.2 80.1 42.2 110c38.9 38.9 94.4 51 143.6 36.3zm-290-228.5L60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5l61.8-61.8-50.6-39.9z"],StreetView:[512,512,[],"solid","M320 64A64 64 0 1 0 192 64a64 64 0 1 0 128 0zm-96 96c-35.3 0-64 28.7-64 64l0 48c0 17.7 14.3 32 32 32l1.8 0 11.1 99.5c1.8 16.2 15.5 28.5 31.8 28.5l38.7 0c16.3 0 30-12.3 31.8-28.5L318.2 304l1.8 0c17.7 0 32-14.3 32-32l0-48c0-35.3-28.7-64-64-64l-64 0zM132.3 394.2c13-2.4 21.7-14.9 19.3-27.9s-14.9-21.7-27.9-19.3c-32.4 5.9-60.9 14.2-82 24.8c-10.5 5.3-20.3 11.7-27.8 19.6C6.4 399.5 0 410.5 0 424c0 21.4 15.5 36.1 29.1 45c14.7 9.6 34.3 17.3 56.4 23.4C130.2 504.7 190.4 512 256 512s125.8-7.3 170.4-19.6c22.1-6.1 41.8-13.8 56.4-23.4c13.7-8.9 29.1-23.6 29.1-45c0-13.5-6.4-24.5-14-32.6c-7.5-7.9-17.3-14.3-27.8-19.6c-21-10.6-49.5-18.9-82-24.8c-13-2.4-25.5 6.3-27.9 19.3s6.3 25.5 19.3 27.9c30.2 5.5 53.7 12.8 69 20.5c3.2 1.6 5.8 3.1 7.9 4.5c3.6 2.4 3.6 7.2 0 9.6c-8.8 5.7-23.1 11.8-43 17.3C374.3 457 318.5 464 256 464s-118.3-7-157.7-17.9c-19.9-5.5-34.2-11.6-43-17.3c-3.6-2.4-3.6-7.2 0-9.6c2.1-1.4 4.8-2.9 7.9-4.5c15.3-7.7 38.8-14.9 69-20.5z"],ClosedCaptioning:[576,512,["CC"],"regular","M512 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l448 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM200 208c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48s21.5-48 48-48zm144 48c0-26.5 21.5-48 48-48c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48z"],ChildReaching:[384,512,[],"solid","M256 64A64 64 0 1 0 128 64a64 64 0 1 0 128 0zM152.9 169.3c-23.7-8.4-44.5-24.3-58.8-45.8L74.6 94.2C64.8 79.5 45 75.6 30.2 85.4s-18.7 29.7-8.9 44.4L40.9 159c18.1 27.1 42.8 48.4 71.1 62.4L112 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96 32 0 0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-258.4c29.1-14.2 54.4-36.2 72.7-64.2l18.2-27.9c9.6-14.8 5.4-34.6-9.4-44.3s-34.6-5.5-44.3 9.4L291 122.4c-21.8 33.4-58.9 53.6-98.8 53.6c-12.6 0-24.9-2-36.6-5.8c-.9-.3-1.8-.7-2.7-.9z"],HourglassHalf:[384,512,[],"regular","M0 24C0 10.7 10.7 0 24 0L360 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 19c0 40.3-16 79-44.5 107.5L225.9 256l81.5 81.5C336 366 352 404.7 352 445l0 19 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24s10.7-24 24-24l8 0 0-19c0-40.3 16-79 44.5-107.5L158.1 256 76.5 174.5C48 146 32 107.3 32 67l0-19-8 0C10.7 48 0 37.3 0 24zM110.5 371.5c-3.9 3.9-7.5 8.1-10.7 12.5l184.4 0c-3.2-4.4-6.8-8.6-10.7-12.5L192 289.9l-81.5 81.5zM284.2 128C297 110.4 304 89 304 67l0-19L80 48l0 19c0 22.1 7 43.4 19.8 61l184.4 0z"],PaperPlane:[512,512,[],"regular","M16.1 260.2c-22.6 12.9-20.5 47.3 3.6 57.3L160 376l0 103.3c0 18.1 14.6 32.7 32.7 32.7c9.7 0 18.9-4.3 25.1-11.8l62-74.3 123.9 51.6c18.9 7.9 40.8-4.5 43.9-24.7l64-416c1.9-12.1-3.4-24.3-13.5-31.2s-23.3-7.5-34-1.4l-448 256zm52.1 25.5L409.7 90.6 190.1 336l1.2 1L68.2 285.7zM403.3 425.4L236.7 355.9 450.8 116.6 403.3 425.4z"],Axis3DArrows:[24,24,[],"solid","m12 2l4 4h-3v7.85l6.53 3.76L21 15.03l1.5 5.47l-5.5 1.46l1.53-2.61L12 15.58l-6.53 3.77L7 21.96L1.5 20.5L3 15.03l1.47 2.58L11 13.85V6H8z"],PersonWalkingDashedLineArrowRight:[640,512,[],"solid","M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM550.6 153.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L530.7 224 384 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l146.7 0-25.4 25.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3l-80-80zM392 0c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48c0-13.3-10.7-24-24-24zm24 152c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16zM392 320c-13.3 0-24 10.7-24 24l0 16c0 13.3 10.7 24 24 24s24-10.7 24-24l0-16c0-13.3-10.7-24-24-24zm24 120c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48z"],PersonWalkingArrowLoopLeft:[640,512,[],"solid","M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zm347.7 119c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L461.3 384l18.7 0c88.4 0 160-71.6 160-160s-71.6-160-160-160L352 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c53 0 96 43 96 96s-43 96-96 96l-18.7 0 25.4-25.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-80 80c-12.5 12.5-12.5 32.8 0 45.3l80 80z"],PersonWalkingArrowRight:[640,512,[],"solid","M208 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM123.7 200.5c1-.4 1.9-.8 2.9-1.2l-16.9 63.5c-5.6 21.1-.1 43.6 14.7 59.7l70.7 77.1 22 88.1c4.3 17.1 21.7 27.6 38.8 23.3s27.6-21.7 23.3-38.8l-23-92.1c-1.9-7.8-5.8-14.9-11.2-20.8l-49.5-54 19.3-65.5 9.6 23c4.4 10.6 12.5 19.3 22.8 24.5l26.7 13.3c15.8 7.9 35 1.5 42.9-14.3s1.5-35-14.3-42.9L281 232.7l-15.3-36.8C248.5 154.8 208.3 128 163.7 128c-22.8 0-45.3 4.8-66.1 14l-8 3.5c-32.9 14.6-58.1 42.4-69.4 76.5l-2.6 7.8c-5.6 16.8 3.5 34.9 20.2 40.5s34.9-3.5 40.5-20.2l2.6-7.8c5.7-17.1 18.3-30.9 34.7-38.2l8-3.5zm-30 135.1L68.7 398 9.4 457.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L116.3 441c4.6-4.6 8.2-10.1 10.6-16.1l14.5-36.2-40.7-44.4c-2.5-2.7-4.8-5.6-7-8.6zM550.6 153.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L530.7 224 384 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l146.7 0-25.4 25.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l80-80c12.5-12.5 12.5-32.8 0-45.3l-80-80z"],ClapperboardClosed:[512,512,[],"solid","M448 32l-86.1 0-1 1-127 127 92.1 0 1-1L453.8 32.3c-1.9-.2-3.8-.3-5.8-.3zm64 128l0-64c0-15.1-5.3-29.1-14-40l-104 104L512 160zM294.1 32l-92.1 0-1 1L73.9 160l92.1 0 1-1 127-127zM64 32C28.7 32 0 60.7 0 96l0 64 6.1 0 1-1 127-127L64 32zM512 192L0 192 0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-224z"],UserOff:[640,512,[],"solid","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L381.9 274c48.5-23.2 82.1-72.7 82.1-130C464 64.5 399.5 0 320 0C250.4 0 192.4 49.3 178.9 114.9L38.8 5.1zM545.5 512L528 512 284.3 320l-59 0C136.2 320 64 392.2 64 481.3c0 17 13.8 30.7 30.7 30.7l450.6 0 .3 0z"],PhotoFilm:[640,512,["Media"],"solid","M256 0L576 0c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64l-320 0c-35.3 0-64-28.7-64-64l0-224c0-35.3 28.7-64 64-64zM476 106.7C471.5 100 464 96 456 96s-15.5 4-20 10.7l-56 84L362.7 169c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l80 0 48 0 144 0c8.9 0 17-4.9 21.2-12.7s3.7-17.3-1.2-24.6l-96-144zM336 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM64 128l96 0 0 256 0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32 160 0 0 64c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64zm8 64c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm0 104c-8.8 0-16 7.2-16 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0zm336 16l0 16c0 8.8 7.2 16 16 16l16 0c8.8 0 16-7.2 16-16l0-16c0-8.8-7.2-16-16-16l-16 0c-8.8 0-16 7.2-16 16z"],Chart:[448,512,[],"solid","M160 80c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-352zM0 272c0-26.5 21.5-48 48-48l32 0c26.5 0 48 21.5 48 48l0 160c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48L0 272zM368 96l32 0c26.5 0 48 21.5 48 48l0 288c0 26.5-21.5 48-48 48l-32 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48z"],HandsAslInterpreting:[640,512,["ASL"],"solid","M156.6 46.3c7.9-15.8 1.5-35-14.3-42.9s-35-1.5-42.9 14.3L13.5 189.4C4.6 207.2 0 226.8 0 246.7L0 256c0 70.7 57.3 128 128 128l72 0 8 0 0-.3c35.2-2.7 65.4-22.8 82.1-51.7c8.8-15.3 3.6-34.9-11.7-43.7s-34.9-3.6-43.7 11.7c-7 12-19.9 20-34.7 20c-22.1 0-40-17.9-40-40s17.9-40 40-40c14.8 0 27.7 8 34.7 20c8.8 15.3 28.4 20.5 43.7 11.7s20.5-28.4 11.7-43.7c-12.8-22.1-33.6-39.1-58.4-47.1l80.8-22c17-4.6 27.1-22.2 22.5-39.3s-22.2-27.1-39.3-22.5L194.9 124.6l81.6-68c13.6-11.3 15.4-31.5 4.1-45.1S249.1-3.9 235.5 7.4L133.6 92.3l23-46zM483.4 465.7c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3l85.9-171.7c8.9-17.8 13.5-37.4 13.5-57.2l0-9.3c0-70.7-57.3-128-128-128l-72 0-8 0 0 .3c-35.2 2.7-65.4 22.8-82.1 51.7c-8.9 15.3-3.6 34.9 11.7 43.7s34.9 3.6 43.7-11.7c7-12 19.9-20 34.7-20c22.1 0 40 17.9 40 40s-17.9 40-40 40c-14.8 0-27.7-8-34.7-20c-8.9-15.3-28.4-20.5-43.7-11.7s-20.5 28.4-11.7 43.7c12.8 22.1 33.6 39.1 58.4 47.1l-80.8 22c-17.1 4.7-27.1 22.2-22.5 39.3s22.2 27.1 39.3 22.5l100.7-27.5-81.6 68c-13.6 11.3-15.4 31.5-4.1 45.1s31.5 15.4 45.1 4.1l101.9-84.9-23 46z"],HandPointRight:[512,512,[],"regular","M448 128l-177.6 0c1 5.2 1.6 10.5 1.6 16l0 16 32 0 144 0c8.8 0 16-7.2 16-16s-7.2-16-16-16zM224 144c0-17.7-14.3-32-32-32c0 0 0 0 0 0l-24 0c-66.3 0-120 53.7-120 120l0 48c0 52.5 33.7 97.1 80.7 113.4c-.5-3.1-.7-6.2-.7-9.4c0-20 9.2-37.9 23.6-49.7c-4.9-9-7.6-19.4-7.6-30.3c0-15.1 5.3-29 14-40c-8.8-11-14-24.9-14-40l0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40c0 8.8 7.2 16 16 16s16-7.2 16-16l0-40 0-40zM192 64s0 0 0 0c18 0 34.6 6 48 16l208 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-82 0c1.3 5.1 2 10.5 2 16c0 25.3-14.7 47.2-36 57.6c2.6 7 4 14.5 4 22.4c0 20-9.2 37.9-23.6 49.7c4.9 9 7.6 19.4 7.6 30.3c0 35.3-28.7 64-64 64l-64 0-24 0C75.2 448 0 372.8 0 280l0-48C0 139.2 75.2 64 168 64l24 0zm64 336c8.8 0 16-7.2 16-16s-7.2-16-16-16l-48 0-16 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l64 0zm16-176c0 5.5-.7 10.9-2 16l2 0 32 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0 0 16zm-24 64l-40 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l48 0 16 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-24 0z"],HandPointUp:[384,512,[],"regular","M64 64l0 177.6c5.2-1 10.5-1.6 16-1.6l16 0 0-32L96 64c0-8.8-7.2-16-16-16s-16 7.2-16 16zM80 288c-17.7 0-32 14.3-32 32c0 0 0 0 0 0l0 24c0 66.3 53.7 120 120 120l48 0c52.5 0 97.1-33.7 113.4-80.7c-3.1 .5-6.2 .7-9.4 .7c-20 0-37.9-9.2-49.7-23.6c-9 4.9-19.4 7.6-30.3 7.6c-15.1 0-29-5.3-40-14c-11 8.8-24.9 14-40 14l-40 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l40 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-40 0-40 0zM0 320s0 0 0 0c0-18 6-34.6 16-48L16 64C16 28.7 44.7 0 80 0s64 28.7 64 64l0 82c5.1-1.3 10.5-2 16-2c25.3 0 47.2 14.7 57.6 36c7-2.6 14.5-4 22.4-4c20 0 37.9 9.2 49.7 23.6c9-4.9 19.4-7.6 30.3-7.6c35.3 0 64 28.7 64 64l0 64 0 24c0 92.8-75.2 168-168 168l-48 0C75.2 512 0 436.8 0 344l0-24zm336-64c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 48 0 16c0 8.8 7.2 16 16 16s16-7.2 16-16l0-64zM160 240c5.5 0 10.9 .7 16 2l0-2 0-32c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 32 16 0zm64 24l0 40c0 8.8 7.2 16 16 16s16-7.2 16-16l0-48 0-16c0-8.8-7.2-16-16-16s-16 7.2-16 16l0 24z"],HandPointDown:[384,512,[],"regular","M64 448l0-177.6c5.2 1 10.5 1.6 16 1.6l16 0 0 32 0 144c0 8.8-7.2 16-16 16s-16-7.2-16-16zM80 224c-17.7 0-32-14.3-32-32c0 0 0 0 0 0l0-24c0-66.3 53.7-120 120-120l48 0c52.5 0 97.1 33.7 113.4 80.7c-3.1-.5-6.2-.7-9.4-.7c-20 0-37.9 9.2-49.7 23.6c-9-4.9-19.4-7.6-30.3-7.6c-15.1 0-29 5.3-40 14c-11-8.8-24.9-14-40-14l-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-40 0-40 0zM0 192s0 0 0 0c0 18 6 34.6 16 48l0 208c0 35.3 28.7 64 64 64s64-28.7 64-64l0-82c5.1 1.3 10.5 2 16 2c25.3 0 47.2-14.7 57.6-36c7 2.6 14.5 4 22.4 4c20 0 37.9-9.2 49.7-23.6c9 4.9 19.4 7.6 30.3 7.6c35.3 0 64-28.7 64-64l0-64 0-24C384 75.2 308.8 0 216 0L168 0C75.2 0 0 75.2 0 168l0 24zm336 64c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48 0-16c0-8.8 7.2-16 16-16s16 7.2 16 16l0 64zM160 272c5.5 0 10.9-.7 16-2l0 2 0 32c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-32 16 0zm64-24l0-40c0-8.8 7.2-16 16-16s16 7.2 16 16l0 48 0 16c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-24z"],HandPointLeft:[512,512,[],"regular","M64 128l177.6 0c-1 5.2-1.6 10.5-1.6 16l0 16-32 0L64 160c-8.8 0-16-7.2-16-16s7.2-16 16-16zm224 16c0-17.7 14.3-32 32-32c0 0 0 0 0 0l24 0c66.3 0 120 53.7 120 120l0 48c0 52.5-33.7 97.1-80.7 113.4c.5-3.1 .7-6.2 .7-9.4c0-20-9.2-37.9-23.6-49.7c4.9-9 7.6-19.4 7.6-30.3c0-15.1-5.3-29-14-40c8.8-11 14-24.9 14-40l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-40 0-40zm32-80s0 0 0 0c-18 0-34.6 6-48 16L64 80C28.7 80 0 108.7 0 144s28.7 64 64 64l82 0c-1.3 5.1-2 10.5-2 16c0 25.3 14.7 47.2 36 57.6c-2.6 7-4 14.5-4 22.4c0 20 9.2 37.9 23.6 49.7c-4.9 9-7.6 19.4-7.6 30.3c0 35.3 28.7 64 64 64l64 0 24 0c92.8 0 168-75.2 168-168l0-48c0-92.8-75.2-168-168-168l-24 0zM256 400c-8.8 0-16-7.2-16-16s7.2-16 16-16l48 0 16 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-64 0zM240 224c0 5.5 .7 10.9 2 16l-2 0-32 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l32 0 0 16zm24 64l40 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-48 0-16 0c-8.8 0-16-7.2-16-16s7.2-16 16-16l24 0z"],HandScissors:[512,512,[],"regular","M.2 276.3c-1.2-35.3 26.4-65 61.7-66.2l3.3-.1L57 208.1C22.5 200.5 .7 166.3 8.3 131.8S50.2 75.5 84.7 83.2l173 38.3c2.3-2.9 4.7-5.7 7.1-8.5l18.4-20.3C299.9 74.5 323.5 64 348.3 64l10.2 0c54.1 0 104.1 28.7 131.3 75.4l1.5 2.6c13.6 23.2 20.7 49.7 20.7 76.6L512 344c0 66.3-53.7 120-120 120l-8 0-96 0c-35.3 0-64-28.7-64-64c0-2.8 .2-5.6 .5-8.3c-19.4-11-32.5-31.8-32.5-55.7c0-.8 0-1.6 0-2.4L66.4 338c-35.3 1.2-65-26.4-66.2-61.7zm63.4-18.2c-8.8 .3-15.7 7.7-15.4 16.5s7.7 15.7 16.5 15.4l161.5-5.6c9.8-.3 18.7 5.3 22.7 14.2s2.2 19.3-4.5 26.4c-2.8 2.9-4.4 6.7-4.4 11c0 8.8 7.2 16 16 16c9.1 0 17.4 5.1 21.5 13.3s3.2 17.9-2.3 25.1c-2 2.7-3.2 6-3.2 9.6c0 8.8 7.2 16 16 16l96 0 8 0c39.8 0 72-32.2 72-72l0-125.4c0-18.4-4.9-36.5-14.2-52.4l-1.5-2.6c-18.6-32-52.8-51.6-89.8-51.6l-10.2 0c-11.3 0-22 4.8-29.6 13.1l-17.5-15.9 17.5 15.9-18.4 20.3c-.6 .6-1.1 1.3-1.7 1.9l57 13.2c8.6 2 14 10.6 12 19.2s-10.6 14-19.2 12l-85.6-19.7L74.3 130c-8.6-1.9-17.2 3.5-19.1 12.2s3.5 17.2 12.2 19.1l187.5 41.6c10.2 2.3 17.8 10.9 18.7 21.4l.1 1c.6 6.6-1.5 13.1-5.8 18.1s-10.6 7.9-17.2 8.2L63.6 258.1z"],HandSpock:[576,512,[],"regular","M170.2 80.8C161 47 180.8 12 214.6 2.4c34-9.6 69.4 10.2 79 44.2l30.3 107.1L337.1 84c6.6-34.7 40.1-57.5 74.8-50.9c31.4 6 53 33.9 52 64.9c10-2.6 20.8-2.8 31.5-.1c34.3 8.6 55.1 43.3 46.6 77.6L486.7 397.2C469.8 464.7 409.2 512 339.6 512l-33.7 0c-56.9 0-112.2-19-157.2-53.9l-92-71.6c-27.9-21.7-32.9-61.9-11.2-89.8s61.9-32.9 89.8-11.2l17 13.2L100.5 167.5c-13-32.9 3.2-70.1 36-83c11.1-4.4 22.7-5.4 33.7-3.7zm77.1-21.2c-2.4-8.5-11.2-13.4-19.7-11s-13.4 11.2-11 19.7l54.8 182.4c3.5 12.3-3.3 25.2-15.4 29.3s-25.3-2-30-13.9L174.9 138.1c-3.2-8.2-12.5-12.3-20.8-9s-12.3 12.5-9 20.8l73.3 185.6c12 30.3-23.7 57-49.4 37l-63.1-49.1c-7-5.4-17-4.2-22.5 2.8s-4.2 17 2.8 22.5l92 71.6c36.5 28.4 81.4 43.8 127.7 43.8l33.7 0c47.5 0 89-32.4 100.5-78.5l55.4-221.6c2.1-8.6-3.1-17.3-11.6-19.4s-17.3 3.1-19.4 11.6l-26 104C435.6 271.8 425 280 413 280c-16.5 0-28.9-15-25.8-31.2L415.7 99c1.7-8.7-4-17.1-12.7-18.7s-17.1 4-18.7 12.7L352.5 260c-2.2 11.6-12.4 20-24.2 20c-11 0-20.7-7.3-23.7-17.9L247.4 59.6z"],HandBackFist:[448,512,["HandRock"],"regular","M144 64c0-8.8 7.2-16 16-16s16 7.2 16 16c0 9.1 5.1 17.4 13.3 21.5s17.9 3.2 25.1-2.3c2.7-2 6-3.2 9.6-3.2c8.8 0 16 7.2 16 16c0 9.1 5.1 17.4 13.3 21.5s17.9 3.2 25.1-2.3c2.7-2 6-3.2 9.6-3.2c8.8 0 16 7.2 16 16c0 9.1 5.1 17.4 13.3 21.5s17.9 3.2 25.1-2.3c2.7-2 6-3.2 9.6-3.2c8.8 0 16 7.2 16 16l0 104c0 31.3-20 58-48 67.9c-9.6 3.4-16 12.5-16 22.6L304 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-117.8c38-20.1 64-60.1 64-106.2l0-104c0-35.3-28.7-64-64-64c-2.8 0-5.6 .2-8.3 .5C332.8 77.1 311.9 64 288 64c-2.8 0-5.6 .2-8.3 .5C268.8 45.1 247.9 32 224 32c-2.8 0-5.6 .2-8.3 .5C204.8 13.1 183.9 0 160 0C124.7 0 96 28.7 96 64l0 64.3c-11.7 7.4-22.5 16.4-32 26.9l17.8 16.1L64 155.2l-9.4 10.5C40 181.8 32 202.8 32 224.6l0 12.8c0 49.6 24.2 96.1 64.8 124.5l13.8-19.7L96.8 361.9l8.9 6.2c6.9 4.8 14.4 8.6 22.3 11.3L128 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-128.1c0-12.6-9.8-23.1-22.4-23.9c-7.3-.5-14.3-2.9-20.3-7.1l-13.1 18.7 13.1-18.7-8.9-6.2C96.6 303.1 80 271.3 80 237.4l0-12.8c0-9.9 3.7-19.4 10.3-26.8l9.4-10.5c3.8-4.2 7.9-8.1 12.3-11.6l0 32.3c0 8.8 7.2 16 16 16s16-7.2 16-16l0-65.7 0-14.3 0-64z"],HandLizard:[512,512,[],"regular","M72 112c-13.3 0-24 10.7-24 24s10.7 24 24 24l168 0c35.3 0 64 28.7 64 64s-28.7 64-64 64l-104 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l152 0c4.5 0 8.9 1.3 12.7 3.6l64 40c7 4.4 11.3 12.1 11.3 20.4l0 24c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-10.7L281.1 384 136 384c-39.8 0-72-32.2-72-72s32.2-72 72-72l104 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L72 208c-39.8 0-72-32.2-72-72S32.2 64 72 64l209.6 0c46.7 0 90.9 21.5 119.7 58.3l78.4 100.1c20.9 26.7 32.3 59.7 32.3 93.7L512 424c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-107.9c0-23.2-7.8-45.8-22.1-64.1L363.5 151.9c-19.7-25.2-49.9-39.9-81.9-39.9L72 112z"],HandPeace:[512,512,[],"regular","M250.8 1.4c-35.2-3.7-66.6 21.8-70.3 57L174 119 156.7 69.6C145 36.3 108.4 18.8 75.1 30.5S24.2 78.8 35.9 112.1L88.7 262.2C73.5 276.7 64 297.3 64 320c0 0 0 0 0 0l0 24c0 92.8 75.2 168 168 168l48 0c92.8 0 168-75.2 168-168l0-72 0-16 0-32c0-35.3-28.7-64-64-64c-7.9 0-15.4 1.4-22.4 4c-10.4-21.3-32.3-36-57.6-36c-.7 0-1.5 0-2.2 0l5.9-56.3c3.7-35.2-21.8-66.6-57-70.3zm-.2 155.4C243.9 166.9 240 179 240 192l0 48c0 .7 0 1.4 0 2c-5.1-1.3-10.5-2-16-2l-7.4 0-5.4-15.3 17-161.3c.9-8.8 8.8-15.2 17.6-14.2s15.2 8.8 14.2 17.6l-9.5 90.1zM111.4 85.6L165.7 240 144 240c-4 0-8 .3-11.9 .9L81.2 96.2c-2.9-8.3 1.5-17.5 9.8-20.4s17.5 1.5 20.4 9.8zM288 192c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 0 16c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48zm38.4 108c10.4 21.3 32.3 36 57.6 36c5.5 0 10.9-.7 16-2l0 10c0 66.3-53.7 120-120 120l-48 0c-66.3 0-120-53.7-120-120l0-24s0 0 0 0c0-17.7 14.3-32 32-32l80 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-40 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l40 0c35.3 0 64-28.7 64-64c0-.7 0-1.4 0-2c5.1 1.3 10.5 2 16 2c7.9 0 15.4-1.4 22.4-4zM400 272c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-32 0-16c0-8.8 7.2-16 16-16s16 7.2 16 16l0 32 0 16z"],Html:[24,24,[],"solid","m3 2l1.578 17.824L12 22l7.467-2.175L21 2zm14.049 6.048H9.075l.172 2.016h7.697l-.626 6.565l-4.246 1.381l-4.281-1.455l-.288-2.932h2.024l.16 1.411l2.4.815l2.346-.763l.297-3.005H7.416l-.562-6.05h10.412z"],CircleNodes:[512,512,[],"solid","M418.4 157.9c35.3-8.3 61.6-40 61.6-77.9c0-44.2-35.8-80-80-80c-43.4 0-78.7 34.5-80 77.5L136.2 151.1C121.7 136.8 101.9 128 80 128c-44.2 0-80 35.8-80 80s35.8 80 80 80c12.2 0 23.8-2.7 34.1-7.6L259.7 407.8c-2.4 7.6-3.7 15.8-3.7 24.2c0 44.2 35.8 80 80 80s80-35.8 80-80c0-27.7-14-52.1-35.4-66.4l37.8-207.7zM156.3 232.2c2.2-6.9 3.5-14.2 3.7-21.7l183.8-73.5c3.6 3.5 7.4 6.7 11.6 9.5L317.6 354.1c-5.5 1.3-10.8 3.1-15.8 5.5L156.3 232.2z"],CircleRight:[512,512,[],"regular","M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM294.6 151.2c-4.2-4.6-10.1-7.2-16.4-7.2C266 144 256 154 256 166.3l0 41.7-96 0c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l96 0 0 41.7c0 12.3 10 22.3 22.3 22.3c6.2 0 12.1-2.6 16.4-7.2l84-91c3.5-3.8 5.4-8.7 5.4-13.9s-1.9-10.1-5.4-13.9l-84-91z"],CircleUp:[512,512,[],"regular","M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM151.2 217.4c-4.6 4.2-7.2 10.1-7.2 16.4c0 12.3 10 22.3 22.3 22.3l41.7 0 0 96c0 17.7 14.3 32 32 32l32 0c17.7 0 32-14.3 32-32l0-96 41.7 0c12.3 0 22.3-10 22.3-22.3c0-6.2-2.6-12.1-7.2-16.4l-91-84c-3.8-3.5-8.7-5.4-13.9-5.4s-10.1 1.9-13.9 5.4l-91 84z"],CircleLeft:[512,512,[],"regular","M48 256a208 208 0 1 1 416 0A208 208 0 1 1 48 256zm464 0A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM217.4 376.9c4.2 4.5 10.1 7.1 16.3 7.1c12.3 0 22.3-10 22.3-22.3l0-57.7 96 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32l-96 0 0-57.7c0-12.3-10-22.3-22.3-22.3c-6.2 0-12.1 2.6-16.3 7.1L117.5 242.2c-3.5 3.8-5.5 8.7-5.5 13.8s2 10.1 5.5 13.8l99.9 107.1z"],CircleDown:[512,512,[],"regular","M256 464a208 208 0 1 1 0-416 208 208 0 1 1 0 416zM256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM376.9 294.6c4.5-4.2 7.1-10.1 7.1-16.3c0-12.3-10-22.3-22.3-22.3L304 256l0-96c0-17.7-14.3-32-32-32l-32 0c-17.7 0-32 14.3-32 32l0 96-57.7 0C138 256 128 266 128 278.3c0 6.2 2.6 12.1 7.1 16.3l107.1 99.9c3.8 3.5 8.7 5.5 13.8 5.5s10.1-2 13.8-5.5l107.1-99.9z"],WindowRestore:[512,512,[],"solid","M432 48L208 48c-17.7 0-32 14.3-32 32l0 16-48 0 0-16c0-44.2 35.8-80 80-80L432 0c44.2 0 80 35.8 80 80l0 224c0 44.2-35.8 80-80 80l-16 0 0-48 16 0c17.7 0 32-14.3 32-32l0-224c0-17.7-14.3-32-32-32zM48 448c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-192L48 256l0 192zM64 128l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 192c0-35.3 28.7-64 64-64z"],WindowMaximize:[512,512,[],"solid","M.3 89.5C.1 91.6 0 93.8 0 96L0 224 0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-192 0-128c0-35.3-28.7-64-64-64L64 32c-2.2 0-4.4 .1-6.5 .3c-9.2 .9-17.8 3.8-25.5 8.2C21.8 46.5 13.4 55.1 7.7 65.5c-3.9 7.3-6.5 15.4-7.4 24zM48 224l416 0 0 192c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16l0-192z"],WindowMinimize:[512,512,[],"solid","M24 432c-13.3 0-24 10.7-24 24s10.7 24 24 24l464 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 432z"],VrCardboard:[640,512,["VR"],"solid","M576 64L64 64C28.7 64 0 92.7 0 128L0 384c0 35.3 28.7 64 64 64l120.4 0c24.2 0 46.4-13.7 57.2-35.4l32-64c8.8-17.5 26.7-28.6 46.3-28.6s37.5 11.1 46.3 28.6l32 64c10.8 21.7 33 35.4 57.2 35.4L576 448c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64zM96 240a64 64 0 1 1 128 0A64 64 0 1 1 96 240zm384-64a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"],C:[32,32,[],"solid","M29.86 8c-.224-.385-.532-.724-.871-.921L17.234.292c-.677-.391-1.787-.391-2.464 0L3.015 7.079C2.338 7.47 1.78 8.432 1.78 9.214v13.573c0 .391.14.828.364 1.213.219.385.532.724.871.917l11.749 6.791c.683.391 1.787.391 2.464 0l11.755-6.791c.339-.193.647-.532.871-.917s.359-.823.359-1.213V9.214c.005-.391-.135-.828-.353-1.213zM16 25.479c-5.229 0-9.479-4.249-9.479-9.479S10.77 6.521 16 6.521a9.51 9.51 0 0 1 8.208 4.733l-4.104 2.376A4.76 4.76 0 0 0 16 11.259c-2.615 0-4.74 2.125-4.74 4.74s2.125 4.74 4.74 4.74a4.76 4.76 0 0 0 4.104-2.371l4.104 2.376A9.51 9.51 0 0 1 16 25.479z",{svgClass:"stroke-none"}],CPlusPlus:[32,32,[],"solid","M29.86 8c-.224-.385-.532-.724-.871-.921L17.234.292c-.677-.391-1.787-.391-2.464 0L3.015 7.079C2.338 7.47 1.78 8.432 1.78 9.214v13.573c0 .391.14.828.364 1.213c.219.385.532.724.871.917l11.749 6.791c.683.391 1.787.391 2.464 0l11.755-6.791c.339-.193.647-.532.871-.917s.359-.823.359-1.213V9.214c.005-.391-.135-.828-.353-1.213zM16 25.479c-5.229 0-9.479-4.249-9.479-9.479S10.77 6.521 16 6.521a9.51 9.51 0 0 1 8.208 4.733l-4.104 2.376A4.76 4.76 0 0 0 16 11.259c-2.615 0-4.74 2.125-4.74 4.74s2.125 4.74 4.74 4.74a4.76 4.76 0 0 0 4.104-2.371l4.104 2.376A9.51 9.51 0 0 1 16 25.477zm9.479-8.952h-1.052v1.052H23.37v-1.052h-1.052v-1.053h1.052v-1.052h1.057v1.052h1.052zm3.948 0h-1.052v1.052h-1.052v-1.052h-1.052v-1.053h1.052v-1.052h1.052v1.052h1.052z",{svgClass:"stroke-none"}],Css:[24,24,[],"solid","M0 0v20.16A3.84 3.84 0 0 0 3.84 24h16.32A3.84 3.84 0 0 0 24 20.16V3.84A3.84 3.84 0 0 0 20.16 0Zm14.256 13.08c1.56 0 2.28 1.08 2.304 2.64h-1.608c.024-.288-.048-.6-.144-.84c-.096-.192-.288-.264-.552-.264c-.456 0-.696.264-.696.84c-.024.576.288.888.768 1.08c.72.288 1.608.744 1.92 1.296q.432.648.432 1.656c0 1.608-.912 2.592-2.496 2.592c-1.656 0-2.4-1.032-2.424-2.688h1.68c0 .792.264 1.176.792 1.176c.264 0 .456-.072.552-.24c.192-.312.24-1.176-.048-1.512c-.312-.408-.912-.6-1.32-.816q-.828-.396-1.224-.936c-.24-.36-.36-.888-.36-1.536c0-1.44.936-2.472 2.424-2.448m5.4 0c1.584 0 2.304 1.08 2.328 2.64h-1.608c0-.288-.048-.6-.168-.84c-.096-.192-.264-.264-.528-.264c-.48 0-.72.264-.72.84s.288.888.792 1.08c.696.288 1.608.744 1.92 1.296c.264.432.408.984.408 1.656c.024 1.608-.888 2.592-2.472 2.592c-1.68 0-2.424-1.056-2.448-2.688h1.68c0 .744.264 1.176.792 1.176c.264 0 .456-.072.552-.24c.216-.312.264-1.176-.048-1.512c-.288-.408-.888-.6-1.32-.816c-.552-.264-.96-.576-1.2-.936s-.36-.888-.36-1.536c-.024-1.44.912-2.472 2.4-2.448m-11.031.018c.711-.006 1.419.198 1.839.63c.432.432.672 1.128.648 1.992H9.336c.024-.456-.096-.792-.432-.96c-.312-.144-.768-.048-.888.24c-.12.264-.192.576-.168.864v3.504c0 .744.264 1.128.768 1.128a.65.65 0 0 0 .552-.264c.168-.24.192-.552.168-.84h1.776c.096 1.632-.984 2.712-2.568 2.688c-1.536 0-2.496-.864-2.472-2.472v-4.032c0-.816.24-1.44.696-1.848c.432-.408 1.146-.624 1.857-.63"],Discord:[640,512,[],"solid","M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"],Godot:[32,32,[],"solid","M12.745.917c-1.458.328-2.906.781-4.266 1.464a32 32 0 0 0 .266 3.505c-.526.339-1.078.63-1.568 1.026c-.5.38-1.01.75-1.464 1.198a28 28 0 0 0-2.849-1.651C1.801 7.6.812 8.834-.001 10.214c.609.99 1.25 1.911 1.938 2.792h.016v8.474a.2.2 0 0 1 .047.005l5.198.5a.554.554 0 0 1 .5.521l.161 2.292l4.531.323l.313-2.115a.56.56 0 0 1 .552-.479h5.484a.56.56 0 0 1 .552.479l.313 2.115l4.531-.323l.161-2.292a.554.554 0 0 1 .505-.521l5.193-.5c.016 0 .031-.005.047-.005v-8.474h.021a30 30 0 0 0 1.932-2.792c-.807-1.38-1.802-2.615-2.865-3.755A29 29 0 0 0 26.28 8.11c-.453-.448-.958-.818-1.458-1.198c-.495-.396-1.047-.688-1.573-1.026c.156-1.161.234-2.307.266-3.505c-1.354-.682-2.802-1.135-4.266-1.464A31 31 0 0 0 17.671 4a11 11 0 0 0-1.661-.13h-.026c-.552.005-1.109.042-1.661.13A30 30 0 0 0 12.74.917zm-4.11 12.406a3.134 3.134 0 0 1 3.13 3.135a3.13 3.13 0 1 1-6.26 0a3.134 3.134 0 0 1 3.13-3.135m14.73 0a3.134 3.134 0 0 1 3.13 3.135a3.13 3.13 0 1 1-6.26 0a3.134 3.134 0 0 1 3.13-3.135M8.932 14.568a2.076 2.076 0 1 0 0 4.151a2.077 2.077 0 0 0 2.083-2.073a2.08 2.08 0 0 0-2.083-2.078m14.131 0a2.076 2.076 0 1 0 0 4.151a2.073 2.073 0 0 0 2.078-2.073a2.074 2.074 0 0 0-2.078-2.078M16 15.172c.557 0 1.01.406 1.01.911v2.885c0 .505-.453.917-1.01.917s-1.01-.411-1.01-.917v-2.885c0-.505.453-.911 1.01-.911M1.948 22.599c0 .505.005 1.052.005 1.161c0 4.938 6.26 7.307 14.036 7.333h.021c7.776-.026 14.031-2.396 14.031-7.333l.01-1.161l-4.672.453l-.161 2.307a.556.556 0 0 1-.516.516l-5.578.396a.56.56 0 0 1-.552-.474l-.318-2.156h-4.516l-.318 2.156a.557.557 0 0 1-.594.474l-5.531-.396a.565.565 0 0 1-.521-.516l-.156-2.307l-4.672-.448z"],Google:[488,512,[],"solid","M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"],Go:[24,24,[],"solid","M1.811 10.231c-.047 0-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046 0 .058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047 11.306c-.047 0-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047 0 .07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828 1.075c-.047 0-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047 0 .07.035.07.082l-.023.28c0 .047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514c-.176.046-.187.058-.34-.117c-.174-.199-.303-.327-.548-.444c-.737-.362-1.45-.257-2.115.175c-.795.514-1.204 1.274-1.192 2.22c.011.935.654 1.706 1.577 1.835c.795.105 1.46-.175 1.987-.77c.105-.13.198-.27.315-.434H10.47c-.245 0-.304-.152-.222-.35c.152-.362.432-.97.596-1.274a.32.32 0 0 1 .292-.187h4.253c-.023.316-.023.631-.07.947a5 5 0 0 1-.958 2.29c-.841 1.11-1.94 1.8-3.33 1.986c-1.145.152-2.209-.07-3.143-.77c-.865-.655-1.356-1.52-1.484-2.595c-.152-1.274.222-2.419.993-3.424c.83-1.086 1.928-1.776 3.272-2.02c1.098-.2 2.15-.07 3.096.571c.62.41 1.063.97 1.356 1.648c.07.105.023.164-.117.2m3.868 6.461c-1.064-.024-2.034-.328-2.852-1.029a3.67 3.67 0 0 1-1.262-2.255c-.21-1.32.152-2.489.947-3.529c.853-1.122 1.881-1.706 3.272-1.95c1.192-.21 2.314-.095 3.33.595c.923.63 1.496 1.484 1.648 2.605c.198 1.578-.257 2.863-1.344 3.962c-.771.783-1.718 1.273-2.805 1.495c-.315.06-.63.07-.934.106m2.78-4.72c-.011-.153-.011-.27-.034-.387c-.21-1.157-1.274-1.81-2.384-1.554c-1.087.245-1.788.935-2.045 2.033c-.21.912.234 1.835 1.075 2.21c.643.28 1.285.244 1.905-.07c.923-.48 1.425-1.228 1.484-2.233z"],Git:[32,32,[],"solid","M13.172 2.828L11.78 4.22l1.91 1.91l2 2A2.986 2.986 0 0 1 20 10.81a3.25 3.25 0 0 1-.31 1.31l2.06 2a2.68 2.68 0 0 1 3.37.57a2.86 2.86 0 0 1 .88 2.117a3.02 3.02 0 0 1-.856 2.109A2.9 2.9 0 0 1 23 19.81a2.93 2.93 0 0 1-2.13-.87a2.694 2.694 0 0 1-.56-3.38l-2-2.06a3 3 0 0 1-.31.12V20a3 3 0 0 1 1.44 1.09a2.92 2.92 0 0 1 .56 1.72a2.88 2.88 0 0 1-.878 2.128a2.98 2.98 0 0 1-2.048.871a2.981 2.981 0 0 1-2.514-4.719A3 3 0 0 1 16 20v-6.38a2.96 2.96 0 0 1-1.44-1.09a2.9 2.9 0 0 1-.56-1.72a2.9 2.9 0 0 1 .31-1.31l-3.9-3.9l-7.579 7.572a4 4 0 0 0-.001 5.658l10.342 10.342a4 4 0 0 0 5.656 0l10.344-10.344a4 4 0 0 0 0-5.656L18.828 2.828a4 4 0 0 0-5.656 0"],Json:[32,32,[],"solid","M4.014 14.976a2.5 2.5 0 0 0 1.567-.518a2.38 2.38 0 0 0 .805-1.358a15.3 15.3 0 0 0 .214-2.944q.012-2.085.075-2.747a5.2 5.2 0 0 1 .418-1.686a3 3 0 0 1 .755-1.018A3.05 3.05 0 0 1 9 4.125A6.8 6.8 0 0 1 10.544 4h.7v1.96h-.387a2.34 2.34 0 0 0-1.723.468a3.4 3.4 0 0 0-.425 2.092a36 36 0 0 1-.137 4.133a4.7 4.7 0 0 1-.768 2.06A4.6 4.6 0 0 1 6.1 16a3.8 3.8 0 0 1 1.992 1.754a8.9 8.9 0 0 1 .618 3.865q0 2.435.05 2.9a1.76 1.76 0 0 0 .504 1.181a2.64 2.64 0 0 0 1.592.337h.387V28h-.7a5.7 5.7 0 0 1-1.773-.2a2.97 2.97 0 0 1-1.324-.93a3.35 3.35 0 0 1-.681-1.63a24 24 0 0 1-.165-3.234a16.5 16.5 0 0 0-.214-3.106a2.4 2.4 0 0 0-.805-1.361a2.5 2.5 0 0 0-1.567-.524Zm23.972 2.035a2.5 2.5 0 0 0-1.567.524a2.4 2.4 0 0 0-.805 1.361a16.5 16.5 0 0 0-.212 3.109a24 24 0 0 1-.169 3.234a3.35 3.35 0 0 1-.681 1.63a2.97 2.97 0 0 1-1.324.93a5.7 5.7 0 0 1-1.773.2h-.7V26.04h.387a2.64 2.64 0 0 0 1.592-.337a1.76 1.76 0 0 0 .506-1.186q.05-.462.05-2.9a8.9 8.9 0 0 1 .618-3.865A3.8 3.8 0 0 1 25.9 16a4.6 4.6 0 0 1-1.7-1.286a4.7 4.7 0 0 1-.768-2.06a36 36 0 0 1-.137-4.133a3.4 3.4 0 0 0-.425-2.092a2.34 2.34 0 0 0-1.723-.468h-.387V4h.7a6.8 6.8 0 0 1 1.54.125a3.05 3.05 0 0 1 1.149.581a3 3 0 0 1 .755 1.018a5.2 5.2 0 0 1 .418 1.686q.062.662.075 2.747a15.3 15.3 0 0 0 .212 2.947a2.38 2.38 0 0 0 .805 1.355a2.5 2.5 0 0 0 1.567.518Z"],Js:[32,32,[],"solid","M18.774 19.7a3.73 3.73 0 0 0 3.376 2.078c1.418 0 2.324-.709 2.324-1.688c0-1.173-.931-1.589-2.491-2.272l-.856-.367c-2.469-1.052-4.11-2.37-4.11-5.156c0-2.567 1.956-4.52 5.012-4.52A5.06 5.06 0 0 1 26.9 10.52l-2.665 1.711a2.33 2.33 0 0 0-2.2-1.467a1.49 1.49 0 0 0-1.638 1.467c0 1.027.636 1.442 2.1 2.078l.856.366c2.908 1.247 4.549 2.518 4.549 5.376c0 3.081-2.42 4.769-5.671 4.769a6.58 6.58 0 0 1-6.236-3.5ZM6.686 20c.538.954 1.027 1.76 2.2 1.76c1.124 0 1.834-.44 1.834-2.15V7.975h3.422v11.683c0 3.543-2.078 5.156-5.11 5.156A5.31 5.31 0 0 1 3.9 21.688Z"],Ts:[32,32,[],"solid","M23.827 8.243a4.4 4.4 0 0 1 2.223 1.281a6 6 0 0 1 .852 1.143c.011.045-1.534 1.083-2.471 1.662c-.034.023-.169-.124-.322-.35a2.01 2.01 0 0 0-1.67-1c-1.077-.074-1.771.49-1.766 1.433a1.3 1.3 0 0 0 .153.666c.237.49.677.784 2.059 1.383c2.544 1.095 3.636 1.817 4.31 2.843a5.16 5.16 0 0 1 .416 4.333a4.76 4.76 0 0 1-3.932 2.815a11 11 0 0 1-2.708-.028a6.53 6.53 0 0 1-3.616-1.884a6.3 6.3 0 0 1-.926-1.371a3 3 0 0 1 .327-.208c.158-.09.756-.434 1.32-.761l1.024-.6l.214.312a4.8 4.8 0 0 0 1.35 1.292a3.3 3.3 0 0 0 3.458-.175a1.545 1.545 0 0 0 .2-1.974c-.276-.395-.84-.727-2.443-1.422a8.8 8.8 0 0 1-3.349-2.055a4.7 4.7 0 0 1-.976-1.777a7.1 7.1 0 0 1-.062-2.268a4.33 4.33 0 0 1 3.644-3.374a9 9 0 0 1 2.691.084m-8.343 1.483l.011 1.454h-4.63v13.148H7.6V11.183H2.97V9.755a14 14 0 0 1 .04-1.466c.017-.023 2.832-.034 6.245-.028l6.211.017Z"],Linux:[448,512,[],"regular","M220.8 123.3c1 .5 1.8 1.7 3 1.7 1.1 0 2.8-.4 2.9-1.5.2-1.4-1.9-2.3-3.2-2.9-1.7-.7-3.9-1-5.5-.1-.4.2-.8.7-.6 1.1.3 1.3 2.3 1.1 3.4 1.7zm-21.9 1.7c1.2 0 2-1.2 3-1.7 1.1-.6 3.1-.4 3.5-1.6.2-.4-.2-.9-.6-1.1-1.6-.9-3.8-.6-5.5.1-1.3.6-3.4 1.5-3.2 2.9.1 1 1.8 1.5 2.8 1.4zM420 403.8c-3.6-4-5.3-11.6-7.2-19.7-1.8-8.1-3.9-16.8-10.5-22.4-1.3-1.1-2.6-2.1-4-2.9-1.3-.8-2.7-1.5-4.1-2 9.2-27.3 5.6-54.5-3.7-79.1-11.4-30.1-31.3-56.4-46.5-74.4-17.1-21.5-33.7-41.9-33.4-72C311.1 85.4 315.7.1 234.8 0 132.4-.2 158 103.4 156.9 135.2c-1.7 23.4-6.4 41.8-22.5 64.7-18.9 22.5-45.5 58.8-58.1 96.7-6 17.9-8.8 36.1-6.2 53.3-6.5 5.8-11.4 14.7-16.6 20.2-4.2 4.3-10.3 5.9-17 8.3s-14 6-18.5 14.5c-2.1 3.9-2.8 8.1-2.8 12.4 0 3.9.6 7.9 1.2 11.8 1.2 8.1 2.5 15.7.8 20.8-5.2 14.4-5.9 24.4-2.2 31.7 3.8 7.3 11.4 10.5 20.1 12.3 17.3 3.6 40.8 2.7 59.3 12.5 19.8 10.4 39.9 14.1 55.9 10.4 11.6-2.6 21.1-9.6 25.9-20.2 12.5-.1 26.3-5.4 48.3-6.6 14.9-1.2 33.6 5.3 55.1 4.1.6 2.3 1.4 4.6 2.5 6.7v.1c8.3 16.7 23.8 24.3 40.3 23 16.6-1.3 34.1-11 48.3-27.9 13.6-16.4 36-23.2 50.9-32.2 7.4-4.5 13.4-10.1 13.9-18.3.4-8.2-4.4-17.3-15.5-29.7zM223.7 87.3c9.8-22.2 34.2-21.8 44-.4 6.5 14.2 3.6 30.9-4.3 40.4-1.6-.8-5.9-2.6-12.6-4.9 1.1-1.2 3.1-2.7 3.9-4.6 4.8-11.8-.2-27-9.1-27.3-7.3-.5-13.9 10.8-11.8 23-4.1-2-9.4-3.5-13-4.4-1-6.9-.3-14.6 2.9-21.8zM183 75.8c10.1 0 20.8 14.2 19.1 33.5-3.5 1-7.1 2.5-10.2 4.6 1.2-8.9-3.3-20.1-9.6-19.6-8.4.7-9.8 21.2-1.8 28.1 1 .8 1.9-.2-5.9 5.5-15.6-14.6-10.5-52.1 8.4-52.1zm-13.6 60.7c6.2-4.6 13.6-10 14.1-10.5 4.7-4.4 13.5-14.2 27.9-14.2 7.1 0 15.6 2.3 25.9 8.9 6.3 4.1 11.3 4.4 22.6 9.3 8.4 3.5 13.7 9.7 10.5 18.2-2.6 7.1-11 14.4-22.7 18.1-11.1 3.6-19.8 16-38.2 14.9-3.9-.2-7-1-9.6-2.1-8-3.5-12.2-10.4-20-15-8.6-4.8-13.2-10.4-14.7-15.3-1.4-4.9 0-9 4.2-12.3zm3.3 334c-2.7 35.1-43.9 34.4-75.3 18-29.9-15.8-68.6-6.5-76.5-21.9-2.4-4.7-2.4-12.7 2.6-26.4v-.2c2.4-7.6.6-16-.6-23.9-1.2-7.8-1.8-15 .9-20 3.5-6.7 8.5-9.1 14.8-11.3 10.3-3.7 11.8-3.4 19.6-9.9 5.5-5.7 9.5-12.9 14.3-18 5.1-5.5 10-8.1 17.7-6.9 8.1 1.2 15.1 6.8 21.9 16l19.6 35.6c9.5 19.9 43.1 48.4 41 68.9zm-1.4-25.9c-4.1-6.6-9.6-13.6-14.4-19.6 7.1 0 14.2-2.2 16.7-8.9 2.3-6.2 0-14.9-7.4-24.9-13.5-18.2-38.3-32.5-38.3-32.5-13.5-8.4-21.1-18.7-24.6-29.9s-3-23.3-.3-35.2c5.2-22.9 18.6-45.2 27.2-59.2 2.3-1.7.8 3.2-8.7 20.8-8.5 16.1-24.4 53.3-2.6 82.4.6-20.7 5.5-41.8 13.8-61.5 12-27.4 37.3-74.9 39.3-112.7 1.1.8 4.6 3.2 6.2 4.1 4.6 2.7 8.1 6.7 12.6 10.3 12.4 10 28.5 9.2 42.4 1.2 6.2-3.5 11.2-7.5 15.9-9 9.9-3.1 17.8-8.6 22.3-15 7.7 30.4 25.7 74.3 37.2 95.7 6.1 11.4 18.3 35.5 23.6 64.6 3.3-.1 7 .4 10.9 1.4 13.8-35.7-11.7-74.2-23.3-84.9-4.7-4.6-4.9-6.6-2.6-6.5 12.6 11.2 29.2 33.7 35.2 59 2.8 11.6 3.3 23.7.4 35.7 16.4 6.8 35.9 17.9 30.7 34.8-2.2-.1-3.2 0-4.2 0 3.2-10.1-3.9-17.6-22.8-26.1-19.6-8.6-36-8.6-38.3 12.5-12.1 4.2-18.3 14.7-21.4 27.3-2.8 11.2-3.6 24.7-4.4 39.9-.5 7.7-3.6 18-6.8 29-32.1 22.9-76.7 32.9-114.3 7.2zm257.4-11.5c-.9 16.8-41.2 19.9-63.2 46.5-13.2 15.7-29.4 24.4-43.6 25.5s-26.5-4.8-33.7-19.3c-4.7-11.1-2.4-23.1 1.1-36.3 3.7-14.2 9.2-28.8 9.9-40.6.8-15.2 1.7-28.5 4.2-38.7 2.6-10.3 6.6-17.2 13.7-21.1.3-.2.7-.3 1-.5.8 13.2 7.3 26.6 18.8 29.5 12.6 3.3 30.7-7.5 38.4-16.3 9-.3 15.7-.9 22.6 5.1 9.9 8.5 7.1 30.3 17.1 41.6 10.6 11.6 14 19.5 13.7 24.6zM173.3 148.7c2 1.9 4.7 4.5 8 7.1 6.6 5.2 15.8 10.6 27.3 10.6 11.6 0 22.5-5.9 31.8-10.8 4.9-2.6 10.9-7 14.8-10.4s5.9-6.3 3.1-6.6-2.6 2.6-6 5.1c-4.4 3.2-9.7 7.4-13.9 9.8-7.4 4.2-19.5 10.2-29.9 10.2s-18.7-4.8-24.9-9.7c-3.1-2.5-5.7-5-7.7-6.9-1.5-1.4-1.9-4.6-4.3-4.9-1.4-.1-1.8 3.7 1.7 6.5z"],SquareJs:[448,512,[],"solid","M448 96c0-35.3-28.7-64-64-64H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96zM180.9 444.9c-33.7 0-53.2-17.4-63.2-38.5L152 385.7c6.6 11.7 12.6 21.6 27.1 21.6c13.8 0 22.6-5.4 22.6-26.5V237.7h42.1V381.4c0 43.6-25.6 63.5-62.9 63.5zm85.8-43L301 382.1c9 14.7 20.8 25.6 41.5 25.6c17.4 0 28.6-8.7 28.6-20.8c0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5c0-31.6 24.1-55.6 61.6-55.6c26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18c-12.3 0-20.1 7.8-20.1 18c0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2c0 37.8-29.8 58.6-69.7 58.6c-39.1 0-64.4-18.6-76.7-43z"],Safari:[512,512,[],"solid","M274.69,274.69l-37.38-37.38L166,346ZM256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8ZM411.85,182.79l14.78-6.13A8,8,0,0,1,437.08,181h0a8,8,0,0,1-4.33,10.46L418,197.57a8,8,0,0,1-10.45-4.33h0A8,8,0,0,1,411.85,182.79ZM314.43,94l6.12-14.78A8,8,0,0,1,331,74.92h0a8,8,0,0,1,4.33,10.45l-6.13,14.78a8,8,0,0,1-10.45,4.33h0A8,8,0,0,1,314.43,94ZM256,60h0a8,8,0,0,1,8,8V84a8,8,0,0,1-8,8h0a8,8,0,0,1-8-8V68A8,8,0,0,1,256,60ZM181,74.92a8,8,0,0,1,10.46,4.33L197.57,94a8,8,0,1,1-14.78,6.12l-6.13-14.78A8,8,0,0,1,181,74.92Zm-63.58,42.49h0a8,8,0,0,1,11.31,0L140,128.72A8,8,0,0,1,140,140h0a8,8,0,0,1-11.31,0l-11.31-11.31A8,8,0,0,1,117.41,117.41ZM60,256h0a8,8,0,0,1,8-8H84a8,8,0,0,1,8,8h0a8,8,0,0,1-8,8H68A8,8,0,0,1,60,256Zm40.15,73.21-14.78,6.13A8,8,0,0,1,74.92,331h0a8,8,0,0,1,4.33-10.46L94,314.43a8,8,0,0,1,10.45,4.33h0A8,8,0,0,1,100.15,329.21Zm4.33-136h0A8,8,0,0,1,94,197.57l-14.78-6.12A8,8,0,0,1,74.92,181h0a8,8,0,0,1,10.45-4.33l14.78,6.13A8,8,0,0,1,104.48,193.24ZM197.57,418l-6.12,14.78a8,8,0,0,1-14.79-6.12l6.13-14.78A8,8,0,1,1,197.57,418ZM264,444a8,8,0,0,1-8,8h0a8,8,0,0,1-8-8V428a8,8,0,0,1,8-8h0a8,8,0,0,1,8,8Zm67-6.92h0a8,8,0,0,1-10.46-4.33L314.43,418a8,8,0,0,1,4.33-10.45h0a8,8,0,0,1,10.45,4.33l6.13,14.78A8,8,0,0,1,331,437.08Zm63.58-42.49h0a8,8,0,0,1-11.31,0L372,383.28A8,8,0,0,1,372,372h0a8,8,0,0,1,11.31,0l11.31,11.31A8,8,0,0,1,394.59,394.59ZM286.25,286.25,110.34,401.66,225.75,225.75,401.66,110.34ZM437.08,331h0a8,8,0,0,1-10.45,4.33l-14.78-6.13a8,8,0,0,1-4.33-10.45h0A8,8,0,0,1,418,314.43l14.78,6.12A8,8,0,0,1,437.08,331ZM444,264H428a8,8,0,0,1-8-8h0a8,8,0,0,1,8-8h16a8,8,0,0,1,8,8h0A8,8,0,0,1,444,264Z"],Php:[512,512,[],"solid","M170.322 349.808c-2.4-15.66-9-28.38-25.02-34.531c-6.27-2.4-11.7-6.78-17.88-9.54c-7.02-3.15-14.16-6.15-21.57-8.1c-5.61-1.5-10.83 1.02-14.16 5.94c-3.15 4.62-.87 8.97 1.77 12.84c2.97 4.35 6.27 8.49 9.6 12.57c5.52 6.78 11.37 13.29 16.74 20.161c5.13 6.57 9.51 13.86 8.76 22.56c-1.65 19.08-10.29 34.891-24.21 47.76c-1.53 1.38-4.23 2.37-6.21 2.19c-8.88-.96-16.95-4.32-23.46-10.53c-7.47-7.11-6.33-15.48 2.61-20.67c2.13-1.23 4.35-2.37 6.3-3.87c5.46-4.11 7.29-11.13 4.32-17.22c-1.41-2.94-3-6.12-5.34-8.25c-11.43-10.41-22.651-21.151-34.891-30.63C18.01 307.447 2.771 276.968.43 240.067c-2.64-40.981 6.87-79.231 28.5-114.242c8.19-13.29 17.73-25.951 32.37-32.52c9.96-4.47 20.88-6.99 31.531-9.78c29.311-7.71 58.89-13.5 89.401-8.34c26.28 4.41 45.511 17.94 54.331 43.77c5.79 16.89 7.17 34.35 5.37 52.231c-3.54 35.131-29.49 66.541-63.331 75.841c-14.67 4.02-22.68 1.77-31.5-10.44c-6.33-8.79-11.58-18.36-17.25-27.631c-.84-1.38-1.44-2.97-2.16-4.44c-.69-1.47-1.44-2.88-2.16-4.35c2.13 15.24 5.67 29.911 13.98 42.99c4.5 7.11 10.5 12.36 19.29 13.14c32.34 2.91 59.641-7.71 79.021-33.721c21.69-29.101 26.461-62.581 20.19-97.831c-1.23-6.96-3.3-13.77-4.77-20.7c-.99-4.47.78-7.77 5.19-9.33c2.04-.69 4.14-1.26 6.18-1.68c26.461-5.7 53.221-7.59 80.191-4.86c30.601 3.06 59.551 11.46 85.441 28.471c40.531 26.67 65.641 64.621 79.291 110.522c1.98 6.66 2.28 13.95 2.46 20.971c.12 4.68-2.88 5.91-6.45 2.97c-3.93-3.21-7.53-6.87-10.92-10.65c-3.15-3.57-5.67-7.65-8.73-11.4c-2.37-2.94-4.44-2.49-5.58 1.17c-.72 2.22-1.35 4.41-1.98 6.63c-7.08 25.26-18.24 48.3-36.33 67.711c-2.52 2.73-4.77 6.78-5.07 10.38c-.78 9.96-1.35 20.13-.39 30.06c1.98 21.331 5.07 42.57 7.47 63.871c1.35 12.03-2.52 19.11-13.83 23.281c-7.95 2.91-16.47 5.04-24.87 5.64c-13.38.93-26.88.27-40.32.27c-.36-15 .93-29.731-13.17-37.771c2.73-11.13 5.88-21.69 7.77-32.49c1.56-8.97.24-17.79-6.06-25.14c-5.91-6.93-13.32-8.82-20.101-4.86c-20.43 11.91-41.671 11.97-63.301 4.17c-9.93-3.6-16.86-1.56-22.351 7.5c-5.91 9.75-8.4 20.7-7.74 31.771c.84 13.95 3.27 27.75 5.13 41.64c1.02 7.77.15 9.78-7.56 11.76c-17.13 4.35-34.56 4.83-52.081 3.42c-.93-.09-1.86-.48-2.46-.63c-.87-14.55.66-29.671-16.68-37.411c7.68-16.29 6.63-33.18 3.99-50.07l-.06-.15zm-103.561-57.09c2.55-2.4 4.59-6.15 5.31-9.6c1.8-8.64-4.68-20.22-12.18-23.43c-3.99-1.74-7.47-1.11-10.29 2.07c-6.87 7.77-13.65 15.63-20.401 23.521c-1.14 1.35-2.16 2.94-2.97 4.53c-2.7 5.19-1.11 8.97 4.65 10.38c3.48.87 7.08 1.05 10.65 1.56c9.3-.9 18.3-2.46 25.23-9zm.78-86.371c-.03-6.18-5.19-11.34-11.28-11.37c-6.27-.03-11.67 5.58-11.46 11.76c.27 6.21 5.43 11.19 11.61 11.07c6.24-.09 11.22-5.19 11.16-11.43z"],Python:[448,512,[],"solid","M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"],Markdown:[32,32,[],"solid","m14 10l-4 3.5L6 10H4v12h4v-6l2 2l2-2v6h4V10zm12 6v-6h-4v6h-4l6 8l6-8z"],Microsoft:[448,512,[],"solid","M0 32h214.6v214.6H0V32zm233.4 0H448v214.6H233.4V32zM0 265.4h214.6V480H0V265.4zm233.4 0H448V480H233.4V265.4z"],Npm:[576,512,[],"solid","M288 288h-32v-64h32v64zm288-128v192H288v32H160v-32H0V160h576zm-416 32H32v128h64v-96h32v96h32V192zm160 0H192v160h64v-32h64V192zm224 0H352v128h64v-96h32v96h32v-96h32v96h32V192z"],Reddit:[512,512,[],"solid","M0 256C0 114.6 114.6 0 256 0S512 114.6 512 256s-114.6 256-256 256L37.1 512c-13.7 0-20.5-16.5-10.9-26.2L75 437C28.7 390.7 0 326.7 0 256zM349.6 153.6c23.6 0 42.7-19.1 42.7-42.7s-19.1-42.7-42.7-42.7c-20.6 0-37.8 14.6-41.8 34c-34.5 3.7-61.4 33-61.4 68.4l0 .2c-37.5 1.6-71.8 12.3-99 29.1c-10.1-7.8-22.8-12.5-36.5-12.5c-33 0-59.8 26.8-59.8 59.8c0 24 14.1 44.6 34.4 54.1c2 69.4 77.6 125.2 170.6 125.2s168.7-55.9 170.6-125.3c20.2-9.6 34.1-30.2 34.1-54c0-33-26.8-59.8-59.8-59.8c-13.7 0-26.3 4.6-36.4 12.4c-27.4-17-62.1-27.7-100-29.1l0-.2c0-25.4 18.9-46.5 43.4-49.9l0 0c4.4 18.8 21.3 32.8 41.5 32.8zM177.1 246.9c16.7 0 29.5 17.6 28.5 39.3s-13.5 29.6-30.3 29.6s-31.4-8.8-30.4-30.5s15.4-38.3 32.1-38.3zm190.1 38.3c1 21.7-13.7 30.5-30.4 30.5s-29.3-7.9-30.3-29.6c-1-21.7 11.8-39.3 28.5-39.3s31.2 16.6 32.1 38.3zm-48.1 56.7c-10.3 24.6-34.6 41.9-63 41.9s-52.7-17.3-63-41.9c-1.2-2.9 .8-6.2 3.9-6.5c18.4-1.9 38.3-2.9 59.1-2.9s40.7 1 59.1 2.9c3.1 .3 5.1 3.6 3.9 6.5z"],Rust:[512,512,[],"solid","M508.52,249.75,486.7,236.24c-.17-2-.34-3.93-.55-5.88l18.72-17.5a7.35,7.35,0,0,0-2.44-12.25l-24-9c-.54-1.88-1.08-3.78-1.67-5.64l15-20.83a7.35,7.35,0,0,0-4.79-11.54l-25.42-4.15c-.9-1.73-1.79-3.45-2.73-5.15l10.68-23.42a7.35,7.35,0,0,0-6.95-10.39l-25.82.91q-1.79-2.22-3.61-4.4L439,81.84A7.36,7.36,0,0,0,430.16,73L405,78.93q-2.17-1.83-4.4-3.61l.91-25.82a7.35,7.35,0,0,0-10.39-7L367.7,53.23c-1.7-.94-3.43-1.84-5.15-2.73L358.4,25.08a7.35,7.35,0,0,0-11.54-4.79L326,35.26c-1.86-.59-3.75-1.13-5.64-1.67l-9-24a7.35,7.35,0,0,0-12.25-2.44l-17.5,18.72c-1.95-.21-3.91-.38-5.88-.55L262.25,3.48a7.35,7.35,0,0,0-12.5,0L236.24,25.3c-2,.17-3.93.34-5.88.55L212.86,7.13a7.35,7.35,0,0,0-12.25,2.44l-9,24c-1.89.55-3.79,1.08-5.66,1.68l-20.82-15a7.35,7.35,0,0,0-11.54,4.79l-4.15,25.41c-1.73.9-3.45,1.79-5.16,2.73L120.88,42.55a7.35,7.35,0,0,0-10.39,7l.92,25.81c-1.49,1.19-3,2.39-4.42,3.61L81.84,73A7.36,7.36,0,0,0,73,81.84L78.93,107c-1.23,1.45-2.43,2.93-3.62,4.41l-25.81-.91a7.42,7.42,0,0,0-6.37,3.26,7.35,7.35,0,0,0-.57,7.13l10.66,23.41c-.94,1.7-1.83,3.43-2.73,5.16L25.08,153.6a7.35,7.35,0,0,0-4.79,11.54l15,20.82c-.59,1.87-1.13,3.77-1.68,5.66l-24,9a7.35,7.35,0,0,0-2.44,12.25l18.72,17.5c-.21,1.95-.38,3.91-.55,5.88L3.48,249.75a7.35,7.35,0,0,0,0,12.5L25.3,275.76c.17,2,.34,3.92.55,5.87L7.13,299.13a7.35,7.35,0,0,0,2.44,12.25l24,9c.55,1.89,1.08,3.78,1.68,5.65l-15,20.83a7.35,7.35,0,0,0,4.79,11.54l25.42,4.15c.9,1.72,1.79,3.45,2.73,5.14L42.56,391.12a7.35,7.35,0,0,0,.57,7.13,7.13,7.13,0,0,0,6.37,3.26l25.83-.91q1.77,2.22,3.6,4.4L73,430.16A7.36,7.36,0,0,0,81.84,439L107,433.07q2.18,1.83,4.41,3.61l-.92,25.82a7.35,7.35,0,0,0,10.39,6.95l23.43-10.68c1.69.94,3.42,1.83,5.14,2.73l4.15,25.42a7.34,7.34,0,0,0,11.54,4.78l20.83-15c1.86.6,3.76,1.13,5.65,1.68l9,24a7.36,7.36,0,0,0,12.25,2.44l17.5-18.72c1.95.21,3.92.38,5.88.55l13.51,21.82a7.35,7.35,0,0,0,12.5,0l13.51-21.82c2-.17,3.93-.34,5.88-.56l17.5,18.73a7.36,7.36,0,0,0,12.25-2.44l9-24c1.89-.55,3.78-1.08,5.65-1.68l20.82,15a7.34,7.34,0,0,0,11.54-4.78l4.15-25.42c1.72-.9,3.45-1.79,5.15-2.73l23.42,10.68a7.35,7.35,0,0,0,10.39-6.95l-.91-25.82q2.22-1.79,4.4-3.61L430.16,439a7.36,7.36,0,0,0,8.84-8.84L433.07,405q1.83-2.17,3.61-4.4l25.82.91a7.23,7.23,0,0,0,6.37-3.26,7.35,7.35,0,0,0,.58-7.13L458.77,367.7c.94-1.7,1.83-3.43,2.73-5.15l25.42-4.15a7.35,7.35,0,0,0,4.79-11.54l-15-20.83c.59-1.87,1.13-3.76,1.67-5.65l24-9a7.35,7.35,0,0,0,2.44-12.25l-18.72-17.5c.21-1.95.38-3.91.55-5.87l21.82-13.51a7.35,7.35,0,0,0,0-12.5Zm-151,129.08A13.91,13.91,0,0,0,341,389.51l-7.64,35.67A187.51,187.51,0,0,1,177,424.44l-7.64-35.66a13.87,13.87,0,0,0-16.46-10.68l-31.51,6.76a187.38,187.38,0,0,1-16.26-19.21H258.3c1.72,0,2.89-.29,2.89-1.91V309.55c0-1.57-1.17-1.91-2.89-1.91H213.47l.05-34.35H262c4.41,0,23.66,1.28,29.79,25.87,1.91,7.55,6.17,32.14,9.06,40,2.89,8.82,14.6,26.46,27.1,26.46H407a187.3,187.3,0,0,1-17.34,20.09Zm25.77,34.49A15.24,15.24,0,1,1,368,398.08h.44A15.23,15.23,0,0,1,383.24,413.32Zm-225.62-.68a15.24,15.24,0,1,1-15.25-15.25h.45A15.25,15.25,0,0,1,157.62,412.64ZM69.57,234.15l32.83-14.6a13.88,13.88,0,0,0,7.06-18.33L102.69,186h26.56V305.73H75.65A187.65,187.65,0,0,1,69.57,234.15ZM58.31,198.09a15.24,15.24,0,0,1,15.23-15.25H74a15.24,15.24,0,1,1-15.67,15.24Zm155.16,24.49.05-35.32h63.26c3.28,0,23.07,3.77,23.07,18.62,0,12.29-15.19,16.7-27.68,16.7ZM399,306.71c-9.8,1.13-20.63-4.12-22-10.09-5.78-32.49-15.39-39.4-30.57-51.4,18.86-11.95,38.46-29.64,38.46-53.26,0-25.52-17.49-41.59-29.4-49.48-16.76-11-35.28-13.23-40.27-13.23H116.32A187.49,187.49,0,0,1,221.21,70.06l23.47,24.6a13.82,13.82,0,0,0,19.6.44l26.26-25a187.51,187.51,0,0,1,128.37,91.43l-18,40.57A14,14,0,0,0,408,220.43l34.59,15.33a187.12,187.12,0,0,1,.4,32.54H423.71c-1.91,0-2.69,1.27-2.69,3.13v8.82C421,301,409.31,305.58,399,306.71ZM240,60.21A15.24,15.24,0,0,1,255.21,45h.45A15.24,15.24,0,1,1,240,60.21ZM436.84,214a15.24,15.24,0,1,1,0-30.48h.44a15.24,15.24,0,0,1-.44,30.48Z"],Unity:[16,16,[],"solid","M8 6.5L5 5l2-1V2L2 5v5l2-1V6.5L7 8v4.5L4 11l-2 1l6 3l6-3l-2-1l-3 1.5V8l3-1.5V9l2 1V5L9 2v2l2 1Z"],UnrealEngine:[24,24,[],"regular","M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0m0 23.52A11.52 11.52 0 1 1 23.52 12A11.52 11.52 0 0 1 12 23.52m7.13-9.791c-.206.997-1.126 3.557-4.06 4.942l-1.179-1.325l-1.988 2a7.34 7.34 0 0 1-5.804-2.978a3 3 0 0 0 .65.123c.326.006.678-.114.678-.66v-5.394a.89.89 0 0 0-1.116-.89c-.92.212-1.656 2.509-1.656 2.509a7.3 7.3 0 0 1 2.528-5.597a7.4 7.4 0 0 1 3.73-1.721c-1.006.573-1.57 1.507-1.57 2.29c0 1.262.76 1.109.984.923v7.28a1.2 1.2 0 0 0 .148.256a1.08 1.08 0 0 0 .88.445c.76 0 1.747-.868 1.747-.868V9.172c0-.6-.452-1.324-.905-1.572c0 0 .838-.149 1.484.346a6 6 0 0 1 .387-.425c1.508-1.48 2.929-1.902 4.112-2.112c0 0-2.151 1.69-2.151 3.96c0 1.687.043 5.801.043 5.801c.799.771 1.986-.342 3.059-1.441Z"],"UnrealEngine@solid":[24,24,[],"solid","M12 23c6.075 0 11-4.925 11-11S18.075 1 12 1S1 5.925 1 12s4.925 11 11 11m-8.442-9.416c.718-2.333 2.53-6.86 7.27-8.584v10.23c.179.18.645.54 1.076.54c.67 0 1.615-.54 1.615-.54V8.77c.555-1.16 3.123-3.232 4.847-3.232c-1.044 1.204-1.532 1.91-2.154 3.231v6.462c.718.18 2.154 0 3.23-1.077c-.87 1.98-3.23 4.308-4.307 4.308l-1.616-1.077L11.904 19c-1.615 0-4.308-1.077-5.385-2.692h1.616v-6.17c-1.96-.268-2.857.973-4.577 3.446"],Ubuntu:[576,512,[],"solid","M469.2 75A75.6 75.6 0 1 0 317.9 75a75.6 75.6 0 1 0 151.2 0zM154.2 240.7A75.6 75.6 0 1 0 3 240.7a75.6 75.6 0 1 0 151.2 0zM57 346C75.6 392.9 108 433 150 461.1s91.5 42.6 142 41.7c-14.7-18.6-22.9-41.5-23.2-65.2c-6.8-.9-13.3-2.1-19.5-3.4c-26.8-5.7-51.9-17.3-73.6-34s-39.3-38.1-51.7-62.5c-20.9 9.9-44.5 12.8-67.1 8.2zm395.1 89.8a75.6 75.6 0 1 0 -151.2 0 75.6 75.6 0 1 0 151.2 0zM444 351.6c18.5 14.8 31.6 35.2 37.2 58.2c33.3-41.3 52.6-92.2 54.8-145.2s-12.5-105.4-42.2-149.4c-8.6 21.5-24 39.6-43.8 51.6c15.4 28.6 22.9 60.8 21.9 93.2s-10.7 64-28 91.6zM101.1 135.4c12.4 2.7 24.3 7.5 35.1 14.3c16.6-24.2 38.9-44.1 64.8-58S255.8 70.4 285.2 70c.2-5.9 .9-11.9 2-17.7c3.6-16.7 11.1-32.3 21.8-45.5c-47.7-3.8-95.4 6-137.6 28.5S94.3 91.7 70.8 133.4c2.7-.2 5.3-.3 8-.3c7.5 0 15 .8 22.4 2.3z"],VsCode:[16,16,[],"solid","M11.5 11.19V4.8L7.3 7.99M1.17 6.07a.6.6 0 0 1-.01-.81L2 4.48c.14-.13.48-.18.73 0l2.39 1.83l5.55-5.09c.22-.22.61-.32 1.05-.08l2.8 1.34c.25.15.49.38.49.81v9.49c0 .28-.2.58-.42.7l-3.08 1.48c-.22.09-.64 0-.79-.14L5.11 9.69l-2.38 1.83c-.27.18-.6.13-.74 0l-.84-.77c-.22-.23-.2-.61.04-.84l2.1-1.9"],Windows:[448,512,[],"solid","M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"],Whatsapp:[448,512,[],"regular","M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"],"X-Twitter":[512,512,[],"regular","M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"],Keyboard:[576,512,[],"regular","M64 112c-8.8 0-16 7.2-16 16l0 256c0 8.8 7.2 16 16 16l448 0c8.8 0 16-7.2 16-16l0-256c0-8.8-7.2-16-16-16L64 112zM0 128C0 92.7 28.7 64 64 64l448 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128zM176 320l224 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-224 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm-72-72c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16zm64 96c0-8.8 7.2-16 16-16l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16zm16-96l16 0c8.8 0 16 7.2 16 16l0 16c0 8.8-7.2 16-16 16l-16 0c-8.8 0-16-7.2-16-16l0-16c0-8.8 7.2-16 16-16z"],IdCard:[576,512,[],"regular","M528 160l0 256c0 8.8-7.2 16-16 16l-192 0c0-44.2-35.8-80-80-80l-64 0c-44.2 0-80 35.8-80 80l-32 0c-8.8 0-16-7.2-16-16l0-256 480 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM272 256a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zm104-48c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0z"],BookUser:[576,512,[],"regular","M512 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l448 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM208 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm-32 32c-44.2 0-80 35.8-80 80c0 8.8 7.2 16 16 16l192 0c8.8 0 16-7.2 16-16c0-44.2-35.8-80-80-80l-64 0zM376 144c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0z"],Copy:[448,512,[],"regular","M384 336l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L400 115.9 400 320c0 8.8-7.2 16-16 16zM192 384l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9L366.1 14.1c-9-9-21.2-14.1-33.9-14.1L192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-32-48 0 0 32c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l32 0 0-48-32 0z"],Eye:[576,512,[],"regular","M288 80c-65.2 0-118.8 29.6-159.9 67.7C89.6 183.5 63 226 49.4 256c13.6 30 40.2 72.5 78.6 108.3C169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256c-13.6-30-40.2-72.5-78.6-108.3C406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 336c44.2 0 80-35.8 80-80s-35.8-80-80-80c-.7 0-1.3 0-2 0c1.3 5.1 2 10.5 2 16c0 35.3-28.7 64-64 64c-5.5 0-10.9-.7-16-2c0 .7 0 1.3 0 2c0 44.2 35.8 80 80 80zm0-208a128 128 0 1 1 0 256 128 128 0 1 1 0-256z"],EyeOff:[640,512,[],"regular","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zm151 118.3C226 97.7 269.5 80 320 80c65.2 0 118.8 29.6 159.9 67.7C518.4 183.5 545 226 558.6 256c-12.6 28-36.6 66.8-70.9 100.9l-53.8-42.2c9.1-17.6 14.2-37.5 14.2-58.7c0-70.7-57.3-128-128-128c-32.2 0-61.7 11.9-84.2 31.5l-46.1-36.1zM394.9 284.2l-81.5-63.9c4.2-8.5 6.6-18.2 6.6-28.3c0-5.5-.7-10.9-2-16c.7 0 1.3 0 2 0c44.2 0 80 35.8 80 80c0 9.9-1.8 19.4-5.1 28.2zm9.4 130.3C378.8 425.4 350.7 432 320 432c-65.2 0-118.8-29.6-159.9-67.7C121.6 328.5 95 286 81.4 256c8.3-18.4 21.5-41.5 39.4-64.8L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5l-41.9-33zM192 256c0 70.7 57.3 128 128 128c13.3 0 26.1-2 38.2-5.8L302 334c-23.5-5.4-43.1-21.2-53.7-42.3l-56.1-44.2c-.2 2.8-.3 5.6-.3 8.5z"],StickyNote:[448,512,[],"regular","M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l224 0 0-80c0-17.7 14.3-32 32-32l80 0 0-224c0-8.8-7.2-16-16-16L64 80zM288 480L64 480c-35.3 0-64-28.7-64-64L0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 224 0 5.5c0 17-6.7 33.3-18.7 45.3l-90.5 90.5c-12 12-28.3 18.7-45.3 18.7l-5.5 0z"],CreditCard:[576,512,[],"regular","M512 80c8.8 0 16 7.2 16 16l0 32L48 128l0-32c0-8.8 7.2-16 16-16l448 0zm16 144l0 192c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16l0-192 480 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l448 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm56 304c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0zm128 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l112 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-112 0z"],Hourglass:[384,512,[],"regular","M24 0C10.7 0 0 10.7 0 24S10.7 48 24 48l8 0 0 19c0 40.3 16 79 44.5 107.5L158.1 256 76.5 337.5C48 366 32 404.7 32 445l0 19-8 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l336 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0-19c0-40.3-16-79-44.5-107.5L225.9 256l81.5-81.5C336 146 352 107.3 352 67l0-19 8 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 0zM192 289.9l81.5 81.5C293 391 304 417.4 304 445l0 19L80 464l0-19c0-27.6 11-54 30.5-73.5L192 289.9zm0-67.9l-81.5-81.5C91 121 80 94.6 80 67l0-19 224 0 0 19c0 27.6-11 54-30.5 73.5L192 222.1z"],Bell:[448,512,[],"solid","M224 0c-17.7 0-32 14.3-32 32l0 19.2C119 66 64 130.6 64 208l0 18.8c0 47-17.3 92.4-48.5 127.6l-7.4 8.3c-8.4 9.4-10.4 22.9-5.3 34.4S19.4 416 32 416l384 0c12.6 0 24-7.4 29.2-18.9s3.1-25-5.3-34.4l-7.4-8.3C401.3 319.2 384 273.9 384 226.8l0-18.8c0-77.4-55-142-128-156.8L256 32c0-17.7-14.3-32-32-32zm45.3 493.3c12-12 18.7-28.3 18.7-45.3l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7z"],BellOff:[640,512,[],"solid","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-90.2-70.7c.2-.4 .4-.9 .6-1.3c5.2-11.5 3.1-25-5.3-34.4l-7.4-8.3C497.3 319.2 480 273.9 480 226.8l0-18.8c0-77.4-55-142-128-156.8L352 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 19.2c-42.6 8.6-79 34.2-102 69.3L38.8 5.1zM406.2 416L160 222.1l0 4.8c0 47-17.3 92.4-48.5 127.6l-7.4 8.3c-8.4 9.4-10.4 22.9-5.3 34.4S115.4 416 128 416l278.2 0zm-40.9 77.3c12-12 18.7-28.3 18.7-45.3l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7z"],Compass:[512,512,[],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm50.7-186.9L162.4 380.6c-19.4 7.5-38.5-11.6-31-31l55.5-144.3c3.3-8.5 9.9-15.1 18.4-18.4l144.3-55.5c19.4-7.5 38.5 11.6 31 31L325.1 306.7c-3.2 8.5-9.9 15.1-18.4 18.4zM288 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"],File:[384,512,[],"solid","M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128z"],MessageCircle:[512,512,[],"solid","M512 240c0 114.9-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6C73.6 471.1 44.7 480 16 480c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.3-.3c.3-.3 .7-.7 1.3-1.4c1.1-1.2 2.8-3.1 4.9-5.7c4.1-5 9.6-12.4 15.2-21.6c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208z"],Inbox:[512,512,[],"solid","M121 32C91.6 32 66 52 58.9 80.5L1.9 308.4C.6 313.5 0 318.7 0 323.9L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-92.1c0-5.2-.6-10.4-1.9-15.5l-57-227.9C446 52 420.4 32 391 32L121 32zm0 64l270 0 48 192-51.2 0c-12.1 0-23.2 6.8-28.6 17.7l-14.3 28.6c-5.4 10.8-16.5 17.7-28.6 17.7l-120.4 0c-12.1 0-23.2-6.8-28.6-17.7l-14.3-28.6c-5.4-10.8-16.5-17.7-28.6-17.7L73 288 121 96z"],Mail:[512,512,[],"solid","M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"],MailOpen:[512,512,[],"solid","M64 208.1L256 65.9 448 208.1l0 47.4L289.5 373c-9.7 7.2-21.4 11-33.5 11s-23.8-3.9-33.5-11L64 255.5l0-47.4zM256 0c-12.1 0-23.8 3.9-33.5 11L25.9 156.7C9.6 168.8 0 187.8 0 208.1L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-239.9c0-20.3-9.6-39.4-25.9-51.4L289.5 11C279.8 3.9 268.1 0 256 0z"],Mic:[384,512,[],"solid","M192 0C139 0 96 43 96 96l0 160c0 53 43 96 96 96s96-43 96-96l0-160c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40z"],MicOff:[640,512,[],"solid","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L472.1 344.7c15.2-26 23.9-56.3 23.9-88.7l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 21.2-5.1 41.1-14.2 58.7L416 300.8 416 96c0-53-43-96-96-96s-96 43-96 96l0 54.3L38.8 5.1zM344 430.4c20.4-2.8 39.7-9.1 57.3-18.2l-43.1-33.9C346.1 382 333.3 384 320 384c-70.7 0-128-57.3-128-128l0-8.7L144.7 210c-.5 1.9-.7 3.9-.7 6l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6z"],Link:[640,512,["Chain"],"solid","M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"],House:[576,512,[],"solid","M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c0 2.7-.2 5.4-.5 8.1l0 16.2c0 22.1-17.9 40-40 40l-16 0c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1L416 512l-24 0c-22.1 0-40-17.9-40-40l0-24 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 64 0 24c0 22.1-17.9 40-40 40l-24 0-31.9 0c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2l-16 0c-22.1 0-40-17.9-40-40l0-112c0-.9 0-1.9 .1-2.8l0-69.7-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"],Gamepad:[640,512,[],"solid","M192 64C86 64 0 150 0 256S86 448 192 448l256 0c106 0 192-86 192-192s-86-192-192-192L192 64zM496 168a40 40 0 1 1 0 80 40 40 0 1 1 0-80zM392 304a40 40 0 1 1 80 0 40 40 0 1 1 -80 0zM168 200c0-13.3 10.7-24 24-24s24 10.7 24 24l0 32 32 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-32 0 0 32c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-32-32 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l32 0 0-32z"],Camera:[512,512,[],"solid","M149.1 64.8L138.7 96 64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-74.7 0L362.9 64.8C356.4 45.2 338.1 32 317.4 32L194.6 32c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"],Printer:[512,512,[],"solid","M128 0C92.7 0 64 28.7 64 64l0 96 64 0 0-96 226.7 0L384 93.3l0 66.7 64 0 0-66.7c0-17-6.7-33.3-18.7-45.3L400 18.7C388 6.7 371.7 0 354.7 0L128 0zM384 352l0 32 0 64-256 0 0-64 0-16 0-16 256 0zm64 32l32 0c17.7 0 32-14.3 32-32l0-96c0-35.3-28.7-64-64-64L64 192c-35.3 0-64 28.7-64 64l0 96c0 17.7 14.3 32 32 32l32 0 0 64c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-64zM432 248a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"],Server:[512,512,[],"solid","M64 32C28.7 32 0 60.7 0 96l0 64c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-64c0-35.3-28.7-64-64-64L64 32zm280 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm48 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0zM64 288c-35.3 0-64 28.7-64 64l0 64c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-64c0-35.3-28.7-64-64-64L64 288zm280 72a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm56 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"],Calendar:[448,512,[],"solid","M96 32l0 32L48 64C21.5 64 0 85.5 0 112l0 48 448 0 0-48c0-26.5-21.5-48-48-48l-48 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32L160 64l0-32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192L0 192 0 464c0 26.5 21.5 48 48 48l352 0c26.5 0 48-21.5 48-48l0-272z"],Pipette:[512,512,[],"solid","M341.6 29.2L240.1 130.8l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4L482.8 170.4c39-39 39-102.2 0-141.1s-102.2-39-141.1 0zM55.4 323.3c-15 15-23.4 35.4-23.4 56.6l0 42.4L5.4 462.2c-8.5 12.7-6.8 29.6 4 40.4s27.7 12.5 40.4 4L89.7 480l42.4 0c21.2 0 41.6-8.4 56.6-23.4L309.4 335.9l-45.3-45.3L143.4 411.3c-3 3-7.1 4.7-11.3 4.7L96 416l0-36.1c0-4.2 1.7-8.3 4.7-11.3L221.4 247.9l-45.3-45.3L55.4 323.3z"],Scroll:[576,512,[],"solid","M0 80l0 48c0 17.7 14.3 32 32 32l16 0 48 0 0-80c0-26.5-21.5-48-48-48S0 53.5 0 80zM112 32c10 13.4 16 30 16 48l0 304c0 35.3 28.7 64 64 64s64-28.7 64-64l0-5.3c0-32.4 26.3-58.7 58.7-58.7L480 320l0-192c0-53-43-96-96-96L112 32zM464 480c61.9 0 112-50.1 112-112c0-8.8-7.2-16-16-16l-245.3 0c-14.7 0-26.7 11.9-26.7 26.7l0 5.3c0 53-43 96-96 96l176 0 96 0z"],Smartphone:[384,512,[],"solid","M16 64C16 28.7 44.7 0 80 0L304 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L80 512c-35.3 0-64-28.7-64-64L16 64zM144 448c0 8.8 7.2 16 16 16l64 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-64 0c-8.8 0-16 7.2-16 16zM304 64L80 64l0 320 224 0 0-320z"],Settings:[512,512,[],"solid","M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"],Map:[576,512,[],"solid","M384 476.1L192 421.2l0-385.3L384 90.8l0 385.3zm32-1.2l0-386.5L543.1 37.5c15.8-6.3 32.9 5.3 32.9 22.3l0 334.8c0 9.8-6 18.6-15.1 22.3L416 474.8zM15.1 95.1L160 37.2l0 386.5L32.9 474.5C17.1 480.8 0 469.2 0 452.2L0 117.4c0-9.8 6-18.6 15.1-22.3z"],Folder:[512,512,[],"solid","M64 480H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H288c-10.1 0-19.6-4.7-25.6-12.8L243.2 57.6C231.1 41.5 212.1 32 192 32H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64z"],FolderOpen:[576,512,[],"solid","M384 480l48 0c11.4 0 21.9-6 27.6-15.9l112-192c5.8-9.9 5.8-22.1 .1-32.1S555.5 224 544 224l-400 0c-11.4 0-21.9 6-27.6 15.9L48 357.1 48 96c0-8.8 7.2-16 16-16l117.5 0c4.2 0 8.3 1.7 11.3 4.7l26.5 26.5c21 21 49.5 32.8 79.2 32.8L416 144c8.8 0 16 7.2 16 16l0 32 48 0 0-32c0-35.3-28.7-64-64-64L298.5 96c-17 0-33.3-6.7-45.3-18.7L226.7 50.7c-12-12-28.3-18.7-45.3-18.7L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l23.7 0L384 480z"],FolderClosed:[512,512,[],"solid","M448 480L64 480c-35.3 0-64-28.7-64-64L0 192l512 0 0 224c0 35.3-28.7 64-64 64zm64-320L0 160 0 96C0 60.7 28.7 32 64 32l128 0c20.1 0 39.1 9.5 51.2 25.6l19.2 25.6c6 8.1 15.5 12.8 25.6 12.8l160 0c35.3 0 64 28.7 64 64z"],Function:[384,512,[],"solid","M314.7 32c-38.8 0-73.7 23.3-88.6 59.1L170.7 224 64 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l80 0L98.9 396.3c-5 11.9-16.6 19.7-29.5 19.7L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l37.3 0c38.8 0 73.7-23.3 88.6-59.1L213.3 288 320 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-80 0 45.1-108.3c5-11.9 16.6-19.7 29.5-19.7L352 96c17.7 0 32-14.3 32-32s-14.3-32-32-32l-37.3 0z"],Stop:[384,512,[],"solid","M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"],Image:[512,512,[],"solid","M448 80c8.8 0 16 7.2 16 16l0 319.8-5-6.5-136-176c-4.5-5.9-11.6-9.3-19-9.3s-14.4 3.4-19 9.3L202 340.7l-30.5-42.7C167 291.7 159.8 288 152 288s-15 3.7-19.5 10.1l-80 112L48 416.3l0-.3L48 96c0-8.8 7.2-16 16-16l384 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm80 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"],Images:[576,512,[],"solid","M160 80l352 0c8.8 0 16 7.2 16 16l0 224c0 8.8-7.2 16-16 16l-21.2 0L388.1 178.9c-4.4-6.8-12-10.9-20.1-10.9s-15.7 4.1-20.1 10.9l-52.2 79.8-12.4-16.9c-4.5-6.2-11.7-9.8-19.4-9.8s-14.8 3.6-19.4 9.8L175.6 336 160 336c-8.8 0-16-7.2-16-16l0-224c0-8.8 7.2-16 16-16zM96 96l0 224c0 35.3 28.7 64 64 64l352 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L160 32c-35.3 0-64 28.7-64 64zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120L0 344c0 75.1 60.9 136 136 136l320 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-320 0c-48.6 0-88-39.4-88-88l0-224zm208 24a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"],Info:[512,512,[],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"],Bone:[576,512,[],"solid","M153.7 144.8c6.9 16.3 20.6 31.2 38.3 31.2l192 0c17.7 0 31.4-14.9 38.3-31.2C434.4 116.1 462.9 96 496 96c44.2 0 80 35.8 80 80c0 30.4-17 56.9-42 70.4c-3.6 1.9-6 5.5-6 9.6s2.4 7.7 6 9.6c25 13.5 42 40 42 70.4c0 44.2-35.8 80-80 80c-33.1 0-61.6-20.1-73.7-48.8C415.4 350.9 401.7 336 384 336l-192 0c-17.7 0-31.4 14.9-38.3 31.2C141.6 395.9 113.1 416 80 416c-44.2 0-80-35.8-80-80c0-30.4 17-56.9 42-70.4c3.6-1.9 6-5.5 6-9.6s-2.4-7.7-6-9.6C17 232.9 0 206.4 0 176c0-44.2 35.8-80 80-80c33.1 0 61.6 20.1 73.7 48.8z"],Puzzle:[512,512,[],"solid","M192 104.8c0-9.2-5.8-17.3-13.2-22.8C167.2 73.3 160 61.3 160 48c0-26.5 28.7-48 64-48s64 21.5 64 48c0 13.3-7.2 25.3-18.8 34c-7.4 5.5-13.2 13.6-13.2 22.8c0 12.8 10.4 23.2 23.2 23.2l56.8 0c26.5 0 48 21.5 48 48l0 56.8c0 12.8 10.4 23.2 23.2 23.2c9.2 0 17.3-5.8 22.8-13.2c8.7-11.6 20.7-18.8 34-18.8c26.5 0 48 28.7 48 64s-21.5 64-48 64c-13.3 0-25.3-7.2-34-18.8c-5.5-7.4-13.6-13.2-22.8-13.2c-12.8 0-23.2 10.4-23.2 23.2L384 464c0 26.5-21.5 48-48 48l-56.8 0c-12.8 0-23.2-10.4-23.2-23.2c0-9.2 5.8-17.3 13.2-22.8c11.6-8.7 18.8-20.7 18.8-34c0-26.5-28.7-48-64-48s-64 21.5-64 48c0 13.3 7.2 25.3 18.8 34c7.4 5.5 13.2 13.6 13.2 22.8c0 12.8-10.4 23.2-23.2 23.2L48 512c-26.5 0-48-21.5-48-48L0 343.2C0 330.4 10.4 320 23.2 320c9.2 0 17.3 5.8 22.8 13.2C54.7 344.8 66.7 352 80 352c26.5 0 48-28.7 48-64s-21.5-64-48-64c-13.3 0-25.3 7.2-34 18.8C40.5 250.2 32.4 256 23.2 256C10.4 256 0 245.6 0 232.8L0 176c0-26.5 21.5-48 48-48l120.8 0c12.8 0 23.2-10.4 23.2-23.2z"],Lock:[448,512,[],"solid","M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"],LockOpen:[576,512,[],"solid","M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z"],Shuffle:[512,512,[],"solid","M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-10.1 0-19.6 4.7-25.6 12.8L284 229.3 244 176l31.2-41.6C293.3 110.2 321.8 96 352 96l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6zM164 282.7L204 336l-31.2 41.6C154.7 401.8 126.2 416 96 416l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c10.1 0 19.6-4.7 25.6-12.8L164 282.7zm274.6 188c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z"],Play:[384,512,[],"solid","M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"],Pause:[320,512,[],"solid","M48 64C21.5 64 0 85.5 0 112L0 400c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48L48 64zm192 0c-26.5 0-48 21.5-48 48l0 288c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48l-32 0z"],LogIn:[512,512,[],"solid","M352 96l64 0c17.7 0 32 14.3 32 32l0 256c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0c53 0 96-43 96-96l0-256c0-53-43-96-96-96l-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32zm-9.4 182.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L242.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"],LogOut:[512,512,[],"solid","M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 192 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128zM160 96c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 32C43 32 0 75 0 128L0 384c0 53 43 96 96 96l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l64 0z"],MousePointer:[320,512,[],"solid","M0 55.2L0 426c0 12.2 9.9 22 22 22c6.3 0 12.4-2.7 16.6-7.5L121.2 346l58.1 116.3c7.9 15.8 27.1 22.2 42.9 14.3s22.2-27.1 14.3-42.9L179.8 320l118.1 0c12.2 0 22.1-9.9 22.1-22.1c0-6.3-2.7-12.3-7.4-16.5L38.6 37.9C34.3 34.1 28.9 32 23.2 32C10.4 32 0 42.4 0 55.2z"],User:[512,512,[],"solid","M256 288A144 144 0 1 0 256 0a144 144 0 1 0 0 288zm-94.7 32C72.2 320 0 392.2 0 481.3c0 17 13.8 30.7 30.7 30.7l450.6 0c17 0 30.7-13.8 30.7-30.7C512 392.2 439.8 320 350.7 320l-189.4 0z"],HardDriveDownload:[512,512,[],"solid","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"],HardDriveUpload:[512,512,[],"solid","M288 109.3L288 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-242.7-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0l128 128c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L288 109.3zM64 352l128 0c0 35.3 28.7 64 64 64s64-28.7 64-64l128 0c35.3 0 64 28.7 64 64l0 32c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64l0-32c0-35.3 28.7-64 64-64zM432 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"],CircleCheck:[512,512,["CheckCircle2"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"],CirclePlay:[512,512,[],"solid","M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"],CirclePause:[512,512,[],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM224 192l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32zm128 0l0 128c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32s32 14.3 32 32z"],CirclePlus:[512,512,["PlusCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"],CircleMinus:[512,512,["MinusCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM184 232l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"],CircleStop:[512,512,[],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 160l128 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32z"],CircleDot:[512,512,[],"solid","M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"],CircleHelp:[512,512,["HelpCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"],CircleArrowUp:[512,512,["ArrowUpCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM385 215c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-71-71L280 392c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-214.1-71 71c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 103c9.4-9.4 24.6-9.4 33.9 0L385 215z"],CircleArrowDown:[512,512,["ArrowDownCircle"],"solid","M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM127 297c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l71 71L232 120c0-13.3 10.7-24 24-24s24 10.7 24 24l0 214.1 71-71c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L273 409c-9.4 9.4-24.6 9.4-33.9 0L127 297z"],CircleArrowLeft:[512,512,["ArrowLeftCircle"],"solid","M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM215 127c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-71 71L392 232c13.3 0 24 10.7 24 24s-10.7 24-24 24l-214.1 0 71 71c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L103 273c-9.4-9.4-9.4-24.6 0-33.9L215 127z"],CircleArrowRight:[512,512,["ArrowRightCircle"],"solid","M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM297 385c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l71-71L120 280c-13.3 0-24-10.7-24-24s10.7-24 24-24l214.1 0-71-71c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L409 239c9.4 9.4 9.4 24.6 0 33.9L297 385z"],CircleAlert:[512,512,["AlertCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"],CircleUser:[512,512,["UserCircle"],"solid","M399 384.2C376.9 345.8 335.4 320 288 320l-64 0c-47.4 0-88.9 25.8-111 64.2c35.2 39.2 86.2 63.8 143 63.8s107.8-24.7 143-63.8zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256 16a72 72 0 1 0 0-144 72 72 0 1 0 0 144z"],CircleChevronRight:[512,512,["ChevronRightCircle"],"solid","M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM241 377c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l87-87-87-87c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L345 239c9.4 9.4 9.4 24.6 0 33.9L241 377z"],CircleChevronDown:[512,512,["ChevronDownCircle"],"solid","M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM135 241c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l87 87 87-87c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L273 345c-9.4 9.4-24.6 9.4-33.9 0L135 241z"],CircleChevronUp:[512,512,["ChevronUpCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM377 271c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-87-87-87 87c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 167c9.4-9.4 24.6-9.4 33.9 0L377 271z"],CircleChevronLeft:[512,512,["ChevronLeftCircle"],"solid","M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM271 135c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-87 87 87 87c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0L167 273c-9.4-9.4-9.4-24.6 0-33.9L271 135z"],CircleX:[512,512,["XCircle"],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"],Apple:[384,512,[],"solid","M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"],Chrome:[512,512,[],"solid","M0 256C0 209.4 12.47 165.6 34.27 127.1L144.1 318.3C166 357.5 207.9 384 256 384C270.3 384 283.1 381.7 296.8 377.4L220.5 509.6C95.9 492.3 0 385.3 0 256zM365.1 321.6C377.4 302.4 384 279.1 384 256C384 217.8 367.2 183.5 340.7 160H493.4C505.4 189.6 512 222.1 512 256C512 397.4 397.4 511.1 256 512L365.1 321.6zM477.8 128H256C193.1 128 142.3 172.1 130.5 230.7L54.19 98.47C101 38.53 174 0 256 0C350.8 0 433.5 51.48 477.8 128V128zM168 256C168 207.4 207.4 168 256 168C304.6 168 344 207.4 344 256C344 304.6 304.6 344 256 344C207.4 344 168 304.6 168 256z"],Facebook:[512,512,[],"solid","M512 256C512 114.6 397.4 0 256 0S0 114.6 0 256C0 376 82.7 476.8 194.2 504.5V334.2H141.4V256h52.8V222.3c0-87.1 39.4-127.5 125-127.5c16.2 0 44.2 3.2 55.7 6.4V172c-6-.6-16.5-1-29.6-1c-42 0-58.2 15.9-58.2 57.2V256h83.6l-14.4 78.2H287V510.1C413.8 494.8 512 386.9 512 256h0z"],Github:[496,512,[],"solid","M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"],Youtube:[576,512,[],"solid","M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"],"CircleRight@solid":[512,512,[],"solid","M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zm395.3 11.3l-112 112c-4.6 4.6-11.5 5.9-17.4 3.5s-9.9-8.3-9.9-14.8l0-64-96 0c-17.7 0-32-14.3-32-32l0-32c0-17.7 14.3-32 32-32l96 0 0-64c0-6.5 3.9-12.3 9.9-14.8s12.9-1.1 17.4 3.5l112 112c6.2 6.2 6.2 16.4 0 22.6z"],"CircleUp@solid":[512,512,[],"solid","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm11.3-395.3l112 112c4.6 4.6 5.9 11.5 3.5 17.4s-8.3 9.9-14.8 9.9l-64 0 0 96c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32l0-96-64 0c-6.5 0-12.3-3.9-14.8-9.9s-1.1-12.9 3.5-17.4l112-112c6.2-6.2 16.4-6.2 22.6 0z"],"CircleLeft@solid":[512,512,[],"solid","M512 256A256 256 0 1 0 0 256a256 256 0 1 0 512 0zM116.7 244.7l112-112c4.6-4.6 11.5-5.9 17.4-3.5s9.9 8.3 9.9 14.8l0 64 96 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32l-96 0 0 64c0 6.5-3.9 12.3-9.9 14.8s-12.9 1.1-17.4-3.5l-112-112c-6.2-6.2-6.2-16.4 0-22.6z"],"CircleDown@solid":[512,512,[],"solid","M256 0a256 256 0 1 0 0 512A256 256 0 1 0 256 0zM244.7 395.3l-112-112c-4.6-4.6-5.9-11.5-3.5-17.4s8.3-9.9 14.8-9.9l64 0 0-96c0-17.7 14.3-32 32-32l32 0c17.7 0 32 14.3 32 32l0 96 64 0c6.5 0 12.3 3.9 14.8 9.9s1.1 12.9-3.5 17.4l-112 112c-6.2 6.2-16.4 6.2-22.6 0z"],"PaperPlane@solid":[512,512,[],"solid","M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480l0-83.6c0-4 1.5-7.8 4.2-10.8L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z"]};e.LX.LucideIconAlias={Stop:"Square",Refresh:"RefreshCw",Left:"ChevronLeft",Right:"ChevronRight",Up:"ChevronUp",Down:"ChevronDown",MenuArrows:"ChevronsUpDown",RotateForward:"RotateCw",RotateRight:"RotateCw",RotateBack:"RotateCcw",RotateLeft:"RotateCcw"},e.LX.ICONS=(()=>{const e={};for(let t in o){o[t][2].forEach(s=>e[s]=t)}return{...o,...e}})();class n{name;value;domEvent;constructor(e,t,s){this.name=e,this.value=t,this.domEvent=s}}var i;e.LX.IEvent=n,e.ComponentType=void 0,(i=e.ComponentType||(e.ComponentType={}))[i.NONE=0]="NONE",i[i.TEXT=1]="TEXT",i[i.TEXTAREA=2]="TEXTAREA",i[i.BUTTON=3]="BUTTON",i[i.SELECT=4]="SELECT",i[i.CHECKBOX=5]="CHECKBOX",i[i.TOGGLE=6]="TOGGLE",i[i.RADIO=7]="RADIO",i[i.BUTTONS=8]="BUTTONS",i[i.COLOR=9]="COLOR",i[i.RANGE=10]="RANGE",i[i.NUMBER=11]="NUMBER",i[i.TITLE=12]="TITLE",i[i.VECTOR=13]="VECTOR",i[i.TREE=14]="TREE",i[i.PROGRESS=15]="PROGRESS",i[i.FILE=16]="FILE",i[i.LAYERS=17]="LAYERS",i[i.ARRAY=18]="ARRAY",i[i.LIST=19]="LIST",i[i.TAGS=20]="TAGS",i[i.CURVE=21]="CURVE",i[i.CARD=22]="CARD",i[i.IMAGE=23]="IMAGE",i[i.CONTENT=24]="CONTENT",i[i.CUSTOM=25]="CUSTOM",i[i.SEPARATOR=26]="SEPARATOR",i[i.KNOB=27]="KNOB",i[i.SIZE=28]="SIZE",i[i.OTP=29]="OTP",i[i.PAD=30]="PAD",i[i.FORM=31]="FORM",i[i.DIAL=32]="DIAL",i[i.COUNTER=33]="COUNTER",i[i.TABLE=34]="TABLE",i[i.TABS=35]="TABS",i[i.DATE=36]="DATE",i[i.MAP2D=37]="MAP2D",i[i.LABEL=39]="LABEL",i[i.BLANK=40]="BLANK",i[i.RATE=41]="RATE",e.LX.ComponentType=e.ComponentType;class a{type;name;customName;options;root;customIdx=-1;disabled=!1;onSetValue;onGetValue;onAllowPaste;onResize;onSetDisabled;_initialValue;static NO_CONTEXT_TYPES=[e.ComponentType.BUTTON,e.ComponentType.LIST,e.ComponentType.FILE,e.ComponentType.PROGRESS];constructor(t,s,o,n={}){this.type=t,this.name=s,this.options=n,this._initialValue=o;const i=e.LX.makeElement("div",e.LX.mergeClass("lexcomponent flex flex-row outline-none items-center text-foreground text-sm overflow-hidden min-h-8 pad-sm",n.className));if(this.onResize=()=>{},n.id&&(i.id=n.id),n.title&&(i.title=n.title),t!=e.ComponentType.TITLE&&(n.width&&(i.style.width=i.style.minWidth=n.width),n.maxWidth&&(i.style.maxWidth=n.maxWidth),n.minWidth&&(i.style.minWidth=n.minWidth),n.height&&(i.style.height=i.style.minHeight=n.height),e.LX.componentResizeObserver.observe(i)),null!=s){if(!n.hideName){let t=e.LX.makeElement("div","lexcomponentname flex text-sm text-secondary-foreground justify-between whitespace-nowrap overflow-hidden",s);n.justifyName&&t.classList.add("float-"+n.justifyName),t.title=n.title??t.innerHTML,t.style.width=n.nameWidth||e.LX.DEFAULT_NAME_WIDTH,t.style.minWidth=t.style.width,i.appendChild(t),i.domName=t;const a=this;t.addEventListener("contextmenu",function(e){e.preventDefault(),a.oncontextmenu(e)}),n.skipReset||null==o||this._addResetProperty(t,function(e,t){a.set(a._initialValue,!1,t),e.style.display="none"})}}else n.hideName=!0;n.signal&&e.LX.addSignal(n.signal,this),this.root=i,this.root.jsInstance=this,this.disabled=n.disabled??!1,this.options=n}static _dispatchEvent(e,t,s,o,n){let i=new CustomEvent(t,{detail:s,bubbles:o,cancelable:n});e.dispatchEvent(i)}_addResetProperty(t,s){const o=e.LX.makeIcon("Undo2",{iconClass:"ml-0 mr-1 px-1",title:"Reset"});return o.style.display="none",o.addEventListener("click",s.bind(o,o)),t.appendChild(o),o}_canPaste(){const t=navigator.clipboard;let s=this.type===e.ComponentType.CUSTOM?void 0!==t.customIdx&&this.customIdx==t.customIdx:t.type===this.type;return s=s&&!0!==this.disabled,this.onAllowPaste&&(s=this.onAllowPaste(s)),s}_trigger(e,t,s=this){t&&t.call(s,e.value,e.domEvent,e.name)}value(){if(this.onGetValue)return this.onGetValue();console.warn("Can't get value of "+this.typeName())}set(e,t,s){if(this.onSetValue){let o=this.root.querySelector(".lexcomponentname .lexicon");if(o){o.style.display=e!=this.value()?"block":"none";const t=e.constructor===Array?function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var s=0;s<e.length;++s)if(e[s]!==t[s])return!1;return!0}(e,this._initialValue):e==this._initialValue;o.style.display=t?"none":"block"}return this.onSetValue(e,t??!1,s)}console.warn(`Can't set value of ${this.typeName()}`)}oncontextmenu(t){a.NO_CONTEXT_TYPES.includes(this.type)||e.LX.addContextMenu(this.typeName(),t,e=>{e.add("Copy",()=>{this.copy()}),e.add("Paste",{disabled:!this._canPaste(),callback:()=>{this.paste()}})})}copy(){const e=navigator.clipboard;e.type=this.type,e.customIdx=this.customIdx,e.data=this.value(),e.writeText(e.data)}paste(){if(!this._canPaste())return;const e=navigator.clipboard;this.set(e.data)}typeName(){switch(this.type){case e.ComponentType.TEXT:return"Text";case e.ComponentType.TEXTAREA:return"TextArea";case e.ComponentType.BUTTON:return"Button";case e.ComponentType.SELECT:return"Select";case e.ComponentType.CHECKBOX:return"Checkbox";case e.ComponentType.TOGGLE:return"Toggle";case e.ComponentType.RADIO:return"Radio";case e.ComponentType.COLOR:return"Color";case e.ComponentType.RANGE:return"Range";case e.ComponentType.NUMBER:return"Number";case e.ComponentType.VECTOR:return"Vector";case e.ComponentType.TREE:return"Tree";case e.ComponentType.PROGRESS:return"Progress";case e.ComponentType.FILE:return"File";case e.ComponentType.LAYERS:return"Layers";case e.ComponentType.ARRAY:return"Array";case e.ComponentType.LIST:return"List";case e.ComponentType.TAGS:return"Tags";case e.ComponentType.CURVE:return"Curve";case e.ComponentType.KNOB:return"Knob";case e.ComponentType.SIZE:return"Size";case e.ComponentType.PAD:return"Pad";case e.ComponentType.FORM:return"Form";case e.ComponentType.DIAL:return"Dial";case e.ComponentType.COUNTER:return"Counter";case e.ComponentType.TABLE:return"Table";case e.ComponentType.TABS:return"Tabs";case e.ComponentType.DATE:return"Date";case e.ComponentType.MAP2D:return"Map2D";case e.ComponentType.RATE:return"Rate";case e.ComponentType.LABEL:return"Label";case e.ComponentType.BLANK:return"Blank";case e.ComponentType.CUSTOM:return this.customName}console.error(`Unknown Component type: ${this.type}`)}setDisabled(e){this.disabled=e,this.onSetDisabled&&this.onSetDisabled(e)}refresh(e){}}e.LX.BaseComponent=a;class r extends a{selectable=!1;callback;setState;swap;constructor(t,s,o,i={}){super(e.ComponentType.BUTTON,t,null,i),this.callback=o,this.selectable=i.selectable??this.selectable,this.onGetValue=()=>{const t=e.LX.hasClass(a,"selected"),o=a.querySelector("input");return o?o.checked:this.selectable?t:s},this.onSetValue=(t,s,o)=>{if(i.swap)this.setState(t,s);else if(a.innerHTML="",i.icon){const t=e.LX.makeIcon(i.icon);a.prepend(t)}else if(i.img){let e=document.createElement("img");e.src=i.img,a.prepend(e)}else a.innerHTML=`${t??""}`},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=`calc( 100% - ${t})`},this.setState=function(e,r){const l=a.querySelector("input");l?l.checked=e:this.selectable&&(i.parent&&i.parent.querySelectorAll(".lexbutton.selected").forEach(e=>{e!=a&&e.classList.remove("selected")}),a.classList.toggle("selected",e)),r||this._trigger(new n(t,l?l.checked:this.selectable?e:s,null),o)};var a=e.LX.makeElement("button",e.LX.mergeClass(["lexbutton","inline-flex","items-center","justify-center","whitespace-nowrap","transition-all","disabled:pointer-events-none","disabled:opacity-50","[&_svg]:pointer-events-none","shrink-0","[&_svg]:shrink-0","outline-none","select-none","cursor-pointer","font-medium","text-sm","border-1","h-9","px-2","overflow-hidden","bg-clip-padding"].join(" "),i.buttonClass??"outline"));if(a.disabled=this.disabled,a.title=i.tooltip?"":i.title??"",this.root.appendChild(a),i.selected&&a.classList.add("selected"),i.img){let e=document.createElement("img");e.src=i.img,a.prepend(e)}else if(i.icon){const t=e.LX.makeIcon(i.icon,{iconClass:i.iconClass,svgClass:i.svgClass}),o=i.iconPosition??"cover";"cover"==o||void 0!==i.swap?a.prepend(t):(a.innerHTML=`${s||""}`,"start"==o?a.prepend(t):a.appendChild(t)),a.classList.add("justify-center")}else a.innerHTML=`${s||""}`;if(i.fileInput){const e=document.createElement("input");e.type="file",e.className="file-input",e.style.display="none",a.appendChild(e),e.addEventListener("change",function(e){if(!e.target)return;const t=e.target.files;if(!t.length)return;const s=new FileReader;"text"===i.fileInputType?s.readAsText(t[0]):"buffer"===i.fileInputType?s.readAsArrayBuffer(t[0]):"bin"===i.fileInputType?s.readAsBinaryString(t[0]):"url"===i.fileInputType&&s.readAsDataURL(t[0]),s.onload=e=>{o.call(this,e.target?.result,t[0])}})}let r=a;if(i.swap){a.classList.add("swap"),a.querySelector("a").classList.add("swap-off");const t=document.createElement("input");t.className="p-0 border-0",t.type="checkbox",a.prepend(t);const s=e.LX.makeIcon(i.swap,{iconClass:"swap-on"});a.appendChild(s),this.swap=function(e){const t=a.querySelector("input");t.checked=!t.checked,e||r.click()}}r.addEventListener("click",r=>{let l;if(this.selectable&&(i.parent&&i.parent.querySelectorAll(".lexbutton.selected").forEach(e=>{e!=a&&e.classList.remove("selected")}),l=a.classList.toggle("selected")),i.fileInput)a.querySelector(".file-input").click();else if(i.mustConfirm){const l=a.querySelector("input");new e.LX.PopConfirm(a,{onConfirm:()=>{i.swap&&(l.checked=!0),this._trigger(new n(t,s,r),o)},side:i.confirmSide,align:i.confirmAlign,confirmText:i.confirmText,cancelText:i.confirmCancelText,title:i.confirmTitle,content:i.confirmContent}),i.swap&&(l.checked=!1)}else{const e=a.querySelector("input");this._trigger(new n(t,e?.checked??(this.selectable?l:s),r),o)}}),i.tooltip&&e.LX.asTooltip(a,i.title??t),e.LX.doAsync(this.onResize.bind(this))}click(){this.root.querySelector("button").click()}setSwapIcon(t){const s=this.root.querySelector(".swap-on");if(!s)return;const o=e.LX.makeIcon(t,{iconClass:"swap-on"});s.replaceWith(o)}}e.LX.Button=r;class l{root;siblingArea;buttonContainer;items=[];buttons={};icons={};shorts={};focused=!1;_currentDropdown;constructor(t,s={}){this.root=e.LX.makeElement("div","lexmenubar size-full bg-background text-foreground inline-flex gap-1 overflow-hidden text-sm font-medium"),s.float&&(this.root.className=e.LX.mergeClass(this.root.className,`justify-${s.float}`)),this.items=t??[],this.createEntries()}_resetMenubar(e){this.root.querySelectorAll(".lexmenuentry").forEach(e=>{e.classList.remove("selected"),delete e.dataset.built}),this._currentDropdown&&(this._currentDropdown.destroy(),this._currentDropdown=null),this.focused=e??!1}createEntries(){for(let t of this.items){let s=t.name,o=e.LX.getSupportedDOMName(s);if(this.root.querySelector("#"+o))continue;let n=document.createElement("div");n.className="lexmenuentry",n.id=o,n.innerHTML="<span>"+s+"</span>",n.tabIndex=1,this.root.appendChild(n);const i=()=>{this._resetMenubar(!0),n.classList.add("selected"),n.dataset.built="true",this._currentDropdown=e.LX.addDropdownMenu(n,t.submenu??[],{side:"bottom",align:"start",onBlur:()=>{this._resetMenubar()}})};n.addEventListener("mousedown",e=>{e.preventDefault()}),n.addEventListener("mouseup",e=>{e.preventDefault();const o=t.callback;if(!o)return i(),this.focused=!0,!1;o.call(this,s,n,e)}),n.addEventListener("mouseover",e=>{this.focused&&!n.dataset.built&&i()})}}getButton(e){return this.buttons[e]}getSubitem(e,t){for(const s of e)if(s?.name==t[0]){if(1==t.length)return s;if(s.submenu)return t.shift(),this.getSubitem(s.submenu,t)}}getItem(e){const t=e.split("/");return this.getSubitem(this.items,t)}setButtonIcon(t,s,o,n={}){if(!t)throw"Set Button Name!";let i=this.buttons[t];i&&(delete this.buttons[t],e.LX.deleteElement(i.root)),i=new r(t,void 0,o,{title:t,buttonClass:"lexmenubutton main bg-none",disabled:n.disabled,icon:s,svgClass:"xl",hideName:!0,swap:n.swap}),"right"==n.float&&(i.root.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(i.root):"left"==n.float?this.root.prepend(i.root):this.root.appendChild(i.root),this.buttons[t]=i}setButtonImage(e,t,s,o={}){if(!e)throw"Set Button Name!";let n=this.buttons[e];if(n)return void(n.querySelector("img").src=t);n=document.createElement("div");const i=o.disabled??!1;n.className="lexmenubutton main"+(i?" disabled":""),n.title=e,n.innerHTML="<a><image src='"+t+"' class='lexicon' style='height:32px;'></a>","right"==o.float&&(n.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(n):"left"==o.float?this.root.prepend(n):this.root.appendChild(n);const a=n.querySelector("a");a.addEventListener("mousedown",e=>{e.preventDefault()}),a.addEventListener("mouseup",e=>{s&&!i&&s.call(this,a,e)}),this.buttons[e]=n}addButtons(e,t={}){if(!e)throw"No buttons to add!";this.buttonContainer||(this.buttonContainer=document.createElement("div"),this.buttonContainer.className="lexmenubuttons",this.buttonContainer.classList.add(t.float??"center"),"right"==t.float&&(this.buttonContainer.right=!0),this.root.lastChild&&this.root.lastChild.right?this.root.lastChild.before(this.buttonContainer):this.root.appendChild(this.buttonContainer));for(const t of e){const e=t.title,s=new r(e,t.label,t.callback,{title:e,buttonClass:"ghost",disabled:t.disabled,icon:t.icon,hideName:!0,swap:t.swap,iconPosition:"start"});this.buttonContainer.appendChild(s.root),e&&(this.buttons[e]=s)}}}class c{static TAB_ID=0;root;area;tabs={};tabDOMs={};thumb;selected=null;folding=!1;folded=!1;onclose;constructor(t,s={}){this.onclose=s.onclose;let o=document.createElement("div");o.className="lexareatabs flex flex-row w-fit "+(s.fit?"fit":"row");const n=s.folding??!1;n&&o.classList.add("folding");let i=this;o.addEventListener("dragenter",function(e){e.preventDefault(),this.classList.add("dockingtab")}),o.addEventListener("dragleave",function(e){e.preventDefault(),this.contains(e.relatedTarget)||this.classList.remove("dockingtab")}),o.addEventListener("drop",function(e){e.preventDefault();const t=e.dataTransfer.getData("source"),s=document.getElementById(t);if(!s)return;const o=s.parentElement,n=e.target,a=n.getBoundingClientRect();e.offsetX<.5*a.width?this.insertBefore(s,n):n.nextElementSibling?this.insertBefore(s,n.nextElementSibling):this.appendChild(s);{o.childNodes.forEach((e,t)=>e.childIndex=t-1);const t=/true/.test(e.dataTransfer.getData("fit"));let s=null;if(o.childElementCount==(t?2:1))s=o.lastChild;else{s=o.querySelector(".selected")??o.childNodes[t?1:0]}s._forceSelect=!0,s.click()}this.childNodes.forEach((e,t)=>e.childIndex=t-1);const r=document.getElementById(t+"_content");i.area.attach(r),this.classList.remove("dockingtab"),s.instance=i,s._forceSelect=!0,s.click(),i.tabs[s.dataset.name]=r}),t.root.classList.add("lexareatabscontainer");const[a,r]=t.split({type:"vertical",sizes:s.sizes??"auto",resize:!1,top:2});if(a.attach(o),s.parentClass&&o.parentElement&&(o.parentElement.className=e.LX.mergeClass(o.parentElement.className,s.parentClass)),this.area=r,this.area.root.className+=" lexareatabscontent",s.contentClass&&(this.area.root.className=e.LX.mergeClass(this.area.root.className,s.contentClass)),this.selected=null,this.root=o,s.fit){let t=document.createElement("span");t.className="lexareatab thumb",this.thumb=t,this.root.appendChild(t);new ResizeObserver(t=>{const s=this.thumb.item;if(s){var o=this.thumb.style.transition;this.thumb.style.transition="none",this.thumb.style.transform="translate( "+s.childIndex*s.offsetWidth+"px )",this.thumb.style.width=s.offsetWidth+"px",e.LX.flushCss(this.thumb),this.thumb.style.transition=o}}).observe(this.area.root)}if(n){this.folded=!0,this.folding=n,"up"==n&&e.LX.insertChildAtIndex(t.root,t.sections[1].root,0);new ResizeObserver(e=>{for(const s of e){const e=s.contentRect,o=t.parentArea?.sections[0].root;o.style.height="calc(100% - "+(42+e.height)+"px )"}}).observe(this.area.root),this.area.root.classList.add("folded")}}add(t,s,o={}){let n=o.selected??!1;if(n){this.root.querySelectorAll("span").forEach(e=>e.classList.remove("selected"));(this.area.root.querySelector(":scope > .pseudoparent-tabs")??this.area.root).querySelectorAll(":scope > .lextabcontent").forEach(e=>e.style.display="none")}n=!Object.keys(this.tabs).length&&!this.folding||n;let i=s.root?s.root:s;if(i.originalDisplay=i.style.display,i.style.display=n?i.originalDisplay:"none",i.classList.add("lextabcontent"),o.icon)if(o.icon.includes(".")){const e="https://raw.githubusercontent.com/jxarco/lexgui.js/master/";o.icon="<img src='"+(e+o.icon)+"'>"}else{const t=o.icon.split(" ");o.icon=e.LX.makeIcon(t[0],{svgClass:"sm "+t.slice(0).join(" ")}).innerHTML}let a=document.createElement("span");if(a.dataset.name=t,a.className="lexareatab flex flex-row gap-1"+(n?" selected":""),a.innerHTML=(o.icon??"")+t,a.id=t.replace(/\s/g,"")+c.TAB_ID++,a.title=o.title??"",a.selected=n??!1,a.fixed=o.fixed,a.instance=this,i.id=a.id+"_content",o.badge){const t={};(o.badge.asChild??!1)&&(t.parent=a),a.innerHTML+=e.LX.badge(o.badge.content??"",o.badge.className,t)}a.selected&&(this.selected=t),a.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();const t=a.instance;if(!a.fixed){const e=a.selected;a.parentElement.querySelectorAll("span").forEach(e=>e.selected=!1),a.selected=!t.folding||!e||!!a._forceSelect,a.parentElement.querySelectorAll("span").forEach(e=>e.classList.remove("selected")),a.classList.toggle("selected",a.selected);(t.area.root.querySelector(":scope > .pseudoparent-tabs")??t.area.root).querySelectorAll(":scope > .lextabcontent").forEach(e=>e.style.display="none"),i.style.display=i.originalDisplay,t.selected=a.dataset.name}t.folding&&(t.folded=a.selected,t.area.root.classList.toggle("folded",!t.folded)),o.onSelect&&o.onSelect(e,a.dataset.name),t.thumb&&(t.thumb.style.transform="translate( "+a.childIndex*a.offsetWidth+"px )",t.thumb.style.width=a.offsetWidth+"px",t.thumb.item=a),delete a._forceSelect}),a.addEventListener("contextmenu",e=>{e.preventDefault(),e.stopPropagation(),o.onContextMenu&&o.onContextMenu(e,a.dataset.name)}),o.allowDelete&&(a.addEventListener("mousedown",t=>{t.button==e.LX.MOUSE_MIDDLE_CLICK&&t.preventDefault()}),a.addEventListener("mouseup",t=>{t.preventDefault(),t.stopPropagation(),t.button==e.LX.MOUSE_MIDDLE_CLICK&&this.delete(a.dataset.name)})),a.setAttribute("draggable",!0),a.addEventListener("dragstart",e=>{const t=!!this.thumb;a.parentElement.childNodes.length!=(t?2:1)?(e.dataTransfer.setData("source",e.target.id),e.dataTransfer.setData("fit",t)):e.preventDefault()});const r=o.indexOffset??-1;a.childIndex=this.root.childElementCount+r,e.LX.insertChildAtIndex(this.root,a,a.childIndex+1),this.area.attach(i),this.tabDOMs[t]=a,this.tabs[t]=s,setTimeout(()=>{o.onCreate&&o.onCreate.call(this,this.area.root.getBoundingClientRect()),n&&this.thumb&&(this.thumb.classList.add("no-transition"),this.thumb.style.transform="translate( "+a.childIndex*a.offsetWidth+"px )",this.thumb.style.width=a.offsetWidth+"px",this.thumb.item=a,this.thumb.classList.remove("no-transition"))},10)}select(e){this.tabDOMs[e]&&this.tabDOMs[e].click()}setIcon(t,s){const o=this.tabDOMs[t];if(!o)return;const n=s.split(" "),i=e.LX.makeIcon(n[0],{svgClass:"sm "+n.slice(0).join(" ")});o.innerHTML=i.innerHTML+t}delete(e){this.selected==e&&(this.selected=null);const t=this.tabDOMs[e];if(!t||t.fixed)return;this.onclose&&this.onclose(e),this.tabDOMs[e].remove(),delete this.tabDOMs[e],this.tabs[e].remove(),delete this.tabs[e];const s=this.root.lastChild;s&&!s.fixed&&this.root.lastChild.click()}}e.LX.Tabs=c;class d extends a{setLimits;constructor(t,s,o,i={}){super(e.ComponentType.NUMBER,t,s,i),this.onGetValue=()=>s,this.onSetValue=(a,l,d)=>{if(isNaN(a))return;s=e.LX.clamp(+a,+c.min,+c.max),c.value=s=e.LX.round(s,i.precision);const h=r.querySelector(".lexinputslider");h&&(h.value=s),l||this._trigger(new n(t,s,d),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=i.inputWidth??`calc( 100% - ${t})`},this.setLimits=(e,t,s)=>{};var a=document.createElement("div");a.className="lexnumber",this.root.appendChild(a);let r=e.LX.makeElement("div","numberbox relative flex flex-col w-full bg-secondary rounded-lg scrollbar-hidden overflow-x-hidden","",a),l=e.LX.makeContainer(["auto","100%"],"relative flex flex-row cursor-text","",r),c=document.createElement("input");c.id="number_"+e.LX.guidGenerator(),c.className="vecinput",c.min=i.min??-1e24,c.max=i.max??1e24,c.step=i.step??"any",c.type="number",c.disabled=this.disabled,s.constructor==Number&&(s=e.LX.clamp(s,+c.min,+c.max),s=e.LX.round(s,i.precision)),c.value=c.iValue=s,l.appendChild(c);const d=e.LX.makeIcon("MoveVertical",{iconClass:"drag-icon hidden-opacity",svgClass:"sm"});if(l.appendChild(d),i.units){let t=e.LX.makeContainer(["auto","auto"],"px-2 bg-card content-center break-keep",i.units,l);c.unitBox=t}if(!i.skipSlider&&void 0!==i.min&&void 0!==i.max){let t=e.LX.makeContainer(["100%","auto"],"z-1 input-box","",r),o=document.createElement("input");o.className="lexinputslider",o.min=i.min,o.max=i.max,o.step=i.step??1,o.type="range",o.value=s,o.disabled=this.disabled,o.addEventListener("input",e=>{this.set(o.valueAsNumber,!1,e)},!1),o.addEventListener("mousedown",function(e){i.onPress&&i.onPress.bind(o)(e,o)},!1),o.addEventListener("mouseup",function(e){i.onRelease&&i.onRelease.bind(o)(e,o)},!1),t.appendChild(o),this.setLimits=(e,t,n)=>{c.min=o.min=e??c.min,c.max=o.max=t??c.max,c.step=n??c.step,o.step=n??o.step,this.set(s,!0)}}c.addEventListener("input",function(t){s=+c.valueAsNumber,s=e.LX.round(s,i.precision)},!1),c.addEventListener("wheel",e=>{if(e.preventDefault(),c!==document.activeElement)return;let t=i.step??1;e.shiftKey?t*=10:e.altKey&&(t*=.1),s=+c.valueAsNumber-t*(e.deltaY>0?1:-1),this.set(s,!1,e)},{passive:!1}),c.addEventListener("change",e=>{this.set(c.valueAsNumber,!1,e)},{passive:!1});var h=this;let u=e=>{let t=-e.movementY;if(0!=t){let o=i.step??1;e.shiftKey?o*=10:e.altKey&&(o*=.1),s=+c.valueAsNumber+o*t,this.set(s,!1,e)}e.stopPropagation(),e.preventDefault()},p=e=>{var t=h.root.ownerDocument;t.removeEventListener("mousemove",u),t.removeEventListener("mouseup",p),document.body.classList.remove("noevents"),d.classList.add("hidden-opacity"),document.pointerLockElement&&document.exitPointerLock(),i.onRelease&&i.onRelease.bind(c)(e,c)};l.addEventListener("mousedown",t=>{if(document.activeElement!=c&&t.button==e.LX.MOUSE_LEFT_CLICK){var s=h.root.ownerDocument;s.addEventListener("mousemove",u),s.addEventListener("mouseup",p),document.body.classList.add("noevents"),d.classList.remove("hidden-opacity"),t.stopImmediatePropagation(),t.stopPropagation(),document.pointerLockElement||l.requestPointerLock(),i.onPress&&i.onPress.bind(c)(t,c)}}),e.LX.doAsync(this.onResize.bind(this))}}e.LX.NumberInput=d;class h extends a{valid;input;_triggerEvent;_lastValueTriggered;constructor(t,s,o,i={}){super(e.ComponentType.TEXT,t,String(s),i),this.onGetValue=()=>s,this.onSetValue=(e,a,l)=>{let c=this._lastValueTriggered==e;i.ignoreValidation||(c=c||!this.valid(e)),c||(this._lastValueTriggered=s=e,r.value=e,delete this._triggerEvent,a||this._trigger(new n(t,e,l),o))},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=i.inputWidth??`calc( 100% - ${t})`},this.valid=(t,s)=>{if(t=t??this.value(),!i.pattern)return!0;return 0==e.LX.validateValueAtPattern(t,i.pattern,s).length};let a=document.createElement("div");a.className=i.warning?" lexwarning":"",a.style.display="flex",a.style.position="relative",this.root.appendChild(a),this.disabled=(this.disabled||i.warning)??!!i.url;let r=null;if(this.disabled)i.url?(r=document.createElement("a"),r.href=i.url,r.target="_blank",r.innerHTML=s??"",r.style.textAlign=i.float??"",r.className="lextext ellipsis-overflow"):(r=document.createElement("input"),r.disabled=!0,r.className=e.LX.mergeClass("lextext ellipsis-overflow",i.inputClass));else{r=e.LX.makeElement("input",e.LX.mergeClass("lextext text-sm",i.inputClass)),r.type=i.type||"",r.setAttribute("placeholder",i.placeholder??""),i.required&&r.setAttribute("required",i.required),i.pattern&&r.setAttribute("pattern",e.LX.buildTextPattern(i.pattern));const t=i.trigger??"default";if("default"==t?(r.addEventListener("keyup",e=>{"Enter"==e.key&&(this._triggerEvent=e,r.blur())}),r.addEventListener("focusout",e=>{this._triggerEvent=this._triggerEvent??e,this.set(e.target.value,!1,this._triggerEvent)})):"input"==t&&r.addEventListener("input",e=>{this.set(e.target.value,!1,e)}),r.addEventListener("mousedown",function(e){e.stopImmediatePropagation(),e.stopPropagation()}),i.icon){r.style.paddingLeft="1.75rem";const t=e.LX.makeIcon(i.icon,{iconClass:"absolute z-1 ml-2",svgClass:"sm"});a.appendChild(t)}}i.fit&&r.classList.add("field-sizing-content"),r instanceof HTMLInputElement&&(r.name=i.name,r.value=s??"",i.autocomplete?r.autocomplete=i.autocomplete:"password"===r.type?r.autocomplete="current-password":"username"===i.name||"email"===i.name?r.autocomplete=i.name:r.autocomplete="on",r.style.textAlign=i.float??"",r.addEventListener("transitionstart",e=>{"background-color"===e.propertyName&&r.matches(":-webkit-autofill")&&this.syncFromDOM()})),Object.assign(r.style,i.style??{}),a.appendChild(r),this.input=r,e.LX.doAsync(this.onResize.bind(this))}syncFromDOM(e=!0){this.input instanceof HTMLInputElement&&this.set(this.input.value,e)}}e.LX.TextInput=h;class u extends a{_lastPlacement=[!1,!1];constructor(t,s,o,i,a={}){super(e.ComponentType.SELECT,t,o,a),this.onGetValue=()=>o,this.onSetValue=(r,l,c)=>{o=r;let d=null;if(m.childNodes.forEach(e=>{e.classList.remove("selected"),e.getAttribute("value")==r&&(d=e)}),console.assert(d,`Item ${r} does not exist in the Select.`),d.classList.add("selected"),u.refresh(o),g){g.root.querySelector("input").value="";const e=this._filterOptions(s,"");m.refresh(e)}const h=this.root.querySelector(".lexcustomcontainer"),p=a[`on_${o}`];if(h.toggleAttribute("hidden",!p),p){h.innerHTML="";const t=new e.LX.Panel;t.queue(h),p.call(this,t),t.clearQueue()}this.root.dataset.opened=!!p,m.style.height="",l||this._trigger(new n(t,o,c),i)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=a.inputWidth??`calc( 100% - ${t})`};let l=document.createElement("div");l.className="lexselect",this.root.appendChild(l);let c=document.createElement("div");c.className="lexselect lexoption",c.name=t,c.iValue=o,void 0!==a.overflowContainer&&(a.overflowContainerX=a.overflowContainerY=a.overflowContainer);const d=(t,s)=>{const o=u.root,n=o.getBoundingClientRect(),i=t.parentElement.closest("dialog")??t.parentElement.closest(".lexcolorpicker");{const r=void 0!==a.overflowContainerY?a.overflowContainerY:e.LX.getParentArea(t),l=t.offsetHeight;let c=n.y,d=window.innerHeight;if(r){const e=r.getBoundingClientRect();d=e.y+e.height}if(i){const e=i.getBoundingClientRect();c-=e.y,d-=e.y}t.style.top=c+o.offsetHeight+"px",m.style.height="";const h=s?this._lastPlacement[0]:c-l<0,u=s?this._lastPlacement[1]:c+l>d;u&&!h?(t.style.top=c-l+"px",t.classList.add("place-above")):u&&h&&(m.style.height=d-c-32+"px"),this._lastPlacement=[h,u]}{const s=void 0!==a.overflowContainerX?a.overflowContainerX:e.LX.getParentArea(t),o=t.offsetWidth;let r=n.x;if(t.style.minWidth=n.width+"px",i){r-=i.getBoundingClientRect().x}t.style.left=r+"px";let l=window.innerWidth;if(s){const e=s.getBoundingClientRect();l=e.x+e.width}!("end"===a.align||r+o>l)||a.align&&"start"===a.align||(t.style.left=r-(o-n.width)+"px")}};let u=new r(null,o,(e,t)=>{if(m.unfocus_event)return void delete m.unfocus_event;p.classList.remove("place-above");p.hasAttribute("open")?p.close():(p.show(),d(p)),g&&g.root.querySelector("input").focus()},{buttonClass:"outline [&_a]:ml-auto",skipInlineCount:!0,disabled:this.disabled});u.root.style.width="100%",u.root.querySelector("button").appendChild(e.LX.makeIcon("Down",{svgClass:"sm"})),l.appendChild(u.root),u.refresh=e=>{const t=u.root.querySelector("button");""==t.innerText?t.innerText=e:t.innerHTML=t.innerHTML.replaceAll(t.innerText,e)};const p=document.createElement("dialog");p.className="lexselectoptions";let m=document.createElement("ul");m.tabIndex=-1,m.className="lexoptions",p.appendChild(m),m.addEventListener("focusout",function(e){if(e.stopPropagation(),e.stopImmediatePropagation(),e.relatedTarget===u.root.querySelector("button"))m.unfocus_event=!0,setTimeout(()=>delete m.unfocus_event,200);else{if(e.relatedTarget&&p.contains(e.relatedTarget))return;if("lexinput-filter"==e.target.className)return}p.close()});let g=null;if(a.filter){const t=e.LX.deepCopy(a);t.placeholder=t.placeholder??"Search...",t.skipComponent=t.skipComponent??!0,t.trigger="input",t.icon="Search",t.className="lexfilter",t.inputClass="outline",g=new h(null,a.filterValue??"",e=>{const t=this._filterOptions(s,e);m.refresh(t),d(p,!0)},t),g.root.querySelector(".lextext").style.border="1px solid transparent";g.root.querySelector("input").addEventListener("focusout",function(e){e.relatedTarget&&"UL"==e.relatedTarget.tagName&&e.relatedTarget.classList.contains("lexoptions")||p.close()}),m.appendChild(g.root)}m.refresh=t=>{for(;m.childElementCount>(a.filter?1:0);)m.removeChild(m.lastChild);if(!t.length){let t=a.emptyMsg??"No options found.",s=document.createElement("div");s.className="option",s.innerHTML=e.LX.makeIcon("Inbox",{svgClass:"mr-2"}).innerHTML+t;let o=document.createElement("li");return o.className="lexselectitem empty",o.appendChild(s),void m.appendChild(o)}for(let s=0;s<t.length;s++){let n=t[s],i=document.createElement("li"),a=document.createElement("div");a.className="option",i.appendChild(a);const r=e=>{this.set(e.currentTarget?.getAttribute("value"),!1,e),p.close()};if(i.addEventListener("click",r),n.constructor!=Object){const t="@"===n[0];t?(a.innerHTML="<span>"+n.substr(1)+"</span>",i.removeEventListener("click",r)):(a.innerHTML=`<span class="flex flex-row justify-between">${n}</span>`,a.appendChild(e.LX.makeIcon("Check")),a.value=n,i.setAttribute("value",n),n==o&&(i.classList.add("selected"),c.innerHTML=n)),i.classList.add(t?"lexselectlabel":"lexselectitem")}else{let e=document.createElement("img");e.src=n.src,i.setAttribute("value",n.value),i.className="lexlistitem",a.innerText=n.value,a.className+=" media",a.prepend(e),a.setAttribute("value",n.value),a.setAttribute("data-index",s),a.setAttribute("data-src",n.src),a.setAttribute("title",n.value),o==n.value&&i.classList.add("selected")}m.appendChild(i)}},m.refresh(s),l.appendChild(p);let f=e.LX.makeElement("div","lexcustomcontainer w-full");const L=a[`on_${o}`];if(f.toggleAttribute("hidden",!L),L){f.innerHTML="";const t=new e.LX.Panel;t.queue(f),L.call(this,t),t.clearQueue()}this.root.appendChild(f),this.root.dataset.opened=!!L,e.LX.doAsync(this.onResize.bind(this))}_filterOptions(e,t){const s=!t.length;let o=[];for(let n=0;n<e.length;n++){let i=e[n];if(!s){let e="string"==typeof i?i:i.value;const s=t.toLowerCase();if(!e.toLowerCase().includes(s))continue}o.push(i)}return o}}e.LX.Select=u;class p extends a{_updateItems;constructor(t,s=[],o,i={}){i.nameWidth="auto",super(e.ComponentType.ARRAY,t,null,i),this.onGetValue=()=>s,this.onSetValue=(e,i,a)=>{s=e,this._updateItems(),i||this._trigger(new n(t,s,a),o)};let a=document.createElement("div");a.className="lexarray shrink-1 grow-1 ml-4",a.style.width="auto",this.root.appendChild(a),this.root.dataset.opened=!1;let l=`Array (size ${s.length})`;const c=new r(null,l,()=>{this.root.dataset.opened="true"!=this.root.dataset.opened,this.root.querySelector(".lexarrayitems").toggleAttribute("hidden")},{buttonClass:"outline [&_a]:ml-auto"});c.root.querySelector("button").appendChild(e.LX.makeIcon("Down",{svgClass:"sm"})),a.appendChild(c.root);let p=document.createElement("div");p.className="lexarrayitems",p.toggleAttribute("hidden",!0),this.root.appendChild(p),this._updateItems=()=>{let a=this.root.querySelector("button");for(let e of a.childNodes)if(e.nodeType===Node.TEXT_NODE){e.textContent=`Array (size ${s.length})`;break}p.innerHTML="";for(let e=0;e<s.length;++e){const a=s[e];let l=i.innerValues?"select":a.constructor,c=null;switch(l){case String:c=new h(e+"",a,function(t){s[e]=t,o(s)},{nameWidth:"12px",className:"p-0",disabled:this.disabled,skipReset:!0});break;case Number:c=new d(e+"",a,function(t){s[e]=t,o(s)},{nameWidth:"12px",className:"p-0",disabled:this.disabled,skipReset:!0});break;case"select":c=new u(e+"",i.innerValues,a,function(t){s[e]=t,o(s)},{nameWidth:"12px",className:"p-0",disabled:this.disabled,skipReset:!0})}if(console.assert(c,`Value of type ${l} cannot be modified in ArrayInput`),p.appendChild(c.root),!this.disabled){const e=new r(null,"",(e,i)=>{s.splice(s.indexOf(a),1),this._updateItems(),this._trigger(new n(t,s,i),o)},{buttonClass:"ghost sm p-0",title:"Remove item",icon:"Trash2"});c.root.appendChild(e.root)}}if(!this.disabled){const a=new r(null,e.LX.makeIcon("Plus",{svgClass:"sm"}).innerHTML+"Add item",(e,a)=>{s.push(i.innerValues?i.innerValues[0]:""),this._updateItems(),this._trigger(new n(t,s,a),o)},{buttonClass:"ghost"});p.appendChild(a.root)}},this._updateItems()}}e.LX.ArrayInput=p;class m extends a{constructor(t,s={}){s.hideName=!0,super(e.ComponentType.CARD,t,null,s),this.root.classList.add("place-content-center");const o=e.LX.makeContainer(["100%","auto"],"lexcard max-w-sm flex flex-col gap-4 bg-card border-color rounded-xl py-6","",this.root);if(s.header){const t=void 0!==s.header.action;let n=e.LX.makeContainer(["100%","auto"],`flex ${t?"flex-row gap-4":"flex-col gap-1"} px-6`,"",o);if(t){const t=new r(null,s.header.action.name,s.header.action.callback,{buttonClass:"secondary"});n.appendChild(t.root);const o=e.LX.makeContainer(["75%","auto"],"flex flex-col gap-1","");n.prepend(o),n=o}s.header.title&&e.LX.makeElement("div","text-sm text-foreground leading-none font-semibold",s.header.title,n),s.header.description&&e.LX.makeElement("div","text-xs text-muted-foreground",s.header.description,n)}if(s.content){const t=e.LX.makeContainer(["100%","auto"],"flex flex-col gap-2 px-6","",o),n=[].concat(s.content);for(let e of n)t.appendChild(e.root?e.root:e)}if(s.footer){const t=e.LX.makeContainer(["100%","auto"],"flex flex-col gap-1 px-6","",o),n=[].concat(s.footer);for(let e of n)t.appendChild(e.root?e.root:e)}s.callback&&(o.classList.add("selectable"),o.style.cursor="pointer",o.addEventListener("click",e=>{this._trigger(new n(t,null,e),s.callback)}))}}e.LX.Card=m;class g extends a{constructor(t,s,o,i={}){if(!t&&!i.label)throw"Set Component Name or at least a label!";super(e.ComponentType.CHECKBOX,t,s,i),this.onGetValue=()=>s,this.onSetValue=(e,i,a)=>{e!=s&&(r.checked=s=e,this.root.querySelector(".lexcheckboxsubmenu")?.toggleAttribute("hidden",!e),i||this._trigger(new n(t,e,a),o))},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=i.inputWidth??`calc( 100% - ${t})`};let a=document.createElement("div");a.className="flex items-center gap-2 my-0 mx-auto [&_span]:truncate [&_span]:flex-auto-fill",this.root.appendChild(a);let r=e.LX.makeElement("input",e.LX.mergeClass("lexcheckbox rounded-xl disabled:pointer-events-none disabled:opacity-50",i.className??"primary"));if(r.type="checkbox",r.checked=s,r.disabled=this.disabled,a.appendChild(r),e.LX.makeElement("span","text-sm",i.label??"On",a),r.addEventListener("change",e=>{this.set(r.checked,!1,e)}),i.suboptions){let t=e.LX.makeElement("div","lexcheckboxsubmenu");t.toggleAttribute("hidden",!r.checked);const s=new e.LX.Panel;s.queue(t),i.suboptions.call(this,s),s.clearQueue(),this.root.appendChild(t)}e.LX.doAsync(this.onResize.bind(this))}}e.LX.Checkbox=g;class f{_rgb;_hex="#000000";_hsv;css;get rgb(){return this._rgb}set rgb(e){this._fromRGB(e)}get hex(){return this._hex}set hex(e){this._fromHex(e)}get hsv(){return this._hsv}set hsv(e){this._fromHSV(e)}constructor(e){this.set(e)}set(e){if("string"==typeof e&&e.startsWith("#"))this._fromHex(e);else if("r"in e&&"g"in e&&"b"in e)e.a=e.a??1,this._fromRGB(e);else{if(!("h"in e&&"s"in e&&"v"in e))throw"Bad color model!";e.a=e.a??1,this._fromHSV(e)}}setHSV(e){this._fromHSV(e)}setRGB(e){this._fromRGB(e)}setHex(e){this._fromHex(e)}_fromHex(t){this._fromRGB(e.LX.hexToRgb(t))}_fromRGB(t){this._rgb=t,this._hsv=e.LX.rgbToHsv(t),this._hex=e.LX.rgbToHex(t),this.css=e.LX.rgbToCss(this._rgb)}_fromHSV(t){this._hsv=t,this._rgb=e.LX.hsvToRgb(t),this._hex=e.LX.rgbToHex(this._rgb),this.css=e.LX.rgbToCss(this._rgb)}}e.LX.Color=f;class L{static currentPicker=!1;root;colorModel;useAlpha;callback;markerHalfSize;markerSize;currentColor;labelComponent;colorPickerBackground;intSatMarker;colorPickerTracker;alphaTracker;hueMarker;alphaMarker;onPopover;constructor(t,s={}){this.colorModel=s.colorModel??"Hex",this.useAlpha=s.useAlpha??!1,this.callback=s.onChange,this.callback||console.warn("Define a callback in _options.onChange_ to allow getting new Color values!"),this.root=e.LX.makeElement("div","lexcolorpicker flex flex-col text-sm w-3xs gap-2 p-1"),this.markerHalfSize=8,this.markerSize=2*this.markerHalfSize,this.currentColor=new f(t);const o=new f({h:this.currentColor.hsv.h,s:1,v:1}),n="size-4 rounded-lg bg-transparent absolute pointer-events-none border-3 border-solid border-white";this.colorPickerBackground=e.LX.makeElement("div","lexcolorpickerbg w-full aspect-square relative rounded-md cursor-pointer"),this.colorPickerBackground.style.backgroundColor=`rgb(${o.css.r}, ${o.css.g}, ${o.css.b})`,this.root.appendChild(this.colorPickerBackground),this.intSatMarker=e.LX.makeElement("div",n),this.intSatMarker.style.backgroundColor=this.currentColor.hex,this.colorPickerBackground.appendChild(this.intSatMarker);let i=null,a=t=>{const s=t.movementX,o=t.movementY,n=t.x-i.x,a=t.y-i.y;0!=s&&(n>=0||s<0)&&(n<this.colorPickerBackground.offsetWidth||s>0)&&(this.intSatMarker.style.left=e.LX.clamp(parseInt(this.intSatMarker.style.left)+s,-this.markerHalfSize,this.colorPickerBackground.offsetWidth-this.markerHalfSize)+"px"),0!=o&&(a>=0||o<0)&&(a<this.colorPickerBackground.offsetHeight||o>0)&&(this.intSatMarker.style.top=e.LX.clamp(parseInt(this.intSatMarker.style.top)+o,-this.markerHalfSize,this.colorPickerBackground.offsetHeight-this.markerHalfSize)+"px"),this._positionToSv(parseInt(this.intSatMarker.style.left),parseInt(this.intSatMarker.style.top)),this._updateColorValue(),t.stopPropagation(),t.preventDefault()},l=e=>{var t=this.root.ownerDocument;t.removeEventListener("mousemove",a),t.removeEventListener("mouseup",l),document.body.classList.remove("noevents")};this.colorPickerBackground.addEventListener("mousedown",e=>{var t=this.root.ownerDocument;t.addEventListener("mousemove",a),t.addEventListener("mouseup",l),document.body.classList.add("noevents"),e.stopImmediatePropagation(),e.stopPropagation();const s=e.offsetX-this.markerHalfSize;this.intSatMarker.style.left=s+"px";const o=e.offsetY-this.markerHalfSize;this.intSatMarker.style.top=o+"px",this._positionToSv(s,o),this._updateColorValue(),i=this.colorPickerBackground.getBoundingClientRect()});const c=e.LX.makeContainer(["100%","auto"],"flex flex-row gap-1 items-center","",this.root),d=window.EyeDropper;d&&c.appendChild(new r(null,"eyedrop",async()=>{const e=new d;try{const t=await e.open();this.fromHexColor(t.sRGBHex)}catch(e){}},{icon:"Pipette",buttonClass:"bg-none",title:"Sample Color"}).root);const p=e.LX.makeContainer(["100%","100%"],"flex flex-col gap-2","",c);this.colorPickerTracker=e.LX.makeElement("div","lexhuetracker w-full h-4 rounded-lg relative cursor-pointer"),p.appendChild(this.colorPickerTracker),this.hueMarker=e.LX.makeElement("div",n),this.hueMarker.style.backgroundColor=`rgb(${o.css.r}, ${o.css.g}, ${o.css.b})`,this.colorPickerTracker.appendChild(this.hueMarker);const m=t=>{this.hueMarker.style.left=t+"px",this.currentColor.hsv.h=e.LX.remapRange(t,0,this.colorPickerTracker.offsetWidth-this.markerSize,0,360);const s=new f({h:this.currentColor.hsv.h,s:1,v:1});this.hueMarker.style.backgroundColor=`rgb(${s.css.r}, ${s.css.g}, ${s.css.b})`,this.colorPickerBackground.style.backgroundColor=`rgb(${s.css.r}, ${s.css.g}, ${s.css.b})`,this._updateColorValue()};let g=null,L=t=>{const s=t.movementX,o=t.x-g.x;if(0!=s&&(o>=this.markerHalfSize||s<0)&&(o<this.colorPickerTracker.offsetWidth-this.markerHalfSize||s>0)){const t=e.LX.clamp(parseInt(this.hueMarker.style.left)+s,0,this.colorPickerTracker.offsetWidth-this.markerSize);m(t)}t.stopPropagation(),t.preventDefault()},b=e=>{var t=this.root.ownerDocument;t.removeEventListener("mousemove",L),t.removeEventListener("mouseup",b),document.body.classList.remove("noevents")};if(this.colorPickerTracker.addEventListener("mousedown",t=>{const s=this.root.ownerDocument;s.addEventListener("mousemove",L),s.addEventListener("mouseup",b),document.body.classList.add("noevents"),t.stopImmediatePropagation(),t.stopPropagation();const o=e.LX.clamp(t.offsetX-this.markerHalfSize,0,this.colorPickerTracker.offsetWidth-this.markerSize);m(o),g=this.colorPickerTracker.getBoundingClientRect()}),this.useAlpha){this.alphaTracker=e.LX.makeElement("div","lexalphatracker w-full h-4 rounded-lg relative cursor-pointer"),this.alphaTracker.style.color=`rgb(${this.currentColor.css.r}, ${this.currentColor.css.g}, ${this.currentColor.css.b})`,p.appendChild(this.alphaTracker),this.alphaMarker=e.LX.makeElement("div",n),this.alphaMarker.style.backgroundColor=`rgb(${this.currentColor.css.r}, ${this.currentColor.css.g}, ${this.currentColor.css.b},${this.currentColor.css.a})`,this.alphaTracker.appendChild(this.alphaMarker);const t=t=>{this.alphaMarker.style.left=t+"px",this.currentColor.hsv.a=e.LX.remapRange(t,0,this.alphaTracker.offsetWidth-this.markerSize,0,1),this._updateColorValue(),this.alphaMarker.style.backgroundColor=`rgb(${this.currentColor.css.r}, ${this.currentColor.css.g}, ${this.currentColor.css.b},${this.currentColor.css.a})`};let s=null,o=o=>{const n=this.root.ownerDocument;n.addEventListener("mousemove",i),n.addEventListener("mouseup",a),document.body.classList.add("noevents"),o.stopImmediatePropagation(),o.stopPropagation();const r=e.LX.clamp(o.offsetX-this.markerHalfSize,0,this.alphaTracker.offsetWidth-this.markerSize);t(r),s=this.alphaTracker.getBoundingClientRect()},i=o=>{const n=o.movementX,i=o.x-s.x;if(0!=n&&(i>=this.markerHalfSize||n<0)&&(i<this.alphaTracker.offsetWidth-this.markerHalfSize||n>0)){const s=e.LX.clamp(parseInt(this.alphaMarker.style.left)+n,0,this.alphaTracker.offsetWidth-this.markerSize);t(s)}o.stopPropagation(),o.preventDefault()},a=e=>{var t=this.root.ownerDocument;t.removeEventListener("mousemove",i),t.removeEventListener("mouseup",a),document.body.classList.remove("noevents")};this.alphaTracker.addEventListener("mousedown",o)}const y=e.LX.makeContainer(["100%","auto"],"flex flex-row gap-1","",this.root);y.appendChild(new u(null,["CSS","Hex","HSV","RGB"],this.colorModel,e=>{this.colorModel=e,this._updateColorValue(null,!0)}).root),this.labelComponent=new h(null,"",null,{inputClass:"bg-none",fit:!0,disabled:!0}),y.appendChild(this.labelComponent.root);{const t=new r(null,"copy",async()=>{navigator.clipboard.writeText(this.labelComponent.value()),t.root.querySelector("input[type='checkbox']").style.pointerEvents="none",e.LX.doAsync(()=>{t.swap&&t.swap(!0),t.root.querySelector("input[type='checkbox']").style.pointerEvents="auto"},3e3)},{swap:"Check",icon:"Copy",buttonClass:"bg-none",className:"ml-auto",title:"Copy"});t.root.querySelector(".swap-on svg").classList.add("text-success"),y.appendChild(t.root)}this._updateColorValue(t,!0),e.LX.doAsync(this._placeMarkers.bind(this)),this.onPopover=this._placeMarkers.bind(this)}_placeMarkers(){this._svToPosition(this.currentColor.hsv.s,this.currentColor.hsv.v);const t=e.LX.remapRange(this.currentColor.hsv.h,0,360,0,this.colorPickerTracker.offsetWidth-this.markerSize);if(this.hueMarker.style.left=t+"px",this.useAlpha){const t=e.LX.remapRange(this.currentColor.hsv.a,0,1,0,this.alphaTracker.offsetWidth-this.markerSize);this.alphaMarker.style.left=t+"px"}}_svToPosition(t,s){this.intSatMarker.style.left=`${e.LX.remapRange(t,0,1,-this.markerHalfSize,this.colorPickerBackground.offsetWidth-this.markerHalfSize)}px`,this.intSatMarker.style.top=`${e.LX.remapRange(1-s,0,1,-this.markerHalfSize,this.colorPickerBackground.offsetHeight-this.markerHalfSize)}px`}_positionToSv(t,s){this.currentColor.hsv.s=e.LX.remapRange(t,-this.markerHalfSize,this.colorPickerBackground.offsetWidth-this.markerHalfSize,0,1),this.currentColor.hsv.v=1-e.LX.remapRange(s,-this.markerHalfSize,this.colorPickerBackground.offsetHeight-this.markerHalfSize,0,1)}_updateColorValue(e,t=!1){this.currentColor.set(e??this.currentColor.hsv),this.callback&&!t&&this.callback(this.currentColor),this.intSatMarker.style.backgroundColor=this.currentColor.hex,this.useAlpha&&(this.alphaTracker.style.color=`rgb(${this.currentColor.css.r}, ${this.currentColor.css.g}, ${this.currentColor.css.b})`);const s=(e,t=2)=>e.toFixed(t).replace(/([0-9]+(\.[0-9]+[1-9])?)(\.?0+$)/,"$1");if("CSS"==this.colorModel){const{r:e,g:t,b:o,a:n}=this.currentColor.css;this.labelComponent.set(`rgb${this.useAlpha?"a":""}(${e},${t},${o}${this.useAlpha?","+s(n):""})`)}else if("Hex"==this.colorModel)this.labelComponent.set((this.useAlpha?this.currentColor.hex:this.currentColor.hex.substr(0,7)).toUpperCase());else if("HSV"==this.colorModel){const{h:e,s:t,v:o,a:n}=this.currentColor.hsv,i=[Math.floor(e)+"º",Math.floor(100*t)+"%",Math.floor(100*o)+"%"];this.useAlpha&&i.push(s(n)),this.labelComponent.set(i.join(" "))}else{const{r:e,g:t,b:o,a:n}=this.currentColor.rgb,i=[s(e),s(t),s(o)];this.useAlpha&&i.push(s(n)),this.labelComponent.set(i.join(" "))}}fromHexColor(t){this.currentColor.setHex(t);const{h:s,s:o,v:n}=this.currentColor.hsv;this._svToPosition(o,n);const i=new f({h:s,s:1,v:1});this.hueMarker.style.backgroundColor=this.colorPickerBackground.style.backgroundColor=`rgb(${i.css.r}, ${i.css.g}, ${i.css.b})`,this.hueMarker.style.left=e.LX.remapRange(s,0,360,-this.markerHalfSize,this.colorPickerTracker.offsetWidth-this.markerHalfSize)+"px",this._updateColorValue(t)}}e.LX.ColorPicker=L;class b{static activeElement=null;root;side="bottom";align="center";sideOffset=0;alignOffset=0;avoidCollisions=!0;reference;_windowPadding=4;_trigger;_parent;_onClick;constructor(t,s,o={}){if(b.activeElement)return void b.activeElement.destroy();this._trigger=t,t&&(t.classList.add("triggered"),t.active=this),this.side=o.side??this.side,this.align=o.align??this.align,this.sideOffset=o.sideOffset??this.sideOffset,this.alignOffset=o.alignOffset??this.alignOffset,this.avoidCollisions=o.avoidCollisions??!0,this.reference=o.reference,this.root=e.LX.makeElement("div","lexpopover fixed bg-background rounded-lg border-color p-1 left-0 top-0"),this.root.dataset.side=this.side,this.root.tabIndex="1";const n=(t??this.reference).closest("dialog");n&&"true"==n.dataset.modal?this._parent=n:this._parent=e.LX.root,this._parent.appendChild(this.root),this.root.addEventListener("keydown",e=>{"Escape"==e.key&&(e.preventDefault(),e.stopPropagation(),this.destroy())}),s&&(s=[].concat(s)).forEach(e=>{const t=e.root??e;this.root.appendChild(t),e.onPopover&&e.onPopover()}),b.activeElement=this,e.LX.doAsync(()=>{this._adjustPosition(),this._trigger&&(this.root.focus(),this._onClick=e=>{e.target&&(this.root.contains(e.target)||e.target==this._trigger)||this.destroy()},document.body.addEventListener("mousedown",this._onClick,!0),document.body.addEventListener("focusin",this._onClick,!0))},10)}destroy(){this._trigger&&(this._trigger.classList.remove("triggered"),delete this._trigger.active,document.body.removeEventListener("mousedown",this._onClick,!0),document.body.removeEventListener("focusin",this._onClick,!0)),this.root.remove(),b.activeElement=null}_adjustPosition(){const t=[0,0];{const e=this.reference??this._trigger;console.assert(e,"Popover needs a trigger or reference element!");const s=e.getBoundingClientRect();let o=!0;switch(this.side){case"left":t[0]+=s.x-this.root.offsetWidth-this.sideOffset,o=!1;break;case"right":t[0]+=s.x+s.width+this.sideOffset,o=!1;break;case"top":t[1]+=s.y-this.root.offsetHeight-this.sideOffset,o=!0;break;case"bottom":t[1]+=s.y+s.height+this.sideOffset,o=!0}switch(this.align){case"start":o?t[0]+=s.x:t[1]+=s.y;break;case"center":o?t[0]+=s.x+.5*s.width-.5*this.root.offsetWidth:t[1]+=s.y+.5*s.height-.5*this.root.offsetHeight;break;case"end":o?t[0]+=s.x-this.root.offsetWidth+s.width:t[1]+=s.y-this.root.offsetHeight+s.height}o?t[0]+=this.alignOffset:t[1]+=this.alignOffset}if(this.avoidCollisions&&(t[0]=e.LX.clamp(t[0],0,window.innerWidth-this.root.offsetWidth-this._windowPadding),t[1]=e.LX.clamp(t[1],0,window.innerHeight-this.root.offsetHeight-this._windowPadding)),this._parent instanceof HTMLDialogElement){let e=this._parent.getBoundingClientRect();t[0]-=e.x,t[1]-=e.y}this.root.style.left=`${t[0]}px`,this.root.style.top=`${t[1]}px`}}e.LX.Popover=b;e.LX.PopConfirm=class{_popover=null;constructor(t,s={}){const o=s.confirmText??"Yes",n=s.cancelText??"No",i=s.title??"Confirm",a=s.content??"Are you sure you want to proceed?",r=s.onConfirm,l=s.onCancel,c=e.LX.makeContainer(["auto","auto"],"tour-step-container");{const t=e.LX.makeContainer(["100%","auto"],"flex flex-row","",c);e.LX.makeContainer(["100%","auto"],"p-1 font-medium text-base",i,t)}e.LX.makeContainer(["100%","auto"],"p-1 text-base",a,c,{maxWidth:"400px"});const d=e.LX.makeContainer(["100%","auto"],"flex flex-row text-base","",c),h=e.LX.makeContainer(["100%","auto"],"text-base","",d),u=new e.LX.Panel;h.appendChild(u.root),u.sameLine(2,"justify-end"),u.addButton(null,n,()=>{l&&l(),this._popover?.destroy()}),u.addButton(null,o,()=>{r&&r(),this._popover?.destroy()},{buttonClass:"accent"}),this._popover?.destroy(),this._popover=new e.LX.Popover(null,[c],{reference:t,side:s.side??"top",align:s.align,sideOffset:s.sideOffset,alignOffset:s.alignOffset})}};class y extends a{picker;_skipTextUpdate=!1;_popover=void 0;constructor(t,s,o,i={}){(s=s??"#000000").constructor===String&&s.includes("oklch")&&(s=e.LX.oklchToHex(s));const a=i.useAlpha??(s.constructor===Object&&"a"in s||s.constructor===String&&[5,9].includes(s.length)),r=new f(s);s=a?r.hex:r.hex.substring(0,7),super(e.ComponentType.COLOR,t,s,i),this.onGetValue=()=>{const e=new f(s);return i.useRGB?e.rgb:s},this.onSetValue=(e,r,l)=>{const c=new f(e);if(d.style.color=s=c.hex.substring(0,7),a&&(u.style.color=s=c.hex),this._skipTextUpdate||p.set(s,!0,l),!r){let e=s;i.useRGB&&(e=c.rgb,a||delete e.a),this._trigger(new n(t,e,l),o)}},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=`calc( 100% - ${t})`};var l=document.createElement("span");l.className="lexcolor",this.root.appendChild(l),this.picker=new L(s,{colorModel:i.useRGB?"RGB":"Hex",useAlpha:a,onChange:e=>{this.set(e.hex)}});let c=e.LX.makeContainer(["18px","18px"],"flex flex-row rounded overflow-hidden","",l);c.tabIndex="1",c.addEventListener("click",e=>{this.disabled||(this._popover=new b(c,[this.picker]))});let d=document.createElement("div");d.className="lexcolorsample",d.style.color=s,c.appendChild(d);let u=null;a?(u=document.createElement("div"),u.className="lexcolorsample",u.style.color=s,c.appendChild(u)):d.style.width="18px";const p=new h(null,s,e=>{this._skipTextUpdate=!0,this.set(e),delete this._skipTextUpdate,this.picker.fromHexColor(e)},{width:"calc( 100% - 24px )",disabled:this.disabled});p.root.style.marginLeft="6px",l.appendChild(p.root),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Color=f,e.LX.ColorPicker=L,e.LX.ColorInput=y;class v extends a{constructor(t,s,o={}){const i=!o.noSelection;let a=i&&(o.toggle??!1),l=document.createElement("div");l.className="lexcombobuttons flex justify-center",o.skipReset=!0,o.float&&(l.className=e.LX.mergeClass(l.className,`justify-${o.float}`));let c=[],d=e.LX.makeElement("div","flex w-max bg-secondary pad-sm rounded-lg gap-1","",l);for(let t of s){if(!t.value)throw"Set 'value' for each button!";const s=e=>{c=[],i&&(a?n.classList.toggle("selected"):(l.querySelectorAll("button").forEach(e=>e.classList.remove("selected")),n.classList.add("selected"))),l.querySelectorAll("button").forEach(e=>{e.classList.contains("selected")&&c.push(e.dataset.value)}),!a&&c.length>1?console.error("Enable _options.toggle_ to allow selecting multiple options in ComboButtons."):(c=c[0],this.set(t.value,!1,n.classList.contains("selected")))};let n=new r(t.name??null,t.value,s,{title:t.icon?t.value:"",icon:t.icon,disabled:t.disabled,buttonClass:e.LX.mergeClass("combo w-auto",o.buttonClass)}).root.querySelector("button");n.id=t.id??"",n.dataset.value=t.value,i&&(t.selected||o.selected?.includes(t.value))&&(n.classList.add("selected"),c=c.concat([t.value])),d.appendChild(n)}c.length>1?a||(o.toggle=!0,a=i,console.warn(`Multiple options selected in '${t}' ComboButtons. Enabling _toggle_ mode.`)):c=c[0],super(e.ComponentType.BUTTONS,t,null,o),this.onGetValue=()=>c,this.onSetValue=(e,o,r)=>{if(i&&null==r&&(l.querySelectorAll("button").forEach(e=>e.classList.remove("selected")),l.querySelectorAll("button").forEach(e=>{c&&c.indexOf(e.dataset.value)>-1&&e.classList.add("selected")})),!o&&e.constructor!=Array){const o=r,i=s.filter(t=>t.value==e)[0]?.callback;this._trigger(new n(t,a?[e,o]:e,null),i)}},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=`calc( 100% - ${t})`},this.root.appendChild(l),e.LX.doAsync(this.onResize.bind(this))}}e.LX.ComboButtons=v;class C extends a{count;constructor(t,s,o,i={}){super(e.ComponentType.COUNTER,t,s,i),this.onGetValue=()=>this.count,this.onSetValue=(s,i,r)=>{this.count=e.LX.clamp(s,a,l),h.value=this.count,i||this._trigger(new n(t,s,r),o)},this.count=s;const a=i.min??0,l=i.max??100,c=i.step??1,d=document.createElement("div");d.className="flex flex-row border-color bg-card rounded-lg shadow",this.root.appendChild(d);const h=e.LX.makeElement("input","lexcounter w-12 bg-card px-2 text-foreground","",d);h.type="number",h.value=s,h.disabled=this.disabled;const u=new r(null,"",(e,t)=>{let s=c??1;t.shiftKey&&(s*=10),this.set(this.count-s,!1,t)},{disabled:this.disabled,className:`p-0 ${this.disabled?"":"hover:bg-secondary"} border-l-color border-r-color`,buttonClass:"px-0 bg-none h-7",icon:"Minus"});d.appendChild(u.root);const p=new r(null,"",(e,t)=>{let s=c??1;t.shiftKey&&(s*=10),this.set(this.count+s,!1,t)},{disabled:this.disabled,className:`p-0 ${this.disabled?"":"hover:bg-secondary"} rounded-r-lg`,buttonClass:"px-0 bg-none h-7",icon:"Plus"});d.appendChild(p.root)}}e.LX.Counter=C;class x{element;canvas;constructor(t,s={}){let o=document.createElement("div");o.className=e.LX.mergeClass("curve [&_canvas]:rounded",s.className),o.style.minHeight="50px",o.style.width=s.width||"100%",o.style.minWidth="50px",o.style.minHeight="20px",o.bgcolor=s.bgColor||e.LX.getCSSVariable("background"),o.pointscolor=s.pointsColor||e.LX.getCSSVariable("primary"),o.activepointscolor=s.activePointsColor||e.LX.getCSSVariable("primary/50"),o.linecolor=s.lineColor||"#555",o.value=t||[],o.xrange=s.xrange||[0,1],o.yrange=s.yrange||[0,1],o.defaulty=null!=s.defaulty?s.defaulty:0,o.no_overlap=s.noOverlap||!1,o.show_samples=s.showSamples||0,o.allow_add_values=s.allowAddValues??!0,o.draggable_x=s.draggableX??!0,o.draggable_y=s.draggableY??!0,o.smooth=(s.smooth&&"number"==typeof s.smooth?s.smooth:.3)||!1,o.move_out=s.moveOutAction??e.LX.CURVE_MOVEOUT_DELETE,e.LX.addSignal("@on_new_color_scheme",(t,n)=>{o.bgcolor=s.bgColor||e.LX.getCSSVariable("background"),o.pointscolor=s.pointsColor||e.LX.getCSSVariable("primary"),o.activepointscolor=s.activePointsColor||e.LX.getCSSVariable("primary/50"),this.redraw()}),this.element=o;let n=document.createElement("canvas");function i(e){return[n.width*(e[0]-o.xrange[0])/o.xrange[1],n.height*(e[1]-o.yrange[0])/o.yrange[1]]}function a(e){return[e[0]*o.xrange[1]/n.width+o.xrange[0],e[1]*o.yrange[1]/n.height+o.yrange[0]]}n.width=s.width||200,n.height=s.height||50,o.appendChild(n),this.canvas=n,o.addEventListener("mousedown",function(t){document.addEventListener("mousemove",c),document.addEventListener("mouseup",d);var s=n.getBoundingClientRect(),h=t.clientX-s.left,m=t.clientY-s.top;if(r=function(e,t){for(var s=1e5,n=-1,a=0;a<o.value.length;a++){var r=u([e,t],i(o.value[a]));r<s&&r<8&&(s=r,n=a)}return n}(h,n.height-m),t.button==e.LX.MOUSE_LEFT_CLICK&&-1==r&&o.allow_add_values){var g=a([h,n.height-m]);o.value.push(g),p(),r=o.value.indexOf(g)}l=[h,m],o.redraw(),t.preventDefault(),t.stopPropagation()}),o.getValueAt=function(e){if(e<o.xrange[0]||e>o.xrange[1])return o.defaulty;let t=[o.xrange[0],o.defaulty],s=0;for(let n=0;n<o.value.length;n+=1){let i=o.value[n];if(e==i[0])return i[1];if(e<i[0])return s=(e-t[0])/(i[0]-t[0]),t[1]*(1-s)+i[1]*s;t=i}let n=[o.xrange[1],o.defaulty];return s=(e-t[0])/(n[0]-t[0]),t[1]*(1-s)+n[1]*s},o.resample=function(e){let t=[],s=(o.xrange[1]-o.xrange[0])/e;for(let e=o.xrange[0];e<=o.xrange[1];e+=s)t.push(o.getValueAt(e));return t},o.addValue=function(e){for(let t=0;t<o.value;t++){if(!(o.value[t][0]<e[0]))return o.value.splice(t,0,e),void this.redraw()}o.value.push(e),this.redraw()};let r=-1;o.redraw=function(t={}){t.value&&(o.value=t.value),t.xrange&&(o.xrange=t.xrange),t.yrange&&(o.yrange=t.yrange),t.smooth&&(o.smooth=t.smooth);var s=n.getContext("2d");if(!s)return;s.setTransform(1,0,0,1,0,0),s.translate(0,n.height),s.scale(1,-1),s.fillStyle=o.bgcolor,s.fillRect(0,0,n.width,n.height),s.strokeStyle=o.linecolor,s.beginPath();var a=i([o.xrange[0],o.defaulty]);s.moveTo(a[0],a[1]);let l=[a[0],a[1]];for(var c in o.value){a=i(o.value[c]),l.push(a[0]),l.push(a[1]),o.smooth||s.lineTo(a[0],a[1])}a=i([o.xrange[1],o.defaulty]),l.push(a[0]),l.push(a[1]),o.smooth?e.LX.drawSpline(s,l,o.smooth):(s.lineTo(a[0],a[1]),s.stroke());for(var d=0;d<o.value.length;d+=1){a=i(o.value[d]);const e=d==r;s.fillStyle=e?o.activepointscolor:o.pointscolor,s.beginPath(),s.arc(a[0],a[1],e?4:3,0,2*Math.PI),s.fill()}if(o.show_samples){var h=o.resample(o.show_samples);s.fillStyle="#888";for(d=0;d<h.length;d+=1){a=i([d*((o.xrange[1]-o.xrange[0])/o.show_samples)+o.xrange[0],h[d]]),s.beginPath(),s.arc(a[0],a[1],2,0,2*Math.PI),s.fill()}}};var l=[0,0];function c(t){var s=n.getBoundingClientRect(),i=t.clientX-s.left,c=t.clientY-s.top;i<0?i=0:i>n.width&&(i=n.width),c<0?c=0:c>n.height&&(c=n.height);const m=[t.clientX-s.left,t.clientY-s.top];if(-1!=r&&u(m,[i,c])>.5*n.height){if(o.move_out==e.LX.CURVE_MOVEOUT_DELETE)o.value.splice(r,1);else{const e=[m[0]-i,m[1]-c];let t=o.value[r];t[0]=0==e[0]?t[0]:e[0]<0?o.xrange[0]:o.xrange[1],t[1]=0==e[1]?t[1]:e[1]<0?o.yrange[1]:o.yrange[0]}d(t)}else{var g=a([-(o.draggable_x?l[0]-i:0),o.draggable_y?l[1]-c:0]);if(-1!=r){var f=o.xrange[0],L=o.xrange[1];o.no_overlap&&(r>0&&(f=o.value[r-1][0]),r<o.value.length-1&&(L=o.value[r+1][0]));var b=o.value[r];b[0]+=g[0],b[1]+=g[1],b[0]<f?b[0]=f:[0]>L&&(b[0]=L),b[1]<o.yrange[0]?b[1]=o.yrange[0]:b[1]>o.yrange[1]&&(b[1]=o.yrange[1])}p(),o.redraw(),l[0]=i,l[1]=c,h(t),t.preventDefault(),t.stopPropagation()}}function d(e){r=-1,o.redraw(),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),h(e),e.preventDefault(),e.stopPropagation()}function h(e){s.callback&&s.callback.call(o,o.value,e)}function u(e,t){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function p(){var e=null;-1!=r&&(e=o.value[r]),o.value.sort(function(e,t){return e[0]-t[0]}),e&&(r=o.value.indexOf(e))}return o.redraw(),this}redraw(e={}){this.element.redraw(e)}}class _ extends a{curveInstance;constructor(t,s,o,i={}){let a=JSON.parse(JSON.stringify(s));super(e.ComponentType.CURVE,t,a,i),this.onGetValue=()=>JSON.parse(JSON.stringify(l.element.value)),this.onSetValue=(e,s,i)=>{l.element.value=JSON.parse(JSON.stringify(e)),l.redraw(),s||this._trigger(new n(t,l.element.value,i),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";r.style.width=`calc( 100% - ${t})`};var r=document.createElement("div");r.className="lexcurve",this.root.appendChild(r),i.callback=(e,s)=>{this._trigger(new n(t,e,s),o)},i.name=t;let l=new x(s,i);r.appendChild(l.element),this.curveInstance=l;new ResizeObserver(e=>{for(const t of e)l.canvas.width=t.contentRect.width,l.redraw()}).observe(r),e.LX.doAsync(this.onResize.bind(this))}}e.LX.CanvasCurve=x,e.LX.Curve=_;class w{root;day=-1;month=-1;year=-1;monthName="";firstDay=-1;daysInMonth=-1;calendarDays=[];currentDate;range;untilToday;fromToday;skipPrevMonth;skipNextMonth;onChange;onPreviousMonth;onNextMonth;constructor(t,s={}){if(this.root=e.LX.makeContainer(["256px","auto"],"p-1 flex flex-col gap-2 text-sm"),this.onChange=s.onChange,this.onPreviousMonth=s.onPreviousMonth,this.onNextMonth=s.onNextMonth,this.untilToday=s.untilToday,this.fromToday=s.fromToday,this.range=s.range,this.skipPrevMonth=s.skipPrevMonth,this.skipNextMonth=s.skipNextMonth,t)this.fromDateString(t);else{const e=new Date;this.month=e.getMonth()+1,this.year=e.getFullYear(),this.fromMonthYear(this.month,this.year)}}_getCurrentDate(){return{day:this.day,month:this.month,year:this.year,fullDate:this.getFullDate()}}_previousMonth(e){this.month=Math.max(1,this.month-1),1==this.month&&(this.month=12,this.year--),this.fromMonthYear(this.month,this.year),!e&&this.onPreviousMonth&&this.onPreviousMonth(this.currentDate)}_nextMonth(e){this.month=Math.min(this.month+1,13),13==this.month&&(this.month=1,this.year++),this.fromMonthYear(this.month,this.year),!e&&this.onNextMonth&&this.onNextMonth(this.currentDate)}refresh(){this.root.innerHTML="";{const t=e.LX.makeContainer(["100%","auto"],"flex flex-row p-1","",this.root);if(!this.skipPrevMonth){const s=e.LX.makeIcon("Left",{title:"Previous Month",iconClass:"border-color p-1 rounded hover:bg-secondary",svgClass:"sm"});t.appendChild(s),s.addEventListener("click",()=>{this._previousMonth()})}if(e.LX.makeContainer(["100%","auto"],"text-center font-medium select-none",`${this.monthName} ${this.year}`,t),!this.skipNextMonth){const s=e.LX.makeIcon("Right",{title:"Next Month",iconClass:"border-color p-1 rounded hover:bg-secondary",svgClass:"sm"});t.appendChild(s),s.addEventListener("click",()=>{this._nextMonth()})}}{const t=document.createElement("table");t.className="w-full",this.root.appendChild(t);{const e=document.createElement("thead");t.appendChild(e);const s=document.createElement("tr");for(const e of["Mo","Tu","We","Th","Fr","Sa","Su"]){const t=document.createElement("th");t.className="text-muted-foreground text-xs font-normal w-10 select-none",t.innerHTML=`<span>${e}</span>`,s.appendChild(t)}e.appendChild(s)}{const s=document.createElement("tbody");t.appendChild(s);let o=this.range?e.LX.dateFromDateString(this.range[0]):null,n=this.range?e.LX.dateFromDateString(this.range[1]):null;for(let e=0;e<6;e++){const t=document.createElement("tr"),i=this.calendarDays.slice(7*e,7*e+7);for(const e of i){const s=document.createElement("th");s.className="leading-8 text-xs font-normal rounded select-none cursor-pointer shrink-0 grow-0";const i=new Date(`${this.month}/${e.day}/${this.year}`),a=new Date,r=!this.untilToday||i.getTime()<a.getTime(),l=!this.fromToday||(i.getFullYear()>a.getFullYear()||i.getFullYear()===a.getFullYear()&&i.getMonth()>a.getMonth()||i.getFullYear()===a.getFullYear()&&i.getMonth()===a.getMonth()&&i.getDate()>=a.getDate()),c=e.currentMonth&&r&&l,d=this.currentDate&&e.day==this.currentDate.day&&this.month==this.currentDate.month&&this.year==this.currentDate.year&&e.currentMonth,h=c&&o&&e.day==o.getDate()&&this.month==o.getMonth()+1&&this.year==o.getFullYear(),u=c&&n&&e.day==n.getDate()&&this.month==n.getMonth()+1&&this.year==n.getFullYear();!this.range&&d||this.range&&(h||u)?s.className+=" bg-primary text-primary-foreground":this.range&&c&&i>o&&i<n?s.className+=" bg-accent text-accent-foreground":s.className+=` ${c?"text-secondary-foreground":"text-muted-foreground"} hover:bg-secondary`,s.innerHTML=`<span>${e.day}</span>`,t.appendChild(s),c?s.addEventListener("click",()=>{this.day=e.day,this.currentDate=this._getCurrentDate(),this.onChange&&this.onChange(this.currentDate)}):void 0!==this.range||e.currentMonth||s.addEventListener("click",()=>{e?.prevMonth?this._previousMonth():this._nextMonth()})}s.appendChild(t)}}}}fromDateString(e){const t=e.split("/");this.day=parseInt(t[0]),this.month=parseInt(t[1]),this.monthName=this.getMonthName(this.month-1),this.year=parseInt(t[2]),this.currentDate=this._getCurrentDate(),this.fromMonthYear(this.month,this.year)}fromMonthYear(e,t){e=Math.max(e-1,0),t=t??(new Date).getFullYear();const s=new Date(t,e,1).getDay(),o=0===s?6:s-1,n=new Date(t,e+1,0).getDate(),i=new Date(0===e?t-1:t,(0===e?11:e-1)+1,0).getDate(),a=[];for(let e=o-1;e>=0;e--)a.push({day:i-e,currentMonth:!1,prevMonth:!0});for(let e=1;e<=n;e++)a.push({day:e,currentMonth:!0});const r=42-a.length;for(let e=1;e<=r;e++)a.push({day:e,currentMonth:!1,nextMonth:!0});this.monthName=this.getMonthName(e),this.firstDay=o,this.daysInMonth=n,this.calendarDays=a,this.refresh()}getMonthName(e,t="en-US"){return new Intl.DateTimeFormat(t,{month:"long"}).format(new Date(2e3,e,1))}getFullDate(e,t,s){return`${e??this.monthName} ${t??this.day}${this._getOrdinalSuffix(t??this.day)}, ${s??this.year}`}setRange(e){console.assert(e.constructor===Array,"Date Range must be in Array format"),this.range=e,this.refresh()}setMonth(e){this.month=e,this.fromMonthYear(this.month,this.year)}_getOrdinalSuffix(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}}e.LX.Calendar=w;class S{root;fromCalendar;toCalendar;from;to;_selectingRange=!1;constructor(t,s={}){this.root=e.LX.makeContainer(["auto","auto"],"flex flex-row"),console.assert(t&&t.constructor===Array,"Range cannot be empty and has to be an Array!");let o=null,n=!1;{const s=e.LX.dateFromDateString(t[0]),i=e.LX.dateFromDateString(t[1]);if(s>i){const e=t[0];t[0]=t[1],t[1]=e,n=!0}o=(n?i.getMonth():s.getMonth())+2}this.from=t[0],this.to=t[1];const i=e=>{const t=`${e.day}/${e.month}/${e.year}`;this._selectingRange?(this.to=t,this._selectingRange=!1):(this.from=this.to=t,this._selectingRange=!0);const o=[this.from,this.to];this.fromCalendar.setRange(o),this.toCalendar.setRange(o),s.onChange&&s.onChange(o)};this.fromCalendar=new w(this.from,{skipNextMonth:!0,onChange:i,onPreviousMonth:()=>{this.toCalendar._previousMonth()},range:t}),this.toCalendar=new w(this.to,{skipPrevMonth:!0,onChange:i,onNextMonth:()=>{this.fromCalendar._nextMonth()},range:t}),console.assert(o&&"New Month must be valid"),this.toCalendar.setMonth(o),this.root.appendChild(this.fromCalendar.root),this.root.appendChild(this.toCalendar.root)}getFullDate(){const t=e.LX.dateFromDateString(this.from),s=this.fromCalendar.getMonthName(t.getMonth()),o=e.LX.dateFromDateString(this.to),n=this.toCalendar.getMonthName(o.getMonth());return`${this.fromCalendar.getFullDate(s,t.getDate(),t.getFullYear())} to ${this.toCalendar.getFullDate(n,o.getDate(),o.getFullYear())}`}}e.LX.CalendarRange=S;class k extends a{calendar;_popover=void 0;constructor(t,s,o,i={}){super(e.ComponentType.DATE,t,null,i);const a=s?.constructor===Array;if(!a&&i.today){const e=new Date;s=`${e.getDate()}/${e.getMonth()+1}/${e.getFullYear()}`}this.onGetValue=()=>s,this.onSetValue=(e,i,r)=>{a||this.calendar.fromDateString(e),s=e,c(this.calendar.getFullDate()),i||this._trigger(new n(t,e,r),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=`calc( 100% - ${t})`};const l=e.LX.makeContainer(["auto","auto"],"lexdate flex flex-row");this.root.appendChild(l),this.calendar=a?new S(s,{onChange:e=>{this.set(e)},...i}):new w(s,{onChange:e=>{const t=`${e.day}/${e.month}/${e.year}`;this.set(t)},...i});const c=t=>{const s=!!t;l.innerHTML="";const o=(t=t??"Pick a date").split(" to "),n=a?o[0]:t,i=e.LX.makeIcon("Calendar"),c=new r(null,n,()=>{this._popover=new b(c.root,[this.calendar])},{disabled:this.disabled,buttonClass:`outline flex flex-row px-3 ${s?"":"text-muted-foreground"} justify-between`});if(c.root.querySelector("button").appendChild(i),c.root.style.width="100%",l.appendChild(c.root),a){const t=e.LX.makeIcon("ArrowRight");e.LX.makeContainer(["32px","auto"],"content-center",t.innerHTML,l);const n=o[1],i=e.LX.makeIcon("Calendar"),a=new r(null,n,()=>{this._popover=new b(a.root,[this.calendar])},{disabled:this.disabled,buttonClass:`outline flex flex-row px-3 ${s?"":"text-muted-foreground"} justify-between`});a.root.querySelector("button").appendChild(i),a.root.style.width="100%",l.appendChild(a.root)}};s?c(this.calendar.getFullDate()):c(),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Calendar=w,e.LX.CalendarRange=S,e.LX.DatePicker=k;class E{element;canvas;constructor(t,s={}){let o=document.createElement("div");o.className=e.LX.mergeClass("dial",s.className),o.style.width=o.style.height=s.size||"100%",o.style.minWidth=o.style.minHeight="50px",o.bgcolor=s.bgColor||e.LX.getCSSVariable("background"),o.pointscolor=s.pointsColor||e.LX.getCSSVariable("primary/50"),o.linecolor=s.lineColor||"#555",o.value=t||[],o.xrange=s.xrange||[0,1],o.yrange=s.yrange||[0,1],o.defaulty=null!=s.defaulty?s.defaulty:0,o.no_overlap=s.noOverlap||!1,o.show_samples=s.showSamples||0,o.allow_add_values=s.allowAddValues??!0,o.draggable_x=s.draggableX??!0,o.draggable_y=s.draggableY??!0,o.smooth=(s.smooth&&"number"==typeof s.smooth?s.smooth:.3)||!1,o.move_out=s.moveOutAction??e.LX.CURVE_MOVEOUT_DELETE,e.LX.addSignal("@on_new_color_scheme",(t,n)=>{o.bgcolor=s.bgColor||e.LX.getCSSVariable("background"),o.pointscolor=s.pointsColor||e.LX.getCSSVariable("primary/50"),this.redraw()}),this.element=o;let n=document.createElement("canvas");function i(e){return[n.width*(e[0]-o.xrange[0])/o.xrange[1],n.height*(e[1]-o.yrange[0])/o.yrange[1]]}function a(e){return[e[0]*o.xrange[1]/n.width+o.xrange[0],e[1]*o.yrange[1]/n.height+o.yrange[0]]}n.width=n.height=s.size||200,o.appendChild(n),this.canvas=n,o.addEventListener("mousedown",function(t){document.addEventListener("mousemove",c),document.addEventListener("mouseup",d);var s=n.getBoundingClientRect(),h=t.clientX-s.left,m=t.clientY-s.top;if(r=function(e,t){for(var s=1e5,n=-1,a=0;a<o.value.length;a++){var r=u([e,t],i(o.value[a]));r<s&&r<8&&(s=r,n=a)}return n}(h,n.height-m),t.button==e.LX.MOUSE_LEFT_CLICK&&-1==r&&o.allow_add_values){var g=a([h,n.height-m]);o.value.push(g),p(),r=o.value.indexOf(g)}l=[h,m],o.redraw(),t.preventDefault(),t.stopPropagation()}),o.getValueAt=function(e){if(e<o.xrange[0]||e>o.xrange[1])return o.defaulty;for(var t=[o.xrange[0],o.defaulty],s=0,n=0;n<o.value.length;n+=1){var i=o.value[n];if(e==i[0])return i[1];if(e<i[0])return s=(e-t[0])/(i[0]-t[0]),t[1]*(1-s)+i[1]*s;t=i}return i=[o.xrange[1],o.defaulty],s=(e-t[0])/(i[0]-t[0]),t[1]*(1-s)+i[1]*s},o.resample=function(e){for(var t=[],s=(o.xrange[1]-o.xrange[0])/e,n=o.xrange[0];n<=o.xrange[1];n+=s)t.push(o.getValueAt(n));return t},o.addValue=function(e){for(var t=0;t<o.value;t++){if(!(o.value[t][0]<e[0]))return o.value.splice(t,0,e),void this.redraw()}o.value.push(e),this.redraw()};var r=-1;o.redraw=function(e={}){e.value&&(o.value=e.value),e.xrange&&(o.xrange=e.xrange),e.yrange&&(o.yrange=e.yrange),e.smooth&&(o.smooth=e.smooth);var t=n.getContext("2d");if(!t)return;t.setTransform(1,0,0,1,0,0),t.translate(0,n.height),t.scale(1,-1),t.fillStyle=o.bgcolor,t.fillRect(0,0,n.width,n.height),t.strokeStyle=o.linecolor,t.beginPath();var s=i([o.xrange[0],o.defaulty]);t.moveTo(s[0],s[1]);let a=[s[0],s[1]];for(var l in o.value){s=i(o.value[l]),a.push(s[0]),a.push(s[1])}s=i([o.xrange[1],o.defaulty]),a.push(s[0]),a.push(s[1]);s=i([0,0]),t.fillStyle="gray",t.beginPath(),t.arc(s[0],s[1],3,0,2*Math.PI),t.fill();for(var c=0;c<o.value.length;c+=1){s=i(o.value[c]);const e=c==r;t.fillStyle=e?"white":o.pointscolor,t.beginPath(),t.arc(s[0],s[1],e?4:3,0,2*Math.PI),t.fill()}if(o.show_samples){var d=o.resample(o.show_samples);t.fillStyle="#888";for(c=0;c<d.length;c+=1){s=i([c*((o.xrange[1]-o.xrange[0])/o.show_samples)+o.xrange[0],d[c]]),t.beginPath(),t.arc(s[0],s[1],2,0,2*Math.PI),t.fill()}}};var l=[0,0];function c(t){var s=n.getBoundingClientRect(),i=t.clientX-s.left,c=t.clientY-s.top;i<0?i=0:i>n.width&&(i=n.width),c<0?c=0:c>n.height&&(c=n.height);const m=[t.clientX-s.left,t.clientY-s.top];if(-1!=r&&u(m,[i,c])>.5*n.height){if(o.move_out==e.LX.CURVE_MOVEOUT_DELETE)o.value.splice(r,1);else{const e=[m[0]-i,m[1]-c];let t=o.value[r];t[0]=0==e[0]?t[0]:e[0]<0?o.xrange[0]:o.xrange[1],t[1]=0==e[1]?t[1]:e[1]<0?o.yrange[1]:o.yrange[0]}d(t)}else{var g=a([-(o.draggable_x?l[0]-i:0),o.draggable_y?l[1]-c:0]);if(-1!=r){var f=o.xrange[0],L=o.xrange[1];o.no_overlap&&(r>0&&(f=o.value[r-1][0]),r<o.value.length-1&&(L=o.value[r+1][0]));var b=o.value[r];b[0]+=g[0],b[1]+=g[1],b[0]<f?b[0]=f:b[0]>L&&(b[0]=L),b[1]<o.yrange[0]?b[1]=o.yrange[0]:b[1]>o.yrange[1]&&(b[1]=o.yrange[1])}p(),o.redraw(),l[0]=i,l[1]=c,h(t),t.preventDefault(),t.stopPropagation()}}function d(e){r=-1,o.redraw(),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),h(e),e.preventDefault(),e.stopPropagation()}function h(e){s.callback&&s.callback.call(o,o.value,e)}function u(e,t){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function p(){var e=null;-1!=r&&(e=o.value[r]),o.value.sort(function(e,t){return e[0]-t[0]}),e&&(r=o.value.indexOf(e))}return o.redraw(),this}redraw(e={}){this.element.redraw(e)}}e.LX.CanvasDial=E;class M extends a{dialInstance;constructor(t,s,o,i={}){let a=JSON.parse(JSON.stringify(s));super(e.ComponentType.DIAL,t,a,i),this.onGetValue=()=>JSON.parse(JSON.stringify(l.element.value)),this.onSetValue=(e,s,i)=>{l.element.value=JSON.parse(JSON.stringify(e)),l.redraw(),s||this._trigger(new n(t,l.element.value,i),o)},this.onResize=t=>{const s=this.root.domName?.style.width??"0px";r.style.width=`calc( 100% - ${s})`,e.LX.flushCss(r),l.element.style.height=l.element.offsetWidth+"px",l.canvas.width=l.element.offsetWidth,r.style.width=l.element.offsetWidth+"px",l.canvas.height=l.canvas.width,l.redraw()};var r=document.createElement("div");r.className="lexcurve",this.root.appendChild(r),i.callback=(e,s)=>{this._trigger(new n(t,e,s),o)},i.name=t;let l=new E(s,i);r.appendChild(l.element),this.dialInstance=l,e.LX.doAsync(this.onResize.bind(this))}}e.LX.CanvasDial=E,e.LX.Dial=M;class T extends a{constructor(t,s,o={}){super(e.ComponentType.FILE,t,null,o);let n=o.local??!0,i=o.type??"text",a=o.read??!0;this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=`calc( 100% - ${t})`};let l=document.createElement("input");if(l.className="lexfileinput",l.type="file",l.disabled=this.disabled,this.root.appendChild(l),o.placeholder&&(l.placeholder=o.placeholder),l.addEventListener("change",function(e){const t=e.target.files;if(t.length)if(a){o.onBeforeRead&&o.onBeforeRead();const e=new FileReader;"text"===i?e.readAsText(t[0]):"buffer"===i?e.readAsArrayBuffer(t[0]):"bin"===i?e.readAsBinaryString(t[0]):"url"===i&&e.readAsDataURL(t[0]),e.onload=e=>{s.call(this,e.target?.result,t[0])}}else s(t[0])}),l.addEventListener("cancel",function(e){s(null)}),n){let t=null;const s=new r(null,"",()=>{t||(t=new e.LX.Dialog("Load Settings",e=>{e.addSelect("Type",["text","buffer","bin","url"],i,e=>{i=e}),e.addButton(null,"Reload",()=>{l.dispatchEvent(new Event("change"))})},{onclose:e=>{e.remove(),t=null}}))},{skipInlineCount:!0,title:"Settings",disabled:this.disabled,icon:"Settings"});this.root.appendChild(s.root)}e.LX.doAsync(this.onResize.bind(this))}}e.LX.FileInput=T;class A extends a{data;formData={};primaryButton;constructor(t,s,o,n={}){if(s.constructor!=Object)return void console.error("Form data must be an Object");n.hideName=!0,super(e.ComponentType.FORM,t,null,n),this.onGetValue=()=>this.formData,this.onSetValue=(t,s,o)=>{this.formData=t;const n=i.querySelectorAll(".lexcomponent");for(let o=0;o<n.length;++o){if(n[o].jsInstance.type!=e.ComponentType.TEXT)continue;let i=n[o].querySelector(".lexcomponentname").innerText,r=n[o].querySelector(".lextext input");r.value=t[i]??"",a._dispatchEvent(r,"focusout",s)}};let i=document.createElement("div");i.className="flex flex-col gap-1",i.style.width="100%",this.root.appendChild(i);for(let t in s){let o=s[t];if(o.constructor!=Object){const n=e.LX.deepCopy(o);o={value:n},s[t]=o}if(o.width="100%",o.placeholder=o.placeholder??o.label??`Enter ${t}`,o.ignoreValidation=!0,!n.skipLabels){const e=new h(null,o.label??t,null,{disabled:!0,inputClass:"formlabel text-xs bg-none text-muted-foreground"});i.appendChild(e.root)}o.textComponent=new h(null,o.constructor==Object?o.value:o,(e,s)=>{this.formData[t]=e,o.submit&&s?.constructor===KeyboardEvent&&this.submit()},o),i.appendChild(o.textComponent.root),this.formData[t]=o.constructor==Object?o.value:o}const l=e.LX.makeContainer(["100%","auto"],"flex flex-row mt-2","",i);if(n.secondaryActionName||n.secondaryActionCallback){const e=new r(null,n.secondaryActionName??"Cancel",(e,t)=>{n.secondaryActionCallback&&n.secondaryActionCallback(this.formData,t)},{width:"100%",minWidth:"0",buttonClass:n.secondaryButtonClass??"secondary"});l.appendChild(e.root)}this.primaryButton=new r(null,n.primaryActionName??"Submit",(t,n)=>{this.syncInputs();const i=[];for(let t in s){let o=s[t];const n=o.pattern,a=n?.fieldMatchName?this.formData[n.fieldMatchName]:void 0;if(!o.textComponent.valid(void 0,a)){const s={entry:t,type:"input_not_valid",messages:[]};n&&(s.messages=e.LX.validateValueAtPattern(this.formData[t],n,a)),i.push(s)}}o&&o(this.formData,i,n)},{width:"100%",minWidth:"0",buttonClass:n.primaryButtonClass??"primary"}),l.appendChild(this.primaryButton.root),n.skipEnterSubmit||this.root.addEventListener("keydown",e=>{if("Enter"!==e.key||e.shiftKey)return;"TEXTAREA"!==e.target.tagName&&(e.preventDefault(),this.submit())}),this.data=s}submit(){this.syncInputs(),this.primaryButton?.click()}syncInputs(){for(const e in this.data){const t=this.data[e].textComponent;t instanceof h&&(t.syncFromDOM(),this.formData[e]=t.value())}}}e.LX.Form=A;class X extends a{setLayers;constructor(t,s,o,i={}){super(e.ComponentType.LAYERS,t,s,i),this.onGetValue=()=>s,this.onSetValue=(e,i,a)=>{s=e,this.setLayers(s),i||this._trigger(new n(t,s,a),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=`calc( 100% - ${t})`};const a=e.LX.makeElement("div","lexlayers grid","",this.root),r=i.maxBits??16;this.setLayers=e=>{a.innerHTML="";let t=e.toString(2),s=t.length;for(let e=0;e<r-s;++e)t="0"+t;for(let s=0;s<r;++s){let o=document.createElement("button");if(o.className="lexlayer size-6 text-secondary-foreground text-center content-center place-self-center cursor-pointer font-semibold text-xs rounded-lg select-none \n disabled:pointer-events-none disabled:opacity-50",o.disabled=this.disabled,null!=e){const e=t[r-s-1];null!=e&&"1"==e&&o.classList.add("selected")}o.innerText=s+1,o.title="Bit "+s+", value "+(1<<s),a.appendChild(o),o.addEventListener("click",t=>{t.stopPropagation(),t.stopImmediatePropagation(),t.target.classList.toggle("selected");const o=e^1<<s;this.set(o,!1,t)})}},this.setLayers(s),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Layers=X;class z extends a{_updateValues;constructor(t,s,o,i,a={}){super(e.ComponentType.LIST,t,o,a),this.onGetValue=()=>o,this.onSetValue=(e,a,l)=>{r.querySelectorAll(".lexlistitem").forEach(e=>e.classList.remove("selected"));let c=null;for(let t=0;t<s.length;++t){const o=s[t];if(o==e||o.constructor==Array&&o[0]==e){c=t;break}}c?(r.children[c].classList.toggle("selected"),o=e,a||this._trigger(new n(t,e,l),i)):console.error(`Cannot find item ${e} in List.`)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";r.style.width=`calc( 100% - ${t})`},this._updateValues=a=>{s=a,r.innerHTML="";for(let a=0;a<s.length;++a){let l=null,c=s[a];c.constructor===Array&&(l=c[1],c=c[0]);let d=document.createElement("button");d.className="lexlistitem disabled:pointer-events-none disabled:opacity-50 "+(o==c?"selected":""),d.disabled=this.disabled,l&&d.appendChild(e.LX.makeIcon(l)),d.innerHTML+=`<span>${c}</span>`,d.addEventListener("click",e=>{r.querySelectorAll(".lexlistitem").forEach(e=>e.classList.remove("selected")),d.classList.toggle("selected"),o=c,this._trigger(new n(t,c,e),i)}),r.appendChild(d)}};let r=document.createElement("div");r.className="bg-background flex flex-col gap-1 rounded-xl border-color p-2",this.root.appendChild(r),this._updateValues(s),e.LX.doAsync(this.onResize.bind(this))}}e.LX.List=z;class P{x;y;constructor(e,t){this.x=e??0,this.y=t??e??0}get xy(){return[this.x,this.y]}get yx(){return[this.y,this.x]}set(e,t){this.x=e,this.y=t}add(e,t=new P){return t.set(this.x+e.x,this.y+e.y),t}sub(e,t=new P){return t.set(this.x-e.x,this.y-e.y),t}mul(e,t=new P){return e.constructor==Number&&(e=new P(e)),t.set(this.x*e.x,this.y*e.y),t}div(e,t=new P){return e.constructor==Number&&(e=new P(e)),t.set(this.x/e.x,this.y/e.y),t}abs(e=new P){return e.set(Math.abs(this.x),Math.abs(this.y)),e}dot(e){return this.x*e.x+this.y*e.y}len2(){return this.dot(this)}len(){return Math.sqrt(this.len2())}nrm(e=new P){return e.set(this.x,this.y),e.mul(1/this.len(),e)}dst(e){return e.sub(this).len()}clp(t,s,o=new P){return o.set(e.LX.clamp(this.x,t,s),e.LX.clamp(this.y,t,s)),o}fromArray(e){this.x=e[0],this.y=e[1]}toArray(){return this.xy}}e.LX.vec2=P;class N{static COLORS=[[255,0,0],[0,255,0],[0,0,255],[0,128,128],[128,0,128],[128,128,0],[255,128,0],[255,0,128],[0,128,255],[128,0,255]];static GRID_SIZE=64;canvas;imageCanvas=null;root;circular;showNames;size;points;callback;weights=[];weightsObj={};currentPosition=new P(0,0);circleCenter=[0,0];circleRadius=1;margin=8;dragging=!1;_valuesChanged=!0;_selectedPoint=null;_precomputedWeightsGridSize=0;_precomputedWeights=null;constructor(t,s,o={}){this.circular=o.circular??!1,this.showNames=o.showNames??!0,this.size=o.size??[200,200],this.points=t??[],this.callback=s,this._valuesChanged=!0,this._selectedPoint=null,this.root=e.LX.makeContainer(["auto","auto"]),this.root.tabIndex="1",this.root.addEventListener("mousedown",function(e){var t=n.root.ownerDocument;return t.addEventListener("mouseup",a),t.addEventListener("mousemove",i),e.stopPropagation(),e.preventDefault(),n.dragging=!0,!0});const n=this;function i(t){if(!n.dragging)return;const s=n.margin,o=n.root.getBoundingClientRect();let i=new P;i.set(t.x-o.x-.5*n.size[0],t.y-o.y-.5*n.size[1]);var a=n.currentPosition;if(a.set(e.LX.clamp(i.x/(.5*n.size[0]-s),-1,1),e.LX.clamp(i.y/(.5*n.size[1]-s),-1,1)),n.circular){const e=new P(0,0);a.dst(e)>1&&(a=a.nrm())}return n.renderToCanvas(n.canvas.getContext("2d",{willReadFrequently:!0})),n.computeWeights(a),n.callback&&n.callback(n.weightsObj,n.weights,a),!0}function a(e){n.dragging=!1;var t=n.root.ownerDocument;t.removeEventListener("mouseup",a),t.removeEventListener("mousemove",i)}this.canvas=document.createElement("canvas"),this.canvas.width=this.size[0],this.canvas.height=this.size[1],this.root.appendChild(this.canvas);const r=this.canvas.getContext("2d",{willReadFrequently:!0});this.renderToCanvas(r)}computeWeights(e){if(!this.points.length)return;let t=this._precomputedWeights;t&&!this._valuesChanged||(t=this.precomputeWeights());let s=this.weights;s.length=this.points.length;for(var o=0;o<s.length;++o)s[o]=0;const n=N.GRID_SIZE;let i=0,a=new P;for(var r=0;r<n;++r)for(var l=0;l<n;++l){a.set(l/n*2-1,r/n*2-1);var c=2*l+r*n*2,d=t[c];e.dst(a)<t[c+1]+.001&&(s[d]+=1,i++)}for(o=0;o<s.length;++o)s[o]/=i,this.weightsObj[this.points[o].name]=s[o];return s}precomputeWeights(){this._valuesChanged=!1;const e=this.points.length,t=N.GRID_SIZE,s=2*t*t;let o=new P;this._precomputedWeights&&this._precomputedWeights.length==s||(this._precomputedWeights=new Float32Array(s));let n=this._precomputedWeights;this._precomputedWeightsGridSize=t;for(let s=0;s<t;++s)for(let i=0;i<t;++i){let a=-1,r=1e5;for(let n=0;n<e;++n){o.set(i/t*2-1,s/t*2-1);let e=new P;e.fromArray(this.points[n].pos);let l=o.dst(e);l>r||(a=n,r=l)}n[2*i+2*s*t]=a,n[2*i+2*s*t+1]=r}return n}precomputeWeightsToImage(e){if(!this.points.length)return null;const t=N.GRID_SIZE;var s=this._precomputedWeights;s&&!this._valuesChanged&&this._precomputedWeightsGridSize==t||(s=this.precomputeWeights());var o=this.imageCanvas;o||(o=this.imageCanvas=document.createElement("canvas")),o.width=o.height=t;var n=o.getContext("2d",{willReadFrequently:!0});if(!n)return;var i=this.weights;i.length=this.points.length;for(var a=0;a<i.length;++a)i[a]=0;let r=0,l=n.getImageData(0,0,t,t),c=new P;for(var d=0;d<t;++d)for(var h=0;h<t;++h){c.set(h/t*2-1,d/t*2-1);const o=4*h+d*t*4,n=2*h+d*t*2,a=s[n],p=N.COLORS[a%N.COLORS.length];var u=e.dst(c)<s[n+1]+.001;u&&(i[a]+=1,r++),l.data[o]=p[0]+(u?128:0),l.data[o+1]=p[1]+(u?128:0),l.data[o+2]=p[2]+(u?128:0),l.data[o+3]=255}for(let e=0;e<i.length;++e)i[e]/=r;return n.putImageData(l,0,0),o}addPoint(t,s=null){if(this.findPoint(t))return void console.warn("CanvasMap2D.addPoint: There is already a point with that name");s||(s=[this.currentPosition.x,this.currentPosition.y]),s[0]=e.LX.clamp(s[0],-1,1),s[1]=e.LX.clamp(s[1],-1,1);const o={name:t,pos:s};return this.points.push(o),this._valuesChanged=!0,o}removePoint(e){const t=this.points.findIndex(t=>t.name==e);t>-1&&(this.points.splice(t,1),this._valuesChanged=!0)}findPoint(e){return this.points.find(t=>t.name==e)}clear(){this.points.length=0,this._precomputedWeights=null,this._selectedPoint=null}renderToCanvas(t){if(!t)return;const s=this.margin,o=this.size[0],n=this.size[1];t.fillStyle="black",t.strokeStyle="#BBB",t.clearRect(0,0,o,n),this.circular?(this.circleCenter[0]=.5*o,this.circleCenter[1]=.5*n,this.circleRadius=.5*n-s,t.lineWidth=1,t.beginPath(),t.arc(this.circleCenter[0],this.circleCenter[1],this.circleRadius,0,2*Math.PI),t.fill(),t.stroke(),t.beginPath(),t.moveTo(this.circleCenter[0]+.5,this.circleCenter[1]-this.circleRadius),t.lineTo(this.circleCenter[0]+.5,this.circleCenter[1]+this.circleRadius),t.moveTo(this.circleCenter[0]-this.circleRadius,this.circleCenter[1]),t.lineTo(this.circleCenter[0]+this.circleRadius,this.circleCenter[1]),t.stroke()):(t.fillRect(s,s,o-2*s,n-2*s),t.strokeRect(s,s,o-2*s,n-2*s));var i=this.precomputeWeightsToImage(this.currentPosition);i&&(t.globalAlpha=.5,t.imageSmoothingEnabled=!1,this.circular?(t.save(),t.beginPath(),t.arc(this.circleCenter[0],this.circleCenter[1],this.circleRadius,0,2*Math.PI),t.clip(),t.drawImage(i,this.circleCenter[0]-this.circleRadius,this.circleCenter[1]-this.circleRadius,2*this.circleRadius,2*this.circleRadius),t.restore()):t.drawImage(i,s,s,o-2*s,n-2*s),t.imageSmoothingEnabled=!0,t.globalAlpha=1);for(let i=0;i<this.points.length;++i){const a=this.points[i];let r=.5*a.pos[0]+.5,l=.5*a.pos[1]+.5;r=r*(o-2*s)+s,l=l*(n-2*s)+s,r=e.LX.clamp(r,s,o-s),l=e.LX.clamp(l,s,n-s),t.fillStyle=a==this._selectedPoint?"#CDF":"#BCD",t.beginPath(),t.arc(r,l,3,0,2*Math.PI),t.fill(),this.showNames&&t.fillText(a.name,r+5,l+5)}t.fillStyle="white",t.beginPath();var a=.5*this.currentPosition.x+.5,r=.5*this.currentPosition.y+.5;a=a*(o-2*s)+s,r=r*(n-2*s)+s,a=e.LX.clamp(a,s,o-s),r=e.LX.clamp(r,s,n-s),t.arc(a,r,4,0,2*Math.PI),t.fill()}}e.LX.CanvasMap2D=N;class I extends a{map2d;_popover=null;constructor(t,s,o,n={}){super(e.ComponentType.MAP2D,t,null,n),this.onGetValue=()=>this.map2d.weightsObj,this.onSetValue=(e,t,s)=>{},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";i.style.width=`calc( 100% - ${t})`};var i=document.createElement("div");i.className="lexmap2d",this.root.appendChild(i),this.map2d=new N(s,o,n);const a=e.LX.makeIcon(n.mapIcon??"SquareMousePointer"),l=new r(null,"Open Map",()=>{this._popover=new b(l.root,[this.map2d])},{buttonClass:"outline justify-between",disabled:this.disabled});l.root.querySelector("button").appendChild(a),i.appendChild(l.root),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Map2D=I;class R{domEl;data;options;selected=[];_forceClose=!1;_callbacks={};constructor(e,t,s={}){if(this.domEl=e,this.data=t,this.options=s,t.constructor===Object)this._createItem(null,t);else for(let e of t)this._createItem(null,e)}_createItem(t,s,o=0,n){const i=this,a=this.domEl.querySelector(".lexnodetreefilter");if(s.children=s.children??[],a&&""!=a.value&&!s.id.includes(a.value)){for(var l=0;l<s.children.length;++l)this._createItem(s,s.children[l],o+1,n);return}const c=this.domEl.querySelector("ul");s.visible=s.visible??!0,s.parent=t;let d=s.children.length>0,h=this.selected.indexOf(s)>-1||s.selected;if(this.options.onlyFolders){let e=!1;s.children.forEach(t=>{e=e||"folder"==t.type}),d=!!e}let u=document.createElement("li");u.className=`lextreeitem inline-flex outline-none text-sm items-center h-7 cursor-pointer truncate rounded-lg select-none datalevel${o} ${d?"parent":""} ${h?" selected":""}`,u.id=e.LX.getSupportedDOMName(s.id),u.tabIndex="0",u.treeData=s,s.treeEl=u;let p=this.options.skipDefaultIcon??1?null:"Dot";if(d&&(p=s.closed?"Right":"Down"),p&&u.appendChild(e.LX.makeIcon(p,{iconClass:"hierarchy",svgClass:"sm"})),p=s.icon,p)if(s.icon.includes(".")){const e="https://raw.githubusercontent.com/jxarco/lexgui.js/master/";u.innerHTML+=`<img src="${e+s.icon}">`}else{const t=s.icon.split(" "),o=e.LX.makeIcon(t[0],{iconClass:"tree-item-icon mr-2",svgClass:"md"+(t.length>1?` ${t.slice(0).join(" ")}`:"")});u.appendChild(o)}u.innerHTML+=s.rename?"":s.id,u.style.paddingLeft=3+15*(o+1)+"px",c.appendChild(u);const m=t&&(s.metadata?.draggable??this.options.defaultDraggable??!0);m&&u.setAttribute("draggable","true"),u.addEventListener("click",e=>{if(f)return void(f=!1);e.shiftKey||(c.querySelectorAll("li").forEach(e=>{e.classList.remove("selected")}),this.selected.length=0);const t=this.selected.indexOf(s);if(u.classList.toggle("selected",-1==t),t>-1?this.selected.splice(t,1):this.selected.push(s),d&&s.id.length>1){s.closed=!1;const t=i._callbacks.caretChanged;if(void 0!==t){t({type:"caret",items:[s],domEvent:e,userInitiated:!0})}i.frefresh(s.id)}const o=i._callbacks.select;if(void 0!==o){o({type:"select",items:[s],result:this.selected,domEvent:e,userInitiated:!0})}}),u.addEventListener("dblclick",function(e){(i.options.rename??1)&&(s.rename=!0,i.refresh());const t=i._callbacks.dblClick;if(void 0!==t){t({type:"dbl_click",items:[s],domEvent:e,userInitiated:!0})}}),u.addEventListener("contextmenu",async t=>{t.preventDefault();const o=i._callbacks.contextMenu;if(!o)return;const n={type:"context_menu",items:this.selected,from:s,domEvent:t,userInitiated:!0},a=await o(n),r=this.selected.length>1,l=this.options.useDefaultContextMenuItems??!0;e.LX.addContextMenu(this.options.contextMenuTitle??(r?"Selected Nodes":s.id),t,e=>{if(a?.length){for(const t of a)e.add(t.name,{callback:t.callback});l&&e.add("")}l&&(e.add("Select Children",()=>{const e=t=>{if(!t.closed)for(let s of t.children??[]){if(!s)continue;this.domEl.querySelector("#"+s.id).classList.add("selected"),this.selected.push(s),e(s)}};this.domEl.querySelectorAll(".selected").forEach(e=>e.classList.remove("selected")),this.selected.length=0,e(s);const o=this._callbacks.select;if(void 0!==o){o({type:"select",items:[s],result:this.selected,domEvent:t,userInitiated:!0})}}),e.add("Delete",{callback:()=>{const e=this._callbacks.beforeDelete,t=this._callbacks.delete,o=(...e)=>{let o=[];this.selected.length?o.push(...i.deleteNodes(this.selected)):i.deleteNode(s)&&o.push(s),this.refresh();t&&t({type:"delete",items:o,userInitiated:!0},...e)};if(e){e({type:"delete",items:this.selected.length?this.selected:[s],userInitiated:!0},o)}else o()}}))})}),u.addEventListener("keydown",t=>{if(!s.rename)if(t.preventDefault(),"Delete"==t.key){const e=this._callbacks.beforeDelete,s=this._callbacks.delete,o=(...e)=>{const o=[];for(let e of this.selected)i.deleteNode(e)&&o.push(e);if(this.selected.length=0,this.refresh(),o.length){s&&s({type:"delete",items:o,domEvent:t,userInitiated:!0},...e)}};if(e){e({type:"delete",items:this.selected,domEvent:t,userInitiated:!0},o)}else o()}else if("ArrowUp"==t.key||"ArrowDown"==t.key){var o=this.selected.length>1?"ArrowUp"==t.key?this.selected.shift():this.selected.pop():this.selected[0],n=this.domEl.querySelector("#"+e.LX.getSupportedDOMName(o.id)),a="ArrowUp"==t.key?n.previousSibling:n.nextSibling;a&&a.click()}});const g=document.createElement("input");g.toggleAttribute("hidden",!s.rename),g.className="text-foreground bg-none text-sm border-none outline-none",g.value=s.id,u.appendChild(g),s.rename&&(u.classList.add("selected"),g.focus()),g.addEventListener("keyup",function(t){if("Enter"==t.key){const t=i._callbacks.beforeRename,o=i._callbacks.rename,n=s.id;this.value=this.value.replace(/\s/g,"_");const a=(...t)=>{s.id=e.LX.getSupportedDOMName(this.value),delete s.rename,i.frefresh(s.id),c.querySelector(`#${s.id}`).classList.add("selected");const a={type:"rename",items:[s],oldName:n,newName:this.value,userInitiated:!0};o&&o(a,...t)};if(t){t({type:"rename",items:[s],oldName:n,newName:this.value,userInitiated:!0},a)}else a()}else"Escape"==t.key&&(delete s.rename,i.frefresh(s.id))}),g.addEventListener("blur",function(e){delete s.rename,i.refresh()}),m&&u.addEventListener("dragstart",e=>{window.__tree_node_dragged=s}),u.addEventListener("dragover",e=>{e.preventDefault()},!1),u.addEventListener("dragenter",e=>{e.target.classList.add("draggingover")}),u.addEventListener("dragend",e=>{e.target.classList.remove("draggingover")}),u.addEventListener("dragleave",e=>{e.target.classList.remove("draggingover")}),u.addEventListener("drop",e=>{e.preventDefault();let t=window.__tree_node_dragged;if(!t)return t=window.__av_item_dragged,void(t&&(t._nodeTarget=s));e.target.classList.remove("draggingover");let o=s;if(t.id==o.id)return void console.warn("Cannot parent node to itself!");const n=function(e,t){var s=!1;for(var o of t.children){if(o.id==e.id)return!0;s=s||n(e,o)}return s};if(n(o,t))return void console.warn("Cannot parent node to a current child!");const a=this._callbacks.beforeMove,r=this._callbacks.move,l=(...s)=>{const n=t.parent.children.findIndex(e=>e.id==t.id),a=t.parent.children.splice(n,1);o.children.push(a[0]),i.refresh(),delete window.__tree_node_dragged;r&&r({type:"move",items:[t],to:o,domEvent:e,userInitiated:!0},...s)};if(a){a({type:"move",items:[t],to:o,domEvent:e,userInitiated:!0},l)}else l()});let f=!1;d&&u.querySelector("a.hierarchy").addEventListener("click",function(e){if(f=!0,e.stopImmediatePropagation(),e.stopPropagation(),e.altKey){const e=function(t){for(var s of(t.closed=!t.closed,t.children))e(s)};e(s)}else s.closed=!s.closed;const t=i._callbacks.caretChanged;if(void 0!==t){t({type:"caret",items:[s],domEvent:e,userInitiated:!0})}i.frefresh(s.id)});const L=e.LX.makeElement("div","flex flex-row ml-auto mr-2");if(u.appendChild(L),s.actions)for(let e=0;e<s.actions.length;++e){const t=s.actions[e],o=new r(null,"",(e,o)=>{o.stopPropagation(),t.callback&&t.callback(s,e,o)},{icon:t.icon,swap:t.swap,title:t.name,hideName:!0,className:"p-0 min-h-fit",buttonClass:"px-0 h-full bg-none"});L.appendChild(o.root)}if(!s.skipVisibility){const e=new r(null,"",(e,t)=>{t.stopPropagation(),s.visible=void 0!==s.visible&&!s.visible;const o=this._callbacks.visibleChanged;if(void 0!==o){o({type:"visibility",items:[s],domEvent:t,userInitiated:!0})}},{icon:s.visible?"Eye":"EyeOff",swap:s.visible?"EyeOff":"Eye",title:"Toggle visible",className:"p-0 min-h-fit",buttonClass:"px-0 h-full bg-none"});L.appendChild(e.root)}const b=function(e,t){if(e.id==t)return!0;let s=!1;for(var o of e?.children??[])s=s||b(o,t);return s},y=b(s,n);if(!s.closed||y)for(l=0;l<s.children.length;++l){let e=s.children[l];this.options.onlyFolders&&"folder"!=e.type||this._createItem(s,e,o+1,n)}}refresh(e,t){if(this.data=e??this.data,this.domEl.querySelector("ul").innerHTML="",this.data.constructor===Object)this._createItem(null,this.data,0,t);else for(let e of this.data)this._createItem(null,e,0,t)}frefresh(e){this.refresh();var t=this.domEl.querySelector(`#${e}`);t&&t.focus()}select(t,s){const o=this.domEl.querySelector(".lexnodetreefilter");if(o&&(o.value=""),this.refresh(null,t),this.domEl.querySelectorAll(".selected").forEach(e=>e.classList.remove("selected")),void 0===t){if(void 0===s)return void(this.selected.length=0);t=s.at(-1)}let n=null;if(void 0!==s){let e=this.data;for(const t of s){const s=e.children.find(e=>e.id===t);if(!s)break;e=s}n=e.treeEl,console.assert(n,"NodeTree: No domEl in item "+t)}else void 0!==t&&(n=this.domEl.querySelector("#"+e.LX.getSupportedDOMName(t)),console.assert(n,"NodeTree: Can't select node "+t));n||console.assert(n,"NodeTree: Can't select node "+t),n.classList.add("selected"),this.selected=[n.treeData],n.focus()}deleteNodes(e){const t=[];for(const s of e)this.deleteNode(s)&&t.push(s);return t}deleteNode(e){const t=this.data.constructor===Array;if(e.parent){let t=e.parent.children;const s=t.indexOf(e);t.splice(s,1)}else{if(!t)return console.warn("NodeTree: Can't delete root node from object data!"),!1;{const t=this.data.indexOf(e);console.assert(t>-1,"NodeTree: Can't delete root node "+e.id+" from data array!"),this.data.splice(t,1)}}return!0}}e.LX.NodeTree=R;class D extends a{innerTree;constructor(t,s,o={}){o.hideName=!0,super(e.ComponentType.TREE,t,null,o);let n=e.LX.makeElement("div","lextree p-1 rounded-lg w-full my-0 mx-auto font-medium text-sm min-h-3","",this.root);t&&e.LX.makeElement("span","block p-1 select-none text-base font-medium whitespace-nowrap",t,n);let i=e.LX.makeElement("div","lextreetools flex items-center bg-secondary px-2 rounded-lg gap-2 my-1");if(t||(i.className+=" notitle"),o.icons)for(let t of o.icons){const s=e.LX.makeIcon(t.icon,{title:t.name});s.addEventListener("click",t.callback),i.appendChild(s)}o.filter=o.filter??!0;let a=null;if(o.filter){a=document.createElement("input"),a.className="lexnodetreefilter",a.setAttribute("placeholder","Filter.."),a.style.width="100%",a.addEventListener("input",()=>{this.innerTree.refresh()});let t=e.LX.makeIcon("Search");i.appendChild(a),i.appendChild(t)}(o.icons||o.filter)&&n.appendChild(i);let r=e.LX.makeElement("ul","flex flex-col gap-1 ps-0");r.addEventListener("contextmenu",function(e){e.preventDefault()}),n.appendChild(r),this.innerTree=new R(n,s,o)}on(e,t){this.innerTree._callbacks[e]=t}}e.LX.Tree=D;class O extends a{constructor(t,s,o,i={}){const a=i.pattern??"xxx-xxx",r=(a.match(/x/g)||[]).length;(s=String(s)).length||(s="x".repeat(r)),super(e.ComponentType.OTP,t,s,i),this.onGetValue=()=>+s,this.onSetValue=(e,i,a)=>{d(s=e),i||this._trigger(new n(t,e,a),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=`calc( 100% - ${t})`};const l=document.createElement("div");l.className="lexotp flex flex-row items-center",this.root.appendChild(l);const c=a.split("-"),d=t=>{l.innerHTML="";let s=0,o=0;for(let n=0;n<c.length;++n){const i=c[n];for(let n=0;n<i.length;++n){let a=t[s++];a="x"==a?"":a;const r=e.LX.makeContainer(["36px","30px"],"lexotpslot border-t-color border-b-color border-l-color px-3 cursor-text select-none font-medium outline-none",a,l);r.tabIndex="1",this.disabled&&r.classList.add("disabled");const c=s;0==n?r.className+=" rounded-l":n==i.length-1&&(r.className+=" rounded-r border-r-color"),r.addEventListener("click",()=>{if(this.disabled)return;l.querySelectorAll(".lexotpslot").forEach(e=>e.classList.remove("active"));const e=l.querySelectorAll(".lexotpslot")[o];e.classList.add("active"),e.focus()}),r.addEventListener("blur",()=>{this.disabled||e.LX.doAsync(()=>{l.contains(document.activeElement)||l.querySelectorAll(".lexotpslot").forEach(e=>e.classList.remove("active"))},10)}),r.addEventListener("keyup",e=>{if(!this.disabled)if(/[^0-9]+/g.test(e.key))if("ArrowLeft"==e.key||"ArrowRight"==e.key){const t="ArrowLeft"==e.key?-1:1,s=l.querySelectorAll(".lexotpslot")[o+t];s&&(l.querySelectorAll(".lexotpslot")[o].classList.remove("active"),s.classList.add("active"),s.focus(),o+=t)}else"Enter"!=e.key||t.includes("x")||this.set(t);else{const s=e.key;console.assert(!Number.isNaN(parseInt(s))),r.innerHTML=s,t=t.substring(0,c-1)+s+t.substring(c);const n=l.querySelectorAll(".lexotpslot")[o+1];n?(l.querySelectorAll(".lexotpslot")[o].classList.remove("active"),n.classList.add("active"),n.focus(),o++):this.set(t)}})}n<c.length-1&&e.LX.makeContainer(["auto","auto"],"mx-2","-",l)}console.assert(s==t.length,"OTP Value/Pattern Mismatch!")};d(s)}}e.LX.OTPInput=O;class H extends a{constructor(t,s,o,i={}){super(e.ComponentType.PAD,t,null,i),this.onGetValue=()=>l.value.xy,this.onSetValue=(e,s,i)=>{l.value.set(e[0],e[1]),c(l.value),s||this._trigger(new n(t,l.value.xy,i),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=`calc( 100% - ${t})`};let a=document.createElement("div");a.className="lexpad",this.root.appendChild(a);let r=document.createElement("div");r.id="lexpad-"+t,r.className="lexinnerpad data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 border-color",r.style.width=i.padSize??"96px",r.style.height=i.padSize??"96px",r.dataset.disabled=this.disabled.toString(),a.appendChild(r);let l=document.createElement("div");l.className="lexpadthumb opacity-inherit",l.value=new P(s[0],s[1]),l.min=i.min??0,l.max=i.max??1,r.appendChild(l);let c=t=>{const[s,o]=[r.offsetWidth,r.offsetHeight],n=new P(e.LX.remapRange(t.x,l.min,l.max,0,1),e.LX.remapRange(t.y,l.min,l.max,0,1));l.style.transform=`translate(calc( ${s*n.x}px - 50% ), calc( ${o*n.y}px - 50%)`};r.addEventListener("mousedown",function(e){if(document.activeElement==l)return;var t=d.root.ownerDocument;t.addEventListener("mousemove",h),t.addEventListener("mouseup",u),document.body.classList.add("nocursor"),document.body.classList.add("noevents"),e.stopImmediatePropagation(),e.stopPropagation(),l.classList.add("active"),i.onPress&&i.onPress.bind(l)(e,l)});let d=this;function h(s){const i=r.getBoundingClientRect(),a=new P(s.x-i.x,s.y-i.y);a.clp(0,r.offsetWidth,a);const[c,h]=[r.offsetWidth,r.offsetHeight],u=a.div(new P(r.offsetWidth,r.offsetHeight));l.style.transform=`translate(calc( ${c*u.x}px - 50% ), calc( ${h*u.y}px - 50%)`,l.value=new P(e.LX.remapRange(u.x,0,1,l.min,l.max),e.LX.remapRange(u.y,0,1,l.min,l.max)),d._trigger(new n(t,l.value.xy,s),o),s.stopPropagation(),s.preventDefault()}function u(e){var t=d.root.ownerDocument;t.removeEventListener("mousemove",h),t.removeEventListener("mouseup",u),document.body.classList.remove("nocursor"),document.body.classList.remove("noevents"),l.classList.remove("active"),i.onRelease&&i.onRelease.bind(l)(e,l)}e.LX.doAsync(()=>{this.onResize(),c(l.value)})}}e.LX.Pad=H;class B extends a{constructor(t,s,o={}){super(e.ComponentType.PROGRESS,t,s,o),this.onGetValue=()=>a.value,this.onSetValue=(s,i,l)=>{s=e.LX.clamp(s,a.min,a.max),this.root.querySelector("meter").value=s,r(),this.root.querySelector("span")&&(this.root.querySelector("span").innerText=s),i||this._trigger(new n(t,s,l),o.callback)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";i.style.width=`calc( 100% - ${t})`};const i=e.LX.makeElement("div","flex justify-center items-center gap-2","",this.root);let a=e.LX.makeElement("meter","lexprogressbar outline-none rounded-lg select-none");a.id="lexprogressbar-"+t,a.step="any",a.min=o.min??0,a.max=o.max??1,a.low=o.low??a.low,a.high=o.high??a.high,a.optimum=o.optimum??a.optimum,a.value=s,i.appendChild(a);const r=()=>{let t=e.LX.getCSSVariable("color-blue-500");null!=a.low&&a.value<a.low?t=e.LX.getCSSVariable("destructive"):null!=a.high&&a.value<a.high&&(t=e.LX.getCSSVariable("warning")),a.style.background=`color-mix(in srgb, ${t} 20%, transparent)`};if(o.showValue){const o=document.getElementById("progressvalue-"+t);o&&o.remove(),e.LX.makeElement("span","w-12 flex-auto-keep text-center",s,i).id="progressvalue-"+t}if(o.editable){a.classList.add("editable");let t=t=>{var n=this.root.ownerDocument;n.addEventListener("mousemove",s),n.addEventListener("mouseup",o),document.body.classList.add("noevents"),a.classList.add("grabbing"),t.stopImmediatePropagation(),t.stopPropagation();const i=a.getBoundingClientRect(),r=e.LX.round(e.LX.remapRange(t.offsetX,0,i.width,a.min,a.max));this.set(r,!1,t)},s=t=>{if(0!=t.movementX){const s=a.getBoundingClientRect(),o=e.LX.round(e.LX.remapRange(t.offsetX-s.x,0,s.width,a.min,a.max));this.set(o,!1,t)}t.stopPropagation(),t.preventDefault()},o=e=>{var t=this.root.ownerDocument;t.removeEventListener("mousemove",s),t.removeEventListener("mouseup",o),document.body.classList.remove("noevents"),a.classList.remove("grabbing")};a.addEventListener("mousedown",t)}r(),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Progress=B;class $ extends a{constructor(t,s,o,i,a={}){super(e.ComponentType.RADIO,t,null,a);let r=null;this.onGetValue=()=>{const e=l.querySelectorAll("button");return r?[r,e[r]]:void 0},this.onSetValue=(e,t,s)=>{e=e[0]??e,console.assert(e.constructor==Number,"RadioGroup _value_ must be an Array index!");const a=l.querySelectorAll("button");a.forEach(e=>{e.checked=!1,e.classList.remove("checked")});const r=a[e];r.checked=!r.checked,r.classList.toggle("checked"),t||this._trigger(new n(null,[e,o[e]],s),i)};var l=document.createElement("div");l.className=e.LX.mergeClass("lexradiogroup flex flex-col",a.className),this.root.appendChild(l),e.LX.makeElement("span","font-medium mb-2",s,l);for(let e=0;e<o.length;++e){const t=document.createElement("div");t.className="lexradiogroupitem flex items-center gap-2 px-6 py-1",l.appendChild(t);const s=document.createElement("button");s.className="flex p-0 rounded-lg cursor-pointer",s.disabled=this.disabled,t.appendChild(s),s.addEventListener("click",t=>{this.set(e,!1,t)});const n=document.createElement("span");s.appendChild(n);const i=document.createElement("span");i.innerHTML=o[e],t.appendChild(i)}a.selected&&(console.assert(a.selected.constructor==Number,"RadioGroup _selected_ must be an Array index!"),r=a.selected,this.set(r,!0))}}e.LX.RadioGroup=$;class V extends a{_maxSlider=null;_labelTooltip=null;setLimits;constructor(t,s,o,i={}){const r=e.LX.deepCopy(s);super(e.ComponentType.RANGE,t,e.LX.deepCopy(r),i);const l=s.constructor==Array&&2==s.length;l&&(s=r[0],i.fill=!1),this.onGetValue=()=>{let e=s;return l?e=[s,r[1]]:i.left&&(e=+d.max-s+ +d.min),e},this.onSetValue=(a,h,u)=>{let p="";const m=i.max-i.min;if(l&&this._maxSlider){d.value=s=e.LX.clamp(+a[0],+d.min,+d.max),this._maxSlider.value=r[1]=e.LX.clamp(+a[1],+d.min,+d.max);const t=s/m-.5,o=r[1]/m-.5,n=e.LX.remapRange(s,i.min,i.max,0,1),l=e.LX.remapRange(r[1],i.min,i.max,0,1);d.style.setProperty("--range-min-value",100*n+"%"),d.style.setProperty("--range-max-value",100*l+"%"),d.style.setProperty("--range-fix-min-offset",-t+"rem"),d.style.setProperty("--range-fix-max-offset",`${o}rem`),c.dataset.tooltipOffsetX=""+(c.offsetWidth*n+c.offsetWidth*(l-n)*.5-.5*c.offsetWidth),p=`${s} - ${r[1]}`}else{if(isNaN(a))return;d.value=s=e.LX.clamp(+a,+d.min,+d.max);const t=.5*e.LX.remapRange(s,i.min,i.max,0,1);c.dataset.tooltipOffsetX=""+(c.offsetWidth*t-.5*c.offsetWidth),p=`${s}`}if(c.dataset.tooltipContent=p,this._labelTooltip&&(this._labelTooltip.innerHTML=p),!h){let e=s;l?e=[s,r[1]]:i.left&&(e=+d.max-s+ +d.min),this._trigger(new n(t,e,u),o)}},this.onResize=t=>{const o=this.root.domName?.style.width??"0px";if(c.style.width=i.inputWidth??`calc( 100% - ${o})`,l){const t=i.max-i.min,o=s/t-.5,n=r[1]/t-.5;d.style.setProperty("--range-min-value",100*e.LX.remapRange(s,i.min,i.max,0,1)+"%"),d.style.setProperty("--range-max-value",100*e.LX.remapRange(r[1],i.min,i.max,0,1)+"%"),d.style.setProperty("--range-fix-min-offset",-o+"rem"),d.style.setProperty("--range-fix-max-offset",`${n}rem`)}};const c=document.createElement("div");c.className="lexrange relative py-3",this.root.appendChild(c);let d=document.createElement("input");if(d.className=e.LX.mergeClass("lexrangeslider"+(l?" range pointer-events-none":""),i.className),d.min=i.min??0,d.max=i.max??100,d.step=i.step??1,d.type="range",d.disabled=this.disabled,s.constructor==Number&&(s=e.LX.clamp(s,+d.min,+d.max)),i.left&&(s=+d.max-s+ +d.min,d.classList.add("left")),(i.fill??1)||d.classList.add("no-fill"),d.value=s,c.appendChild(d),d.addEventListener("input",e=>{this.set(l?[Math.min(e.target.valueAsNumber,r[1]),r[1]]:e.target.valueAsNumber,!1,e)},{passive:!1}),l||(d.addEventListener("mousedown",function(e){i.onPress&&i.onPress.bind(d)(e,d)},!1),d.addEventListener("mouseup",function(e){i.onRelease&&i.onRelease.bind(d)(e,d)},!1)),this.setLimits=(e,t,s)=>{d.min=e??d.min,d.max=t??d.max,d.step=s??d.step,a._dispatchEvent(d,"input",!0)},e.LX.doAsync(()=>{this.onResize();let t=0;if(l){const o=e.LX.remapRange(s,i.min,i.max,0,1),n=e.LX.remapRange(r[1],i.min,i.max,0,1);t=c.offsetWidth*o+c.offsetWidth*(n-o)*.5-.5*c.offsetWidth}else{const o=.5*e.LX.remapRange(s,i.min,i.max,0,1);t=c.offsetWidth*o-.5*c.offsetWidth}e.LX.asTooltip(c,`${s}${l?`- ${r[1]}`:""}`,{offsetX:t,callback:e=>{this._labelTooltip=e}})}),r.constructor==Array){let t=e.LX.makeElement("input",e.LX.mergeClass("lexrangeslider no-fill pointer-events-none overlap absolute left-0",i.className));t.min=i.min??0,t.max=i.max??100,t.step=i.step??1,t.type="range",t.disabled=this.disabled,this._maxSlider=t;let o=r[1];t.value=o=e.LX.clamp(o,+t.min,+t.max),c.appendChild(t),t.addEventListener("input",e=>{r[1]=Math.max(s,+e.target.valueAsNumber),this.set([s,r[1]],!1,e)},{passive:!1})}}}e.LX.RangeInput=V;class F extends a{constructor(t,s,o,i={}){const a=i.allowHalf??!1;a||(s=Math.floor(s)),super(e.ComponentType.RATE,t,s,i),this.onGetValue=()=>s,this.onSetValue=(e,i,a)=>{h(s=e),i||this._trigger(new n(t,e,a),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";r.style.width=`calc( 100% - ${t})`};const r=document.createElement("div");r.className="lexrate relative data-[disabled=true]:pointer-events-none",r.dataset.disabled=this.disabled.toString(),this.root.appendChild(r);const l=e.LX.makeContainer(["fit-content","auto"],"flex flex-row gap-1","",r),c=e.LX.makeContainer(["fit-content","auto"],"absolute top-0 flex flex-row gap-1 pointer-events-none","",r),d=e.LX.makeContainer(["fit-content","auto"],"absolute top-0 flex flex-row gap-1 pointer-events-none","",r);l.addEventListener("mousemove",e=>{const t=e.target,s=t.dataset.idx;if(void 0!==s){const o=t.getBoundingClientRect(),n=a&&e.offsetX<.5*o.width;h(s-(n?.5:0))}},!1),l.addEventListener("mouseleave",e=>{h(s)},!1);for(let t=0;t<5;++t){const s=e.LX.makeIcon("Star",{svgClass:"lg fill-current text-accent"});s.dataset.idx=t+1,l.appendChild(s),s.addEventListener("click",e=>{const t=e.target,s=t.getBoundingClientRect(),o=a&&e.offsetX<.5*s.width;this.set(parseFloat(t.dataset.idx)-(o?.5:0))},!1);const o=e.LX.makeIcon("Star",{svgClass:"lg fill-current text-yellow-400"});c.appendChild(o);const n=e.LX.makeIcon("StarHalf",{svgClass:"lg fill-current text-yellow-400"});d.appendChild(n)}const h=e=>{for(let t=0;t<5;++t){const s=e>t+.5,o=c.childNodes[t],n=d.childNodes[t];if(s)o.style.opacity=1;else{o.style.opacity=0;const s=a&&e>t;n.style.opacity=s?1:0}}};h(s),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Rate=F;class W extends a{constructor(t,s,o,n={}){super(e.ComponentType.SIZE,t,s,n),this.onGetValue=()=>{const e=[];for(let t=0;t<this.root.dimensions.length;++t)e.push(this.root.dimensions[t].value());return e},this.onSetValue=(e,t,s)=>{for(let s=0;s<this.root.dimensions.length;++s)this.root.dimensions[s].set(e[s],t)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";i.style.width=`calc( 100% - ${t})`},this.root.aspectRatio=2==s.length?s[0]/s[1]:null,this.root.dimensions=[];const i=e.LX.makeElement("div","flex","",this.root);for(let t=0;t<s.length;++t){const a=new e.LX.Panel;if(this.root.dimensions[t]=a.addNumber(null,s[t],e=>{const s=this.value();if(this.root.locked){const o=0==t?1/this.root.aspectRatio:this.root.aspectRatio,n=(1+t)%2;s[n]=e*o,this.root.dimensions[n].set(s[n],!0)}o&&o(s)},{min:0,disabled:this.disabled,precision:n.precision,className:"flex-auto-fill"}),i.appendChild(this.root.dimensions[t].root),t+1!=s.length){const t=e.LX.makeIcon("X",{svgClass:"text-foreground font-bold"});i.appendChild(t)}}if(n.units&&e.LX.makeElement("span","text-muted-foreground align-center content-center font-medium flex-auto-keep select-none",n.units,i),this.root.aspectRatio){const e=new r(null,"",e=>{if(this.root.locked=e,e){const e=this.value();this.root.aspectRatio=e[0]/e[1]}},{title:"Lock Aspect Ratio",icon:"LockOpen",swap:"Lock",className:"flex-auto-keep",buttonClass:"h-auto bg-none p-0"});i.appendChild(e.root)}e.LX.doAsync(this.onResize.bind(this))}}e.LX.SizeInput=W;class q{static ITEMS_PER_PAGE_VALUES=[8,12,24,48,96];root;pagesRoot;page=1;pages=1;_alwaysShowEdges=!0;_useEllipsis=!0;_maxButtons=3;_itemsPerPage=12;_itemsPerPageValues=q.ITEMS_PER_PAGE_VALUES;onChange=()=>{};onItemsPerPageChange=()=>{};constructor(t={}){if(this.pages=t.pages??1,this.page=e.LX.clamp(t.page??1,1,this.pages),this._alwaysShowEdges=t.alwaysShowEdges??this._alwaysShowEdges,this._useEllipsis=t.useEllipsis??this._useEllipsis,this._maxButtons=t.maxButtons??this._maxButtons,this._itemsPerPage=t.itemsPerPage??this._itemsPerPage,-1===this._itemsPerPageValues.indexOf(this._itemsPerPage)&&(this._itemsPerPageValues.push(this._itemsPerPage),this._itemsPerPageValues=this._itemsPerPageValues.sort((e,t)=>e<t?-1:e>t?1:0)),"function"==typeof t.onChange&&(this.onChange=t.onChange),"function"==typeof t.onItemsPerPageChange&&(this.onItemsPerPageChange=t.onItemsPerPageChange),this.root=e.LX.makeContainer(["auto","auto"],e.LX.mergeClass("flex flex-row gap-2",t.className)),t.allowChangeItemsPerPage){const t=e.LX.makeContainer(["auto","auto"],"flex flex-row items-center","",this.root),s=new u(null,q.ITEMS_PER_PAGE_VALUES,this._itemsPerPage,e=>{this._itemsPerPage=e,this.onItemsPerPageChange?.(this._itemsPerPage)},{overflowContainer:null});t.appendChild(s.root)}this.pagesRoot=e.LX.makeContainer(["auto","auto"],"flex flex-row overflow-scroll","",this.root),this.refresh()}setPage(t){const s=e.LX.clamp(t,1,this.pages);s!==this.page&&(this.page=s,this.refresh(),this._emitChange())}setPages(e){this.pages=Math.max(1,e),this.page>this.pages&&(this.page=this.pages),this.refresh()}next(){this.setPage(this.page+1)}prev(){this.setPage(this.page-1)}refresh(){this.pagesRoot.innerHTML="",this._makeButton(e.LX.makeIcon("ChevronLeft").innerHTML,1===this.page,()=>this.prev(),"bg-none "+(1===this.page?"":"hover:bg-secondary"));const t=e.LX.makeContainer(["auto","auto"],"flex flex-row items-center","",this.pagesRoot),s=this._maxButtons+2;if(this.pages<=s)for(let e=1;e<=this.pages;e++)this._makePageButton(t,e);else{const o=this.page,n=this.pages,i=1,a=n,r=this._alwaysShowEdges?1:0,l=s-2,c=Math.floor(l/2);let d=Math.max(1+r,o-c),h=Math.min(n-r,o+c);d<=2&&(d=1+r,h=d+l-1),h>=n-1&&(h=n-r,d=h-l+1),this._alwaysShowEdges&&this._makePageButton(t,i),this._useEllipsis&&d>2&&e.LX.makeElement("span","h-6 px-2 text-lg font-semibold whitespace-nowrap","...",t);for(let e=d;e<=h;e++)this._makePageButton(t,e);this._useEllipsis&&h<n-1&&e.LX.makeElement("span","h-6 px-2 text-lg font-semibold whitespace-nowrap","...",t),this._alwaysShowEdges&&this._makePageButton(t,a)}this._makeButton(e.LX.makeIcon("ChevronRight").innerHTML,this.page===this.pages,()=>this.next(),"bg-none "+(this.page===this.pages?"":"hover:bg-secondary"))}_emitChange(){this.onChange?.(this.page),this.root.dispatchEvent(new CustomEvent("change",{detail:{page:this.page}}))}_makeButton(e,t,s,o,n){const i=new r(null,e,s,{disabled:t,buttonClass:o});return i.root.querySelector("button").style.paddingInline="0.5rem",(n=n??this.pagesRoot).appendChild(i.root),i.root}_makePageButton(e,t){const s="h-8 "+(t===this.page?"primary text-primary-foreground":"ghost");return this._makeButton(String(t),!1,()=>this.setPage(t),s,e)}}e.LX.Pagination=q;class U extends a{data;filter;customFilters;activeCustomFilters;rowOffsetCount=0;_currentFilter;_toggleColumns;_sortColumns;_resetCustomFiltersBtn=null;_hiddenColumns=[];_paginator;_showSelectedNumber;_centered;get centered(){return this._centered}set centered(e){this._setCentered(e)}_rowsPerPage=-1;get rowsPerPage(){return this._rowsPerPage}set rowsPerPage(e){this._setRowsPerPage(e)}constructor(t,s,o={}){if(!s)throw"Data is needed to create a table!";super(e.ComponentType.TABLE,t,null,o),this.onResize=e=>{const t=this.root.domName?.style.width??"0px";n.style.width=`calc( 100% - ${t})`};const n=document.createElement("div");n.className="lextable",this.root.appendChild(n),this._centered=o.centered??!1,!0===this._centered&&n.classList.add("centered"),this.data=s,this.filter=o.filter??!1,this.customFilters=o.customFilters??null,this.activeCustomFilters={},this._toggleColumns=o.toggleColumns??!1,this._sortColumns=o.sortColumns??!0,this._showSelectedNumber=o.showSelectedNumber??!0,this._currentFilter=o.filterValue,this._hiddenColumns=o.hiddenColumns??[],s.head=s.head??[],s.body=s.body??[],s.checkMap={},s.colVisibilityMap={},s.head.forEach((e,t)=>{const o=this._hiddenColumns.indexOf(e),n=!this._toggleColumns||-1===o;s.colVisibilityMap[t]=n}),o.pagination&&(this._rowsPerPage=o.rowsPerPage??12,this._paginator=new q({pages:this._getNumPages(),itemsPerPage:this._rowsPerPage,allowChangeItemsPerPage:o.allowChangeItemsPerPage??!0,onChange:this._onChangePage.bind(this),onItemsPerPageChange:e=>{this.rowsPerPage=e}}));const i=e=>{const t=e.match(/^(\d{1,2})[\/-](\d{1,2})[\/-](\d{2}|\d{4})$/);if(!t)return null;let s=Number(t[1]),o=Number(t[2])-1,n=Number(t[3]);n<100&&(n+=2e3);const i=new Date(n,o,s);return i.getFullYear()!==n||i.getMonth()!==o||i.getDate()!==s?null:i},a=(e,t,s,o)=>{const n=s[e],a=o[e],r=i(n),l=i(a);if(r&&l)return r.getTime()<l.getTime()?-t:r.getTime()>l.getTime()?t:0;const c=Number(n),d=Number(a);return isNaN(c)||isNaN(d)?n<a?-t:n>a?t:0:c<d?-t:c>d?t:0},l=(e,t)=>{s.body=s.body.sort(a.bind(this,e,t)),this.refresh()},c=this;if(this.filter||this.customFilters||this._toggleColumns){const t=e.LX.makeContainer(["100%","auto"],"flex flex-row mb-2");if(this.filter){const s=e.LX.deepCopy(o);s.placeholder=`Filter ${this.filter}...`,s.skipComponent=!0,s.trigger="input",s.inputClass="outline";let n=new h(null,this._currentFilter??"",e=>{this._currentFilter=e,this.refresh()},s);t.appendChild(n.root)}if(null!==this.customFilters){const s=e.LX.makeIcon("CirclePlus",{svgClass:"sm"}),o='<div class="lexcontainer border-r-color place-self-center mx-1" style="width: 1px; height: 70%;"></div>';for(let n of this.customFilters)n.component=new r(null,s.innerHTML+n.name,t=>{const i=n.component.root.querySelector("button");if(n.options){const t=n.options.map((t,a)=>{const r={name:t,checked:!!this.activeCustomFilters[t],callback:(t,a,r)=>{a?this.activeCustomFilters[t]=n.name:delete this.activeCustomFilters[t];const l=Object.keys(this.activeCustomFilters).filter(e=>this.activeCustomFilters[e]==n.name),c=l.reduce((t,s)=>t+e.LX.badge(s,"xs secondary"),"");i.innerHTML=s.innerHTML+n.name+(l.length?o:"")+c,this.refresh()}};return r});e.LX.addDropdownMenu(n.component.root,t,{side:"bottom",align:"start"})}else if("range"==n.type){console.assert(null!=n.min&&null!=n.max,"Range filter needs min and max values!");const t=e.LX.makeContainer(["240px","auto"],"text-base"),a=new e.LX.Panel({className:"flex flex-col gap-2"});e.LX.makeContainer(["100%","auto"],"px-3 p-2 pb-0 text-base font-medium",n.name,t),n.start=n.start??n.min,n.end=n.end??n.max,a.refresh=()=>{a.clear(),a.sameLine(2,"justify-center"),a.addNumber(null,n.start,t=>{n.start=t;const a=n.start!=n.min||n.end!=n.max;i.innerHTML=s.innerHTML+n.name+(a?o+e.LX.badge(`${n.start} - ${n.end} ${n.units??""}`,"xs secondary"):""),a&&this._resetCustomFiltersBtn?.root.classList.remove("hidden"),this.refresh()},{skipSlider:!0,min:n.min,max:n.max,step:n.step,units:n.units}),a.addNumber(null,n.end,t=>{n.end=t;const a=n.start!=n.min||n.end!=n.max;i.innerHTML=s.innerHTML+n.name+(a?o+e.LX.badge(`${n.start} - ${n.end} ${n.units??""}`,"xs secondary"):""),a&&this._resetCustomFiltersBtn?.root.classList.remove("hidden"),this.refresh()},{skipSlider:!0,min:n.min,max:n.max,step:n.step,units:n.units}),a.addButton(null,"Reset",()=>{n.start=n.min,n.end=n.max,i.innerHTML=s.innerHTML+n.name,a.refresh(),this.refresh()},{buttonClass:"ghost"})},a.refresh(),t.appendChild(a.root),new b(n.component.root,[t],{side:"bottom"})}else if("date"==n.type){const t=e.LX.makeContainer(["auto","auto"],"text-base"),a=new e.LX.Panel;e.LX.makeContainer(["100%","auto"],"px-3 p-2 pb-0 text-base font-medium",n.name,t),a.refresh=()=>{if(a.clear(),!n.default){const e=new Date,t=`${e.getDate()}/${e.getMonth()+1}/${e.getFullYear()}`;n.default=[t,t]}const t=new S(n.value??n.default,{onChange:a=>{n.value=a,i.innerHTML=s.innerHTML+n.name+(o+e.LX.badge(`${t.getFullDate()}`,"xs secondary")),this._resetCustomFiltersBtn?.root.classList.remove("hidden"),this.refresh()}});a.attach(t)},a.refresh(),t.appendChild(a.root),new b(n.component.root,[t],{side:"bottom"})}},{buttonClass:"sm outline dashed"}),t.appendChild(n.component.root);this._resetCustomFiltersBtn=new r(null,"resetButton",()=>{this.activeCustomFilters={},this._resetCustomFiltersBtn?.root.classList.add("hidden");for(let e of this.customFilters??[])e.component.root.querySelector("button").innerHTML=s.innerHTML+e.name,"range"==e.type?(e.start=e.min,e.end=e.max):"date"==e.type&&delete e.value;this.refresh()},{title:"Reset filters",tooltip:!0,icon:"X",buttonClass:"ghost"}),t.appendChild(this._resetCustomFiltersBtn?.root),this._resetCustomFiltersBtn?.root.classList.add("hidden")}if(this._toggleColumns){const o=e.LX.makeIcon("Settings2"),n=new r("toggleColumnsBtn",o.innerHTML+"View",(t,o)=>{const n=s.head.map((e,t)=>{const o={name:e,icon:"Check",callback:()=>{s.colVisibilityMap[t]=!s.colVisibilityMap[t];d.querySelectorAll(`tr > *:nth-child(${t+this.rowOffsetCount+1})`).forEach(e=>{e.style.display="none"===e.style.display?"":"none"})}};return s.colVisibilityMap[t]||delete o.icon,o});e.LX.addDropdownMenu(o.target,n,{side:"bottom",align:"end"})},{hideName:!0,buttonClass:"outline"});t.appendChild(n.root),n.root.style.marginLeft="auto"}n.appendChild(t)}const d=e.LX.makeElement("table",o.tableClass,"",n);this.refresh=()=>{this._currentFilter=this._currentFilter??"",d.innerHTML="",this.rowOffsetCount=0;{const t=document.createElement("thead");t.className="lextablehead",d.appendChild(t);const n=document.createElement("tr");if(o.sortable){const e=document.createElement("th");e.style.width="0px",n.appendChild(e),this.rowOffsetCount++}if(o.selectable){const t=document.createElement("th");t.style.width="0px";const o=document.createElement("input");o.type="checkbox",o.className="lexcheckbox primary",o.checked=s.checkMap[":root"]??!1,t.appendChild(o),o.addEventListener("change",function(){s.checkMap[":root"]=this.checked;const t=d.querySelector("tbody");for(const e of t.childNodes){const t=e.getAttribute("rowId");t&&(s.checkMap[t]=this.checked,e.querySelector("input[type='checkbox']").checked=this.checked)}const o=c.getSelectedRows();e.LX.emitSignal("@rows_selected_changed",o.length)}),this.rowOffsetCount++,n.appendChild(t)}for(const t of s.head){const i=document.createElement("th");i.innerHTML=`<span>${t}</span>`,i.querySelector("span").appendChild(e.LX.makeIcon("MenuArrows",{svgClass:"sm"}));const a=s.head.indexOf(t);this._centered?.indexOf&&(this._centered.indexOf(a)>-1||this._centered.indexOf(t)>-1)&&i.classList.add("centered");const r=[];if(o.columnActions)for(let e of o.columnActions)e.name?r.push({name:e.name,icon:e.icon,className:e.className,callback:()=>{const t=this.data.body.map(e=>[e[a]]);e.callback(t,d)&&this.refresh()}}):console.warn("Invalid column action (missing name):",e);this._sortColumns&&(r.length>0&&r.push(null),r.push({name:"Asc",icon:"ArrowUpZA",callback:l.bind(this,a,1)},{name:"Desc",icon:"ArrowDownZA",callback:l.bind(this,a,-1)})),this._toggleColumns&&(r.length>0&&r.push(null),r.push({name:"Hide",icon:"EyeOff",callback:()=>{s.colVisibilityMap[a]=!1;d.querySelectorAll(`tr > *:nth-child(${a+this.rowOffsetCount+1})`).forEach(e=>{e.style.display="none"===e.style.display?"":"none"})}})),i.addEventListener("click",t=>{0!==r.length&&e.LX.addDropdownMenu(t.target,r,{side:"bottom",align:"start"})}),n.appendChild(i)}if(o.rowActions){const e=document.createElement("th");e.className="sm",n.appendChild(e)}t.appendChild(n)}{const t=document.createElement("tbody");t.className="lextablebody",d.appendChild(t);let n=null,i=!1,a=null;document.addEventListener("mouseup",t=>{if(null===n)return;document.removeEventListener("mousemove",r);const o=d.rows[n];if(o.dY=0,o.classList.remove("dragging"),Array.from(d.rows).forEach(e=>{e.style.transform="",e.style.transition="none"}),e.LX.flushCss(o),a){const t=this._paginator?(this._paginator.page-1)*this.rowsPerPage:0,o=n-1+t,i=a[1]-1+t;e.LX.emitSignal("@on_table_sort",{instance:this,fromIdx:o,targetIdx:i});const r=s.body[o];let l=0;if(o==i)return;if(o>i)for(let e=o;e>i;--e)s.body[e]=s.body[e-1];else{l=1;for(let e=o;e<i;++e)s.body[e]=s.body[e+1]}s.body[i]=r;const c=a[0].parentNode;e.LX.insertChildAtIndex(c,a[0],i+l-t),a=null}n=null,e.LX.doAsync(()=>{Array.from(d.rows).forEach(e=>{e.style.transition="transform 0.2s ease-in"})})});let r=e=>{if(!n)return;const t=d.rows[n];t.dY=t.dY??0,t.dY+=e.movementY,t.style.transform=`translateY(${t.dY}px)`};const l=[];for(let t=0;t<s.body.length;++t){const o=s.body[t];if(this.filter){const t=s.head.indexOf(this.filter);if(t>-1){if(!e.LX.stripHTML(o[t]).toLowerCase().includes(this._currentFilter.toLowerCase()))continue}}if(Object.keys(this.activeCustomFilters).length){let t={};this._resetCustomFiltersBtn?.root.classList.remove("hidden");for(let n in this.activeCustomFilters){const i=this.activeCustomFilters[n];t[i]=t[i]??!1;const a=s.head.indexOf(i);if(a>-1){const s=o[a],r=e.LX.stripTags(s)??s;t[i]=t[i]||r===n}}if(!Object.values(t).reduce((e,t)=>e&&t,!0))continue}if(this.customFilters){let t={};for(let n of this.customFilters){const i=n.name;if("range"==n.type){t[i]=t[i]??!1;const e=s.head.indexOf(i);if(e>-1){const s=parseFloat(o[e]),a=n.start??n.min,r=n.end??n.max;t[i]=t[i]||s>=a&&s<=r}}else if("date"==n.type){t[i]=t[i]??!1;const a=s.head.indexOf(i);if(a>-1){if(!n.value){t[i]=!0;continue}n.value=n.value??n.default;const s=o[a],r=e.LX.dateFromDateString(s),l=e.LX.dateFromDateString(n.value[0]),c=e.LX.dateFromDateString(n.value[1]);t[i]=t[i]||r>=l&&r<=c}}}if(!Object.values(t).reduce((e,t)=>e&&t,!0))continue}l.push(o)}this._paginator&&this._paginator.setPages(this._getNumPages(l.length));const h=this._paginator?(this._paginator.page-1)*this.rowsPerPage:0,u=this._paginator?Math.min(h+this.rowsPerPage,l.length):l.length;for(let p=h;p<u;++p){const h=l[p],u=this.data.body.indexOf(h),m=document.createElement("tr"),g=this._makeRowId(h);if(m.setAttribute("rowId",g),o.sortable){const t=document.createElement("td");t.style.width="0px";const s=e.LX.makeIcon("GripVertical");t.appendChild(s),s.draggable=!0,s.addEventListener("dragstart",e=>{e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),n=m.rowIndex,m.classList.add("dragging"),document.addEventListener("mousemove",r)},!1),m.addEventListener("mouseenter",function(t){if(t.preventDefault(),null!=n&&this.rowIndex!=n&&i!=this.rowIndex){i=this.rowIndex;const t=d.rows[n],s=""!=this.style.transform;this.rowIndex>n?(a=[t,s?this.rowIndex-1:this.rowIndex],this.style.transform=s?"":`translateY(-${this.offsetHeight}px)`):(a=[t,s?this.rowIndex+1:this.rowIndex],this.style.transform=s?"":`translateY(${this.offsetHeight}px)`),e.LX.doAsync(()=>{i=!1})}}),m.appendChild(t)}if(o.selectable){const t=document.createElement("td"),o=document.createElement("input");o.type="checkbox",o.className="lexcheckbox primary",o.checked=s.checkMap[g],t.appendChild(o),o.addEventListener("change",function(){s.checkMap[g]=this.checked;const t=d.querySelector("thead input[type='checkbox']");if(console.assert(t,"Header checkbox not found!"),this.checked){Array.from(d.querySelectorAll("tbody input[type='checkbox']")).filter(e=>!e.checked).length||(t.checked=s.checkMap[":root"]=!0)}else t.checked=s.checkMap[":root"]=!1;const o=c.getSelectedRows();e.LX.emitSignal("@rows_selected_changed",o.length)}),m.appendChild(t)}for(let e=0;e<h.length;++e){const t=h[e],o=document.createElement("td");o.innerHTML=`${t}`;const n=s.head[e];this._centered?.indexOf&&(this._centered.indexOf(e)>-1||this._centered.indexOf(n)>-1)&&o.classList.add("centered"),m.appendChild(o)}if(o.rowActions){const t=document.createElement("td");t.style.width="0px";const n=document.createElement("div");n.className="lextablebuttons",t.appendChild(n);for(const t of o.rowActions){let i=null;"delete"==t?(i=e.LX.makeIcon("Trash3",{title:"Delete Row"}),i.addEventListener("click",()=>{s.body.splice(u,1),this.refresh()})):"menu"==t?(i=e.LX.makeIcon("EllipsisVertical",{title:"Menu"}),i.addEventListener("click",function(t){if(!o.onMenuAction)return;const n=o.onMenuAction(u,s);console.assert(n.length,"Add items to the Menu Action Dropdown!"),e.LX.addDropdownMenu(t.target,n,{side:"bottom",align:"end"})})):(console.assert(t.constructor==Object),i=e.LX.makeIcon(t.icon,{title:t.title}),t.callback&&i.addEventListener("click",e=>{t.callback(u,h,d,e)&&this.refresh()})),console.assert(i),n.appendChild(i)}m.appendChild(t)}t.appendChild(m)}if(o.selectable){const t=this.getSelectedRows();e.LX.emitSignal("@rows_selected_changed",t.length)}if(0==t.childNodes.length){const e=document.createElement("tr"),o=document.createElement("td");o.setAttribute("colspan",s.head.length+this.rowOffsetCount+1),o.className="empty-row",o.innerHTML="No results.",e.appendChild(o),t.appendChild(e)}}for(const e in s.colVisibilityMap){const t=parseInt(e);if(!s.colVisibilityMap[t]){d.querySelectorAll(`tr > *:nth-child(${t+this.rowOffsetCount+1})`).forEach(e=>{e.style.display="none"===e.style.display?"":"none"})}}};const u=this._showSelectedNumber&&o.selectable;if(u||this._paginator){const t=e.LX.makeContainer(["100%","auto"],"flex flex-row px-3 my-1 align-center","",n);if(u){const s=e.LX.makeContainer(["100%","auto"],"flex justify-start items-center","0 row(s) selected.",t);e.LX.addSignal("@rows_selected_changed",(e,t)=>{this._showSelectedNumber&&(s.innerHTML=0===t?"":`${t??0} row(s) selected.`)})}if(this._paginator){e.LX.makeContainer(["100%","auto"],"flex justify-end","",t).appendChild(this._paginator.root)}}this.refresh(),e.LX.doAsync(this.onResize.bind(this))}getSelectedRows(){const e=[];for(const t of this.data.body){const s=this._makeRowId(t);!0===this.data.checkMap[s]&&e.push(t)}return e}_makeRowId(t){return e.LX.getSupportedDOMName(t.join("-")).substr(0,32)}_onChangePage(e){this.refresh()}_getNumPages(e){return-1===this.rowsPerPage?1:(e=e??this.data.body?.length,Math.ceil((e??0)/this.rowsPerPage))}_setRowsPerPage(e){this._rowsPerPage=e,this.refresh()}_setCentered(e){if(e.constructor==Boolean){this.root.querySelector(".lextable").classList.toggle("centered",e)}else e=Array.isArray(e)?e:[e];this._centered=e,this.refresh()}}e.LX.Table=U;class j extends a{tabs;tabDOMs;constructor(t,s,o={}){if(o.hideName=!0,super(e.ComponentType.TABS,t,null,o),s.constructor!=Array)throw"Param @tabs must be an Array!";if(!s.length)throw"Tab list cannot be empty!";const n=o.vertical??!0,i=!n&&(o.showNames??!1);this.tabDOMs={};let a=document.createElement("div");a.className="lextabscontainer",n||(a.className+=" horizontal");let r=document.createElement("div");r.className="tabs",a.appendChild(r),this.root.appendChild(a),s.findIndex(e=>!0===e.selected)<0&&(s[0].selected=!0);for(let t of s){console.assert(t.name);let s=document.createElement("div");s.className="lextab "+(t.selected?"selected":""),s.innerHTML=i?t.name:"",s.appendChild(e.LX.makeIcon(t.icon??"Hash",{title:t.name,iconClass:t.iconClass,svgClass:"lg"+(t.svgClass?" "+t.svgClass:"")})),this.tabDOMs[t.name]=s;let o=document.createElement("div");if(o.id=t.name.replace(/\s/g,""),o.className="components",o.toggleAttribute("hidden",!t.selected),a.appendChild(o),s.addEventListener("click",e=>{r.querySelectorAll(".lextab").forEach(e=>{e.classList.remove("selected")}),s.classList.add("selected"),a.querySelectorAll(".components").forEach(e=>{e.toggleAttribute("hidden",!0)});const n=a.querySelector("#"+o.id);n?.toggleAttribute("hidden"),t.onSelect&&t.onSelect(this,o)}),r.appendChild(s),t.onCreate){const s=new e.LX.Panel;s.queue(o),t.onCreate.call(this,s,o),s.clearQueue()}}this.tabs=s}select(e){const t=this.tabDOMs[e];t&&t.click()}}e.LX.TabSections=j;class G extends a{generateTags;constructor(t,s,o,i={}){let a=s.replace(/\s/g,"").split(","),r=e.LX.deepCopy(a);super(e.ComponentType.TAGS,t,r,i),this.options.skipDuplicates=i.skipDuplicates??!0,this.onGetValue=()=>e.LX.deepCopy(s),this.onSetValue=(e,s,i)=>{a=[].concat(e),this.generateTags(a),s||this._trigger(new n(t,a,i),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";l.style.width=`calc( 100% - ${t})`};const l=document.createElement("div");l.className="inline-flex flex-wrap gap-1 bg-card/50 rounded-lg pad-xs [&_input]:w-2/3",this.root.appendChild(l),this.generateTags=t=>{l.innerHTML="";for(let s=0;s<t.length;++s){const o=t[s],n=e.LX.mergeClass("lextag bg-primary px-2 py-1 rounded-xl min-w-2 justify-center text-primary-foreground gap-1 text-sm select-none",i.tagClass),a=e.LX.makeElement("span",n,o);if(!this.disabled){const s=e.LX.makeIcon("X",{svgClass:"sm"});a.appendChild(s),s.addEventListener("click",e=>{a.remove(),t.splice(t.indexOf(o),1),this.set(t,!1,e)})}l.appendChild(a)}if(this.disabled)return;let s=document.createElement("input");s.value="",s.placeholder="Add tag...",l.appendChild(s),s.onkeydown=e=>{if(" "==e.key||"Enter"==e.key){const o=s.value.replace(/\s/g,"");if(e.preventDefault(),!o.length||i.skipDuplicates&&t.indexOf(o)>-1)return;t.push(o),this.set(t,!1,e),l.querySelector("input")?.focus()}}},this.generateTags(a),e.LX.doAsync(this.onResize.bind(this))}}e.LX.Tags=G;class Z extends a{constructor(t,s,o,i={}){super(e.ComponentType.TEXTAREA,t,s,i),this.onGetValue=()=>s,this.onSetValue=(e,i,a)=>{r.value=s=e,i||this._trigger(new n(t,e,a),o)},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=i.inputWidth??`calc( 100% - ${t})`};let a=document.createElement("div");a.className="lextextarea",a.style.display="flex",this.root.appendChild(a);let r=e.LX.makeElement("textarea",e.LX.mergeClass("w-full text-sm text-foreground bg-card border-color disabled:pointer-events-none disabled:opacity-50 rounded-lg outline-none pad-md",i.inputClass??""));r.value=s??"",r.style.textAlign=i.float??"",r.disabled=this.disabled,Object.assign(r.style,i.style??{}),i.fitHeight&&r.classList.add("field-sizing-content"),(i.resize??1)||r.classList.add("resize-none"),a.appendChild(r),i.placeholder&&r.setAttribute("placeholder",i.placeholder);const l=i.trigger??"default",c=i.submitOnEnterKey??!0;if("default"==l?(r.addEventListener("keydown",function(e){if(c&&"Enter"==e.key&&!e.shiftKey)return e.preventDefault(),!1}),r.addEventListener("keyup",function(e){(c&&"Enter"==e.key&&!e.shiftKey||"Escape"==e.key)&&(e.preventDefault(),r.blur())}),r.addEventListener("focusout",e=>{this.set(e.target?.value,!1,e)})):"input"==l&&r.addEventListener("input",e=>{this.set(e.target?.value,!1,e)}),i.icon){const t=e.LX.makeIcon(i.icon,{iconClass:"absolute z-1 ml-2",svgClass:"sm"});a.appendChild(t)}e.LX.doAsync(()=>{a.style.height=i.height??"",this.onResize()},10)}}e.LX.TextArea=Z;class Y extends a{constructor(t,s={}){console.assert(0!==t.length,"Can't create Title Component without text!"),super(e.ComponentType.TITLE,null,null,s);const o="lextitle !w-fit bg-muted text-foreground text-sm font-semibold leading-normal m-3 flex content-center rounded-xl select-none";if(this.root.className=e.LX.mergeClass(o,s.className),s.icon){let t=e.LX.makeIcon(s.icon,{iconClass:"mr-2"});t.querySelector("svg").style.color=s.iconColor||"",this.root.appendChild(t)}let n=document.createElement("span");if(n.innerText=t,this.root.appendChild(n),null!=s.link){let n=e.LX.makeElement("a",`${o} link`,t);n.href=s.link,n.target=s.target??"",this.root.replaceWith(n),this.root=n}Object.assign(this.root.style,s.style??{})}}e.LX.Title=Y;class K extends a{constructor(t,s,o,i={}){if(!t&&!i.label)throw"Set Component Name or at least a label!";super(e.ComponentType.TOGGLE,t,s,i),this.onGetValue=()=>r.checked,this.onSetValue=(e,i,a)=>{e!=s&&(r.checked=s=e,this.root.querySelector(".lextogglesubmenu")?.toggleAttribute("hidden",!e),i||this._trigger(new n(t,e,a),o))},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";a.style.width=i.inputWidth??`calc( 100% - ${t})`};var a=document.createElement("div");a.className="flex flex-row gap-2 items-center",this.root.appendChild(a);let r=e.LX.makeElement("input",e.LX.mergeClass("lextoggle relative inline-grid place-content-center cursor-pointer shrink-0 select-none disabled:pointer-events-none disabled:opacity-50",i.className));r.type="checkbox",r.checked=s,r.iValue=s,r.disabled=this.disabled,a.appendChild(r);let l=document.createElement("span");if(l.className="font-medium w-full overflow-hidden truncate",l.innerHTML=i.label??"On",a.appendChild(l),r.addEventListener("change",e=>{this.set(r.checked,!1,e)}),i.suboptions){let t=e.LX.makeElement("div","lextogglesubmenu w-full p-2");t.toggleAttribute("hidden",!r.checked);const s=new e.LX.Panel;s.queue(t),i.suboptions.call(this,s),s.clearQueue(),this.root.appendChild(t)}e.LX.doAsync(this.onResize.bind(this))}}e.LX.Toggle=K;class J extends a{locked=!1;setLimits;constructor(t,s,o,i,l={}){t=e.LX.clamp(t,2,4),o=o??new Array(t).fill(0),super(e.ComponentType.VECTOR,s,e.LX.deepCopy(o),l),this.onGetValue=()=>{let e=this.root.querySelectorAll("input[type='number']"),t=[];for(var s of e)t.push(+s.value);return t},this.onSetValue=(t,a,r)=>{if(c.length==t.length){for(let s=0;s<c.length;++s){let n=t[s];n=e.LX.clamp(n,+c[s].min,+c[s].max),n=e.LX.round(n,l.precision)??0,c[s].value=o[s]=n}a||this._trigger(new n(s,o,r),i)}else console.error("Input length does not match vector length.")},this.onResize=e=>{const t=this.root.domName?.style.width??"0px";d.style.width=`calc( 100% - ${t})`},this.setLimits=(e,t,s)=>{};const c=[];var d=document.createElement("div");d.className="lexvector flex",this.root.appendChild(d);const h=this;for(let u=0;u<t;++u){let p=document.createElement("div");p.className="vecbox",p.innerHTML="<span class='"+e.LX.Panel.VECTOR_COMPONENTS[u]+"'></span>";let m=document.createElement("input");m.className="vecinput v"+t,m.min=l.min??-1e24,m.max=l.max??1e24,m.step=l.step??"any",m.type="number",m.id="vec"+t+"_"+e.LX.guidGenerator(),m.idx=u,m.disabled=this.disabled,c[u]=m,p.appendChild(m),o[u].constructor==Number&&(o[u]=e.LX.clamp(o[u],+m.min,+m.max),o[u]=e.LX.round(o[u],l.precision)),m.value=m.iValue=o[u];const g=e.LX.makeIcon("MoveVertical",{iconClass:"drag-icon hidden-opacity",svgClass:"sm"});function f(t){if(document.activeElement!=m&&t.button==e.LX.MOUSE_LEFT_CLICK){var s=h.root.ownerDocument;s.addEventListener("mousemove",L),s.addEventListener("mouseup",b),document.body.classList.add("noevents"),g.classList.remove("hidden-opacity"),t.stopImmediatePropagation(),t.stopPropagation(),document.pointerLockElement||p.requestPointerLock(),l.onPress&&l.onPress.bind(m)(t,m)}}function L(t){let s=-t.movementY;if(0!=s){let o=l.step??1;if(t.shiftKey?o=10:t.altKey&&(o=.1),h.locked)for(let t of c)t.value=e.LX.round(+t.valueAsNumber+o*s,l.precision),a._dispatchEvent(t,"change");else m.value=e.LX.round(+m.valueAsNumber+o*s,l.precision),a._dispatchEvent(m,"change")}t.stopPropagation(),t.preventDefault()}function b(e){var t=h.root.ownerDocument;t.removeEventListener("mousemove",L),t.removeEventListener("mouseup",b),document.body.classList.remove("noevents"),g.classList.add("hidden-opacity"),document.pointerLockElement&&document.exitPointerLock(),l.onRelease&&l.onRelease.bind(m)(e,m)}p.appendChild(g),m.addEventListener("wheel",function(t){if(t.preventDefault(),m!==document.activeElement)return;let s=l.step??1;if(t.shiftKey?s=10:t.altKey&&(s=.1),h.locked)for(let o of c)o.value=e.LX.round(+o.valueAsNumber-s*(t.deltaY>0?1:-1),l.precision),a._dispatchEvent(o,"change");else m.value=e.LX.round(+m.valueAsNumber-s*(t.deltaY>0?1:-1),l.precision),a._dispatchEvent(m,"change")},{passive:!1}),m.addEventListener("change",t=>{if(isNaN(t.target.value))return;let s=e.LX.clamp(t.target.value,+m.min,+m.max);if(s=e.LX.round(s,l.precision),this.locked)for(let e of c)e.value=s,o[e.idx]=s;else m.value=s,o[t.target.idx]=s;this.set(o,!1,t)},!1),p.addEventListener("mousedown",f),d.appendChild(p)}if(void 0===l.min&&void 0===l.max||(this.setLimits=(e,t,s)=>{for(let o of c)o.min=e??o.min,o.max=t??o.max,o.step=s??o.step;this.set(o,!0)}),!l.skipLock){const y=new r(null,"",e=>{this.locked=e},{title:"Lock",icon:"LockOpen",swap:"Lock",buttonClass:"h-auto bg-none p-0"});d.appendChild(y.root)}e.LX.doAsync(this.onResize.bind(this))}}e.LX.Vector=J;class Q{name;components;closed;root;content;grabber;panel;onclick;oncontextmenu;constructor(t,s={}){this.name=t;var o=document.createElement("div");s.id&&(o.id=s.id),o.className=e.LX.mergeClass("lexbranch bg-secondary/50 dark:bg-card text-secondary-foreground dark:text-card-foreground w-full rounded-lg my-0 mx-auto",s.className);var n=this;this.closed=s.closed??!1,this.root=o,this.components=[],this.panel=null;const i=e.LX.makeElement("div","lexbranchtitle flex cursor-pointer select-none pad-lg text-lg","",o);if(s.icon){const t=e.LX.makeIcon(s.icon,{iconClass:"mr-2"});i.appendChild(t)}i.innerHTML+=t||"Branch";const a=e.LX.makeIcon("Right",{iconClass:"switch-branch-button",svgClass:"sm"});i.appendChild(a);var r=e.LX.makeElement("div","lexbranchcontent pad-xs","",o);r.id=t.replace(/\s/g,""),this.content=r,this._addBranchSeparator(),this.closed&&(i.classList.add("closed"),o.classList.add("closed"),this.grabber.setAttribute("hidden",!0),e.LX.doAsync(()=>{this.content.setAttribute("hidden",!0)},10)),this.onclick=function(){i.classList.toggle("closed"),i.parentElement.classList.toggle("closed"),n.content.toggleAttribute("hidden"),n.grabber.toggleAttribute("hidden"),e.LX.emitSignal("@on_branch_closed",i.classList.contains("closed"))},this.oncontextmenu=function(t){t.preventDefault(),t.stopPropagation(),i.parentElement.classList.contains("dialog")||e.LX.addContextMenu("Dock",t,e=>{t.preventDefault(),e.add("Floating",n._onMakeFloating.bind(n))},{icon:"WindowRestore"})},i.addEventListener("click",this.onclick),i.addEventListener("contextmenu",this.oncontextmenu)}_onMakeFloating(){const t=new e.LX.Dialog(this.name,e=>{for(let t of this.components)e.root.appendChild(t.root)},{dockable:!0}),s=Array.from(this.root.parentElement.childNodes).indexOf(this.root);console.assert(s>=0,"Branch not found!"),t.branchData={name:this.name,components:this.components,closed:this.closed,panel:this.panel,childIndex:s},this.root.remove()}_addBranchSeparator(){const t=document.createElement("div");t.className="lexcomponentseparator",t.style.width="100%",t.style.background="none";const s=document.createElement("div");s.innerHTML="▾",t.appendChild(s),e.LX.doAsync(()=>{s.style.marginLeft=parseFloat(e.LX.DEFAULT_NAME_WIDTH)/100*this.content.offsetWidth+"px"},10);const o=document.createElement("div");o.style.width="1px",o.style.marginLeft="6px",o.style.marginTop="2px",o.style.height="0px",s.appendChild(o),s.addEventListener("mousedown",function(e){var t=n.root.ownerDocument;t.addEventListener("mouseup",a),t.addEventListener("mousemove",i),e.stopPropagation(),e.preventDefault();const s=n.root.offsetHeight-n.root.children[0].offsetHeight;o.style.height=s-3+"px",document.body.classList.add("nocursor")}),this.grabber=s;let n=this;function i(t){let o=t.movementX;if(0!=o){const t=parseFloat(s.style.marginLeft);s.style.marginLeft=e.LX.clamp(t+o,32,n.content.offsetWidth-32)+"px"}}function a(e){n._updateComponents(),o.style.height="0px";var t=n.root.ownerDocument;t.removeEventListener("mouseup",a),t.removeEventListener("mousemove",i),document.body.classList.remove("nocursor")}this.content.appendChild(t)}_updateComponents(){var t=this.grabber.style.marginLeft;for(let s=0;s<this.components.length;s++){let o=this.components[s];const n=o.root;if(n.children.length<2)continue;let i=n.children[0],a=n.children[1];switch(i.style.width=t,i.style.minWidth=t,o.type){case e.LX.BaseComponent.CUSTOM:case e.LX.BaseComponent.ARRAY:continue}a.style.width="-moz-calc( 100% - "+t+" )",a.style.width="-webkit-calc( 100% - "+t+" )",a.style.width="calc( 100% - "+t+" )"}}}e.LX.Branch=Q;class ee{root;branches;components;signals;queuedContainer;_branchOpen;_currentBranch;_queue;_inlineComponentsLeft;_inlineQueuedContainer;_inlineExtraClass;_inlineContainer;_inlineComponents;constructor(t={}){const s=e.LX.makeElement("div",e.LX.mergeClass("lexpanel m-0 pad-md overflow-hidden overflow-y-scroll text-foreground scrollbar-hidden",t.className));t.id&&(s.id=t.id),s.style.width=t.width||"100%",s.style.height=t.height||"100%",Object.assign(s.style,t.style??{}),this.root=s,this.branches=[],this.signals=[],this.components={},this._branchOpen=!1,this._currentBranch=null,this._queue=[],this._inlineComponentsLeft=-1,this._inlineQueuedContainer=null,this._inlineExtraClass=null,this._inlineComponents=[]}get(e){return this.components[e]}getValue(e){let t=this.components[e];if(!t)throw"No component called "+e;return t.value()}setValue(e,t,s){let o=this.components[e];if(!o)throw"No component called "+e;return o.set(t,s)}attach(e){console.assert(e,"No content to attach!"),e.parent=this,this.root.appendChild(e.root?e.root:e)}clear(){this.branches=[],this._branchOpen=!1,this._currentBranch=null;for(let t in this.components)if(this.components[t].options&&this.components[t].options.signal){const s=this.components[t].options.signal;for(let o=0;o<e.LX.signals[s].length;o++)e.LX.signals[s][o]==this.components[t]&&(e.LX.signals[s]=[...e.LX.signals[s].slice(0,o),...e.LX.signals[s].slice(o+1)])}if(this.signals)for(let t=0;t<this.signals.length;t++){let s=Object.values(this.signals[t])[0],o=s.options.signal;for(let t=0;t<e.LX.signals[o].length;t++)e.LX.signals[o][t]==s&&(e.LX.signals[o]=[...e.LX.signals[o].slice(0,t),...e.LX.signals[o].slice(t+1)])}this.components={},this.root.innerHTML=""}sameLine(e,t){this._inlineQueuedContainer=this.queuedContainer,this._inlineComponentsLeft=e??1/0,this._inlineExtraClass=t??null}endLine(e){if(e=e??this._inlineExtraClass,-1!=this._inlineComponentsLeft){this._inlineComponentsLeft=-1,this._inlineContainer||(this._inlineContainer=document.createElement("div"),this._inlineContainer.className="lexinlinecomponents",e&&(this._inlineContainer.className+=` ${e}`));for(let e of this._inlineComponents){e.constructor==Array?this._inlineQueuedContainer?this._inlineContainer.appendChild(e[0]):e[1].appendChild(e[0]):this._inlineContainer.appendChild(e)}this._inlineQueuedContainer?this._inlineQueuedContainer.appendChild(this._inlineContainer):this._currentBranch?this._currentBranch.content.appendChild(this._inlineContainer):this.root.appendChild(this._inlineContainer),this._inlineComponents=[],this._inlineContainer=null,this._inlineExtraClass=null}else console.warn("No pending components to be inlined!")}branch(e,t={}){this._branchOpen&&this.merge();var s=new Q(e,t);return s.panel=this,this._branchOpen=!0,this._currentBranch=s,this.branches.push(s),this.root.appendChild(s.root),t.filter&&this._addFilter(t.filter,{callback:this._searchComponents.bind(this,s.name)}),s}merge(){this._branchOpen=!1,this._currentBranch=null}_pick(e,t){return void 0===e?t:e}_attachComponent(e,t={}){null!=e.name&&(this.components[e.name]=e),e.options.signal&&!e.name&&(this.signals||(this.signals=[]),this.signals.push({[e.options.signal]:e}));const s=s=>{t.container?t.container.appendChild(s):this.queuedContainer?this.queuedContainer.appendChild(s):this._currentBranch?(t.skipComponent||this._currentBranch.components.push(e),this._currentBranch.content.appendChild(s)):(s.className+=" nobranch w-full",this.root.appendChild(s))},o=e=>{this.queuedContainer?this._inlineComponents.push([e,this.queuedContainer]):this._inlineComponents.push(e)};return this._inlineComponentsLeft>0&&!t.skipInlineCount?(o(e.root),this._inlineComponentsLeft--,this._inlineComponentsLeft||this.endLine()):s(e.root),e}_addFilter(t,s={}){s.placeholder=t.constructor==String?t:"Filter properties..",s.skipComponent=s.skipComponent??!0,s.skipInlineCount=!0;const o=new h(null,void 0,null,s).root;o.className+=" lexfilter";let n=document.createElement("input");n.className="lexinput-filter",n.setAttribute("placeholder",s.placeholder),n.style.width="100%",n.value=s.filterValue||"";let i=e.LX.makeIcon("Search");return o.appendChild(i),o.appendChild(n),n.addEventListener("input",e=>{s.callback&&s.callback(n.value,e)}),o}_searchComponents(e,t){for(let s of this.branches){if(s.name!==e)continue;for(let e of s.components)e.domEl.classList.contains("lexfilter")||e.domEl.remove();this.queue(s.content);const o=!t.length;for(let e of s.components){if(!o){if(!e.name)continue;if(!e.name.toLowerCase().includes(t))continue}this.queuedContainer.appendChild(e.domEl)}return void this.clearQueue()}}getBranch(e){return e?this.branches.find(t=>t.name==e):this._currentBranch}queue(e){!e&&this._currentBranch&&(e=this._currentBranch.root),this.queuedContainer&&this._queue.push(this.queuedContainer),this.queuedContainer=e}clearQueue(){this._queue&&this._queue.length?this.queuedContainer=this._queue.pop():delete this.queuedContainer}addSeparator(){var t=document.createElement("div");t.className="lexseparator";let s=new a(e.ComponentType.SEPARATOR);s.root=t,this._currentBranch?(this._currentBranch.content.appendChild(t),this._currentBranch.components.push(s)):this.root.appendChild(t)}addTitle(e,t={}){const s=new Y(e,t);return this._attachComponent(s)}addText(e,t,s,o={}){const n=new h(e,t,s,o);return this._attachComponent(n)}addTextArea(e,t,s,o={}){const n=new Z(e,t,s,o);return this._attachComponent(n)}addLabel(t,s={}){s.disabled=!0,s.inputClass=e.LX.mergeClass("bg-none",s.inputClass);const o=this.addText(null,t,null,s);return o.type=e.ComponentType.LABEL,o}addButton(e,t,s,o={}){const n=new r(e,t,s,o);return this._attachComponent(n)}addComboButtons(e,t,s={}){const o=new v(e,t,s);return this._attachComponent(o)}addCard(e,t={}){const s=new m(e,t);return this._attachComponent(s)}addForm(e,t,s,o={}){const n=new A(e,t,s,o);return this._attachComponent(n)}addContent(t,s,o={}){if(console.assert(s,"Empty content!"),s.constructor==String){const e=document.createElement("div");e.innerHTML=s,s=e.childElementCount>1?e:e.firstElementChild}o.hideName=!0;let n=new a(e.ComponentType.CONTENT,t,null,o);return n.root.appendChild(s),this._attachComponent(n)}async addImage(t,s,o={}){console.assert(0!==s.length,"Empty src/url for Image!");let n=document.createElement("div");n.className="leximage",n.style.width="100%";let i=document.createElement("img");i.src=s,Object.assign(i.style,o.style??{}),n.appendChild(i);let r=new a(e.ComponentType.IMAGE,t,null,o);return r.root.appendChild(n),i.decode(),this._attachComponent(r)}addSelect(e,t,s,o,n={}){const i=new u(e,t,s,o,n);return this._attachComponent(i)}addCurve(e,t,s,o={}){const n=new _(e,t,s,o);return this._attachComponent(n)}addDial(e,t,s,o={}){const n=new M(e,t,s,o);return this._attachComponent(n)}addLayers(e,t,s,o={}){const n=new X(e,t,s,o);return this._attachComponent(n)}addArray(e,t=[],s,o={}){const n=new p(e,t,s,o);return this._attachComponent(n)}addList(e,t,s,o,n={}){const i=new z(e,t,s,o,n);return this._attachComponent(i)}addTags(e,t,s,o={}){const n=new G(e,t,s,o);return this._attachComponent(n)}addCheckbox(e,t,s,o={}){const n=new g(e,t,s,o);return this._attachComponent(n)}addToggle(e,t,s,o={}){const n=new K(e,t,s,o);return this._attachComponent(n)}addRadioGroup(e,t,s,o,n={}){const i=new $(e,t,s,o,n);return this._attachComponent(i)}addColor(e,t,s,o={}){const n=new y(e,t,s,o);return this._attachComponent(n)}addRange(e,t,s,o={}){const n=new V(e,t,s,o);return this._attachComponent(n)}addNumber(e,t,s,o={}){const n=new d(e,t,s,o);return this._attachComponent(n)}static VECTOR_COMPONENTS={0:"x",1:"y",2:"z",3:"w"};_addVector(e,t,s,o,n={}){const i=new J(e,t,s,o,n);return this._attachComponent(i)}addVector2(e,t,s,o){return this._addVector(2,e,t,s,o)}addVector3(e,t,s,o){return this._addVector(3,e,t,s,o)}addVector4(e,t,s,o){return this._addVector(4,e,t,s,o)}addSize(e,t,s,o={}){const n=new W(e,t,s,o);return this._attachComponent(n)}addOTP(e,t,s,o={}){const n=new O(e,t,s,o);return this._attachComponent(n)}addPad(e,t,s,o={}){const n=new H(e,t,s,o);return this._attachComponent(n)}addProgress(e,t,s={}){const o=new B(e,t,s);return this._attachComponent(o)}addFile(e,t,s={}){const o=new T(e,t,s);return this._attachComponent(o)}addTree(e,t,s={}){const o=new D(e,t,s);return this._attachComponent(o)}addTabSections(e,t,s={}){const o=new j(e,t,s);return this._attachComponent(o)}addCounter(e,t,s,o={}){const n=new C(e,t,s,o);return this._attachComponent(n)}addTable(e,t,s={}){const o=new U(e,t,s);return this._attachComponent(o)}addDate(e,t,s,o={}){const n=new k(e,t,s,o);return this._attachComponent(n)}addMap2D(e,t,s,o={}){const n=new I(e,t,s,o);return this._attachComponent(n)}addRate(e,t,s,o={}){const n=new F(e,t,s,o);return this._attachComponent(n)}}e.LX.Panel=ee;class te{area;options;buttons;constructor(e,t,s={}){this.area=e,this.options=s,this.buttons={},this._buildButtons(t,s)}_buildButtons(t,s={}){s.className="lexoverlaybuttons flex justify-start gap-2 bg-card m-2 p-1 rounded-2xl border-color";let o=this.area.addPanel(s),n=null;const i=e.LX.makeElement("div","lexoverlaybuttonscontainer absolute flex top-0 w-full pointer-events-none");i.appendChild(o.root),this.area.attach(i);const a=s.float;let r="";if(a){for(let e=0;e<a.length;e++){switch(a[e]){case"h":case"t":case"l":break;case"v":r+=" vertical";break;case"m":r+=" middle";break;case"b":r+=" bottom";break;case"c":r+=" center";break;case"r":r+=" right"}}i.className+=` ${r}`}const l=(e,t,s)=>{const i={width:"auto",selectable:e.selectable,selected:e.selected,icon:e.icon,img:e.img,className:e.class??"",buttonClass:e.buttonClass??"x",title:e.name,overflowContainerX:o.root,swap:e.swap};t&&(n||(n=document.createElement("div"),n.className="lexoverlaygroup flex flex-none bg-secondary rounded-xl",o.queuedContainer=n),i.parent=n);let a=e.callback,r=null;r=e.options?o.addSelect(null,e.options,e.value??e.name,a,i):o.addButton(null,e.name,function(t,s){if(e.selectable)if(e.group){let t=e.selected;e.group.forEach(e=>e.selected=!1),e.selected=!t}else e.selected=!e.selected;a&&a(t,s,r.root)},i),this.buttons[e.name]=r,n&&s&&(o.root.appendChild(n),n=null,o.clearQueue())};!function(){o.clear();for(let e of t){if(null===e){const e=document.createElement("div");e.className="lexoverlayseparator"+r,o.root.appendChild(e);continue}if(e.constructor===Array)for(let t=0;t<e.length;++t){let s=e[t];s.group=e,l(s,!0,t==e.length-1)}else l(e)}if(a){var e=0;o.root.childNodes.forEach(t=>{e+=t.offsetHeight}),i.className.includes("middle")&&(i.style.top="-moz-calc( 50% - "+.5*e+"px )",i.style.top="-webkit-calc( 50% - "+.5*e+"px )",i.style.top="calc( 50% - "+.5*e+"px )")}}()}}e.LX.AreaOverlayButtons=te;class se{offset=0;root;size;resize=!1;sections=[];panels=[];minWidth=0;minHeight=0;maxWidth=1/0;maxHeight=1/0;layout;type;parentArea;splitBar;splitExtended;overlayButtons;onresize;_autoVerticalResizeObserver;_root;constructor(t={}){var s=document.createElement("div");t.id&&(s.id=t.id),s.className=e.LX.mergeClass("lexarea m-0 bg-background text-foreground",t.className);var o=t.width||"100%",n=t.height||"100%";this.setLimitBox(t.minWidth,t.minHeight,t.maxWidth,t.maxHeight),o.constructor==Number&&(o=`${o}px`),n.constructor==Number&&(n=`${n}px`),s.style.width=o,s.style.height=n,this.root=s,this.size=[this.root.offsetWidth,this.root.offsetHeight];let i=document.getElementById("lexroot");i&&!t.skipAppend&&i.appendChild(this.root),t.layout&&this.setLayout(t.layout);let a=t.overlay;if(a){this.root.classList.add("overlay-"+a),t.left?this.root.style.left=t.left:t.right?this.root.style.right=t.right:t.top?this.root.style.top=t.top:t.bottom&&(this.root.style.bottom=t.bottom);if((t.draggable??!0)&&e.LX.makeDraggable(s,t),t.resizeable&&s.classList.add("resizeable"),t.resize){this.splitBar=document.createElement("div");let r="left"==a||"right"==a?"horizontal":"vertical";if(this.type=a,this.splitBar.className="lexsplitbar "+r,"right"==a)this.splitBar.style.width=e.LX.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.left=-e.LX.DEFAULT_SPLITBAR_SIZE/2+"px";else if("left"==a){let p=Math.min(document.body.clientWidth-e.LX.DEFAULT_SPLITBAR_SIZE,this.root.clientWidth);this.splitBar.style.width=e.LX.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.left=p+e.LX.DEFAULT_SPLITBAR_SIZE/2+"px"}else if("top"==a){let m=Math.min(document.body.clientHeight-e.LX.DEFAULT_SPLITBAR_SIZE,this.root.clientHeight);this.splitBar.style.height=e.LX.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.top=m+e.LX.DEFAULT_SPLITBAR_SIZE/2+"px"}else"bottom"==a&&(this.splitBar.style.height=e.LX.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.style.top=-e.LX.DEFAULT_SPLITBAR_SIZE/2+"px");this.splitBar.addEventListener("mousedown",d),this.root.appendChild(this.splitBar);const l=this;let c=[0,0];function d(e){const t=l.root.ownerDocument;t.addEventListener("mousemove",h),t.addEventListener("mouseup",u),c[0]=e.x,c[1]=e.y,e.stopPropagation(),e.preventDefault(),document.body.classList.add("nocursor"),l.splitBar.classList.add("nocursor")}function h(t){switch(l.type){case"right":var s=c[0]-t.x,o=l.root.offsetWidth+s;l.root.style.width=o+"px";break;case"left":s=c[0]-t.x,o=Math.min(document.body.clientWidth-e.LX.DEFAULT_SPLITBAR_SIZE,l.root.offsetWidth-s);l.root.style.width=o+"px",l.splitBar.style.left=o+e.LX.DEFAULT_SPLITBAR_SIZE/2+"px";break;case"top":s=c[1]-t.y,o=Math.min(document.body.clientHeight-e.LX.DEFAULT_SPLITBAR_SIZE,l.root.offsetHeight-s);l.root.style.height=o+"px",l.splitBar.style.top=o+e.LX.DEFAULT_SPLITBAR_SIZE/2+"px";break;case"bottom":s=c[1]-t.y,o=l.root.offsetHeight+s;l.root.style.height=o+"px"}c[0]=t.x,c[1]=t.y,t.stopPropagation(),t.preventDefault(),l.onresize&&l.onresize(l.root.getBoundingClientRect())}function u(e){const t=l.root.ownerDocument;t.removeEventListener("mousemove",h),t.removeEventListener("mouseup",u),document.body.classList.remove("nocursor"),l.splitBar.classList.remove("nocursor")}}}}attach(e){if(this.sections.length)return void this.sections[1].attach(e);if(!e)throw"no content to attach";e.parent=this;let t=e.root?e.root:e;this.root.appendChild(t)}setLayout(t){if(this.layout=e.LX.deepCopy(t),!t.splits)return void console.warn("Area layout has no splits!");const s=(e,t)=>{if(t.className&&(e.root.className+=` ${t.className}`),!t.splits)return;const o=t.type??"horizontal",n=t.resize??!0,i=t.minimizable??!1,[a,r]=e.split({type:o,resize:n,minimizable:i,sizes:[t.splits[0].size,t.splits[1].size]});s(a,t.splits[0]),s(r,t.splits[1])};s(this,t)}split(t={}){this.sections.length&&(this.offset=this.root.childNodes[0].offsetHeight,this._root=this.sections[0].root,this.root=this.sections[1].root);const s=t.type??"horizontal",o=t.sizes||["50%","50%"],n="auto"===t.sizes||t.sizes&&"auto"==t.sizes[0]&&"auto"==t.sizes[1],i=this.root.getBoundingClientRect();if(!o[1]||"auto"!=o[0]&&"auto"==o[1]){let e=o[0],s=t.top?t.top:0;e.constructor==Number&&(e+=s,e=`${e}px`),o[1]="calc( 100% - "+e+" )"}let a=t.minimizable??!1,r=(t.resize??!0)||a,l=t.fixedSize??!r,c=0,d=[],h=[];if(this.offset=0,r&&(this.resize=r,this.splitBar=document.createElement("div"),this.splitBar.className="lexsplitbar "+s,"horizontal"==s?this.splitBar.style.width=e.LX.DEFAULT_SPLITBAR_SIZE+"px":this.splitBar.style.height=e.LX.DEFAULT_SPLITBAR_SIZE+"px",this.splitBar.addEventListener("mousedown",function(e){const t=m.root.ownerDocument;t.addEventListener("mousemove",g),t.addEventListener("mouseup",f),e.stopPropagation(),e.preventDefault()}),c=e.LX.DEFAULT_SPLITBAR_SIZE/2),"horizontal"==s){if(this.root.style.display="flex",l)d[0]=`calc(${o[0]} - ${c}px)`,h[0]=`calc(${o[1]} - ${c}px)`;else{const t=i.width,s=e.LX.parsePixelSize(o[0],t)/t*100,n=e.LX.parsePixelSize(o[1],t)/t*100;d[0]=`calc(${s}% - ${c}px)`,h[0]=`calc(${n}% - ${c}px)`}d[1]="100%",h[1]="100%"}else{if(n)d[1]="auto",h[1]="auto";else if(l)d[1]="auto"==o[0]?"auto":`calc(${o[0]} - ${c}px)`,h[1]="auto"==o[1]?"auto":`calc(${o[1]} - ${c}px)`;else{const t=i.height,s=e.LX.parsePixelSize(o[0],t)/t*100,n=e.LX.parsePixelSize(o[1],t)/t*100;d[1]="auto"==o[0]?"auto":`calc(${s}% - ${c}px)`,h[1]="auto"==o[1]?"auto":`calc(${n}% - ${c}px)`}d[0]="100%",h[0]="100%"}let u=new se({width:d[0],height:d[1],skipAppend:!0,className:"split"+(t.menubar||t.sidebar?"":" origin")}),p=new se({width:h[0],height:h[1],skipAppend:!0,className:"split"});if(!(l||i.width&&i.height)){const t=new ResizeObserver(i=>{console.assert(1==i.length,"AreaResizeObserver: more than one entry");const a=i[0].contentRect;if(a.width&&a.height){if(this._update([a.width,a.height],!1),!n){if("horizontal"==s){const t=a.width,s=e.LX.parsePixelSize(o[0],t)/t*100,n=e.LX.parsePixelSize(o[1],t)/t*100;d[0]=`calc(${s}% - ${c}px)`,h[0]=`calc(${n}% - ${c}px)`}else{const t=a.height,s=e.LX.parsePixelSize(o[0],t)/t*100,n=e.LX.parsePixelSize(o[1],t)/t*100;d[1]="auto"==o[0]?"auto":`calc(${s}% - ${c}px)`,h[1]="auto"==o[1]?"auto":`calc(${n}% - ${c}px)`}u.root.style.width=d[0],u.root.style.height=d[1],p.root.style.width=h[0],p.root.style.height=h[1]}u._update(),p._update(),t.disconnect()}});e.LX.doAsync(()=>{t.observe(this.root)},100)}if(n&&"vertical"==s&&(this._autoVerticalResizeObserver=new ResizeObserver(t=>{for(const s of t){const t=e.LX.getComputedSize(s.target);p.root.style.height="calc(100% - "+t.height+"px )"}}),this._autoVerticalResizeObserver.observe(u.root)),r&&a&&(this.splitExtended=!1,p.root.addEventListener("animationend",t=>{const o=getComputedStyle(p.root).opacity;p.root.classList.remove(t.animationName+"-"+s),p.root.style.opacity=o,e.LX.flushCss(p.root)}),this.splitBar.addEventListener("contextmenu",t=>{t.preventDefault(),e.LX.addContextMenu(null,t,e=>{e.add("Extend",{disabled:this.splitExtended,callback:()=>{this.extend()}}),e.add("Reduce",{disabled:!this.splitExtended,callback:()=>{this.reduce()}})})})),u.parentArea=this,p.parentArea=this,this.root.appendChild(u.root),r&&this.root.appendChild(this.splitBar),this.root.appendChild(p.root),this.sections=[u,p],this.type=s,this._update(i.width||i.height?[i.width,i.height]:void 0),!r)return this.sections;const m=this;function g(e){const t=m.root.getBoundingClientRect();e.x<t.x||e.x>t.x+t.width||e.y<t.y||e.y>t.y+t.height||("horizontal"==m.type?m._moveSplit(-e.movementX):m._moveSplit(-e.movementY),e.stopPropagation(),e.preventDefault())}function f(e){const t=m.root.ownerDocument;t.removeEventListener("mousemove",g),t.removeEventListener("mouseup",f)}return this.sections}setLimitBox(e=0,t=0,s=1/0,o=1/0){this.minWidth=e,this.minHeight=t,this.maxWidth=s,this.maxHeight=o,0!=e&&(this.root.style.minWidth=`${e}px`),0!=t&&(this.root.style.minHeight=`${t}px`),s!=1/0&&(this.root.style.maxWidth=`${s}px`),o!=1/0&&(this.root.style.maxHeight=`${o}px`)}setSize(t){let[s,o]=t;null!=s&&s.constructor==Number&&(s=`${s}px`),null!=o&&o.constructor==Number&&(o=`${o}px`),s&&(this.root.style.width=s),o&&(this.root.style.height=o),this.onresize&&this.onresize(this.root.getBoundingClientRect()),e.LX.doAsync(()=>{this.size=[this.root.clientWidth,this.root.clientHeight],this.propagateEvent("onresize")},150)}extend(){if(this.splitExtended)return;let[t,s]=this.sections;this.splitExtended=!0,t.root.classList.add(`maximize-${this.type}`),s.root.classList.add(`minimize-${this.type}`),s.root.classList.add(`fadeout-${this.type}`),s.root.classList.remove(`fadein-${this.type}`),"vertical"==this.type?(this.offset=s.root.offsetHeight,this._moveSplit(-1/0,!0)):(this.offset=s.root.offsetWidth-8,this._moveSplit(-1/0,!0,8)),e.LX.doAsync(()=>{this.propagateEvent("onresize")},100)}reduce(){if(!this.splitExtended)return;this.splitExtended=!1;let[t,s]=this.sections;t.root.classList.add(`minimize-${this.type}`),s.root.classList.add(`maximize-${this.type}`),s.root.classList.add(`fadein-${this.type}`),s.root.classList.remove(`fadeout-${this.type}`),this._moveSplit(this.offset),e.LX.doAsync(()=>{this.propagateEvent("onresize")},100)}hide(){this.root.classList.add("hidden")}show(){this.root.classList.remove("hidden")}toggle(e){this.root.classList.toggle("hidden",e)}propagateEvent(e){for(let t=0;t<this.sections.length;t++){const s=this.sections[t];s[e]&&s[e].call(this,s.root.getBoundingClientRect()),s.propagateEvent(e)}}addPanel(e){let t=new ee(e);return this.attach(t),this.panels.push(t),t}addMenubar(t,s={}){let o=new l(t,s);e.LX.menubars.push(o);const[n,i]=this.split({type:"vertical",sizes:["48px",null],resize:!1,menubar:!0});return o.siblingArea=i,n.attach(o),n.isMenubar=!0,(s.sticky??1)&&(n.root.className+=" sticky top-0 z-100"),s.parentClass&&(n.root.className=e.LX.mergeClass(n.root.className,s.parentClass)),o}addSidebar(t,s={}){let o=new e.LX.Sidebar({callback:t,...s});t&&t(o),o.update(),e.LX.sidebars.push(o);const n=s.side??"left";console.assert("left"==n||"right"==n,"Invalid sidebar side: "+n);const i="left"==n,a=s.width??"16rem",r=i?[a,null]:[null,a],[l,c]=this.split({type:"horizontal",sizes:r,resize:!1,sidebar:!0});o.siblingArea=i?c:l;let d=i?l:c;return d.attach(o),d.isSidebar=!0,s.parentClass&&(d.root.className=e.LX.mergeClass(d.root.className,s.parentClass)),o}addOverlayButtons(e,t={}){return this.sections.length?this.sections[1].addOverlayButtons(e,t):(console.assert(e.constructor==Array&&0!==e.length),this.root.style.position="relative",this.overlayButtons=new te(this,e,t),this.overlayButtons)}addTabs(e={}){const t=new c(this,e);return e.folding&&(this.parentArea?._disableSplitResize(),this.root.style.paddingTop="4px"),t}_moveSplit(t,s=!1,o=0){if(!this.type)throw"No split area";if(void 0===t)return;this._autoVerticalResizeObserver&&this._autoVerticalResizeObserver.disconnect();const n=this.sections[0];var i=n.root;i.classList.contains("origin")||(i=i.parentElement);const a=this.sections[1],r=a.root,l="- "+e.LX.DEFAULT_SPLITBAR_SIZE+"px";let c=null;if(s||(c=i.style.transition,i.style.transition=r.style.transition="none"),"horizontal"==this.type){var d=Math.max(r.offsetWidth+t,parseInt(a.minWidth));o&&(d=o);const e=d/this.size[0]*100,s=Math.max(0,100-e);i.style.width=`-moz-calc(${s}% ${l})`,i.style.width=`-webkit-calc( ${s}% ${l})`,i.style.width=`calc( ${s}% ${l})`,r.style.width=`${e}%`,r.style.width=`${e}%`,r.style.width=`${e}%`,n.maxWidth!=1/0&&(r.style.minWidth=`calc( 100% - ${parseInt(n.maxWidth)}px )`)}else{const s=this.size[1];d=Math.max(r.offsetHeight+t+a.offset,parseInt(a.minHeight));d=Math.min(s-e.LX.DEFAULT_SPLITBAR_SIZE,d),o&&(d=o);const c=d/s*100,h=Math.max(0,100-c);i.style.height=`-moz-calc(${h}% ${l})`,i.style.height=`-webkit-calc( ${h}% ${l})`,i.style.height=`calc( ${h}% ${l})`,r.style.height=`${c}%`,r.style.height=`${c}%`,r.style.height=`${c}%`,n.maxHeight!=1/0&&(r.style.minHeight=`calc( 100% - ${parseInt(n.maxHeight)}px )`)}s||(i.style.transition=r.style.transition=c),e.LX.doAsync(()=>{this._update(),this.propagateEvent("onresize")},10)}_disableSplitResize(){this.resize=!1,this.splitBar.remove(),delete this.splitBar}_update(e,t=!0){if(e)this.size=e;else{const e=this.root.getBoundingClientRect();this.size=[e.width,e.height]}if(t)for(var s=0;s<this.sections.length;s++)this.sections[s]._update()}}function oe(t,s=!0){t="light"==t?"light":"dark",document.documentElement.setAttribute("data-mode",t),document.documentElement.classList.toggle("dark","dark"==t),s&&localStorage.setItem("lxColorScheme",t),e.LX.emitSignal("@on_new_color_scheme",t)}function ne(){return document.documentElement.getAttribute("data-mode")??"dark"}function ie(e,t){if(!/^#(?:[A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e))throw`Invalid Hex Color: ${e}`;3!==(e=e.replace(/^#/,"")).length&&4!==e.length||(e=e.split("").map(e=>e+e).join(""));const s=parseInt(e,16),o=(s>>(8===e.length?24:16)&255)/255,n=(s>>(8===e.length?16:8)&255)/255,i=(s>>(8===e.length?8:0)&255)/255,a=(8===e.length?255&s:4===e.length?parseInt(e.slice(-2),16):255)/255;return{r:o,g:n,b:i,a:t?t/100:a}}function ae(e){let{r:t,g:s,b:o,a:n}=e;n=n??1;const i=Math.max(t,s,o),a=i-Math.min(t,s,o);let r=0;0!==a&&(r=i===t?(s-o)/a%6:i===s?(o-t)/a+2:(t-s)/a+4,r*=60,r<0&&(r+=360));return{h:r,s:0===i?0:a/i,v:i,a:n}}e.LX.Area=se,e.LX.twMerge=t.extendTailwindMerge({extend:{classGroups:{pad:[{pad:["xs","sm","md","lg","xl","2xl"]}]}}}),e.LX.clamp=function(e,t,s){return Math.min(Math.max(e,t),s)},e.LX.round=function(e,t){return 0==t?Math.floor(e):+e.toFixed(t??2).replace(/([0-9]+(\.[0-9]+[1-9])?)(\.?0+$)/,"$1")},e.LX.remapRange=function(e,t,s,o,n){return(e-t)*(n-o)/(s-t)+o},"undefined"!=typeof performance?e.LX.getTime=performance.now.bind(performance):"undefined"!=typeof Date&&Date.now?e.LX.getTime=Date.now.bind(Date):e.LX.getTime=function(){return(new Date).getTime()},e.LX.doAsync=function(e,t){setTimeout(e,t??0)},e.LX.flushCss=function(e){e.offsetHeight},e.LX.deleteElement=function(e){e&&e.remove()},e.LX.toCamelCase=function(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(e,t)=>t.toUpperCase())},e.LX.toTitleCase=function(e){return e.replace(/-/g," ").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())},e.LX.toKebabCase=function(e){return e.replace(/([A-Z])/g,"-$1").replace(/[\s_]+/g,"-").replace(/^-/,"").toLowerCase()},e.LX.toSnakeCase=function(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/[\s\-]+/g,"_").toLowerCase()},e.LX.getSupportedDOMName=function(e){console.assert("string"==typeof e,"getSupportedDOMName: Text is not a string!");let t=e.trim();return t=t.replace(/\//g,"_slash_").replace(/@/g,"_at_").replace(/\+/g,"_plus_").replace(/\./g,"_dot_"),t=t.replace(/[^a-zA-Z0-9_-]/g,"_"),/^[0-9]/.test(t)&&(t="_"+t),t},e.LX.has=function(t){return e.LX.extensions.indexOf(t)>-1},e.LX.getExtension=function(e){return e.includes(".")?e.split(".").pop():null},e.LX.stripHTML=function(e){const t=document.createElement("div");return t.innerHTML=e,t.textContent||t.innerText||""},e.LX.stripTags=function(e,t){t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");const s=/<\/?([a-z0-9]*)\b[^>]*>?/gi,o=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;let n=e;for(n="<"===n.substring(n.length-1)?n.substring(0,n.length-1):n;;){const e=n;if(n=e.replace(o,"").replace(s,function(e,s){return t.indexOf("<"+s.toLowerCase()+">")>-1?e:""}),e===n)return n}},e.LX.parsePixelSize=function e(t,s){if(t.constructor===Number)return t;if(t.constructor===String){const o=parseFloat(t);if(t.endsWith("px"))return o;if(t.endsWith("%"))return o/100*s;if(t.endsWith("rem")||t.endsWith("em")){return o*16}if(t.endsWith("vw"))return o/100*window.innerWidth;if(t.endsWith("vh"))return o/100*window.innerHeight;if(t.startsWith("calc(")){const o=t.slice(5,-1).split(/([+\-])/);let n=0,i="+";for(let t of o)if(t=t.trim(),"+"===t||"-"===t)i=t;else{let o=e(t,s);n="+"===i?n+o:n-o}return n}}throw"Bad size format!"},e.LX.deepCopy=function(e){return JSON.parse(JSON.stringify(e))},e.LX.concatTypedArray=function(e,t){let s=new t(e.reduce((e,t)=>e+t.length,0)),o=0;for(let t=0;t<e.length;++t)s.set(e[t],o),o+=e[t].length;return s},e.LX.setThemeColor=function(t){document.documentElement.className=`theme-${t}`;const s=e.LX.getMode();document.documentElement.classList.toggle("dark","dark"==s)},e.LX.setMode=oe,e.LX.getMode=ne,e.LX.switchMode=function(){oe("dark"==ne()?"light":"dark")},e.LX.setSystemMode=function(){oe(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),localStorage.removeItem("lxColorScheme"),e.LX._mqlPrefersDarkScheme&&(e.LX._mqlPrefersDarkScheme.removeEventListener("change",e.LX._onChangeSystemTheme),e.LX._mqlPrefersDarkScheme.addEventListener("change",e.LX._onChangeSystemTheme))},e.LX.setCSSVariable=function(e,t){document.querySelector(":root").style.setProperty("--"+e,t)},e.LX.getCSSVariable=function(t){const[s,o]=t.split("/"),n=document.querySelector(":root"),i=getComputedStyle(n);let a=i.getPropertyValue("--"+s);if(!a)return"";if(a.includes("light-dark")){a="light"==i.getPropertyValue("color-scheme")?a.substring(a.indexOf("(")+1,a.indexOf(",")).replace(/\s/g,""):a.substring(a.indexOf(",")+1,a.indexOf(")")).replace(/\s/g,"")}if(o){if(a.includes("/"))return a;if(a.startsWith("rgb(")||a.startsWith("hsl(")||a.startsWith("oklch(")||a.startsWith("lab(")||a.startsWith("lch("))return a.replace(/\)$/,` / ${parseFloat(o)/100})`);if(a.startsWith("#")){const t=e.LX.hexToRgb(a,o);return e.LX.rgbToHex(t)}}return a},e.LX.switchSpacing=function(){const t=document.documentElement.getAttribute("data-spacing")??"default";document.documentElement.setAttribute("data-spacing","default"==t?"compact":"default"),e.LX.emitSignal("@on_new_spacing_layout",t)},e.LX.getBase64Image=function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");return s&&s.drawImage(e,0,0),t.toDataURL("image/png")},e.LX.hexToRgb=ie,e.LX.hexToHsv=function(e){return ae(ie(e))},e.LX.rgbToHex=function(t,s=255){const o=[t.r,t.g,t.b];return null!=t.a&&o.push(t.a),"#"+o.map(t=>{const o=(t=Math.floor(e.LX.clamp(t*s,0,s))).toString(16);return 1===o.length?"0"+o:o}).join("")},e.LX.oklchToHex=function(t){const s=t.match(/oklch\(\s*([\d.]+)%\s+([\d.]+)\s+([\d.]+)\s*\)/);if(!s)return console.error("Invalid OKLCH format"),"#000";let[,o,n,i]=s;const a=parseFloat(o)/100,r=parseFloat(i)*Math.PI/180,l=parseFloat(n)*Math.cos(r),c=parseFloat(n)*Math.sin(r),d=(a+.3963377774*l+.2158037573*c)**3,h=(a-.1055613458*l-.0638541728*c)**3,u=(a-.0894841775*l-1.291485548*c)**3;let p=4.0767416621*d-3.3077115913*h+.2309699292*u,m=-1.2684380046*d+2.6097574011*h-.3413193965*u,g=-.0041960863*d-.7034186147*h+1.707614701*u;const f=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055;return p=f(p),m=f(m),g=f(g),e.LX.rgbToHex({r:p,g:m,b:g})},e.LX.rgbToCss=function(e){return{r:Math.floor(255*e.r),g:Math.floor(255*e.g),b:Math.floor(255*e.b),a:e.a}},e.LX.rgbToHsv=ae,e.LX.hsvToRgb=function(e){const{h:t,s:s,v:o,a:n}=e,i=o*s,a=i*(1-Math.abs(t/60%2-1)),r=o-i;let l=0,c=0,d=0;return t<60?(l=i,c=a,d=0):t<120?(l=a,c=i,d=0):t<180?(l=0,c=i,d=a):t<240?(l=0,c=a,d=i):t<300?(l=a,c=0,d=i):(l=i,c=0,d=a),{r:l+r,g:c+r,b:d+r,a:n}},e.LX.dateFromDateString=function(e){const t=e.split("/"),s=parseInt(t[0]),o=parseInt(t[1]),n=parseInt(t[2]);return new Date(`${o}/${s}/${n}`)},e.LX.measureRealWidth=function(t,s=8){var o=document.createElement("span");o.className="lexinputmeasure",o.innerHTML=t,document.body.appendChild(o);var n=o.getBoundingClientRect();return e.LX.deleteElement(o),n.width+s},e.LX.guidGenerator=function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+"-"+e()+"-"+e()},e.LX.escapeRegExp=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},e.LX.wildcardToRegExp=function(e){const t=e.replace(/([.+^${}()|[\]\\])/g,"\\$1").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^"+t+"$","i")},e.LX.buildTextPattern=function(e={}){let t=[];e.lowercase&&t.push("(?=.*[a-z])"),e.uppercase&&t.push("(?=.*[A-Z])"),e.digit&&t.push("(?=.*\\d)"),e.specialChar&&t.push("(?=.*[@#$%^&+=!])"),e.noSpaces&&t.push("(?!.*\\s)"),e.email&&t.push("(^[^s@]+@[^s@]+.[^s@]+$)");let s=e.minLength||0,o=e.maxLength||"",n=`^${t.join("")}.{${s},${o}}$`;return e.asRegExp?new RegExp(n):n},e.LX.validateValueAtPattern=function(e,t={},...s){const o=[],n=t.minLength||0,i=t.maxLength;return e.length<n?o.push(`Must be at least ${n} characters long.`):void 0!==i&&e.length>i&&o.push(`Must be no more than ${i} characters long.`),t.lowercase&&!/[a-z]/.test(e)&&o.push("Must contain at least one lowercase letter (a-z)."),t.uppercase&&!/[A-Z]/.test(e)&&o.push("Must contain at least one uppercase letter (A-Z)."),t.digit&&!/\d/.test(e)&&o.push("Must contain at least one number (0-9)."),t.noSpaces&&/\s/.test(e)&&o.push("Must NOT contain any spaces."),t.specialChar&&!/[@#$%^&+=!]/.test(e)&&o.push("Must contain at least one special character (e.g., @, #, $, %, ^, &, +, =, !)."),t.email&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)&&o.push("Must have a valid email format."),t.fieldMatchName&&e!==s[0]&&o.push(`Must match ${t.fieldMatchName} field.`),o},e.LX.makeDraggable=function(t,s={}){let o=0,n=0,i=null,a=s.targetClass,r=s.dragMargin??3,l=(s,i,a)=>{const l=t.parentElement?t.parentElement.getBoundingClientRect():{x:0,y:0,width:0,height:0},c="fixed"==t.style.position?new P(l.x,l.y):new P;a=a??s.clientX-o-l.x,i=i??s.clientY-n-l.y,t.style.left=e.LX.clamp(a,r+c.x,c.x+l.width-t.offsetWidth-r)+"px",t.style.top=e.LX.clamp(i,r+c.y,c.y+l.height-t.offsetHeight-r)+"px",t.style.translate="none"};s.autoAdjust&&l(null,parseInt(t.style.left),parseInt(t.style.top));let c=e.LX.guidGenerator();t["draggable-id"]=c;let d=s.onMove?e=>{i&&s.onMove&&s.onMove(i)}:e=>{i&&l(e)},h=s.onDragStart;t.setAttribute("draggable","true"),t.addEventListener("mousedown",function(e){i=e.target.classList.contains(a)||!a?e.target:null}),t.addEventListener("dragstart",function(a){if(a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation(),!i)return;var r=new Image;r.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",a.dataTransfer&&(a.dataTransfer.setDragImage(r,0,0),a.dataTransfer.effectAllowed="move");const l=a.target.getBoundingClientRect(),c=i.parentElement.getBoundingClientRect(),u="fixed"==i.style.position?new P(c.x,c.y):new P;o=a.clientX-l.x-u.x,n=a.clientY-l.y-u.y,document.addEventListener("mousemove",d),i.eventCatched=!0,(s.updateLayers??1)&&(e.LX.activeDraggable&&(e.LX.activeDraggable.style.zIndex=e.LX.DRAGGABLE_Z_INDEX),e.LX.activeDraggable=t,e.LX.activeDraggable.style.zIndex=e.LX.DRAGGABLE_Z_INDEX+1),h&&h(i,a)},!1),document.addEventListener("mouseup",e=>{i&&(i=null,document.removeEventListener("mousemove",d))})},e.LX.makeCollapsible=function(t,s,o,n={}){t.classList.add("collapsible");const i=n.collapsed??!0,a=e.LX.makeIcon("Right");a.classList.add("collapser"),i&&(a.dataset.collapsed="true",s.style.display="none"),a.style.marginLeft="auto",a.style.marginRight="0.2rem",a.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),this.dataset.collapsed?(delete this.dataset.collapsed,s.style.display=n.display??"block"):(this.dataset.collapsed="true",s.style.display="none")}),t.appendChild(a),(o=o??t.parentElement).appendChild(s)},e.LX.makeCodeSnippet=function(t,s,o={}){if(!e.LX.has("CodeEditor"))return void console.error("Import the CodeEditor component to create snippets!");const n=document.createElement("div");n.className=e.LX.mergeClass("lexcodesnippet relative rounded-xl overflow-hidden",o.className),n.style.width=s?s[0]:"auto",n.style.height=s?s[1]:"auto";const i=new se({xskipAppend:!0});return new e.LX.CodeEditor(i,{skipInfo:!0,disableEdition:!0,allowAddScripts:!1,name:o.tabName,onReady:e=>{if(e.setText(t,o.language??"Plain Text"),o.linesAdded){const t=e.root.querySelector(".code");for(let e of o.linesAdded){const s=e;if(s.constructor==Number)t.childNodes[s-1].classList.add("added");else if(s.constructor==Array)for(let e=s[0]-1;e<=s[1]-1;e++)t.childNodes[e].classList.add("added")}}if(o.linesRemoved){const t=e.root.querySelector(".code");for(let e of o.linesRemoved){const s=e;if(s.constructor==Number)t.childNodes[s-1].classList.add("removed");else if(s.constructor==Array)for(let e=s[0]-1;e<=s[1]-1;e++)t.childNodes[e].classList.add("removed")}}if(o.windowMode){const t=document.createElement("div");t.className="lexwindowbuttons";const s=document.createElement("span");s.style.background="#ee4f50";const o=document.createElement("span");o.style.background="#f5b720";const n=document.createElement("span");n.style.background="#53ca29",t.appendChild(s),t.appendChild(o),t.appendChild(n);e.root.querySelector(".lexareatabs").prepend(t)}(o.lineNumbers??1)||e.root.classList.add("no-gutter")}}),n.appendChild(i.root),n},e.LX.makeKbd=function(t,s=!0,o=""){const n={Ctrl:"⌃",Enter:"↩",Shift:"⇧",CapsLock:"⇪",Meta:"⌘",Option:"⌥",Alt:"⌥",Tab:"⇥",ArrowUp:"↑",ArrowDown:"↓",ArrowLeft:"←",ArrowRight:"→",Space:"␣"},i=e.LX.makeContainer(["auto","auto"],"text-muted-foreground font-sans text-xs inline-flex\n ml-auto pointer-events-none select-none items-center justify-center gap-1");for(const a of t)e.LX.makeContainer(["auto","auto"],"bg-muted px-1 rounded-sm "+o,s?n[a]??a:a,i);return i},e.LX.makeBreadcrumb=function(t,s={}){const o=e.LX.makeContainer(["auto","auto"],"flex flex-row gap-1"),n=s.separatorIcon??"ChevronRight",i=s.maxItems??4,a=t.length-i;if(a>0){const e={name:"...",ellipsis:t.splice(1,a+1).map(e=>e.name).join("/")};t.splice(1,0,e)}for(let s=0;s<t.length;++s){const i=t[s];if(console.assert(i.name,"Breadcrumb item must have a name!"),0!=s){const t=e.LX.makeIcon(n,{svgClass:"sm text-foreground separator"});o.appendChild(t)}const a=s==t.length-1,r=e.LX.makeContainer(["auto","auto"],"p-1 flex flex-row gap-1 items-center "+(a?"text-foreground":"text-muted-foreground"));o.appendChild(r);let l=e.LX.makeElement("p","",i.name);if(i.icon&&r.appendChild(e.LX.makeIcon(i.icon,{svgClass:"sm"})),void 0!==i.items){const t=e.LX.makeContainer(["auto","auto"],""+(a?"text-foreground":"text-muted-foreground"));e.LX.listen(t,"click",t=>{e.LX.addDropdownMenu(t.target,i.items,{side:"bottom",align:"start"})}),t.append(l),r.appendChild(t)}else if(void 0!==i.url){let t=e.LX.makeElement("a","decoration-none hover:underline underline-offset-4 "+(a?"text-foreground":"text-muted-foreground"),"",r);t.href=i.url,t.appendChild(l)}else r.appendChild(l);i.ellipsis&&e.LX.asTooltip(r,i.ellipsis,{side:"bottom",offset:4})}return o},e.LX.makeIcon=function(t,s={}){let o=null;const n=function(o){const n=s.svgClass;if(n&&n.length){const t=e.LX.twMerge(...o.classList,...n.split(" "));o.classList.remove(...o.classList),t.split(" ").forEach(e=>o.classList.add(e))}const i=e.LX.makeElement("a",e.LX.mergeClass("lexicon",s.iconClass));return i.title=s.title??"",i.appendChild(o),o.dataset.name=t,i};if(t.includes("@")){const e=t.split("@");t=e[0],s.variant=e[1]}let i=e.LX.ICONS[t];const a=window.lucide,r=a[t]??a[e.LX.LucideIconAlias[t]];if(i){i.constructor!=Array&&(i=e.LX.ICONS[i]);const a=s.variant??"regular";i=("solid"==a?e.LX.ICONS[`${t}@solid`]:i)??i;const l=i[3];if(a==l||!r||"regular"==l){if(o=document.createElementNS("http://www.w3.org/2000/svg","svg"),o.classList.add("text-inherit"),o.setAttribute("viewBox",`0 0 ${i[0]} ${i[1]}`),i[5]){const e=i[5].svgClass;e?.split(" ").forEach(e=>{o.classList.add(e)});const t=i[5].svgAttributes;t?.split(" ").forEach(e=>{const t=e.split("=");o.setAttribute(t[0],t[1])})}const e=document.createElement("path");if(e.classList.add("text-inherit"),e.setAttribute("fill","currentColor"),e.setAttribute("d",i[4]),o.appendChild(e),i[5]){const t=i[5].pathClass;t?.split(" ").forEach(t=>{e.classList.add(t)});const s=i[5].pathAttributes;s?.split(" ").forEach(t=>{const s=t.split("=");e.setAttribute(s[0],s[1])})}const t="\x3c!-- This icon might belong to a collection from Iconify - https://iconify.design/ - or !Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e";return o.innerHTML+=t,n(o)}}return console.assert(r,`No existing icon named _${t}_`),o=a.createElement(r,s),n(o)},e.LX.registerIcon=function(t,s,o="none",n=[]){const i=(new DOMParser).parseFromString(s,"image/svg+xml").documentElement,a=i.querySelector("path"),r=i.getAttribute("viewBox").split(" "),l=a.getAttribute("d");let c=[],d=[];for(const e of i.attributes)switch(e.name){case"transform":case"fill":case"stroke-width":case"stroke-linecap":case"stroke-linejoin":c.push(`${e.name}=${e.value}`)}for(const e of a.attributes)switch(e.name){case"transform":case"fill":case"stroke-width":case"stroke-linecap":case"stroke-linejoin":d.push(`${e.name}=${e.value}`)}const h=[parseInt(r[2]),parseInt(r[3]),n,o,l,{svgAttributes:c.length?c.join(" "):null,pathAttributes:d.length?d.join(" "):null}];e.LX.ICONS[t]&&console.warn(`${t} will be added/replaced in LX.ICONS`),e.LX.ICONS[t]=h},e.LX.registerCommandbarEntry=function(t,s){e.LX.extraCommandbarEntries.push({name:t,callback:s})},e.LX.message=function(t,s,o={}){if(!t)throw"No message to show";return o.modal=!0,new e.LX.Dialog(s,e=>{e.addTextArea(null,t,null,{disabled:!0,fitHeight:!0})},o)},e.LX.popup=function(t,s,o={}){if(!t)throw"No message to show";o.size=o.size??["max-content","auto"];const n=o.timeout||3e3,i=new e.LX.Dialog(s,e=>{e.addTextArea(null,t,null,{disabled:!0,fitHeight:!0})},o);return setTimeout(()=>{i.close()},Math.max(n,150)),i},e.LX.prompt=function t(s,o,n,i={}){i.modal=!0,i.className="prompt";let a="";const r=()=>{i.required&&""===a?(s+=s.includes("You must fill the input text.")?"":"\nYou must fill the input text.",l.close(),t(s,o,n,i)):(n&&n.call(e.LX,a),l.close())},l=new e.LX.Dialog(o,t=>{e.LX.makeElement("p","max-h-64 p-2 break-word overflow-scroll",s,t),(i.input??1)&&t.addText(null,i.input||a,(e,t)=>{a=e,t?.constructor===KeyboardEvent&&r()},{placeholder:"..."}),t.sameLine(2),t.addButton(null,"Cancel",()=>{i.on_cancel&&i.on_cancel(),l.close()},{width:"50%",buttonClass:"destructive"}),t.addButton(null,i.accept||"Continue",()=>{r()},{width:"50%",buttonClass:"primary"})},i);return(i.input??1)&&l.root.querySelector("input").focus(),l},e.LX.toast=function(t,s,o={}){if(!t)throw"The toast needs at least a title!";const n=e.LX.notifications;console.assert(n);const i=e.LX.makeElement("li","lextoast flex flex-row relative w-full border-color overflow-hidden select-none pointer-events-auto touch-none rounded-lg p-3","",n),[a,r]=o.position?o.position.split("-"):["bottom","right"];switch(n.style.right="unset",n.style.left="unset",n.style.top="unset",n.style.bottom="unset",n.style.placeSelf="unset",a){case"top":i.style.translate="0 -30px",n.style.top="1rem",n.style.flexDirection="column";break;case"bottom":i.style.translate="0 calc(100% + 30px)",n.style.top="auto",n.style.bottom="1rem",n.style.flexDirection="column-reverse"}switch(r){case"left":n.style.left="1rem";break;case"center":n.style.placeSelf="center",n.style.justifySelf="anchor-center";break;case"right":n.style.right="1rem"}i.classList.add(a),i.classList.add(r),e.LX.doAsync(()=>{n.offsetWidth>n.iWidth&&(n.iWidth=Math.min(n.offsetWidth,480),n.style.width=n.iWidth+"px"),i.dataset.open=!0},10);const l=e.LX.makeElement("div","grid h-fit max-w-lg gap-1 items-center mr-6 [&_div]:truncate [&_svg]:shrink-0","",i);if(e.LX.makeElement("div","flex flex-row gap-2 text-sm text-foreground items-center min-w-0",t,l),s&&e.LX.makeElement("div","text-secondary-foreground text-xs",s,l),o.action){const t=new ee;t.addButton(null,o.action.name??"Accept",o.action.callback.bind(e.LX,i),{width:"auto",maxWidth:"150px",className:"right",buttonClass:"outline sm"}),i.appendChild(t.root.childNodes[0])}if(i.close=function(){this.dataset.open="false",e.LX.doAsync(()=>{this.remove(),e.LX.notifications.childElementCount||(e.LX.notifications.style.width="unset",e.LX.notifications.iWidth=0)},500)},o.closable??1){const t=e.LX.makeIcon("X",{iconClass:"absolute top-2 right-2 text-sm"});t.addEventListener("click",()=>{i.close()}),i.appendChild(t)}const c=o.timeout??3e3;-1!=c&&e.LX.doAsync(()=>{i.close()},c)},e.LX.badge=function(t,s,o={}){const n=document.createElement("div");n.innerHTML=t;const i=["lexbadge","inline-flex","items-center","justify-center","rounded-full","border","px-2","py-0.5","text-xs","font-medium","w-fit","whitespace-nowrap","shrink-0","overflow-hidden","border-transparent","gap-1","min-w-5","bg-card text-foreground"];if(n.className=s?e.LX.twMerge(...i,...s.split(" ")):i.join(" "),Object.assign(n.style,o.style??{}),o.callback){const t=e.LX.makeIcon("ArrowUpRight",{svgClass:"xs"});t.querySelector("svg").style.marginLeft="-0.25rem",n.innerHTML+=t.innerHTML,n.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),o.callback()})}return o.parent&&(o.parent.classList.add("lexbadge-parent"),o.parent.appendChild(n)),o.asElement?n:n.outerHTML},e.LX.makeElement=function(e,t,s,o,n={}){const i=document.createElement(e);return i.className=t??"",i.innerHTML=s??"",Object.assign(i.style,n),o&&(o.attach?o.attach(i):o.appendChild(i)),i},e.LX.makeContainer=function(t,s,o,n,i={}){const a=e.LX.makeElement("div","lexcontainer "+(s??""),o,n,i);return a.style.width=t&&t[0]?t[0]:"100%",a.style.height=t&&t[1]?t[1]:"100%",a},e.LX.asTooltip=function(t,s,o={}){console.assert(t,"You need a trigger to generate a tooltip!"),t.dataset.disableTooltip=!(o.active??1);let n=null,i=null,a=null;const r=o.offset,l=o.offsetX??r??0,c=o.offsetY??r??6,d=o.delay??100,h=()=>{clearTimeout(i),null!==a&&(cancelAnimationFrame(a),a=null),n&&(n.remove(),n=null)},u=()=>{t.isConnected?n&&(a=requestAnimationFrame(u)):h()},p=()=>{n=e.LX.makeElement("div","lextooltip fixed bg-secondary-foreground text-secondary text-xs px-2 py-1 rounded-lg pointer-events-none data-closed:opacity-0",t.dataset.tooltipContent??s);const i=t.closest("dialog"),r=i??e.LX.root;e.LX.root.querySelectorAll(".lextooltip").forEach(e=>e.remove()),r.appendChild(n),a=requestAnimationFrame(u),e.LX.doAsync(()=>{const s=[0,0],a=parseFloat(t.dataset.tooltipOffsetX??l),d=parseFloat(t.dataset.tooltipOffsetY??c),h=t.getBoundingClientRect(),u=o.side??"top",p="top"===u||"bottom"===u;switch(u){case"left":s[0]+=h.x-n.offsetWidth-a;break;case"right":s[0]+=h.x+h.width+a;break;case"top":s[1]+=h.y-n.offsetHeight-d;break;case"bottom":s[1]+=h.y+h.height+d}if(p?s[0]+=h.x+.5*h.width-.5*n.offsetWidth+a:s[1]+=h.y+.5*h.height-.5*n.offsetHeight+d,s[0]=e.LX.clamp(s[0],0,window.innerWidth-n.offsetWidth-4),s[1]=e.LX.clamp(s[1],0,window.innerHeight-n.offsetHeight-4),i){const e=r.getBoundingClientRect();s[0]-=e.x,s[1]-=e.y}n.style.left=`${s[0]}px`,n.style.top=`${s[1]}px`,o.callback?.(n,t)})};t.addEventListener("mouseenter",function(){"true"!=t.dataset.disableTooltip&&(i=setTimeout(p,d))}),t.addEventListener("mouseleave",h)},e.LX.insertChildAtIndex=function(e,t,s=1/0){s>=e.children.length?e.appendChild(t):e.insertBefore(t,e.children[s])},e.LX.getComputedSize=function(e){return{width:e.offsetWidth,height:e.offsetHeight}},e.LX.listen=function(e,t,s,o){e[o=o??"_on"+t]=s,e.addEventListener(t,s)},e.LX.ignore=function(e,t,s){const o=e[s=s??"_on"+t];e.removeEventListener(t,o)},e.LX.getParentArea=function(e){let t=e.parentElement;for(;t;){if(t.classList.contains("lexarea"))return t;t=t.parentElement}},e.LX.hasClass=function(e,t){return!!(t=[].concat(t)).filter(t=>e.classList.contains(t)).length},e.LX.addClass=function(e,t){if(!t)return;const s=t.split(" ");e.classList.add(...s)},e.LX.removeClass=function(e,t){if(!t)return;const s=t.split(" ");e.classList.remove(...s)},e.LX.toggleClass=function(e,t,s){t&&e.classList.toggle(t,s)},e.LX.mergeClass=function(t,s){return s&&(t=[t,s].join(" ")),e.LX.twMerge(...t.split(" "))},e.LX.lastChar=function(e){return e[e.length-1]},Object.assign(e.LX,{request(e){var t=e.dataType||"text";"json"==t||"xml"==t?t="text":"binary"==t&&(t="arraybuffer",e.mimeType="application/octet-stream");var s=new XMLHttpRequest;s.open(e.data?"POST":"GET",e.url,!0),t&&(s.responseType=t),e.mimeType&&s.overrideMimeType(e.mimeType),e.nocache&&s.setRequestHeader("Cache-Control","no-cache"),s.onload=function(t){var s=this.response;if(200==this.status){if("json"==e.dataType)try{s=JSON.parse(s)}catch(o){if(!e.error)throw o;e.error(o)}else if("xml"==e.dataType)try{s=(new DOMParser).parseFromString(s,"text/xml")}catch(o){if(!e.error)throw o;e.error(o)}e.success&&e.success.call(this,s,this)}else{var o="Error "+this.status;e.error&&e.error(o)}},s.onerror=function(t){e.error&&e.error(t)};var o=new FormData;if(e.data)for(var n in e.data)o.append(n,e.data[n]);return s.send(o),s},requestFileAsync:async(e,t,s=!1)=>new Promise((o,n)=>{const i="arraybuffer"===(t=t??"arraybuffer")?"application/octet-stream":void 0;var a=new XMLHttpRequest;return a.open("GET",e,!0),a.responseType=t,i&&a.overrideMimeType(i),s&&a.setRequestHeader("Cache-Control","no-cache"),a.onload=function(){var e=this.response;if(200==this.status)o(e);else{var t="Error "+this.status;n(t)}},a.onerror=function(e){n(e)},a.send(),a}),requestText(e,t,s){return this.request({url:e,dataType:"text",success:t,error:s})},requestJSON(e,t,s){return this.request({url:e,dataType:"json",success:t,error:s})},requestBinary(e,t,s){return this.request({url:e,dataType:"binary",success:t,error:s})},requireScript(e,t,s,o,n){if(!e)throw"invalid URL";e.constructor===String&&(e=[e]);var i=e.length,a=[];for(var r in e){var l=document.createElement("script");l.num=r,l.type="text/javascript",l.src=e[r]+(n?"?version="+n:""),l.original_src=e[r],l.async=!1,l.onload=function(e){i--,a.push(this),i?o&&o(this.original_src,this.num):t&&t(a)},s&&(l.onerror=function(e){s(e,this.original_src,this.num)}),document.getElementsByTagName("head")[0].appendChild(l)}},loadScriptSync:e=>new Promise((t,s)=>{const o=document.createElement("script");o.src=e,o.async=!1,o.onload=()=>t(1),o.onerror=()=>s(new Error(`Failed to load ${e}`)),document.head.appendChild(o)}),downloadURL(t,s){const o=new FileReader,n=function(e){var t=document.createElement("a");t.href=e,t.download=s,document.body.appendChild(t),t.click(),document.body.removeChild(t)};t.includes("http")?e.LX.request({url:t,dataType:"blob",success:e=>{o.readAsDataURL(e),o.onload=e=>{n(e.currentTarget.result)}}}):n(t)},downloadFile:function(e,t,s){if(t){s||(s=t.constructor===String?"text/plain":"application/octet-stream");var o=null;o=t.constructor!==File&&t.constructor!==Blob?new Blob([t],{type:s}):t;var n=URL.createObjectURL(o),i=document.createElement("a");i.setAttribute("href",n),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(function(){URL.revokeObjectURL(n)},6e4)}else console.warn("No file provided to download")}}),e.LX.formatBytes=function(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,t)).toFixed(2)+" "+["B","KB","MB","GB","TB"][t]},e.LX.compareThreshold=function(e,t,s,o){return Math.abs(e-t)>=o||Math.abs(e-s)>=o},e.LX.compareThresholdRange=function(e,t,s,o){return e>=s&&e<=o||t>=s&&t<=o||e<=s&&t>=o},e.LX.getControlPoints=function(e,t,s,o,n,i,a){var r=Math.sqrt(Math.pow(s-e,2)+Math.pow(o-t,2)),l=a*r/(r+Math.sqrt(Math.pow(n-s,2)+Math.pow(i-o,2))),c=a-l;return[s+l*(e-n),o+l*(t-i),s-c*(e-n),o-c*(t-i)]},e.LX.drawSpline=function(t,s,o){t.save();for(var n=[],i=s.length,a=0;a<i-4;a+=2)n=n.concat(e.LX.getControlPoints(s[a],s[a+1],s[a+2],s[a+3],s[a+4],s[a+5],o));for(a=2;a<s.length-5;a+=2)t.beginPath(),t.moveTo(s[a],s[a+1]),t.bezierCurveTo(n[2*a-2],n[2*a-1],n[2*a],n[2*a+1],s[a+2],s[a+3]),t.stroke(),t.closePath();t.beginPath(),t.moveTo(s[0],s[1]),t.quadraticCurveTo(n[0],n[1],s[2],s[3]),t.stroke(),t.closePath(),t.beginPath(),t.moveTo(s[i-2],s[i-1]),t.quadraticCurveTo(n[2*i-10],n[2*i-9],s[i-4],s[i-3]),t.stroke(),t.closePath(),t.restore()};class re{root;imageElement=void 0;fallbackElement=void 0;constructor(t){let s="lexavatar bg-card items-center flex flex-row relative size-8 shrink-0 overflow-hidden rounded-full";if(this.root=e.LX.makeElement("div"),t.imgSource){const s="aspect-square size-full object-cover",o=e.LX.makeElement("img",t.imgClass?e.LX.twMerge(...s.split(" "),...t.imgClass.split(" ")):s,"",this.root);o.src=t.imgSource,o.alt=t.imgAlt,this.imageElement=o}else if(t.fallback){const o="size-full text-sm font-semibold place-self-center text-center content-center",n=e.LX.makeElement("span",t.fallbackClass?e.LX.twMerge(...o.split(" "),...t.fallbackClass.split(" ")):o,t.fallback,this.root);this.fallbackElement=n,s+=" border-color"}this.root.className=t.className?e.LX.twMerge(...s.split(" "),...t.className.split(" ")):s}}e.LX.Avatar=re;class le{root;constructor(t={}){const s=t.icon??"LoaderCircle",o=t.size??"md",n=e.LX.mergeClass("flex",t.iconClass),i=e.LX.mergeClass(`animate-spin ${o}`,t.svgClass);this.root=e.LX.makeIcon(s,{iconClass:n,svgClass:i})}html(){return this.root.innerHTML}destroy(){this.root.remove()}}e.LX.Spinner=le;class ce{static _last_id=0;id;root;panel;title;size=[];branchData;close=()=>{};_oncreate;constructor(t,s,o={}){s||console.warn("Content is empty, add some components using 'callback' parameter!"),this._oncreate=s,this.id=e.LX.guidGenerator();const n=o.size??[],i=o.position??[],a=o.draggable??!0,r=o.dockable??!1,l=o.modal??!1;let c=document.createElement("dialog");c.className=e.LX.mergeClass("lexdialog absolute outline-none border-color m-0 p-0 min-w-3xs min-h-max overflow-hidden rounded-xl bg-background",o.className),c.id=o.id??"dialog"+ce._last_id++,c.dataset.modal=l,e.LX.root.appendChild(c),e.LX.doAsync(()=>{l?c.showModal():c.show()},10);let d=this;const h=document.createElement("div");if(t&&(h.className="lexdialogtitle flex w-full outline-none items-center justify-between font-semibold text-xl text-secondary-foreground pad-xl select-none",h.innerHTML=t,h.setAttribute("draggable","false"),c.appendChild(h)),o.closable??1){this.close=()=>{o.onBeforeClose&&o.onBeforeClose(this),o.onclose?o.onclose(this.root):(c.close(),e.LX.doAsync(()=>{d.panel.clear(),c.remove()},150))};const s=e.LX.makeIcon("X",{title:"Close",iconClass:"lexdialogcloser text-lg text-secondary-foreground cursor-pointer z-1 select-none"});s.addEventListener("click",this.close);const n=e.LX.makeIcon("Minus",{title:"Dock",iconClass:"ml-auto mr-2"});n.addEventListener("click",()=>{const e=this.branchData,t=e.panel,s=t.root.childElementCount,o=t.branch(e.name,{closed:e.closed});o.components=e.components;for(let e of o.components)o.content.appendChild(e.root);e.childIndex<s&&t.root.insertChildAtIndex(o.root,e.childIndex),this.close()}),t?(r&&h.appendChild(n),h.appendChild(s)):(s.classList.add("notitle"),c.appendChild(s))}const u=new e.LX.Panel({className:"lexdialogcontent w-full p-1 text-secondary-foreground text-sm ml-0 break-all"});t||u.root.classList.add("notitle"),s&&s.call(this,u),c.appendChild(u.root),u.root.querySelectorAll(".lexbranch").forEach(e=>e.classList.add("dialog")),this.panel=u,this.root=c,this.title=h,a&&e.LX.makeDraggable(c,Object.assign({targetClass:"lexdialogtitle"},o)),n.length&&"string"!=typeof n[0]&&(n[0]+="px"),n.length&&"string"!=typeof n[1]&&(n[1]+="px"),c.style.width=n[0]?n[0]:"25%",c.style.height=n[1]?n[1]:"auto",c.style.translate=o.position?"unset":"-50% -50%",o.size&&(this.size=n),c.style.left=i[0]??"50%",c.style.top=i[1]??"50%",u.root.style.height=t?"calc( 100% - "+(h.offsetHeight+30)+"px )":"calc(100%)"}destroy(){this.root.remove()}refresh(){this.panel.root.innerHTML="",this._oncreate.call(this,this.panel)}setPosition(e,t){this.root.style.left=`${e}px`,this.root.style.top=`${t}px`}setTitle(e){const t=this.root.querySelector(".lexdialogtitle");t&&(t.innerText=e)}}e.LX.Dialog=ce;class de extends ce{constructor(t,s,o,n={}){n.closable=!1,n.draggable=!1,n.modal=!0,super(void 0,i=>{i.root.className=e.LX.mergeClass(i.root.className,"pad-2xl flex flex-col gap-2"),e.LX.makeContainer(["100%","100%"],"text-lg font-medium text-foreground px-2",t,i),i.addTextArea(null,s,null,{disabled:!0,fitHeight:!0,inputClass:"bg-none text-sm text-muted-foreground"}),i.sameLine(2,"justify-end"),i.addButton(null,n.cancelText??"Cancel",()=>{n.cancelCallback&&n.cancelCallback(),this.destroy()},{buttonClass:"outline"}),i.addButton(null,n.continueText??"Continue",()=>{this.destroy(),o&&o()},{buttonClass:"primary"})},n)}}e.LX.AlertDialog=de;class he{root;items;colors;_parent;constructor(t,s,o={}){if(document.body.querySelectorAll(".lexcontextmenu").forEach(e=>e.remove()),this.root=document.createElement("div"),this.root.className="lexcontextmenu",this.root.addEventListener("mouseleave",function(){this.remove()}),this.items=[],this.colors={},s){let e={};e[s]=[],e.className="cmtitle",e.icon=o.icon,this.items.push(e)}const n=t.target.closest("dialog");n&&"true"==n.dataset.modal?this._parent=n:this._parent=e.LX.root,this._parent.appendChild(this.root);const i=[t.x-48,t.y-8];if(this._parent instanceof HTMLDialogElement){let e=this._parent.getBoundingClientRect();i[0]-=e.x,i[1]-=e.y}this.root.style.left=`${i[0]}px`,this.root.style.top=`${i[1]}px`}_adjustPosition(e,t,s=!1){let o=e.getBoundingClientRect(),n=parseInt(e.style.left),i=parseInt(e.style.top);if(s){let s=window.innerWidth-o.right;s<0&&(n=e.offsetLeft+(s-t)),s=window.innerHeight-(o.top+o.height),s<0&&(i=e.offsetTop+(s-t+20))}else{let s=o.width;o.left<0?n=t:window.innerWidth-o.right<0&&(n=window.innerWidth-s-t),o.top<0?i=t:o.top+o.height>window.innerHeight&&(e.style.marginTop="",i=window.innerHeight-o.height-t)}e.style.left=`${n}px`,e.style.top=`${i}px`}_createSubmenu(e,t,s,o){this.root.querySelectorAll(".lexcontextmenu").forEach(e=>e.remove());let n=document.createElement("div");n.className="lexcontextmenu",s.appendChild(n);for(let s=0;s<e[t].length;++s){const i=e[t][s],a=Object.keys(i)[0];this._createEntry(i,a,n,o)}const i=s.getBoundingClientRect();n.style.left=i.x+i.width+"px",n.style.marginTop="-31px",this._adjustPosition(n,6)}_createEntry(t,s,o,n){const i=t[s].length;let a=document.createElement("div");a.className="lexmenuboxentry"+(t.className?" "+t.className:""),a.id=t.id??"eId"+e.LX.getSupportedDOMName(s),a.innerHTML="";const r=t.icon;r&&a.appendChild(e.LX.makeIcon(r,{svgClass:"sm"}));const l=t.disabled;if(a.innerHTML+="<div class='lexentryname"+(l?" disabled":"")+"'>"+s+"</div>",o.appendChild(a),this.colors[s]&&(a.style.borderColor=this.colors[s]),""==s)return void(a.className+=" cmseparator");if(a.addEventListener("click",o=>{if(o.stopPropagation(),o.stopImmediatePropagation(),l)return;const r=t.callback;r&&(r.call(this,s,a),this.root.remove()),i&&"click"==e.LX.OPEN_CONTEXTMENU_ENTRY&&this._createSubmenu(t,s,a,++n)}),!i)return;const c=e.LX.makeIcon("Menu",{svgClass:"sm"});a.appendChild(c),"mouseover"==e.LX.OPEN_CONTEXTMENU_ENTRY&&a.addEventListener("mouseover",e=>{"true"!=a.dataset.built&&(a.dataset.built="true",this._createSubmenu(t,s,a,++n),e.stopPropagation())}),a.addEventListener("mouseleave",()=>{n=-1,o.querySelectorAll(".lexcontextmenu").forEach(e=>e.remove())})}onCreate(){e.LX.doAsync(()=>this._adjustPosition(this.root,6))}add(t,s={}){s.constructor==Function&&(s={callback:s});const o=(t+="").split("/"),n=o[o.length-1];this.colors[n]=s.color;let i=0;const a=(e,t)=>{if(null==e)return;let n=null;if(t.forEach(t=>{const s=Object.keys(t).find(t=>t==e);s&&(n=t[s])}),n)a(o[i++],n);else{let n={};n[e]=[];const r=o[i++];r||(n.id=s.id,n.icon=s.icon,n.callback=s.callback,n.disabled=s.disabled??!1),t.push(n),a(r,n[e])}};a(o[i++],this.items);const r=e=>{let t=Object.keys(e)[0],s=e[t];if(s.length){if(null==s.find(e=>Object.keys(e)[0]==t)){let s={};s[t]=[],s.className="cmtitle",e[t].unshift(s)}for(let s of e[t]){let e=Object.keys(s)[0];for(let t=0;t<s[e].length;++t)r(s)}}};for(let e of this.items)r(e);for(let t of this.items){let s=Object.keys(t)[0],o="eId"+e.LX.getSupportedDOMName(s);const n="#"+(t.id??o);this.root.querySelector(n)||this._createEntry(t,s,this.root,-1)}}setColor(t,s){"#"!==s[0]&&(s=e.LX.rgbToHex(s)),this.colors[t]=s}}e.LX.ContextMenu=he,e.LX.addContextMenu=function(e,t,s,o={}){const n=new he(t,e,o);return s&&s(n),n.onCreate(),n};class ue{static currentMenu=null;root;side="bottom";align="center";sideOffset=0;alignOffset=0;avoidCollisions=!0;onBlur;event;inPlace=!1;_trigger;_items=[];_parent;_windowPadding=4;_onClick;_radioGroup;invalid=!1;constructor(t,s,o={}){if(console.assert(t,"DropdownMenu needs a DOM element as trigger!"),ue.currentMenu||!s?.length)return ue.currentMenu?.destroy(),void(this.invalid=!0);this._trigger=t,t.classList.add("triggered"),t.ddm=this,this._items=s,this.side=o.side??"bottom",this.align=o.align??"center",this.sideOffset=o.sideOffset??0,this.alignOffset=o.alignOffset??0,this.avoidCollisions=o.avoidCollisions??!0,this.onBlur=o.onBlur,this.event=o.event,this.root=document.createElement("div"),this.root.id="root",this.root.dataset.side=this.side,this.root.tabIndex="1",this.root.className="lexdropdownmenu";const n=t.closest("dialog");n&&"true"==n.dataset.modal?this._parent=n:this._parent=e.LX.root,this._parent.appendChild(this.root),this._create(this._items),ue.currentMenu=this,e.LX.doAsync(()=>{this._adjustPosition(),this.root.focus(),this._onClick=e=>{(!e.target||null==e.target.closest(".lexdropdownmenu")&&e.target!=this._trigger)&&this.destroy(!0)},document.body.addEventListener("mousedown",this._onClick,!0),document.body.addEventListener("focusin",this._onClick,!0)},10)}destroy(e=!1){this._trigger.classList.remove("triggered"),delete this._trigger.ddm,document.body.removeEventListener("mousedown",this._onClick,!0),document.body.removeEventListener("focusin",this._onClick,!0),this._parent.querySelectorAll(".lexdropdownmenu").forEach(e=>{e.remove()}),ue.currentMenu=null,e&&this.onBlur&&this.onBlur()}_create(t,s){if(s){const t=s.getBoundingClientRect();let o=document.createElement("div");o.tabIndex="1",o.className="lexdropdownmenu",o.dataset.id=s.dataset.id,o.dataset.side="right",this._parent.appendChild(o),o.currentParent=s,s=o,e.LX.doAsync(()=>{const s=[t.x+t.width,t.y];if(this._parent instanceof HTMLDialogElement){let e=this._parent.getBoundingClientRect();s[0]-=e.x,s[1]-=e.y}this.avoidCollisions&&(s[0]=e.LX.clamp(s[0],0,window.innerWidth-o.offsetWidth-this._windowPadding),s[1]=e.LX.clamp(s[1],0,window.innerHeight-o.offsetHeight-this._windowPadding)),o.style.left=`${s[0]}px`,o.style.top=`${s[1]}px`},10)}else s=this.root;let o=t.filter(e=>null!=e?.icon||null!=e?.checked).length>0;for(let e of t)this._createItem(e,s,o)}_createItem(t,s,o){if(!t)return void this._addSeparator(s);const n=t.name??t,i=e.LX.getSupportedDOMName(n);if(s.querySelector("#"+i))return;const a=document.createElement("div");if(a.className=e.LX.mergeClass("lexdropdownmenuitem flex flex-row pad-md rounded-lg gap-2 truncate cursor-pointer select-none"+(t.name||t.options?"":" label")+(t.disabled?" disabled":""),t.className),a.dataset.id=i,a.innerHTML=`<span class="ellipsis-overflow">${n}</span>`,a.tabIndex="1",s.appendChild(a),t.constructor===String)return;if(t.submenu){const t=e.LX.makeIcon("Right",{svgClass:"sm"});a.appendChild(t)}else if(t.kbd){t.kbd=[].concat(t.kbd);const s=e.LX.makeKbd(t.kbd,t.useKbdSpecialKeys??!0);a.appendChild(s),document.addEventListener("keydown",e=>{if(!this._trigger.ddm)return;e.preventDefault();let s=t.kbd.join("");s=1==s.length?s.toLowerCase():s,s==e.key&&a.click()})}const r=t.disabled??!1;if(void 0!==this._radioGroup){if(t.name===this._radioGroup.selected){const t=e.LX.makeIcon("Circle",{svgClass:"2xs fill-current"});a.prepend(t)}a.setAttribute("data-radioname",this._radioGroup.name)}else if(t.icon){const s=t.icon.constructor===String?e.LX.makeIcon(t.icon,{svgClass:r?"text-muted-foreground":t.svgClass??t.className}):t.icon;a.prepend(s)}else null==t.checked&&o&&a.classList.add("pl-8");if(!r){if(null!=t.checked){const e=new g(i+"_entryChecked",t.checked,e=>{const s=t.callback;t.checked=e,s&&s.call(this,n,e,a)},{className:"primary"}),s=e.root.querySelector("input");s.classList.add("ml-auto"),a.appendChild(s),a.addEventListener("click",t=>{"checkbox"!=t.target.type&&(s.checked=!s.checked,e.set(s.checked))})}else a.addEventListener("click",e=>{const s=a.getAttribute("data-radioname");s&&(this._trigger[s]=n);const o=t.callback;o&&o.call(this,n,a,s),!t.options&&(t.closeOnClick??1)&&this.destroy(!0)});if(a.addEventListener("mouseover",e=>{let o=a.dataset.id;if(!o)return;let n=s;for(;n;)o+="/"+n.dataset.id,n=n.currentParent?.parentElement;if(this._parent.querySelectorAll(".lexdropdownmenu").forEach(e=>{o.includes(e.dataset.id)||(e.currentParent.built=!1,e.remove())}),t.submenu&&this.inPlace){if(a.built)return;a.built=!0,this._create(t.submenu,a)}e.stopPropagation()}),t.options){console.assert(this._trigger[t.name]&&"An item of the radio group must be selected!"),this._radioGroup={name:t.name,selected:this._trigger[t.name]};for(let e of t.options)this._createItem(e,s,o);delete this._radioGroup,this._addSeparator()}}}_adjustPosition(){const t=[0,0],s=this._trigger.getBoundingClientRect();if(this.event)t[0]=this.event.x,t[1]=this.event.y;else{let e=!0;switch(this.side){case"left":t[0]+=s.x-this.root.offsetWidth-this.sideOffset,e=!1;break;case"right":t[0]+=s.x+s.width+this.sideOffset,e=!1;break;case"top":t[1]+=s.y-this.root.offsetHeight-this.sideOffset,e=!0;break;case"bottom":t[1]+=s.y+s.height+this.sideOffset,e=!0}switch(this.align){case"start":e?t[0]+=s.x:t[1]+=s.y;break;case"center":e?t[0]+=s.x+.5*s.width-.5*this.root.offsetWidth:t[1]+=s.y+.5*s.height-.5*this.root.offsetHeight;break;case"end":e?t[0]+=s.x-this.root.offsetWidth+s.width:t[1]+=s.y-this.root.offsetHeight+s.height}e?t[0]+=this.alignOffset:t[1]+=this.alignOffset}if(this._parent instanceof HTMLDialogElement){let e=this._parent.getBoundingClientRect();t[0]-=e.x,t[1]-=e.y}this.avoidCollisions&&(t[0]=e.LX.clamp(t[0],0,window.innerWidth-this.root.offsetWidth-this._windowPadding),t[1]=e.LX.clamp(t[1],0,window.innerHeight-this.root.offsetHeight-this._windowPadding)),this.root.style.left=`${t[0]}px`,this.root.style.top=`${t[1]}px`,this.inPlace=!0}_addSeparator(e=null){const t=document.createElement("div");t.className="separator",e=e??this.root,e?.appendChild(t)}}function pe(e,t,s={}){const o=new ue(e,t,s);return o.invalid?null:o}e.LX.DropdownMenu=ue,e.LX.addDropdownMenu=pe;class me{root;constructor(t={}){const s=document.createElement("footer");s.className=e.LX.mergeClass("lexfooter bg-background p-2 w-full leading-6 [&_p]:text-xs",t.className);const o=document.createElement("div");if(o.style.minHeight="48px",o.className="w-full",s.appendChild(o),t.columns&&t.columns.constructor==Array){const e=document.createElement("div");e.className="grid text-center",e.style.gridTemplateColumns="1fr ".repeat(t.columns.length),o.appendChild(e);for(let s of t.columns){const t=document.createElement("div");t.className="col",e.appendChild(t);const o=document.createElement("h2");if(o.innerHTML=s.title,t.appendChild(o),!s.items||!s.items.length)continue;const n=document.createElement("ul");t.appendChild(n);for(let e of s.items){const t=document.createElement("li");t.innerHTML=`<a class="" href="${e.link}">${e.title}</a>`,n.appendChild(t)}}}if(t.credits||t.socials){const s=document.createElement("div");if(s.className="credits-and-socials",o.appendChild(s),t.credits){const e=document.createElement("p");e.innerHTML=t.credits,s.appendChild(e)}if(t.socials){const o=document.createElement("div");o.className="socials flex flex-row gap-1 my-2 justify-end";for(let s of t.socials){const t=e.LX.makeIcon(s.icon,{title:s.title,svgClass:"xl"});t.href=s.link,t.target="_blank",o.appendChild(t)}s.appendChild(o)}}(t.parent??document.body).appendChild(s),s.previousElementSibling&&(s.previousElementSibling.style.flexGrow="1"),this.root=s}}e.LX.Footer=me;class ge extends ce{static TOP=0;static BOTTOM=1;dockPosition=ge.TOP;minimized=!1;constructor(t,s,o={}){o.draggable=o.draggable??!1,o.closable=o.closable??!1;super(t,s,o);let n=this;e.LX.addSignal("@on_branch_closed",this.panel,e=>{this.dockPosition==ge.BOTTOM&&(this.root.style.top=`calc(100% - ${this.root.offsetHeight+3}px)`)}),this.root.classList.add("pocket"),this.root.style.translate="none",this.root.style.top="0",this.root.style.left="unset",o.position||(this.root.style.right="3px",this.root.style.top="3px"),this.panel.root.style.width="100%",this.panel.root.style.height="100%";const i=this.title;if(i.tabIndex=-1,i.addEventListener("click",e=>{i.eventCatched?i.eventCatched=!1:(this.size&&(this.minimized?this.root.style.height=this.size[1]:this.root.style.height="auto"),this.root.classList.toggle("minimized"),this.minimized=!this.minimized,this.dockPosition==ge.BOTTOM&&(n.root.style.top=this.root.classList.contains("minimized")?`calc(100% - ${n.title.offsetHeight+6}px)`:`calc(100% - ${n.root.offsetHeight+3}px)`))}),!o.draggable){const e=o.float;if(e)for(let t=0;t<e.length;t++){switch(e[t]){case"b":this.root.style.top=`calc(100% - ${this.root.offsetHeight+3}px)`;break;case"l":this.root.style.right="unset",this.root.style.left=o.position?o.position[1]:"3px"}}this.root.classList.add("dockable"),i.addEventListener("keydown",function(e){e.ctrlKey&&(n.root.style.right="unset","ArrowLeft"==e.key?n.root.style.left="0px":"ArrowRight"==e.key?n.root.style.left=`calc(100% - ${n.root.offsetWidth+3}px)`:"ArrowUp"==e.key?(n.root.style.top="0px",n.dockPosition=ge.TOP):"ArrowDown"==e.key&&(n.root.style.top=`calc(100% - ${n.root.offsetHeight+3}px)`,n.dockPosition=ge.BOTTOM))})}}}e.LX.PocketDialog=ge;class fe{side="left";root;_onClick;constructor(t,s,o={}){this.side=o.side??this.side,this.root=document.createElement("div"),this.root.dataset.side=this.side,this.root.tabIndex="1",this.root.role="dialog",this.root.className="lexsheet fixed z-1000 bg-primary overflow-hidden",document.body.appendChild(this.root),this.root.addEventListener("keydown",e=>{"Escape"==e.key&&(e.preventDefault(),e.stopPropagation(),this.destroy())}),s&&(s=[].concat(s)).forEach(e=>{const t=e.root??e;this.root.appendChild(t),e.onSheet&&e.onSheet()}),e.LX.doAsync(()=>{switch(e.LX.modal.toggle(!1),this.side){case"left":this.root.style.left="0",this.root.style.width=t,this.root.style.height="100%";break;case"right":this.root.style.right="0",this.root.style.width=t,this.root.style.height="100%";break;case"top":this.root.style.left="0",this.root.style.top="0",this.root.style.width="100%",this.root.style.height=t;break;case"bottom":this.root.style.left="0",this.root.style.bottom="0",this.root.style.width="100%",this.root.style.height=t}document.documentElement.setAttribute("data-scale",`sheet-${this.side}`),this.root.focus(),this._onClick=e=>{e.target&&this.root.contains(e.target)||this.destroy()},document.body.addEventListener("mousedown",this._onClick,!0),document.body.addEventListener("focusin",this._onClick,!0)},10)}destroy(){document.documentElement.setAttribute("data-scale",""),document.body.removeEventListener("mousedown",this._onClick,!0),document.body.removeEventListener("focusin",this._onClick,!0),this.root.remove(),e.LX.modal.toggle(!0)}}e.LX.Sheet=fe;class Le{root;callback;items=[];icons={};groups={};side;collapsable;collapsed;filterString;filter;header;content;footer;resizeObserver=void 0;siblingArea=void 0;currentGroup;collapseQueue;collapseContainer;_collapseWidth;_displaySelected=!0;get displaySelected(){return this._displaySelected}set displaySelected(e){this._displaySelected=e,e||this.root.querySelectorAll(".lexsidebarentry").forEach(e=>e.classList.remove("selected"))}constructor(t={}){const s=navigator&&/Android|iPhone/i.test(navigator.userAgent);if(this.root=document.createElement("div"),this.root.className=e.LX.mergeClass("lexsidebar flex flex-col pad-xl size-full scrollbar-hidden",t.className),this.callback=t.callback??null,this.side=t.side??"left",this.collapsable=t.collapsable??!0,this.collapsed=t.collapsed??s,this._displaySelected=t.displaySelected??!1,this._collapseWidth=t.collapseToIcons??1?"58px":"0px",this.filterString="",e.LX.doAsync(()=>{if(this.root.parentElement.ogWidth=this.root.parentElement.style.width,this.root.parentElement.style.transition=this.collapsed?"":"width 0.25s ease-out",this.resizeObserver=new ResizeObserver(e=>{for(const t of e)this.siblingArea?.setSize(["calc(100% - "+t.contentRect.width+"px )",null])}),this.collapsed){if(this.root.classList.toggle("collapsed",this.collapsed),this.root.parentElement.style.width=this._collapseWidth,!this.resizeObserver)throw"Wait until ResizeObserver has been created!";this.resizeObserver.observe(this.root.parentElement),e.LX.doAsync(()=>{this.resizeObserver?.unobserve(this.root.parentElement),this.root.querySelectorAll(".lexsidebarentrycontent").forEach(e=>e.dataset.disableTooltip=`${!this.collapsed}`)},10)}},10),!t.skipHeader&&(this.header=t.header??this._generateDefaultHeader(t),console.assert(this.header.constructor===HTMLDivElement,"Use an HTMLDivElement to build your custom header"),this.header.className="lexsidebarheader w-full h-[48px] flex rounded-lg p-2 mb-2 text-sm cursor-pointer items-center select-none",this.root.appendChild(this.header),this.collapsable)){const o=e.LX.makeIcon("left"==this.side?"PanelLeft":"PanelRight",{title:"Toggle Sidebar",iconClass:"toggler"});if(this.header.appendChild(o),s){const s=new se({skipAppend:!0}),n=e.LX.deepCopy(t);n.collapsed=!1,n.collapsable=!1,s.addSidebar(this.callback,n),o.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),new e.LX.Sheet("256px",[s],{side:this.side})})}else o.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.toggleCollapsed()})}if(t.filter){const e=new h(null,"",(e,t)=>{this.filterString=e,this.update()},{inputClass:"outline",placeholder:"Search...",icon:"Search",className:"lexsidebarfilter"});this.filter=e.root,this.root.appendChild(this.filter)}this.content=document.createElement("div"),this.content.className="lexsidebarcontent overflow-mask flex flex-col overflow-x-hidden overflow-y-scroll flex-auto-fill w-full",this.root.appendChild(this.content),t.skipFooter||(this.footer=t.footer??this._generateDefaultFooter(t),console.assert(this.footer.constructor===HTMLDivElement,"Use an HTMLDivElement to build your custom footer"),this.footer.className="lexsidebarfooter w-full h-[48px] flex rounded-lg p-2 mt-2 text-sm cursor-pointer items-center select-none",this.root.appendChild(this.footer))}_generateDefaultHeader(t={}){const s=document.createElement("div");s.addEventListener("click",e=>{this.collapsed?(e.preventDefault(),e.stopPropagation(),this.toggleCollapsed()):t.onHeaderPressed&&t.onHeaderPressed(e)});const o=new e.LX.Avatar({imgSource:t.headerImage,fallback:t.headerIcon?e.LX.makeIcon(t.headerIcon,{svgClass:"xl"}).innerHTML:void 0,className:"rounded-lg"});s.appendChild(o.root);{const o=document.createElement("div");o.className="infodefault",s.appendChild(o);const n=e.LX.makeElement("span","truncate text-sm font-semibold");n.innerHTML=t.headerTitle??"",o.appendChild(n);const i=e.LX.makeElement("span","truncate text-xs");i.innerHTML=t.headerSubtitle??"",o.appendChild(i)}if(t.onHeaderPressed&&!this.collapsable){const t=e.LX.makeIcon("MenuArrows");s.appendChild(t)}return s}_generateDefaultFooter(t={}){const s=document.createElement("div");s.addEventListener("click",e=>{t.onFooterPressed&&t.onFooterPressed(e,s)});const o=new e.LX.Avatar({imgSource:t.footerImage,fallback:t.footerIcon?e.LX.makeIcon(t.footerIcon,{svgClass:"xl"}).innerHTML:void 0,className:"rounded-lg"});s.appendChild(o.root);{const o=document.createElement("div");o.className="infodefault",s.appendChild(o);const n=e.LX.makeElement("span","truncate text-sm font-semibold");n.innerHTML=t.footerTitle??"",o.appendChild(n);const i=e.LX.makeElement("span","truncate text-xs");i.innerHTML=t.footerSubtitle??"",o.appendChild(i)}if(t.onFooterPressed){const t=e.LX.makeIcon("MenuArrows");s.appendChild(t)}return s}toggleCollapsed(t){if(this.collapsable){if(this.collapsed=t??!this.collapsed,this.collapsed?(this.root.classList.add("collapsing"),this.root.parentElement.style.width=this._collapseWidth):(this.root.classList.remove("collapsing"),this.root.classList.remove("collapsed"),this.root.parentElement.style.width=this.root.parentElement.ogWidth),!this.resizeObserver)throw"Wait until ResizeObserver has been created!";this.resizeObserver.observe(this.root.parentElement),e.LX.doAsync(()=>{this.root.classList.toggle("collapsed",this.collapsed),this.resizeObserver?.unobserve(this.root.parentElement),this.root.querySelectorAll(".lexsidebarentrycontent").forEach(e=>e.dataset.disableTooltip=`${!this.collapsed}`)},250)}}separator(){this.currentGroup=null,this.add("")}group(e,t){this.currentGroup=e,this.groups[e]=t}add(e,t={}){t.constructor==Function&&(t={callback:t});const s=e.split("/"),o=s[s.length-1];this.icons[o]=t.icon;let n=0;const i=(e,o)=>{if(null==e)return;let a=null;if(o.forEach(t=>{const s=Object.keys(t).find(t=>t==e);s&&(a=t[s])}),a)i(s[n++],a);else{let a={};a[e]=[];const r=s[n++];r||(a.callback=t.callback,a.group=this.currentGroup,a.options=t),o.push(a),i(r,a[e])}};i(s[n++],this.items)}select(t){let s=e.LX.getSupportedDOMName(t);const o=this.items.find(e=>e.name===s);o&&o.dom.click()}update(){this.content.innerHTML="";for(let e of this.items)delete e.dom;for(let t of this.items){const s=t.options??{};if(t.dom)continue;let o=t.name=Object.keys(t)[0];if(this.filterString.length&&!o.toLowerCase().includes(this.filterString.toLowerCase()))continue;let n=e.LX.getSupportedDOMName(o),i=null,a=e.LX.makeElement("div",e.LX.mergeClass("lexsidebarentry w-full rounded-lg cursor-pointer select-none",s.className));if(a.id=n,this.displaySelected&&s.selected&&a.classList.add("selected"),t.group){const s=t.group.replace(/\s/g,"").replaceAll(".","");if(i=this.content.querySelector("#"+s),i){if(!i.classList.contains("lexsidebargroup"))throw"Bad id: "+t.group}else{i=e.LX.makeElement("div","lexsidebargroup flex flex-col gap-0.5"),i.id=s,this.content.appendChild(i);let o=e.LX.makeElement("div","lexsidebargrouptitle");if(i.appendChild(o),e.LX.makeElement("div","",t.group,o),null!=this.groups[t.group]){const s=e.LX.makeIcon(this.groups[t.group].icon,{svgClass:"sm"});o.appendChild(s),s.addEventListener("click",e=>{this.groups[t.group].callback&&this.groups[t.group].callback(t.group,e)})}}}if(""==n){let e=document.createElement("div");e.className="lexsidebarseparator",this.content.appendChild(e);continue}this.collapseContainer?(this.collapseContainer.appendChild(a),this.collapseQueue--,this.collapseQueue||delete this.collapseContainer):i?i.appendChild(a):this.content.appendChild(a);let r=document.createElement("div");if(r.className="lexsidebarentrycontent",a.appendChild(r),t.dom=a,"checkbox"==s.type){t.value=s.value??!1;const e=new ee;t.checkbox=e.addCheckbox(null,t.value,(e,n)=>{n.preventDefault(),n.stopPropagation();const i=s.callback;t.value=e,i&&i.call(this,o,e,n)},{className:"primary",label:o,signal:"@checkbox_"+o}),r.appendChild(e.root.childNodes[0])}else{if(s.icon){const t=e.LX.makeIcon(s.icon,{iconClass:"lexsidebarentryicon"});r.appendChild(t),e.LX.asTooltip(r,o,{side:"right",offset:16,active:!1})}if(e.LX.makeElement("a","grid-column-start-2",o,r),s.swap){r.classList.add("swap","inline-grid"),r.querySelector("a")?.classList.add("swap-off");const t=document.createElement("input");t.className="p-0 border-0",t.type="checkbox",r.prepend(t);const o=e.LX.makeIcon(s.swap,{iconClass:"lexsidebarentryicon swap-on"});r.appendChild(o)}s.content&&r.appendChild(s.content)}const l=null!=s.collapsable?s.collapsable:s.collapsable||t[o].length;if(a.addEventListener("click",e=>{if(e.target&&e.target.classList.contains("lexcheckbox"))return;let n;if(l)r.querySelector(".collapser")?.click();else if(t.checkbox)t.value=!t.value,t.checkbox.set(t.value,!0),n=t.value;else if(s.swap&&!(e.target instanceof HTMLInputElement)){const e=r.querySelector("input");e.checked=!e.checked,n=e.checked}const i=s.callback;i&&i.call(this,o,n??a,e),this.displaySelected&&!s.skipSelection&&(this.root.querySelectorAll(".lexsidebarentry").forEach(e=>e.classList.remove("selected")),a.classList.add("selected"))}),s.action){const t=e.LX.makeIcon(s.action.icon??"Ellipsis",{title:s.action.name});r.appendChild(t),t.addEventListener("click",e=>{e.preventDefault(),e.stopImmediatePropagation();const t=s.action.callback;t&&t.call(this,o,e)})}else if(l){const t=document.createElement("div");t.className="collapsablecontainer",Object.assign(t.style,{width:"100%",display:"none"}),e.LX.makeCollapsible(r,t,i??this.content),this.collapseQueue=s.collapsable,this.collapseContainer=t}if(!t[o].length)continue;let c=e.LX.makeElement("div","lexsidebarsubentrycontainer flex flex-col self-center w-full ml-4 px-4 select-none");l?(this.collapseContainer.appendChild(c),delete this.collapseContainer):i?(c.classList.add("collapsablecontainer"),i.appendChild(c)):this.content.appendChild(c);for(let s=0;s<t[o].length;++s){const n=t[o][s],i=n.options??{},a=n.name=Object.keys(n)[0];if(this.filterString.length&&!a.toLowerCase().includes(this.filterString.toLowerCase()))continue;let r=document.createElement("div");if(r.innerHTML=`<span>${a}</span>`,i.action){const t=e.LX.makeIcon(i.action.icon??"Ellipsis",{title:i.action.name});r.appendChild(t),t.addEventListener("click",e=>{e.preventDefault(),e.stopImmediatePropagation();const t=i.action.callback;t&&t.call(this,a,e)})}if(r.className="lexsidebarentry w-full rounded-lg cursor-pointer select-none",r.id=a,i.content){const t=e.LX.makeElement("div");t.appendChild(i.content),r.appendChild(t)}c.appendChild(r),r.addEventListener("click",e=>{const t=i.callback;t&&t.call(this,a,r,e),this.displaySelected&&!i.skipSelection&&(this.root.querySelectorAll(".lexsidebarentry").forEach(e=>e.classList.remove("selected")),r.classList.add("selected"))})}}}}e.LX.Sidebar=Le;class be{root;constructor(t){if(this.root=e.LX.makeContainer(["auto","auto"],"flex flex-row lexskeleton"),t.constructor===String)this.root.innerHTML=t;else{t=[].concat(t);for(let e of t)this.root.appendChild(e)}}destroy(){this.root.dataset.closed=!0,e.LX.doAsync(()=>{this.root.remove(),this.root=null},200)}}e.LX.Skeleton=be;class ye{static ACTIVE_TOURS=[];steps;currentStep=0;useModal;offset;horizontalOffset;verticalOffset;radius;tourContainer;tourMask=void 0;_popover=null;constructor(t,s={}){this.steps=t||[],this.useModal=s.useModal??!0,this.offset=s.offset??8,this.horizontalOffset=s.horizontalOffset,this.verticalOffset=s.verticalOffset,this.radius=s.radius??12,this.tourContainer=document.querySelector(".tour-container"),this.tourContainer||(this.tourContainer=e.LX.makeContainer(["100%","100%"],"tour-container"),this.tourContainer.style.display="none",document.body.appendChild(this.tourContainer),window.addEventListener("resize",()=>{for(const e of ye.ACTIVE_TOURS)e._showStep(0)}))}begin(){this.currentStep=0,this.tourContainer.style.display="block",ye.ACTIVE_TOURS.push(this),this._showStep(0)}stop(){this.useModal&&(this.tourMask?.remove(),this.tourMask=void 0),this._popover?.destroy();const e=ye.ACTIVE_TOURS.indexOf(this);-1!==e&&ye.ACTIVE_TOURS.splice(e,1),this.tourContainer.innerHTML="",this.tourContainer.style.display="none"}_showStep(e=1){this.currentStep+=e;const t=this.steps[this.currentStep];if(!t)return void this.stop();const s=this.steps[this.currentStep-1],o=this.steps[this.currentStep+1];this.useModal&&this._generateMask(t.reference),this._createHighlight(t,s,o)}_generateMask(t){this.tourContainer.innerHTML="",this.tourMask=e.LX.makeContainer(["100%","100%"],"tour-mask absolute inset-0"),this.tourContainer.appendChild(this.tourMask);const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.style.width="100%",s.style.height="100%",this.tourMask?.appendChild(s);const o=document.createElementNS("http://www.w3.org/2000/svg","clipPath");function n(e,t){const s=Math.ceil(e);return[s,t-(s-e)]}o.setAttribute("id","svgTourClipPath"),s.appendChild(o);const i=t.getBoundingClientRect(),[a,r]=n(i.x,i.width),[l,c]=n(i.y,i.height),d=this.verticalOffset??this.offset,h=this.horizontalOffset??this.offset;{const e=document.createElementNS("http://www.w3.org/2000/svg","rect");e.setAttribute("x","0"),e.setAttribute("y","0"),e.setAttribute("width",`${Math.max(0,a-h)}`),e.setAttribute("height",`${window.innerHeight}`),e.setAttribute("stroke","none"),o.appendChild(e)}{const e=document.createElementNS("http://www.w3.org/2000/svg","rect");e.setAttribute("x",""+(a-h)),e.setAttribute("y","0"),e.setAttribute("width",`${Math.max(0,r+2*h)}`),e.setAttribute("height",`${Math.max(0,l-d)}`),e.setAttribute("stroke","none"),o.appendChild(e)}{const e=document.createElementNS("http://www.w3.org/2000/svg","rect");e.setAttribute("x",""+(a-h)),e.setAttribute("y",`${l+c+d}`),e.setAttribute("width",`${Math.max(0,r+2*h)}`),e.setAttribute("height",`${Math.max(0,window.innerHeight-l-c-d)}`),e.setAttribute("stroke","none"),o.appendChild(e)}{const e=document.createElementNS("http://www.w3.org/2000/svg","rect");e.setAttribute("x",`${a+r+h}`),e.setAttribute("y","0"),e.setAttribute("width",`${Math.max(0,window.innerWidth-a-r)}`),e.setAttribute("height",`${Math.max(0,window.innerHeight)}`),e.setAttribute("stroke","none"),o.appendChild(e)}const u=e.LX.makeContainer(["0","0"],"tour-ref-mask absolute");u.style.left=a-h-1+"px",u.style.top=l-d-1+"px",u.style.width=`${r+2*h+2}px`,u.style.height=`${c+2*d+2}px`,this.tourContainer.appendChild(u);const p=document.createElementNS("http://www.w3.org/2000/svg","mask");p.setAttribute("id","svgTourReferenceMask"),s.appendChild(p);{const e=document.createElementNS("http://www.w3.org/2000/svg","rect");e.setAttribute("width",`${r+2*h+2}`),e.setAttribute("height",`${c+2*d+2}`),e.setAttribute("stroke","none"),e.setAttribute("fill","white"),p.appendChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","rect");t.setAttribute("rx",`${this.radius}`),t.setAttribute("width",`${r+2*h+2}`),t.setAttribute("height",`${c+2*d+2}`),t.setAttribute("stroke","none"),t.setAttribute("fill","black"),p.appendChild(t)}}_createHighlight(t,s,o){const n=e.LX.makeContainer(["auto","auto"],"tour-step-container");{const s=e.LX.makeContainer(["100%","auto"],"flex flex-row","",n);e.LX.makeContainer(["70%","auto"],"p-2 font-medium text-base",t.title,s);const o=e.LX.makeContainer(["30%","auto"],"flex flex-row p-2 justify-end","",s),i=e.LX.makeIcon("X");o.appendChild(i),e.LX.listen(i,"click",()=>{this.stop()})}e.LX.makeContainer(["100%","auto"],"p-2 text-sm",t.content,n,{maxWidth:"400px"});const i=e.LX.makeContainer(["100%","auto"],"flex flex-row","",n);{const t=e.LX.makeContainer(["50%","auto"],"p-2 gap-1 place-self-center flex flex-row","",i);for(let s=0;s<this.steps.length;s++){const o=e.LX.makeElement("span");o.className="size-3 rounded-full bg-accent inline-flex data-active:bg-primary",s===this.currentStep&&(o.dataset.active="true"),t.appendChild(o)}}const a=e.LX.makeContainer(["50%","auto"],"text-base","",i),r=new ee;let l=1;s&&l++,l>1&&r.sameLine(2,"justify-end"),s&&r.addButton(null,"Previous",()=>{this._showStep(-1)},{buttonClass:"ghost"}),o?r.addButton(null,"Next",()=>{this._showStep(1)},{buttonClass:"accent"}):r.addButton(null,"Finish",()=>{this.stop()},{buttonClass:"primary"}),a.appendChild(r.root);const c=("left"===t.side||"right"===t.side?this.horizontalOffset:this.verticalOffset)??this.offset,d="start"===t.align||"end"===t.align?c:0;this._popover?.destroy(),this._popover=new b(null,[n],{reference:t.reference,side:t.side,align:t.align,sideOffset:c,alignOffset:"start"===t.align?-d:d})}}if(e.LX.Tour=ye,!e.LX)throw"Missing LX namespace!";function ve(e){return/[^\w\s]/.test(e)}function Ce(e){return/\w/.test(e)}function xe(e,t){if(!e?.icon)return"FileCode text-neutral-500";if("string"==typeof e.icon)return e.icon;if(t&&e.icon[t])return e.icon[t];return Object.values(e.icon)[0]||"FileCode text-neutral-500"}e.LX.extensions.push("CodeEditor");class _e{static languages=new Map;static extensionMap=new Map;static registerLanguage(e){_e.languages.set(e.name,e);for(const t of e.extensions)_e.extensionMap.set(t,e.name)}static getLanguage(e){return _e.languages.get(e)}static getLanguageByExtension(e){const t=_e.extensionMap.get(e);return t?_e.languages.get(t):void 0}static getRegisteredLanguages(){return Array.from(_e.languages.keys())}static initialState(){return{stack:["root"]}}static tokenizeLine(e,t,s){const o=[],n=[...s.stack];let i=0;for(;i<e.length;){const s=n[n.length-1],a=t.states[s];if(!a){o.push({type:"text",value:e.slice(i)}),i=e.length;break}let r=!1;for(const t of a){const s=new RegExp(t.match.source,"y"+t.match.flags.replace(/[gy]/g,""));s.lastIndex=i;const a=s.exec(e);if(a){if(0===a[0].length)continue;if(o.push({type:t.type,value:a[0]}),i+=a[0].length,t.next)n.push(t.next);else if(t.pop){const e="number"==typeof t.pop?t.pop:1;for(let t=0;t<e&&n.length>1;t++)n.pop()}r=!0;break}}if(!r){const t=o[o.length-1];t&&"text"===t.type?t.value+=e[i]:o.push({type:"text",value:e[i]}),i++}}return{tokens:_e._mergeTokens(o),state:{stack:n}}}static _mergeTokens(e){if(0===e.length)return e;const t=[e[0]];for(let s=1;s<e.length;s++){const o=t[t.length-1];e[s].type===o.type?o.value+=e[s].value:t.push(e[s])}return t}}function we(e){return new RegExp("\\b(?:"+e.join("|")+")\\b")}e.LX.Tokenizer=_e;const Se={blockComment:[{match:/\*\//,type:"comment",pop:!0},{match:/[^*]+/,type:"comment"},{match:/\*/,type:"comment"}],doubleString:[{match:/\\./,type:"string"},{match:/"/,type:"string",pop:!0},{match:/[^"\\]+/,type:"string"}],singleString:[{match:/\\./,type:"string"},{match:/'/,type:"string",pop:!0},{match:/[^'\\]+/,type:"string"}]},ke=[{match:/0[bB][01]+(?:[uU][lL]{0,2}|[lL]{1,2}[uU]?)?\b/,type:"number"},{match:/0[xX][0-9a-fA-F]+(?:[uU][lL]{0,2}|[lL]{1,2}[uU]?)?\b/,type:"number"},{match:/0[oO][0-7]+(?:[uU][lL]{0,2}|[lL]{1,2}[uU]?)?\b/,type:"number"},{match:/\d+\.?\d*(?:[eE][+-]?\d+)?(?:[fFdDmMlLuUiI]|[uU][lL]{0,2}|[lL]{1,2}[uU]?)?\b/,type:"number"},{match:/\.\d+(?:[eE][+-]?\d+)?(?:[fFdDmM])?\b/,type:"number"}],Ee=[{match:/[a-zA-Z_$]\w*(?=\s*[<(])/,type:"method"},{match:/[a-zA-Z_$]\w*/,type:"text"},{match:/[{}()\[\];,.:?!&|<>=+\-*/%^~@#]/,type:"symbol"},{match:/\s+/,type:"text"}];function Me(e){return{templateString:[{match:/\\./,type:"string"},{match:/`/,type:"string",pop:!0},{match:/\$\{/,type:"symbol",next:"templateExpr"},{match:/[^`\\$]+/,type:"string"},{match:/\$/,type:"string"}],templateExpr:[{match:/\}/,type:"symbol",pop:!0},{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},{match:/`/,type:"string",next:"templateString"},...ke,{match:we(e),type:"keyword"},...Ee]}}_e.registerLanguage({name:"Plain Text",extensions:["txt"],states:{root:[{match:/.+/,type:"text"}]},reservedWords:[],icon:"FileText text-neutral-500"});const Te=["var","let","const","this","in","of","true","false","null","undefined","new","function","class","extends","super","import","export","from","default","async","typeof","instanceof","void","delete","debugger","NaN","static","constructor","Infinity","abstract"],Ae=["for","if","else","switch","case","return","while","do","continue","break","await","yield","throw","try","catch","finally","with"],Xe=["document","console","window","navigator","performance","Math","JSON","Promise","Array","Object","String","Number","Boolean","RegExp","Error","Map","Set","WeakMap","WeakSet","Symbol","Proxy","Reflect"];_e.registerLanguage({name:"JavaScript",extensions:["js","mjs","cjs"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/`/,type:"string",next:"templateString"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},...ke,{match:we(Te),type:"keyword"},{match:we(Xe),type:"builtin"},{match:we(Ae),type:"statement"},{match:/(?<=\b(?:class|enum)\s+)[A-Z][a-zA-Z0-9_]*/,type:"type"},...Ee],...Se,...Me(["var","let","const","this","true","false","null","undefined","new","typeof","instanceof","void"])},reservedWords:[...Te,...Ae,...Xe],icon:"Js text-yellow-500"});const ze=[...Te,"as","interface","type","enum","namespace","declare","private","protected","implements","readonly","keyof","infer","is","asserts","override","satisfies"],Pe=["string","number","boolean","any","unknown","never","void","null","undefined","object","symbol","bigint","Promise","Record","Partial","Required","Readonly","Pick","Omit","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","Awaited"];_e.registerLanguage({name:"TypeScript",extensions:["ts","tsx"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/`/,type:"string",next:"templateString"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},...ke,{match:we(ze),type:"keyword"},{match:we(Pe),type:"type"},{match:we(Xe),type:"builtin"},{match:we(Ae),type:"statement"},{match:/(?<=\b(?:class|enum|interface|type|extends|implements)\s+)[A-Z][a-zA-Z0-9_]*/,type:"type"},{match:/(?<=<\s*)[A-Z][a-zA-Z0-9_]*(?=\s*(?:[,>]|extends|=))/,type:"type"},{match:/(?<=,\s*)[A-Z][a-zA-Z0-9_]*(?=\s*(?:[,>]|extends|=))/,type:"type"},{match:/(?<=:\s*)[A-Z][a-zA-Z0-9_]*/,type:"type"},...Ee],...Se,...Me(["var","let","const","this","true","false","null","undefined","new","typeof","instanceof","void"])},reservedWords:[...ze,...Pe,...Xe,...Ae],icon:"Ts text-blue-600"});const Ne=["bool","i32","u32","f16","f32","vec2","vec3","vec4","vec2i","vec3i","vec4i","vec2u","vec3u","vec4u","vec2f","vec3f","vec4f","mat2x2f","mat2x3f","mat2x4f","mat3x2f","mat3x3f","mat3x4f","mat4x2f","mat4x3f","mat4x4f","array","struct","ptr","atomic","sampler","sampler_comparison","texture_1d","texture_2d","texture_2d_array","texture_3d","texture_cube","texture_cube_array","texture_multisampled_2d","texture_depth_2d","texture_depth_2d_array","texture_depth_cube","texture_depth_cube_array","texture_depth_multisampled_2d","texture_storage_1d","texture_storage_2d","texture_storage_2d_array","texture_storage_3d","texture_external","var","let","const","override","fn","type","alias","true","false"],Ie=["if","else","switch","case","default","for","loop","while","break","continue","discard","return","function","private","workgroup","uniform","storage","read","write","read_write","bitcast"],Re=["position","vertex_index","instance_index","front_facing","frag_depth","local_invocation_id","local_invocation_index","global_invocation_id","workgroup_id","num_workgroups","abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","clamp","cos","cosh","cross","degrees","determinant","distance","dot","exp","exp2","floor","fma","fract","inverseSqrt","length","log","log2","max","min","mix","normalize","pow","radians","reflect","refract","round","saturate","sign","sin","sinh","smoothstep","sqrt","step","tan","tanh","transpose","trunc","textureSample","textureSampleBias","textureSampleLevel","textureSampleGrad","textureSampleCompare","textureSampleCompareLevel","textureSampleBaseClampToEdge","textureLoad","textureStore","textureGather","textureGatherCompare","textureDimensions","textureNumLayers","textureNumLevels","textureNumSamples","pack4x8snorm","pack4x8unorm","pack2x16snorm","pack2x16unorm","pack2x16float","unpack4x8snorm","unpack4x8unorm","unpack2x16snorm","unpack2x16unorm","unpack2x16float","atomicLoad","atomicStore","atomicAdd","atomicSub","atomicMax","atomicMin","atomicAnd","atomicOr","atomicXor","atomicExchange","atomicCompareExchangeWeak","dpdx","dpdxCoarse","dpdxFine","dpdy","dpdyCoarse","dpdyFine","fwidth","fwidthCoarse","fwidthFine","select","arrayLength","countLeadingZeros","countOneBits","countTrailingZeros","extractBits","firstLeadingBit","firstTrailingBit","insertBits","reverseBits","storageBarrier","workgroupBarrier","workgroupUniformLoad"];_e.registerLanguage({name:"WGSL",extensions:["wgsl"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/#\w+/,type:"preprocessor"},...ke,{match:we(Ne),type:"keyword"},{match:we(Re),type:"builtin"},{match:we(Ie),type:"statement"},{match:/@\w+/,type:"text"},...Ee],...Se},reservedWords:[...Ne,...Re,...Ie],icon:"AlignLeft text-orange-500"});const De=["true","false","int","float","double","bool","void","uint","struct","mat2","mat3","mat4","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","vec2","vec3","vec4","ivec2","ivec3","ivec4","uvec2","uvec3","uvec4","dvec2","dvec3","dvec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler2DShadow","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","samplerCubeArray","samplerCubeArrayShadow","isampler2D","usampler2D","isampler3D","usampler3D","lowp","mediump","highp","precision","in","out","inout","uniform","varying","attribute","const","layout","centroid","flat","smooth","noperspective","patch","sample","buffer","shared","coherent","volatile","restrict","readonly","writeonly"],Oe=["if","else","switch","case","default","for","while","do","break","continue","return","discard"],He=["radians","degrees","sin","cos","tan","asin","acos","atan","pow","exp","log","exp2","log2","sqrt","inversesqrt","abs","sign","floor","ceil","fract","mod","min","max","clamp","mix","step","smoothstep","length","distance","dot","cross","normalize","reflect","refract","matrixCompMult","lessThan","lessThanEqual","greaterThan","greaterThanEqual","equal","notEqual","any","all","not","texture","textureProj","textureLod","textureGrad","texelFetch"];_e.registerLanguage({name:"GLSL",extensions:["glsl"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/#\w+/,type:"preprocessor"},...ke,{match:we(De),type:"keyword"},{match:we(He),type:"builtin"},{match:we(Oe),type:"statement"},...Ee],...Se},reservedWords:[...De,...He,...Oe],icon:"AlignLeft text-neutral-500"});const Be=["bool","int","uint","dword","half","float","double","min16float","min10float","min16int","min12int","min16uint","float1","float2","float3","float4","int1","int2","int3","int4","uint1","uint2","uint3","uint4","bool1","bool2","bool3","bool4","half1","half2","half3","half4","float1x1","float1x2","float1x3","float1x4","float2x1","float2x2","float2x3","float2x4","float3x1","float3x2","float3x3","float3x4","float4x1","float4x2","float4x3","float4x4","vector","matrix","string","void","struct","class","interface","true","false","sampler","sampler1D","sampler2D","sampler3D","samplerCUBE","sampler_state","Texture1D","Texture2D","Texture3D","TextureCube","Texture1DArray","Texture2DArray","TextureCubeArray","Buffer","AppendStructuredBuffer","ConsumeStructuredBuffer","StructuredBuffer","RWStructuredBuffer","ByteAddressBuffer","RWByteAddressBuffer","RWTexture1D","RWTexture2D","RWTexture3D","RWTexture1DArray","RWTexture2DArray","cbuffer","tbuffer","in","out","inout","uniform","extern","static","volatile","precise","shared","groupshared","linear","centroid","nointerpolation","noperspective","sample","const","row_major","column_major"],$e=["if","else","for","while","do","switch","case","default","break","continue","discard","return","typedef","register","packoffset"],Ve=["SV_Position","SV_Target","SV_Depth","SV_VertexID","SV_InstanceID","SV_PrimitiveID","SV_DispatchThreadID","SV_GroupID","SV_GroupThreadID","SV_GroupIndex","SV_Coverage","SV_IsFrontFace","SV_RenderTargetArrayIndex","POSITION","NORMAL","TEXCOORD","COLOR","TANGENT","BINORMAL"];_e.registerLanguage({name:"HLSL",extensions:["hlsl","fx","fxh","vsh","psh"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/#\w+/,type:"preprocessor"},...ke,{match:we(Be),type:"keyword"},{match:we(Ve),type:"builtin"},{match:we($e),type:"statement"},...Ee],...Se},reservedWords:[...Be,...Ve,...$e],icon:"AlignLeft text-purple-500"});const Fe=["False","def","None","True","in","is","and","lambda","nonlocal","not","or"],We=["if","elif","else","for","while","try","except","finally","with","match","case","break","continue","return","raise","pass","import","from","as","global","nonlocal","assert","del","yield"],qe=["abs","all","any","ascii","bin","bool","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],Ue=["int","float","complex","bool","str","bytes","bytearray","list","tuple","set","frozenset","dict","object","type","ArithmeticError","AssertionError","AttributeError","BaseException","BufferError","EOFError","Exception","FloatingPointError","GeneratorExit","ImportError","ModuleNotFoundError","IndentationError","IndexError","KeyError","KeyboardInterrupt","LookupError","MemoryError","NameError","NotImplementedError","OSError","OverflowError","RecursionError","ReferenceError","RuntimeError","StopAsyncIteration","StopIteration","SyntaxError","TabError","SystemError","SystemExit","TypeError","UnboundLocalError","UnicodeError","UnicodeEncodeError","UnicodeDecodeError","UnicodeTranslateError","ValueError","ZeroDivisionError"];_e.registerLanguage({name:"Python",extensions:["py"],lineComment:"#",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/#.*/,type:"comment"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},...ke,{match:we(Fe),type:"keyword"},{match:we(Ue),type:"type"},{match:we(qe),type:"builtin"},{match:we(We),type:"statement"},...Ee],...Se},reservedWords:[...Fe,...Ue,...qe,...We],icon:"Python text-cyan-600"});const je=["abstract","and","array","as","callable","class","clone","const","enum","extends","final","fn","function","global","implements","include","include_once","instanceof","insteadof","interface","namespace","new","null","or","private","protected","public","readonly","require","require_once","static","trait","use","var","xor","from","$this"],Ge=["if","else","elseif","endif","switch","case","default","endswitch","for","endfor","foreach","endforeach","while","endwhile","do","break","continue","return","try","catch","finally","throw","declare","enddeclare","goto","yield","match"],Ze=["int","float","string","bool","array","object","callable","iterable","void","never","mixed","static","self","parent","Exception","Error","Throwable","DateTime","DateTimeImmutable","Closure","Generator","JsonSerializable"],Ye=["echo","print","isset","empty","unset","eval","die","exit","count","sizeof","in_array","array_merge","array_push","array_pop","strlen","strpos","substr","str_replace","explode","implode","json_encode","json_decode","var_dump","print_r"];_e.registerLanguage({name:"PHP",extensions:["php"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},...ke,{match:we(je),type:"keyword"},{match:we(Ze),type:"type"},{match:we(Ye),type:"builtin"},{match:we(Ge),type:"statement"},...Ee],...Se},reservedWords:[...je,...Ze,...Ye,...Ge],icon:"Php text-purple-700"});const Ke=["int","float","double","bool","long","short","char","void","const","enum","extern","register","sizeof","static","struct","typedef","union","volatile","true","false"],Je=["break","continue","do","else","for","goto","if","return","switch","while"];_e.registerLanguage({name:"C",extensions:["c","h"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/#\w+/,type:"preprocessor"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},...ke,{match:we(Ke),type:"keyword"},{match:we(Je),type:"statement"},...Ee],...Se},reservedWords:[...Ke,...Je],icon:{c:"C text-sky-400",h:"C text-fuchsia-500"}});const Qe=[...Ke,"wchar_t","static_cast","dynamic_cast","new","delete","auto","class","nullptr","NULL","signed","unsigned","namespace","static","private","public"],et=[...Je,"case","using","glm","spdlog","default"],tt=["uint8_t","uint16_t","uint32_t","uint64_t","int8_t","int16_t","int32_t","int64_t","size_t","ptrdiff_t"],st=["std","string","vector","map","set","unordered_map","unordered_set","array","tuple","optional","variant","cout","cin","cerr","clog"];_e.registerLanguage({name:"C++",extensions:["cpp","hpp"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/#\w+/,type:"preprocessor"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},...ke,{match:we(Qe),type:"keyword"},{match:we(tt),type:"type"},{match:we(st),type:"builtin"},{match:we(et),type:"statement"},...Ee],...Se},reservedWords:[...Qe,...tt,...st,...et],icon:{cpp:"CPlusPlus text-sky-400",hpp:"CPlusPlus text-fuchsia-500"}}),_e.registerLanguage({name:"JSON",extensions:["json","jsonc","bml"],states:{root:[{match:/"/,type:"string",next:"doubleString"},{match:/\btrue\b|\bfalse\b|\bnull\b/,type:"keyword"},{match:/-?\d+\.?\d*(?:[eE][+-]?\d+)?/,type:"number"},{match:/[{}[\]:,]/,type:"symbol"},{match:/\s+/,type:"text"}],...Se},reservedWords:[],icon:"Json text-yellow-600"}),_e.registerLanguage({name:"XML",extensions:["xml","xaml","xsd","xsl"],lineComment:"\x3c!--",states:{root:[{match:/<!--/,type:"comment",next:"xmlComment"},{match:/<\?/,type:"preprocessor",next:"processingInstruction"},{match:/<\/[a-zA-Z][\w:-]*>/,type:"keyword"},{match:/<[a-zA-Z][\w:-]*/,type:"keyword",next:"tag"},{match:/[^<]+/,type:"text"}],tag:[{match:/\/?>/,type:"keyword",pop:!0},{match:/[a-zA-Z][\w:-]*(?==)/,type:"type"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},{match:/[^"'>/]+/,type:"text"}],xmlComment:[{match:/-->/,type:"comment",pop:!0},{match:/[^-]+/,type:"comment"},{match:/-/,type:"comment"}],processingInstruction:[{match:/\?>/,type:"preprocessor",pop:!0},{match:/[^?]+/,type:"preprocessor"},{match:/\?/,type:"preprocessor"}],...Se},reservedWords:[],icon:"Rss text-orange-600"});_e.registerLanguage({name:"HTML",extensions:["html"],lineComment:"\x3c!--",states:{root:[{match:/<!--/,type:"comment",next:"xmlComment"},{match:/<!DOCTYPE/i,type:"preprocessor"},{match:/<\/[a-zA-Z][\w-]*>/,type:"keyword"},{match:/<script\b/i,type:"keyword",next:"scriptTag"},{match:/<style\b/i,type:"keyword",next:"styleTag"},{match:/<[a-zA-Z][\w-]*/,type:"keyword",next:"tag"},{match:/[^<]+/,type:"text"}],tag:[{match:/\/?>/,type:"keyword",pop:!0},{match:/[a-zA-Z][\w-]*(?==)/,type:"type"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},{match:/[^"'>/]+/,type:"text"}],scriptTag:[{match:/\/>/,type:"keyword",pop:!0},{match:/>/,type:"keyword",next:"scriptContent"},{match:/[a-zA-Z][\w-]*(?==)/,type:"type"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},{match:/[^"'>/]+/,type:"text"}],scriptContent:[{match:/<\/script>/i,type:"keyword",pop:2},{match:/[^<]+/,type:"text"},{match:/</,type:"text"}],styleTag:[{match:/\/>/,type:"keyword",pop:!0},{match:/>/,type:"keyword",next:"styleContent"},{match:/[a-zA-Z][\w-]*(?==)/,type:"type"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},{match:/[^"'>/]+/,type:"text"}],styleContent:[{match:/<\/style>/i,type:"keyword",pop:2},{match:/[^<]+/,type:"text"},{match:/</,type:"text"}],xmlComment:[{match:/-->/,type:"comment",pop:!0},{match:/[^-]+/,type:"comment"},{match:/-/,type:"comment"}],...Se},reservedWords:["html","head","body","title","meta","link","script","style","div","span","p","a","img","ul","ol","li","table","tr","td","th","form","input","button","select","option","textarea","label","h1","h2","h3","h4","h5","h6","header","footer","nav","section","article","aside","main","figure","figcaption","video","audio","source","canvas","svg"],icon:"Code text-orange-500"});const ot=["inherit","initial","unset","revert","revert-layer","auto","none","hidden","visible","collapse","block","inline","inline-block","flex","inline-flex","grid","inline-grid","contents","list-item","static","relative","absolute","fixed","sticky","solid","dashed","dotted","double","groove","ridge","inset","outset","bold","bolder","lighter","normal","italic","oblique","uppercase","lowercase","capitalize","left","right","center","top","bottom","start","end","stretch","space-between","space-around","space-evenly","repeat","no-repeat","repeat-x","repeat-y","cover","contain","pointer","default","move","text","not-allowed","transparent","currentColor"];_e.registerLanguage({name:"CSS",extensions:["css","scss","sass","less"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/@[\w-]+/,type:"statement"},{match:/#[\w-]+/,type:"keyword"},{match:/\.[\w-]+/,type:"keyword"},{match:/::?[\w-]+(?:\([^)]*\))?/,type:"keyword"},{match:/\[[\w-]+(?:[~|^$*]?=(?:"[^"]*"|'[^']*'|[\w-]+))?\]/,type:"type"},{match:/{/,type:"symbol",next:"properties"},{match:/}/,type:"symbol"},{match:/[,>+~*]/,type:"symbol"},{match:/[\w-]+/,type:"keyword"},{match:/\s+/,type:"text"}],properties:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/}/,type:"symbol",pop:!0},{match:/[\w-]+(?=\s*:)/,type:"type"},{match:/:/,type:"symbol"},{match:we(ot),type:"string"},{match:/;/,type:"symbol"},{match:/"/,type:"string",next:"doubleString"},{match:/'/,type:"string",next:"singleString"},{match:/#[a-fA-F0-9]{3,8}\b/,type:"string"},{match:/-?\d+\.?\d*(?:px|em|rem|%|vh|vw|vmin|vmax|pt|cm|mm|in|pc|ex|ch|fr|deg|rad|grad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?/,type:"number"},{match:/!important\b/,type:"builtin"},{match:/[\w-]+\(/,type:"method"},{match:/--[\w-]+/,type:"type"},{match:/[(),]/,type:"symbol"},{match:/{/,type:"symbol",next:"properties"},{match:/[\w-]+/,type:"text"},{match:/\s+/,type:"text"}],...Se},reservedWords:["color","background","border","margin","padding","font","display","position","width","height","top","left","right","bottom","flex","grid","z-index","opacity","transform","transition","animation","content","visibility",...ot,"hover","active","focus","visited","link","before","after","first-child","last-child","nth-child","not","root","disabled","checked"],icon:"Hash text-blue-500"}),_e.registerLanguage({name:"Markdown",extensions:["md","markdown"],states:{root:[{match:/^#{1,6}\s+.+/,type:"keyword"},{match:/^\*\*\*.+$/,type:"symbol"},{match:/\*\*[^*]+\*\*/,type:"keyword"},{match:/\*[^*]+\*/,type:"type"},{match:/__[^_]+__/,type:"keyword"},{match:/_[^_]+_/,type:"type"},{match:/`[^`]+`/,type:"string"},{match:/```/,type:"comment",next:"codeBlock"},{match:/^\s*[-*+]\s+/,type:"symbol"},{match:/^\s*\d+\.\s+/,type:"symbol"},{match:/\[([^\]]+)\]\(([^)]+)\)/,type:"builtin"},{match:/^>\s+/,type:"comment"},{match:/.+/,type:"text"}],codeBlock:[{match:/```/,type:"comment",pop:!0},{match:/.+/,type:"string"}]},reservedWords:[],icon:"Markdown text-red-500"});const nt=["if","else","for","in","do","goto","call","exit","setlocal","endlocal","set","echo","rem","pause","cd","pushd","popd","shift","start"],it=["dir","copy","move","del","ren","md","rd","type","find","findstr","tasklist","taskkill","ping","ipconfig","netstat","cls","title","color"];_e.registerLanguage({name:"Batch",extensions:["bat","cmd"],lineComment:"rem",states:{root:[{match:/^rem\s+.*/i,type:"comment"},{match:/^::.*/,type:"comment"},{match:/"/,type:"string",next:"doubleString"},{match:/%[\w]+%/,type:"type"},{match:/\b\d+\b/,type:"number"},{match:we([...nt,...nt.map(e=>e.toUpperCase())]),type:"keyword"},{match:we(it),type:"builtin"},{match:/@echo/,type:"statement"},{match:/[a-zA-Z_]\w*/,type:"text"},{match:/[<>|&()@]/,type:"symbol"},{match:/\s+/,type:"text"}],...Se},reservedWords:[...nt,...it],icon:"Terminal text-gray-300"});const at=["project","cmake_minimum_required","add_executable","add_library","target_link_libraries","target_include_directories","set","option","if","else","elseif","endif","foreach","endforeach","while","endwhile","function","endfunction","macro","endmacro","find_package","include","message","install","add_subdirectory","configure_file"];_e.registerLanguage({name:"CMake",extensions:["cmake","txt","cmake-cache"],lineComment:"#",states:{root:[{match:/#.*/,type:"comment"},{match:/"/,type:"string",next:"doubleString"},{match:/\$\{[^}]+\}/,type:"type"},{match:/\b\d+\.?\d*\b/,type:"number"},{match:we([...at,...at.map(e=>e.toUpperCase())]),type:"keyword"},{match:/\b[A-Z_][A-Z0-9_]*\b/,type:"builtin"},{match:/[a-zA-Z_]\w*/,type:"text"},{match:/[(){}]/,type:"symbol"},{match:/\s+/,type:"text"}],...Se},reservedWords:[...at],icon:"AlignLeft text-neutral-500"});const rt=["as","break","const","continue","crate","else","enum","extern","false","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","Self","static","struct","super","trait","true","type","unsafe","use","where","while","async","await","dyn","abstract","become","box","do","final","macro","override","priv","typeof","unsized","virtual","yield"],lt=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","bool","char","str","String","Vec","Option","Result","Box"],ct=["println","print","eprintln","eprint","format","panic","assert","assert_eq","assert_ne","debug_assert","vec","Some","None","Ok","Err"];_e.registerLanguage({name:"Rust",extensions:["rs"],lineComment:"//",states:{root:[{match:/\/\*/,type:"comment",next:"blockComment"},{match:/\/\/.*/,type:"comment"},{match:/"/,type:"string",next:"doubleString"},{match:/'(?:\\.|[^'])+'/,type:"string"},{match:/r#*"/,type:"string",next:"rawString"},...ke,{match:/#\[[\w:]+\]/,type:"preprocessor"},{match:we(rt),type:"keyword"},{match:we(lt),type:"type"},{match:we(ct),type:"builtin"},{match:/![a-zA-Z_]\w*/,type:"preprocessor"},...Ee],rawString:[{match:/"#*/,type:"string",pop:!0},{match:/[^"]+/,type:"string"},{match:/"/,type:"string"}],...Se},reservedWords:[...rt,...lt,...ct],icon:"Rust text-orange-400"});class dt{onChange=void 0;_lines=[""];get lineCount(){return this._lines.length}constructor(e){this.onChange=e}getLine(e){return this._lines[e]??""}getText(e="\n"){return this._lines.join(e)}setText(e){this._lines=e.split(/\r?\n/),0===this._lines.length&&(this._lines=[""]),this.onChange&&this.onChange(this)}getCharAt(e,t){const s=this._lines[e];if(!(!s||t<0||t>=s.length))return s[t]}getWordAt(e,t){const s=this._lines[e];if(!s||t<0||t>s.length)return["",t,t];let o=t;for(;o>0&&Ce(s[o-1]);)o--;let n=t;for(;n<s.length&&Ce(s[n]);)n++;return[s.substring(o,n),o,n]}getIndent(e){const t=function(e){const t=e.search(/\S|$/);return t<e.length?t:-1}(this._lines[e]??"");return-1===t?this._lines[e]?.length??0:t}findNext(e,t,s){if(!e)return null;for(let o=t;o<this._lines.length;o++){const n=o===t?s:0,i=this._lines[o].indexOf(e,n);if(-1!==i)return{line:o,col:i}}for(let o=0;o<=t;o++){const n=o===t?s:this._lines[o].length,i=this._lines[o].indexOf(e);if(-1!==i&&i<n)return{line:o,col:i}}return null}insert(e,t,s){const o=s.split(/\r?\n/),n=this._lines[e]??"",i=n.substring(0,t),a=n.substring(t);if(1===o.length)this._lines[e]=i+o[0]+a;else{this._lines[e]=i+o[0];for(let t=1;t<o.length-1;t++)this._lines.splice(e+t,0,o[t]);this._lines.splice(e+o.length-1,0,o[o.length-1]+a)}return this.onChange&&this.onChange(this),{type:"insert",line:e,col:t,text:s}}delete(e,t,s){let o=s,n="",i=e,a=t;for(;o>0&&i<this._lines.length;){const e=this._lines[i],t=e.length-a;if(o<=t)n+=e.substring(a,a+o),this._lines[i]=e.substring(0,a)+e.substring(a+o),o=0;else{n+=e.substring(a)+"\n",o-=t+1;const s=this._lines[i+1]??"";this._lines[i]=e.substring(0,a)+s,this._lines.splice(i+1,1)}}return this.onChange&&this.onChange(this),{type:"delete",line:e,col:t,text:n}}insertLine(e,t=""){const s=e+1;return this._lines.splice(s,0,t),this.onChange&&this.onChange(this),{type:"insert",line:Math.max(e,0),col:e>=0?this._lines[e]?.length??0:0,text:"\n"+t}}removeLine(e){const t=this._lines[e];return this._lines.splice(e,1),0===this._lines.length&&(this._lines=[""]),this.onChange&&this.onChange(this),{type:"delete",line:Math.max(e-1,0),col:e>0?this._lines[e-1]?.length??0:0,text:"\n"+t}}replaceLine(e,t){const s=this._lines[e];return this._lines[e]=t,this.onChange&&this.onChange(this),{type:"replaceLine",line:e,col:0,text:t,oldText:s}}applyInverse(e){return"insert"===e.type?this.delete(e.line,e.col,e.text.length):"replaceLine"===e.type?this.replaceLine(e.line,e.oldText):this.insert(e.line,e.col,e.text)}}class ht{_undoStack=[];_redoStack=[];_pendingOps=[];_pendingCursorsBefore=[];_pendingCursorsAfter=[];_lastPushTime=0;_groupThresholdMs;_maxSteps;constructor(e=2e3,t=200){this._groupThresholdMs=e,this._maxSteps=t}record(e,t){const s=Date.now();s-this._lastPushTime>this._groupThresholdMs&&this._pendingOps.length>0&&this._flush(),0===this._pendingOps.length&&(this._pendingCursorsBefore=t.map(e=>({...e}))),this._pendingOps.push(e),this._pendingCursorsAfter=t.map(e=>({...e})),this._lastPushTime=s,this._redoStack.length=0}flush(e){e&&this._pendingOps.length>0&&(this._pendingCursorsAfter=e.map(e=>({...e}))),this._flush()}undo(e,t){this.flush(t);const s=this._undoStack.pop();if(!s)return null;const o=[];for(let t=s.operations.length-1;t>=0;t--){const n=e.applyInverse(s.operations[t]);o.unshift(n)}return this._redoStack.push({operations:o,cursorsBefore:s.cursorsBefore,cursorsAfter:s.cursorsAfter}),{cursors:s.cursorsBefore}}redo(e){const t=this._redoStack.pop();if(!t)return null;const s=[];for(let o=0;o<t.operations.length;o++){const n=e.applyInverse(t.operations[o]);s.push(n)}return this._undoStack.push({operations:s,cursorsBefore:t.cursorsBefore,cursorsAfter:t.cursorsAfter}),{cursors:t.cursorsAfter}}canUndo(){return this._undoStack.length>0||this._pendingOps.length>0}canRedo(){return this._redoStack.length>0}clear(){this._undoStack.length=0,this._redoStack.length=0,this._pendingOps.length=0,this._lastPushTime=0}_flush(){if(0!==this._pendingOps.length)for(this._undoStack.push({operations:[...this._pendingOps],cursorsBefore:[...this._pendingCursorsBefore],cursorsAfter:[...this._pendingCursorsAfter]}),this._pendingOps.length=0,this._pendingCursorsBefore=[],this._pendingCursorsAfter=[];this._undoStack.length>this._maxSteps;)this._undoStack.shift()}}function ut(e,t){return e.line===t.line&&e.col===t.col}function pt(e,t){return e.line<t.line||e.line===t.line&&e.col<t.col}function mt(e){return pt(e.anchor,e.head)?e.anchor:e.head}function gt(e){return pt(e.anchor,e.head)?e.head:e.anchor}function ft(e){return ut(e.anchor,e.head)}class Lt{cursors=[];constructor(){this.cursors=[{anchor:{line:0,col:0},head:{line:0,col:0}}]}getPrimary(){return this.cursors[0]}set(e,t){this.cursors=[{anchor:{line:e,col:t},head:{line:e,col:t}}]}moveLeft(e,t=!1){for(const s of this.cursors)this._moveHead(s,e,-1,0,t);this._merge()}moveRight(e,t=!1){for(const s of this.cursors)this._moveHead(s,e,1,0,t);this._merge()}moveUp(e,t=!1){for(const s of this.cursors)this._moveVertical(s,e,-1,t);this._merge()}moveDown(e,t=!1){for(const s of this.cursors)this._moveVertical(s,e,1,t);this._merge()}moveToLineStart(e,t=!1,s=!1){for(const o of this.cursors){const n=o.head.line,i=e.getIndent(n),a=o.head.col===i||s?0:i;o.head={line:n,col:a},t||(o.anchor={...o.head})}this._merge()}moveToLineEnd(e,t=!1){for(const s of this.cursors){const o=s.head.line;s.head={line:o,col:e.getLine(o).length},t||(s.anchor={...s.head})}this._merge()}moveWordLeft(e,t=!1){for(const s of this.cursors){const{line:o,col:n}=s.head;if(0===n&&o>0)s.head={line:o-1,col:e.getLine(o-1).length};else{const t=e.getLine(o);let i=n;for(;i>0&&/\s/.test(t[i-1]);)i--;if(i>0&&Ce(t[i-1]))for(;i>0&&Ce(t[i-1]);)i--;else if(i>0)for(;i>0&&ve(t[i-1]);)i--;s.head={line:o,col:i}}t||(s.anchor={...s.head})}this._merge()}moveWordRight(e,t=!1){for(const s of this.cursors){const{line:o,col:n}=s.head,i=e.getLine(o);if(n>=i.length&&o<e.lineCount-1)s.head={line:o+1,col:0};else{let e=n;for(;e<i.length&&/\s/.test(i[e]);)e++;if(e<i.length&&Ce(i[e]))for(;e<i.length&&Ce(i[e]);)e++;else if(e<i.length&&ve(i[e]))for(;e<i.length&&ve(i[e]);)e++;s.head={line:o,col:e}}t||(s.anchor={...s.head})}this._merge()}selectAll(e){const t=e.lineCount-1;this.cursors=[{anchor:{line:0,col:0},head:{line:t,col:e.getLine(t).length}}]}addCursor(e,t){this.cursors.push({anchor:{line:e,col:t},head:{line:e,col:t}}),this._merge()}removeSecondaryCursors(){this.cursors=[this.cursors[0]]}sortedIndicesBottomUp(){return this.cursors.map((e,t)=>t).sort((e,t)=>{const s=this.cursors[e].head,o=this.cursors[t].head;return o.line!==s.line?o.line-s.line:o.col-s.col})}adjustOthers(e,t,s,o,n=0){for(let i=0;i<this.cursors.length;i++){if(i===e)continue;const a=this.cursors[i];0!==n&&a.head.line>t?a.head={line:a.head.line+n,col:a.head.col}:a.head.line===t&&a.head.col>=s&&(a.head={line:a.head.line+n,col:a.head.col+o}),0!==n&&a.anchor.line>t?a.anchor={line:a.anchor.line+n,col:a.anchor.col}:a.anchor.line===t&&a.anchor.col>=s&&(a.anchor={line:a.anchor.line+n,col:a.anchor.col+o})}}hasSelection(e=0){const t=this.cursors[e];return!!t&&!ut(t.anchor,t.head)}getSelectedText(e,t=0){const s=this.cursors[t];if(!s||ft(s))return"";const o=mt(s),n=gt(s);if(o.line===n.line)return e.getLine(o.line).substring(o.col,n.col);const i=[];i.push(e.getLine(o.line).substring(o.col));for(let t=o.line+1;t<n.line;t++)i.push(e.getLine(t));return i.push(e.getLine(n.line).substring(0,n.col)),i.join("\n")}getCursorPositions(){return this.cursors.map(e=>({...e.head}))}_moveHead(e,t,s,o,n){const{line:i,col:a}=e.head;if(!n&&!ft(e)){const t=s<0?mt(e):gt(e);return e.head={...t},void(e.anchor={...t})}if(s<0)a>0?e.head={line:i,col:a-1}:i>0&&(e.head={line:i-1,col:t.getLine(i-1).length});else if(s>0){a<t.getLine(i).length?e.head={line:i,col:a+1}:i<t.lineCount-1&&(e.head={line:i+1,col:0})}n||(e.anchor={...e.head})}_moveVertical(e,t,s,o){const{line:n,col:i}=e.head,a=n+s;if(a<0||a>=t.lineCount)return;const r=t.getLine(a).length;e.head={line:a,col:Math.min(i,r)},o||(e.anchor={...e.head})}_merge(){if(this.cursors.length<=1)return;this.cursors.sort((e,t)=>e.head.line!==t.head.line?e.head.line-t.head.line:e.head.col-t.head.col);const e=[this.cursors[0]];for(let t=1;t<this.cursors.length;t++){const s=e[e.length-1],o=this.cursors[t];ut(s.head,o.head)||e.push(o)}this.cursors=e}}class bt{_symbols=new Map;_lineSymbols=[];_scopeStack=[{name:"global",type:"global",line:0}];_lineScopes=[];_lineScopesEnd=[];get currentScope(){return this._scopeStack[this._scopeStack.length-1]?.name??"global"}get currentScopeType(){return this._scopeStack[this._scopeStack.length-1]?.type??"global"}getScopeAtLine(e){return this._lineScopes[e]??[{name:"global",type:"global",line:0}]}getLineScopeEnd(e){return this._lineScopesEnd[e]??[{name:"global",type:"global",line:0}]}getSymbols(e){return this._symbols.get(e)??[]}getAllSymbolNames(){return Array.from(this._symbols.keys())}getAllSymbols(){const e=[];for(const t of this._symbols.values())e.push(...t);return e}getLineSymbols(e){return this._lineSymbols[e]??[]}updateScopeForLine(e,t){0===e?this._scopeStack=[{name:"global",type:"global",line:0}]:this._lineScopesEnd[e-1]&&(this._scopeStack=[...this._lineScopesEnd[e-1]]);const s=function(e){let t="",s=0;for(;s<e.length;){const o=e[s];if("/"===o&&"/"===e[s+1])break;if("/"!==o||"*"!==e[s+1]){if('"'===o||"'"===o||"`"===o){const t=o;for(s++;s<e.length;)if("\\"!==e[s]){if(e[s]===t){s++;break}s++}else s+=2;continue}t+=o,s++}else{for(s+=2;s<e.length&&("*"!==e[s]||"/"!==e[s+1]);)s++;s+=2}}return t}(t),o=(s.match(/\{/g)||[]).length,n=(s.match(/\}/g)||[]).length;this._lineScopes[e]=[...this._scopeStack];for(let e=0;e<n;e++)this._scopeStack.length>1&&this._scopeStack.pop();for(let t=0;t<o;t++)this._scopeStack.push({name:"anonymous",type:"anonymous",line:e});this._lineScopesEnd[e]=[...this._scopeStack]}nameCurrentScope(e,t){if(this._scopeStack.length>0){const s=this._scopeStack[this._scopeStack.length-1];"anonymous"!==s.name&&"anonymous"!==s.type||(s.name=e,s.type=t)}}removeLineSymbols(e){const t=this._lineSymbols[e];if(t){for(const s of t){const t=this._symbols.get(s.name);if(!t)continue;const o=t.findIndex(t=>t.line===e&&t.kind===s.kind&&t.scope===s.scope);-1!==o&&t.splice(o,1),0===t.length&&this._symbols.delete(s.name)}this._lineSymbols[e]=[]}}addSymbol(e){this._symbols.has(e.name)||this._symbols.set(e.name,[]),this._symbols.get(e.name).push(e),this._lineSymbols[e.line]||(this._lineSymbols[e.line]=[]),this._lineSymbols[e.line].push(e)}resetScopes(){this._scopeStack=[{name:"global",type:"global",line:0}],this._lineScopes=[],this._lineScopesEnd=[]}clear(){this._symbols.clear(),this._lineSymbols=[],this.resetScopes()}}const yt=globalThis,vt={keyword:"cm-kwd",statement:"cm-std",type:"cm-typ",builtin:"cm-bln",string:"cm-str",comment:"cm-com",number:"cm-dec",method:"cm-mtd",symbol:"cm-sym",enum:"cm-enu",preprocessor:"cm-ppc",variable:"cm-var"};e.LX.Area,e.LX.Panel,e.LX.Tabs,e.LX.NodeTree;const Ct=/#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{4}|[0-9a-fA-F]{3})\b/g;function xt(e,t,s){Ct.lastIndex=0;let o,n="",i=0;const a=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");for(;null!==(o=Ct.exec(e));){n+=a(e.slice(i,o.index));const r=o[0];n+=`<span class="code-color" data-color="${r}" data-line="${t}" data-col="${s+o.index}" style="--code-color:${r}"><span class="code-color-swatch"></span>${a(r)}</span>`,i=o.index+r.length}return n+=a(e.slice(i)),n}class _t{static SIZE=10;root;thumb;_vertical;_thumbPos=0;_thumbRatio=0;_lastMouse=0;_onDrag=null;get visible(){return!this.root.classList.contains("hidden")}get isVertical(){return this._vertical}constructor(t,s){this._vertical=t,this._onDrag=s,this.root=e.LX.makeElement("div","lexcodescrollbar hidden "+(t?"vertical":"horizontal")),this.thumb=e.LX.makeElement("div"),this.thumb.addEventListener("mousedown",e=>this._onMouseDown(e)),this.root.appendChild(this.thumb)}setThumbRatio(t){this._thumbRatio=e.LX.clamp(t,0,1);const s=this._thumbRatio<1;this.root.classList.toggle("hidden",!s),s&&(this._vertical?this.thumb.style.height=100*this._thumbRatio+"%":this.thumb.style.width=100*this._thumbRatio+"%")}syncToScroll(e,t){if(t<=0)return;const s=(this._vertical?this.root.offsetHeight:this.root.offsetWidth)-(this._vertical?this.thumb.offsetHeight:this.thumb.offsetWidth);s<=0||(this._thumbPos=e/t*s,this._applyPosition())}applyDragDelta(t,s){const o=(this._vertical?this.root.offsetHeight:this.root.offsetWidth)-(this._vertical?this.thumb.offsetHeight:this.thumb.offsetWidth);return o<=0?0:(this._thumbPos=e.LX.clamp(this._thumbPos+t,0,o),this._applyPosition(),this._thumbPos/o*s)}_applyPosition(){this._vertical?this.thumb.style.top=this._thumbPos+"px":this.thumb.style.left=this._thumbPos+"px"}_onMouseDown(e){const t=document;this._lastMouse=this._vertical?e.clientY:e.clientX;const s=e=>{const t=this._vertical?e.clientY:e.clientX,s=t-this._lastMouse;this._lastMouse=t,this._onDrag?.(s),e.stopPropagation(),e.preventDefault()},o=()=>{t.removeEventListener("mousemove",s),t.removeEventListener("mouseup",o)};t.addEventListener("mousemove",s),t.addEventListener("mouseup",o),e.stopPropagation(),e.preventDefault()}}class wt{static __instances=[];language;symbolTable;area;baseArea;codeArea;explorerArea;tabs;root;codeScroller;codeSizer;cursorsLayer;selectionsLayer;lineGutter;vScrollbar;hScrollbar;searchBox=null;searchLineBox=null;autocomplete=null;currentTab=null;statusPanel;leftStatusPanel;rightStatusPanel;explorer=null;charWidth=0;lineHeight=0;fontSize=0;xPadding=64;_cachedTabsHeight=0;_cachedStatusPanelHeight=0;skipInfo=!1;disableEdition=!1;skipTabs=!1;useFileExplorer=!1;useAutoComplete=!0;allowAddScripts=!0;allowClosingTabs=!0;allowLoadingFiles=!0;tabSize=4;highlight="Plain Text";newTabOptions=null;customSuggestions=[];explorerName="EXPLORER";onSave;onRun;onCtrlSpace;onCreateStatusPanel;onContextMenu;onNewTab;onSelectTab;onReady;onCreateFile;onCodeChange;onHoverSymbol;_inputArea;_lineStates=[];_lineElements=[];_bracketOpenLine=-1;_bracketCloseLine=-1;_hoverTimer=null;_hoverPopup=null;_hoverWord="";_colorPopover=null;_openedTabs={};_loadedTabs={};_storedTabs={};_focused=!1;_composing=!1;_keyChain=null;_wasPaired=!1;_lastAction="";_blinkerInterval=null;_cursorVisible=!0;_cursorBlinkRate=550;_clickCount=0;_lastClickTime=0;_lastClickLine=-1;_isSearchBoxActive=!1;_isSearchLineBoxActive=!1;_searchMatchCase=!1;_lastTextFound="";_lastSearchPos=null;_discardScroll=!1;_isReady=!1;_lastMaxLineLength=0;_lastLineCount=0;_isAutoCompleteActive=!1;_selectedAutocompleteIndex=0;_displayObservers;static CODE_MIN_FONT_SIZE=9;static CODE_MAX_FONT_SIZE=22;static PAIR_KEYS={'"':'"',"'":"'","`":"`","(":")","{":"}","[":"]"};get doc(){return this.currentTab.doc}get undoManager(){return this.currentTab.undoManager}get cursorSet(){return this.currentTab.cursorSet}get codeContainer(){return this.currentTab.dom}static getInstances(){return wt.__instances}constructor(t,s={}){if(yt.editor=this,wt.__instances.push(this),this.skipInfo=s.skipInfo??this.skipInfo,this.disableEdition=s.disableEdition??this.disableEdition,this.skipTabs=s.skipTabs??this.skipTabs,this.useFileExplorer=(s.fileExplorer??this.useFileExplorer)&&!this.skipTabs,this.useAutoComplete=s.autocomplete??this.useAutoComplete,this.allowAddScripts=s.allowAddScripts??this.allowAddScripts,this.allowClosingTabs=s.allowClosingTabs??this.allowClosingTabs,this.allowLoadingFiles=s.allowLoadingFiles??this.allowLoadingFiles,this.highlight=s.highlight??this.highlight,this.newTabOptions=s.newTabOptions,this.customSuggestions=s.customSuggestions??[],this.explorerName=s.explorerName??this.explorerName,this.onSave=s.onSave,this.onRun=s.onRun,this.onCtrlSpace=s.onCtrlSpace,this.onCreateStatusPanel=s.onCreateStatusPanel,this.onContextMenu=s.onContextMenu,this.onNewTab=s.onNewTab,this.onSelectTab=s.onSelectTab,this.onReady=s.onReady,this.onCodeChange=s.onCodeChange,this.onHoverSymbol=s.onHoverSymbol,this.language=_e.getLanguage(this.highlight)??_e.getLanguage("Plain Text"),this.symbolTable=new bt,this.useFileExplorer){let[s,o]=t.split({sizes:["15%","85%"]});this.explorerArea=s;let n=new e.LX.Panel;n.addTitle(this.explorerName);let i=[];this.explorer=n.addTree(null,i,{filter:!1,rename:!1,skipDefaultIcon:!0}),this.explorer.on("dblClick",e=>{const t=e.items[0].id;this.loadTab(t)}),this.explorer.on("beforeDelete",(e,t)=>{}),s.attach(n),t=o}t.root.className=e.LX.mergeClass(t.root.className,"codebasearea overflow-hidden flex relative"),this.baseArea=t,this.area=new e.LX.Area({className:"lexcodeeditor flex flex-col outline-none overflow-hidden size-full select-none bg-inherit relative",skipAppend:!0});const o="lexcodearea scrollbar-hidden flex flex-row flex-auto-fill";if(this.skipTabs?(this.codeArea=new e.LX.Area({className:o,skipAppend:!0}),this.area.attach(this.codeArea)):(this.tabs=this.area.addTabs({contentClass:o,onclose:e=>{delete this._openedTabs[e]}}),e.LX.addClass(this.tabs.root.parentElement,"rounded-t-lg"),this.disableEdition||this.tabs.root.parentElement.addEventListener("dblclick",e=>{this.allowAddScripts&&(e.preventDefault(),this._onCreateNewFile())}),this.codeArea=this.tabs.area),this.root=this.area.root,t.attach(this.root),this.codeScroller=this.codeArea.root,this.lineGutter=e.LX.makeElement("div","w-16 overflow-hidden absolute top-0 bg-inherit z-10 "+(this.skipTabs?"":"mt-8"),null,this.codeScroller),this.codeSizer=e.LX.makeElement("div","pseudoparent-tabs w-full",null,this.codeScroller),this.cursorsLayer=e.LX.makeElement("div","cursors",null,this.codeSizer),this.selectionsLayer=e.LX.makeElement("div","selections",null,this.codeSizer),!this.disableEdition){this.vScrollbar=new _t(!0,e=>{const t=this.codeScroller.scrollHeight-this.codeScroller.clientHeight;this.codeScroller.scrollTop=this.vScrollbar.applyDragDelta(e,t),this._discardScroll=!0}),this.root.appendChild(this.vScrollbar.root),this.hScrollbar=new _t(!1,e=>{const t=this.codeScroller.scrollWidth-this.codeScroller.clientWidth;this.codeScroller.scrollLeft=this.hScrollbar.applyDragDelta(e,t),this._discardScroll=!0}),this.root.appendChild(this.hScrollbar.root),this.codeScroller.addEventListener("scroll",()=>{this._discardScroll?this._discardScroll=!1:this._syncScrollBars()});let e=0,t=0;this.codeScroller.addEventListener("touchstart",s=>{e=s.touches[0].clientX,t=s.touches[0].clientY},{passive:!0}),this.codeScroller.addEventListener("touchmove",s=>{const o=s.touches[0].clientX,n=s.touches[0].clientY,i=e-o,a=t-n;this.codeScroller.scrollLeft+=i,this.codeScroller.scrollTop+=a,e=o,t=n},{passive:!0}),this.codeScroller.addEventListener("wheel",e=>{if(e.ctrlKey)return e.preventDefault(),void this._applyFontSizeOffset(e.deltaY<0?1:-1);e.shiftKey&&(this.codeScroller.scrollLeft+=e.deltaY>0?10:-10)},{passive:!1})}if(new ResizeObserver(()=>{this.currentTab&&this.resize(!0)}).observe(this.codeArea.root),!this.disableEdition){this.useAutoComplete&&(this.autocomplete=e.LX.makeElement("div","autocomplete"),this.codeArea.attach(this.autocomplete));const t="searchbox bg-card min-w-96 absolute z-100 top-8 right-2 rounded-lg border-color overflow-y-scroll opacity-0";{const s=e.LX.makeElement("div",t,null,this.codeArea),o=new e.LX.Panel;s.appendChild(o.root),o.sameLine();const n=o.addText(null,"",null,{placeholder:"Find",inputClass:"bg-secondary"});o.addButton(null,"MatchCaseButton",e=>{this._searchMatchCase=e,this._doSearch()},{icon:"CaseSensitive",selectable:!0,buttonClass:"link",title:"Match Case",tooltip:!0}),o.addButton(null,"up",()=>this._doSearch(null,!0),{icon:"ArrowUp",buttonClass:"ghost",title:"Previous Match",tooltip:!0}),o.addButton(null,"down",()=>this._doSearch(),{icon:"ArrowDown",buttonClass:"ghost",title:"Next Match",tooltip:!0}),o.addButton(null,"x",this._doHideSearch.bind(this),{icon:"X",buttonClass:"ghost",title:"Close",tooltip:!0}),o.endLine();const i=n.root.querySelector("input");i?.addEventListener("keyup",e=>{"Escape"==e.key?this._doHideSearch():"Enter"==e.key&&this._doSearch(e.target.value,!!e.shiftKey)}),this.searchBox=s}{const s=e.LX.makeElement("div",t,null,this.codeArea),o=new e.LX.Panel;s.appendChild(o.root),o.sameLine();const n=o.addText(null,"",e=>{i.value=":"+e.replaceAll(":",""),this._doGotoLine(parseInt(i.value.slice(1)))},{className:"flex-auto-fill",placeholder:"Go to line",trigger:"input"});o.addButton(null,"x",this._doHideSearch.bind(this),{icon:"X",title:"Close",buttonClass:"ghost",tooltip:!0}),o.endLine();const i=n.root.querySelector("input");i.addEventListener("keyup",e=>{"Escape"==e.key&&this._doHideSearch()}),o.addText(null,"Type a line number to go to (from 0 to 0).",null,{disabled:!0,inputClass:"text-xs bg-none",signal:"@line-number-range"}),this.searchLineBox=s}}this._inputArea=e.LX.makeElement("textarea","absolute opacity-0 w-[1px] h-[1px] top-0 left-0 overflow-hidden resize-none","",this.root),this._inputArea.setAttribute("autocorrect","off"),this._inputArea.setAttribute("autocapitalize","off"),this._inputArea.setAttribute("spellcheck","false"),this._inputArea.tabIndex=0,this._inputArea.addEventListener("keydown",this._onKeyDown.bind(this)),this._inputArea.addEventListener("compositionstart",()=>this._composing=!0),this._inputArea.addEventListener("compositionend",e=>{this._composing=!1,this._inputArea.value="",e.data&&this._doInsertChar(e.data)}),this._inputArea.addEventListener("input",()=>{if(this._composing)return;const e=this._inputArea.value;e&&(this._inputArea.value="",this._doInsertChar(e))}),this._inputArea.addEventListener("focus",()=>this._setFocused(!0)),this._inputArea.addEventListener("blur",()=>this._setFocused(!1)),this.codeArea.root.addEventListener("mousedown",this._onMouseDown.bind(this)),this.codeArea.root.addEventListener("contextmenu",this._onMouseDown.bind(this)),this.codeArea.root.addEventListener("mouseover",e=>{const t=e.target.closest(".code-link");t&&e.ctrlKey&&t.classList.add("hovered")}),this.codeArea.root.addEventListener("mouseout",e=>{const t=e.target.closest(".code-link");t&&t.classList.remove("hovered")}),this.codeArea.root.addEventListener("mousemove",e=>{const t=e.target.closest(".code-link");t&&t.classList.toggle("hovered",e.ctrlKey),this._onCodeAreaMouseMove(e)}),this.codeArea.root.addEventListener("mouseleave",()=>{this._clearHoverPopup()}),this.codeArea.root.addEventListener("click",e=>{this._onColorSwatchClick(e)}),this.statusPanel=this._createStatusPanel(s),this.statusPanel&&this.area.root.appendChild(this.statusPanel.root),this.allowAddScripts&&(this.onCreateFile=s.onCreateFile,this.addTab("+",{selected:!1,title:"Create file"})),(s.defaultTab??1)&&(this.addTab(s.name||"untitled",{language:this.highlight,title:s.title}),this._renderAllLines(),this._renderCursors()),this._init()}_init(){if(this._displayObservers)return;this._isReady=!1;const e=this.root,t=async()=>{this._isReady||null!==e.offsetParent&&e.clientWidth>0&&e.clientHeight>0&&(s.disconnect(),o.disconnect(),await this._setupEditorWhenVisible())},s=new IntersectionObserver(e=>{for(const s of e)s.isIntersecting&&t()});s.observe(e);const o=new ResizeObserver(()=>{t()});o.observe(e),this._displayObservers={intersectionObserver:s,resizeObserver:o}}clear(){console.assert(this.rightStatusPanel&&this.leftStatusPanel,"No panels to clear."),this.rightStatusPanel.clear(),this.leftStatusPanel.clear()}addExplorerItem(e){this.explorer&&(this.explorer.innerTree.data.find((t,s)=>t.id===e.id)||this.explorer.innerTree.data.push(e))}setText(e,t,s=!1){if(this.currentTab){if(this.doc.setText(this._normalizeText(e)),this.cursorSet.set(0,0),this.undoManager.clear(),this._lineStates=[],t)this.setLanguage(t);else if(s){const t=this._detectLanguage(e);t&&this.setLanguage(t)}this._renderAllLines(),this._renderCursors(),this._renderSelections(),this.resize(!0)}}_detectLanguage(e){const t={},s=(e,s)=>{t[e]=(t[e]??0)+s},o=new Set(e.match(/\b\w+\b/g)??[]),n=Math.max(o.size,1);for(const e of _e.getRegisteredLanguages()){const t=_e.getLanguage(e);if(!t?.reservedWords?.length)continue;let i=0;for(const e of t.reservedWords)o.has(e)&&i++;if(i>0){const o=i/t.reservedWords.length,a=i/n;s(e,Math.round(40*(o+a)))}}/<!DOCTYPE\s+html/i.test(e)&&s("HTML",20),/<html[\s>]/i.test(e)&&s("HTML",15),/<\/?(div|span|body|head|script|style|meta)\b/i.test(e)&&s("HTML",8),/^\s*[\[{]/.test(e)&&/"\s*:\s*/.test(e)&&!/function|=>|const|var|let/.test(e)&&s("JSON",15),/[\w-]+\s*:\s*[\w#\d"'(]+.*;/.test(e)&&/[{}]/.test(e)&&!/<\w+/.test(e)&&s("CSS",10),/@(media|keyframes|import|charset|font-face)\b/.test(e)&&s("CSS",15),/@(vertex|fragment|compute|group|binding|builtin)\b/.test(e)&&s("WGSL",20),/\bfn\s+\w+\s*\(/.test(e)&&/\bvar\b/.test(e)&&s("WGSL",10),/\b(vec2f|vec3f|vec4f|mat4x4f|f32|u32|i32)\b/.test(e)&&s("WGSL",12),/\b(gl_Position|gl_FragColor|gl_FragCoord)\b/.test(e)&&s("GLSL",20),/\b(uniform|varying|attribute)\s+\w/.test(e)&&s("GLSL",10),/\b(vec2|vec3|vec4|mat4|sampler2D)\b/.test(e)&&!/vec2f|vec3f/.test(e)&&s("GLSL",8),/\b(SV_Position|SV_Target|SV_Depth)\b/.test(e)&&s("HLSL",20),/\b(cbuffer|tbuffer|float4|float3|float2|Texture2D)\b/.test(e)&&s("HLSL",12),/^\s*def\s+\w+\s*\(/m.test(e)&&s("Python",15),/^\s*import\s+\w/m.test(e)&&!/\bfrom\s+['"]/.test(e)&&s("Python",8),/^\s*class\s+\w+(\s*\(.*\))?:/m.test(e)&&s("Python",10),/\bprint\s*\(/.test(e)&&/:\s*$/.test(e)&&s("Python",5),/elif\b|lambda\b|self\.\w/.test(e)&&s("Python",8),/\bfn\s+\w+\s*\(/.test(e)&&/\blet\s+mut\b/.test(e)&&s("Rust",15),/\b(impl|trait|enum|struct)\s+\w+/.test(e)&&/\bfn\b/.test(e)&&s("Rust",12),/use\s+std::|use\s+\w+::\w+/.test(e)&&s("Rust",10),/println!\s*\(/.test(e)&&s("Rust",8),/#include\s*<[\w./]+>/.test(e)&&s("C++",15),/\bstd::\w+/.test(e)&&s("C++",12),/\b(class|template|namespace|nullptr|new\s+\w)\b/.test(e)&&s("C++",8),/(::|->)\w+/.test(e)&&s("C++",6),/#include\s*<[\w.]+\.h>/.test(e)&&s("C",12),/\bint\s+main\s*\(/.test(e)&&s("C",15),/\b(printf|scanf|malloc|free|sizeof)\s*\(/.test(e)&&s("C",10),/:\s*(string|number|boolean|void|any|never|unknown)\b/.test(e)&&s("TypeScript",12),/\binterface\s+\w+/.test(e)&&s("TypeScript",12),/\btype\s+\w+\s*=/.test(e)&&s("TypeScript",10),/\bas\s+(string|number|any|unknown)\b/.test(e)&&s("TypeScript",8),/\benum\s+\w+\s*\{/.test(e)&&s("TypeScript",8),/\b(const|let|var)\s+\w+\s*=/.test(e)&&s("JavaScript",8),/=>\s*[\w{(]/.test(e)&&s("JavaScript",6),/\b(import|export)\s+(default|{|\*)/.test(e)&&s("JavaScript",8),/\bconsole\.(log|warn|error)\b/.test(e)&&s("JavaScript",6),/^#{1,6}\s+\S/m.test(e)&&s("Markdown",12),(/\*\*\w.*?\*\*/.test(e)||/\[.+\]\(.+\)/.test(e))&&s("Markdown",8),/^```\w*/m.test(e)&&s("Markdown",10);const i=Object.entries(t).sort((e,t)=>t[1]-e[1])[0];return i&&i[1]>=8?i[0]:null}appendText(e){const t=this.cursorSet.getPrimary(),{line:s,col:o}=t.head,n=this.doc.insert(s,o,e);this.undoManager.record(n,this.cursorSet.getCursorPositions());const i=e.split(/\r?\n/);1===i.length?t.head={line:s,col:o+e.length}:t.head={line:s+i.length-1,col:i[i.length-1].length},t.anchor={...t.head},this._rebuildLines(),this._renderCursors(),this._renderSelections(),this.resize(),this._scrollCursorIntoView()}getText(){return this.doc.getText()}setLanguage(t,s){const o=_e.getLanguage(t);o&&(this.language=o,this.currentTab&&(this.currentTab.language=t,this.skipTabs||this.tabs.setIcon(this.currentTab.name,xe(o,s))),this._lineStates=[],this._renderAllLines(),e.LX.emitSignal("@highlight",t))}focus(){this._inputArea.focus()}addTab(t,s={}){const o="+"===t,n=e.LX.makeElement("div","code"),i=s.language??"Plain Text",a=_e.getLanguage(i),r=e.LX.getExtension(t),l=o?null:xe(a,r),c=s.selected??!0,d={name:t,dom:n,doc:new dt(this.onCodeChange),cursorSet:new Lt,undoManager:new ht,language:i,title:s.title??t};return this._openedTabs[t]=d,this._loadedTabs[t]=d,this.useFileExplorer&&!o&&(this.addExplorerItem({id:t,skipVisibility:!0,icon:l}),this.explorer.innerTree.frefresh(t)),this.skipTabs||this.tabs.add(t,n,{selected:c,icon:l,fixed:o,title:d.title,onSelect:this._onSelectTab.bind(this,o),onContextMenu:this._onContextMenuTab.bind(this,o),allowDelete:this.allowClosingTabs,indexOffset:s.indexOffset}),this.codeSizer.appendChild(n),s.text&&(d.doc.setText(s.text),d.cursorSet.set(0,0),d.undoManager.clear(),this._renderAllLines(),this._renderCursors(),this._renderSelections(),this._resetGutter()),c&&(this.currentTab=d,this._updateDataInfoPanel("@tab-name",t),this.setLanguage(i,r)),d}loadTab(e){if(this._openedTabs[e])return void this.tabs.select(e);const t=this._loadedTabs[e];if(t)return this._openedTabs[e]=t,this.tabs.add(e,t.dom,{selected:!0,title:t.title,onSelect:this._onSelectTab.bind(this),onContextMenu:this._onContextMenuTab.bind(this),allowDelete:this.allowClosingTabs}),this.codeSizer.appendChild(t.dom),this.currentTab=t,void this._updateDataInfoPanel("@tab-name",e);this.addTab(e,this._storedTabs[e]??null)}closeTab(e){if(!this.allowClosingTabs)return;this.tabs.delete(e);const t=this._openedTabs[e];if(t&&(t.dom.remove(),delete this._openedTabs[e]),this.currentTab?.name===e){const e=Object.keys(this._openedTabs).filter(e=>"+"!==e);e.length>0?this.tabs.select(e[0]):this.currentTab=null}}setCustomSuggestions(e){e&&e.constructor===Array?this.customSuggestions=e.map(e=>"string"==typeof e?{label:e}:e):console.warn("suggestions should be an array!")}loadFile(t,s={}){const o=(t,o)=>{t=this._normalizeText(t);const n=e.LX.getExtension(o),i=s.language??_e.getLanguage(s.language)??_e.getLanguageByExtension(n)??_e.getLanguage("Plain Text"),a=i.name;this.useFileExplorer||this.skipTabs?(this._storedTabs[o]={text:t,title:s.title??o,language:a,...s},this.useFileExplorer&&(this.addExplorerItem({id:o,skipVisibility:!0,icon:xe(i,n)}),this.explorer.innerTree.frefresh(o))):(this.addTab(o,{selected:!0,title:s.title??o,language:a}),this.doc.setText(t),this.setLanguage(a,n),this.cursorSet.set(0,0),this.undoManager.clear(),this._renderCursors(),this._renderSelections(),this._resetGutter()),s.callback&&s.callback(o,t)};if("string"==typeof t){const n=t,i=s.filename??n.substring(n.lastIndexOf("/")+1);e.LX.request({url:n,success:e=>{o(e,i)}})}else{const e=new FileReader;e.readAsText(t),e.onload=e=>{const s=e.currentTarget.result;o(s,t.name)}}}async loadFiles(t,s,o=!1){if(!t||0===t.length)return void s?.(this,[],0);const n=[];for(const s of t)try{const t=await e.LX.requestFileAsync(s,"text"),o=s.substring(s.lastIndexOf("/")+1),i=t.replaceAll("\r","").replaceAll(/\t|\\t/g," ".repeat(this.tabSize)),a=e.LX.getExtension(o),r=_e.getLanguageByExtension(a)??_e.getLanguage("Plain Text"),l=r.name;this.useFileExplorer||this.skipTabs?(this._storedTabs[o]={text:i,title:o,language:l},this.useFileExplorer&&(this.addExplorerItem({id:o,skipVisibility:!0,icon:xe(r,a)}),this.explorer.innerTree.frefresh(o))):(this.addTab(o,{selected:0===n.length,title:o,language:l}),0===n.length&&(this.doc.setText(i),this.setLanguage(l,a),this.cursorSet.set(0,0),this.undoManager.clear(),this._renderCursors(),this._renderSelections(),this._resetGutter())),n.push({filePath:s,name:o,success:!0})}catch(e){console.error(`[LX.CodeEditor] Failed to load file: ${s}`,e),n.push({filePath:s,success:!1,error:e})}s?.(this,n,n.length)}async _setupEditorWhenVisible(){const t=window.localStorage.getItem("lexcodeeditor-font-size");if(t)await this._setFontSize(parseInt(t),!1);else{const e=document.querySelector(":root"),t=getComputedStyle(e);this.fontSize=parseInt(t.getPropertyValue("--code-editor-font-size")),await this._measureChar()}e.LX.emitSignal("@font-size",this.fontSize),e.LX.doAsync(()=>{this._isReady||(this._isReady=!0,this.onReady&&this.onReady(this),console.log(`[LX.CodeEditor] Ready! (font size: ${this.fontSize}px, char size: ${this.charWidth}px)`))},20)}_onSelectTab(t,s,o){this.disableEdition||(t?this._onNewTab(s):(this.currentTab=this._openedTabs[o],this._updateDataInfoPanel("@tab-name",o),this.language=_e.getLanguage(this.currentTab.language)??_e.getLanguage("Plain Text"),e.LX.emitSignal("@highlight",this.currentTab.language),this._renderAllLines(),this._afterCursorMove(),!t&&this.onSelectTab&&this.onSelectTab(o,this)))}_onNewTab(t){if(this.onNewTab)return void this.onNewTab(t);const s=this.newTabOptions??[{name:"Create file",icon:"FilePlus",callback:this._onCreateNewFile.bind(this)},{name:"Load file",icon:"FileUp",disabled:!this.allowLoadingFiles,callback:this._doLoadFromFile.bind(this)}];e.LX.addDropdownMenu(t.target,s,{side:"bottom",align:"start"})}_onCreateNewFile(){let e={};if(this.onCreateFile&&(e=this.onCreateFile(this),!e))return;const t=e.name??"unnamed.js";this.addTab(t,{selected:!0,title:t,indexOffset:e.indexOffset,language:e.language??"JavaScript"}),this._renderAllLines(),this._renderCursors(),this._renderSelections(),this._resetGutter()}_onContextMenuTab(t=!1,s,o){t||e.LX.addDropdownMenu(s.target,[{name:"Close",kbd:"MWB",disabled:!this.allowClosingTabs,callback:()=>{this.closeTab(o)}},{name:"Close Others",disabled:!this.allowClosingTabs,callback:()=>{for(const e of Object.keys(this.tabs.tabs))"+"!==e&&e!==o&&this.closeTab(e)}},{name:"Close All",disabled:!this.allowClosingTabs,callback:()=>{for(const e of Object.keys(this.tabs.tabs))"+"!==e&&this.closeTab(e)}},null,{name:"Copy Path",icon:"Copy",callback:()=>{navigator.clipboard.writeText(this._openedTabs[o].path??"")}}],{side:"bottom",align:"start",event:s})}async _measureChar(){const t=e.LX.makeContainer(null,"lexcodeeditor","",document.body),s=e.LX.makeContainer(null,"code","",t),o=document.createElement("pre");s.appendChild(o);const n=document.createElement("span");n.className="codechar",n.style.visibility="hidden",n.textContent="M",o.appendChild(n);const i=getComputedStyle(n),a=i.fontFamily,r=i.fontSize,l=i.fontWeight||"normal",c=`${i.fontStyle||"normal"} ${l} ${r} ${a}`;try{await document.fonts.load(c)}catch(e){console.warn("[LX.CodeEditor] Failed to load font:",c,e)}requestAnimationFrame(()=>{const s=n.getBoundingClientRect();this.charWidth=s.width||7,this.lineHeight=parseFloat(getComputedStyle(this.root).getPropertyValue("--code-editor-row-height"))||20,e.LX.deleteElement(t),this._renderCursors(),this._renderSelections(),this.resize(!0)})}_createStatusPanel(t={}){if(this.skipInfo)return;let s=new e.LX.Panel({className:"lexcodetabinfo bg-inherit flex flex-row flex-auto-keep",height:"auto"});this.onCreateStatusPanel&&this.onCreateStatusPanel(s,this);let o=this.leftStatusPanel=new e.LX.Panel({id:"FontSizeZoomStatusComponent",className:"pad-xs content-center items-center flex-auto-keep",width:"auto",height:"auto"});o.sameLine(),o.addButton(null,"ZoomOutButton",this._decreaseFontSize.bind(this),{icon:"ZoomOut",buttonClass:"ghost sm",title:"Zoom Out",tooltip:!0}),o.addLabel(this.fontSize,{fit:!0,signal:"@font-size"}),o.addButton(null,"ZoomInButton",this._increaseFontSize.bind(this),{icon:"ZoomIn",buttonClass:"ghost sm",title:"Zoom In",tooltip:!0}),o.endLine("justify-start"),s.attach(o.root);let n=this.rightStatusPanel=new e.LX.Panel({className:"pad-xs content-center items-center",height:"auto"});n.sameLine(),n.addLabel(this.currentTab?.title??"",{id:"EditorFilenameStatusComponent",fit:!0,inputClass:"text-xs",signal:"@tab-name"}),n.addButton(null,"Ln 1, Col 1",this._doOpenLineSearch.bind(this),{id:"EditorSelectionStatusComponent",buttonClass:"outline xs",fit:!0,signal:"@cursor-data"});const i=n.addButton(null,"Spaces: "+this.tabSize,(t,s)=>{const o=e=>{this.tabSize=parseInt(e),this._rebuildLines(),this._updateDataInfoPanel("@tab-spaces",`Spaces: ${this.tabSize}`)},n=e.LX.addDropdownMenu(i.root,["2","4","8"].map(e=>({name:e,className:"w-full place-content-center",callback:o})),{side:"top",align:"end"});e.LX.addClass(n.root,"min-w-16! items-center")},{id:"EditorIndentationStatusComponent",buttonClass:"outline xs",signal:"@tab-spaces"}),a=n.addButton("<b>{ }</b>",this.highlight,(t,s)=>{const o=e.LX.addDropdownMenu(a.root,_e.getRegisteredLanguages().map(e=>{const t=xe(_e.getLanguage(e)),s=t?t.split(" "):[];return{name:e,icon:s[0],className:"w-full text-xs px-3",svgClass:s.slice(1).join(" "),callback:e=>this.setLanguage(e)}}),{side:"top",align:"end"});e.LX.addClass(o.root,"min-w-min! items-center")},{id:"EditorLanguageStatusComponent",nameWidth:"auto",buttonClass:"outline xs",signal:"@highlight",title:""});n.endLine("justify-end"),s.attach(n.root);const r={"Font Size Zoom":t.statusShowFontSizeZoom??!0,"Editor Filename":t.statusShowEditorFilename??!0,"Editor Selection":t.statusShowEditorSelection??!0,"Editor Indentation":t.statusShowEditorIndentation??!0,"Editor Language":t.statusShowEditorLanguage??!0},l=e=>{const t=s.root.querySelector(`#${e.replaceAll(" ","")}StatusComponent`);console.assert(t,`${e} has no status button!`),t.classList.toggle("hidden",!r[e])};for(const[e,t]of Object.entries(r))l(e);return s.root.addEventListener("contextmenu",t=>{if(t.target&&(t.target.classList.contains("lexpanel")||t.target.classList.contains("lexinlinecomponents")))return;const s=Object.keys(r).map((e,t)=>{const s={name:e,icon:"Check",callback:()=>{r[e]=!r[e],l(e)}};return r[e]||delete s.icon,s});e.LX.addDropdownMenu(t.target,s,{side:"top",align:"start"})}),s}_updateDataInfoPanel(t,s){this.skipInfo||(this.cursorSet.cursors.length>1&&(s=""),e.LX.emitSignal(t,s))}_tokenizeLine(e){const t=e>0?this._lineStates[e-1]??_e.initialState():_e.initialState(),s=this.doc.getLine(e),o=_e.tokenizeLine(s,this.language,t),n=this.language.name.toLowerCase().replace(/[^a-z]/g,""),i=/(https?:\/\/[^\s"'<>)\]]+)/g;let a=-1;if(e===this._bracketOpenLine){for(let e=o.tokens.length-1;e>=0;e--)if("symbol"===o.tokens[e].type&&"{"===o.tokens[e].value){a=e;break}}else if(e===this._bracketCloseLine)for(let e=0;e<o.tokens.length;e++)if("symbol"===o.tokens[e].type&&"}"===o.tokens[e].value){a=e;break}let r="",l=0;for(let t=0;t<o.tokens.length;t++){const s=o.tokens[t],c=vt[s.type],d=l;let h;if(l+=s.value.length,"comment"===s.type){h=s.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(i,'<span class="code-link" data-url="$1">$1</span>')}else h=xt(s.value,e,d);const u=t===a?" code-bracket-active":"";r+=c?`<span class="${c} ${n}${u}">${h}</span>`:u?`<span class="${u.trim()}">${h}</span>`:h}return{html:r||" ",endState:o.state,tokens:o.tokens}}_updateSymbolsForLine(e){const t=this.doc.getLine(e);this.symbolTable.updateScopeForLine(e,t),this.symbolTable.removeLineSymbols(e);const{tokens:s}=this._tokenizeLine(e),o=function(e,t,s,o){const n=[],i=o.getScopeAtLine(s),a=i[i.length-1],r=a?.name??"global",l=a?.type??"global",c=new Set;for(const e of t)["keyword","statement","builtin","preprocessor"].includes(e.type)&&c.add(e.value);const d=new Set,h=(e,t,o=0)=>{if(!e||!e.match(/^[a-zA-Z_$][\w$]*$/))return;if(c.has(e))return;const i=`${e}@${5*Math.floor(o/5)}`;d.has(i)||(n.push({name:e,kind:t,scope:r,line:s,col:o}),d.add(i))},u=[{regex:/^\s*class\s+([A-Z_]\w*)/i,kind:"class"},{regex:/^\s*struct\s+([A-Z_]\w*)/i,kind:"struct"},{regex:/^\s*interface\s+([A-Z_]\w*)/i,kind:"interface"},{regex:/^\s*enum\s+([A-Z_]\w*)/i,kind:"enum"},{regex:/^\s*type\s+([A-Z_]\w*)\s*=/i,kind:"type"},{regex:/^\s*(?:export\s+)?(?:async\s+)?function\s+(\w+)/i,kind:"function"},{regex:/^\s*(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s+)?\([^)]*\)\s*=>/i,kind:"function"},{regex:/^\s*(?:static\s+|const\s+|virtual\s+|inline\s+|extern\s+|pub\s+|async\s+)*(?!\b(?:await|return|if|else|while|for|switch|case|throw|new|delete|typeof|yield)\b)(\w+[\w\s\*&:<>,]*?)\s+(\w+)\s*\([^)]*\)\s*[{;]/i,kind:"typed-function"},{regex:/^\s*(?:(?:public|private|protected|static|readonly|async|override)\s+)*(\w+)\s*\([^)]*\)\s*[:{]/i,kind:"class"===l?"method":"function"}],p=[{regex:/(?:const|let|var)\s+(\w+)/gi,kind:"variable"},{regex:/(\w+)\s*:\s*(?:function|[A-Z]\w*)/gi,kind:"variable"},{regex:/this\.(\w+)\s*=/gi,kind:"property"},{regex:/\b(?:private|protected|public)\s+(?:(?:static|readonly)\s+)*(\w+)\s*[=:;]/gi,kind:"property"},{regex:/new\s+([A-Z]\w+)/gi,kind:"constructor-call"},{regex:/(\w+)\s*\(/gi,kind:"method-call"}];let m=!1;for(const t of u){const s=e.match(t.regex);if(s){let n,i=t.kind;if("typed-function"===t.kind&&s[2])n=s[2],i="class"===l?"method":"function";else{if(!s[1])continue;n=s[1]}h(n,i,e.indexOf(n)),["class","function","method","enum","struct","interface"].includes(i)&&o.nameCurrentScope(n,i),m=!0;break}}if(!m)for(const t of p){const s=e.matchAll(t.regex);for(const e of s)if(e[1]){const s=e[1],o=e.index??0;h(s,t.kind,o)}}if("enum"===l){const t=e.match(/^\s*(\w+)\s*[,=]?/);t&&t[1]&&!e.includes("enum")&&h(t[1],"enum-value",e.indexOf(t[1]))}return n}(t,s,e,this.symbolTable);for(const e of o)this.symbolTable.addSymbol(e)}_renderAllLines(){if(this.currentTab){this.codeContainer.innerHTML="",this._lineElements=[],this._lineStates=[],this.symbolTable.clear();for(let e=0;e<this.doc.lineCount;e++)this._appendLineElement(e)}}_getGutterHtml(e){return`<span class="line-gutter">${e+1}</span>`}_appendLineElement(e){const{html:t,endState:s}=this._tokenizeLine(e);this._lineStates[e]=s;const o=document.createElement("pre");o.innerHTML=this._getGutterHtml(e)+t,this.codeContainer.appendChild(o),this._lineElements[e]=o,this._updateSymbolsForLine(e)}_updateLine(e){const{html:t,endState:s}=this._tokenizeLine(e),o=this._lineStates[e];if(this._lineStates[e]=s,this._lineElements[e]&&(this._lineElements[e].innerHTML=this._getGutterHtml(e)+t),this._updateSymbolsForLine(e),!this._statesEqual(o,s))for(let t=e+1;t<this.doc.lineCount;t++){const{html:e,endState:s}=this._tokenizeLine(t),o=this._lineStates[t];if(this._lineStates[t]=s,this._lineElements[t]&&(this._lineElements[t].innerHTML=this._getGutterHtml(t)+e),this._updateSymbolsForLine(t),this._statesEqual(o,s))break}for(let t=e+1;t<this.doc.lineCount;t++){const e=this.symbolTable.getScopeAtLine(t).length;if(this.symbolTable.updateScopeForLine(t,this.doc.getLine(t)),this.symbolTable.getScopeAtLine(t).length===e)break}}_rebuildLines(){if(this._lineElements.length===this.doc.lineCount)for(let e=0;e<this.doc.lineCount;e++)this._updateLine(e);else this._renderAllLines();this.resize()}_statesEqual(e,t){if(!e)return!1;if(e.stack.length!==t.stack.length)return!1;for(let s=0;s<e.stack.length;s++)if(e.stack[s]!==t.stack[s])return!1;return!0}_updateActiveLine(){const e=this.cursorSet.hasSelection(),t=this.cursorSet.getPrimary().head.line,s=this.cursorSet.getPrimary().head.col;for(let s=0;s<this._lineElements.length;s++)this._lineElements[s].classList.toggle("active-line",!e&&s===t);this._updateDataInfoPanel("@cursor-data",`Ln ${t+1}, Col ${s+1}`)}_renderCursors(){if(this.currentTab){this.cursorsLayer.innerHTML="";for(const t of this.cursorSet.cursors){const s=e.LX.makeElement("div","cursor"," ",this.cursorsLayer);s.style.left=t.head.col*this.charWidth+this.xPadding+"px",s.style.top=t.head.line*this.lineHeight+"px"}this._updateActiveLine()}}_renderSelections(){if(this.currentTab){this.selectionsLayer.innerHTML="";for(const t of this.cursorSet.cursors){if(ft(t))continue;const s=mt(t),o=gt(t);for(let t=s.line;t<=o.line;t++){const n=this.doc.getLine(t),i=t===s.line?s.col:0,a=t===o.line?o.col:n.length;if(i===a&&t===o.line)continue;const r=i===a?Math.ceil(.5*this.charWidth):(a-i)*this.charWidth,l=e.LX.makeElement("div","lexcodeselection","",this.selectionsLayer);l.style.top=t*this.lineHeight+"px",l.style.left=i*this.charWidth+this.xPadding+"px",l.style.width=r+"px"}}}}_setFocused(e){this._focused=e,e?(this.cursorsLayer.classList.add("show"),this.selectionsLayer.classList.add("show"),this.selectionsLayer.classList.remove("unfocused"),this._startBlinker()):(this.cursorsLayer.classList.remove("show"),this._isSearchBoxActive?this.selectionsLayer.classList.add("show"):this.selectionsLayer.classList.add("unfocused"),this._stopBlinker())}_startBlinker(){this._stopBlinker(),this._cursorVisible=!0,this._setCursorVisibility(!0),this._blinkerInterval=setInterval(()=>{this._cursorVisible=!this._cursorVisible,this._setCursorVisibility(this._cursorVisible)},this._cursorBlinkRate)}_stopBlinker(){null!==this._blinkerInterval&&(clearInterval(this._blinkerInterval),this._blinkerInterval=null)}_resetBlinker(){this._focused&&this._startBlinker()}_setCursorVisibility(e){const t=this.cursorsLayer.querySelectorAll(".cursor");for(const s of t)s.style.opacity=e?"0.6":"0"}_onKeyDown(e){if(!this.currentTab)return;if(this._composing||"Dead"===e.key)return;if(["Control","Shift","Alt","Meta"].includes(e.key))return;const t=e.ctrlKey||e.metaKey,s=e.shiftKey,o=e.altKey;if(this._keyChain){const s=this._keyChain;if(this._keyChain=null,e.preventDefault(),t&&"k"===s)switch(e.key.toLowerCase()){case"c":return void this._commentLines();case"u":return void this._uncommentLines()}return}if(t)switch(e.key.toLowerCase()){case"a":return e.preventDefault(),this.cursorSet.selectAll(this.doc),void this._afterCursorMove();case"d":return e.preventDefault(),void this._doFindNextOcurrence();case"f":return e.preventDefault(),void this._doOpenSearch();case"g":return e.preventDefault(),void this._doOpenLineSearch();case"k":return e.preventDefault(),void(this._keyChain="k");case"s":return e.preventDefault(),void(this.onSave&&this.onSave(this.getText(),this));case"z":return e.preventDefault(),void(s?this._doRedo():this._doUndo());case"y":return e.preventDefault(),void this._doRedo();case"c":return e.preventDefault(),void this._doCopy();case"x":return e.preventDefault(),void this._doCut();case"v":return e.preventDefault(),void this._doPaste();case" ":return e.preventDefault(),void(this.onCtrlSpace&&this.onCtrlSpace(this.getText(),this))}switch(e.key){case"ArrowLeft":return e.preventDefault(),this._wasPaired=!1,t?this.cursorSet.moveWordLeft(this.doc,s):this.cursorSet.moveLeft(this.doc,s),void this._afterCursorMove();case"ArrowRight":return e.preventDefault(),this._wasPaired=!1,t?this.cursorSet.moveWordRight(this.doc,s):this.cursorSet.moveRight(this.doc,s),void this._afterCursorMove();case"ArrowUp":if(e.preventDefault(),this._isAutoCompleteActive){const e=this.autocomplete.childNodes;return e[this._selectedAutocompleteIndex]?.classList.remove("selected"),this._selectedAutocompleteIndex=(this._selectedAutocompleteIndex-1+e.length)%e.length,e[this._selectedAutocompleteIndex]?.classList.add("selected"),void e[this._selectedAutocompleteIndex]?.scrollIntoView({block:"nearest"})}return this._wasPaired=!1,o&&s?void this._duplicateLine(-1):o?void this._swapLine(-1):(this.cursorSet.moveUp(this.doc,s),void this._afterCursorMove());case"ArrowDown":if(e.preventDefault(),this._isAutoCompleteActive){const e=this.autocomplete.childNodes;return e[this._selectedAutocompleteIndex]?.classList.remove("selected"),this._selectedAutocompleteIndex=(this._selectedAutocompleteIndex+1)%e.length,e[this._selectedAutocompleteIndex]?.classList.add("selected"),void e[this._selectedAutocompleteIndex]?.scrollIntoView({block:"nearest"})}return this._wasPaired=!1,o&&s?void this._duplicateLine(1):o?void this._swapLine(1):(this.cursorSet.moveDown(this.doc,s),void this._afterCursorMove());case"Home":return e.preventDefault(),this._wasPaired=!1,this.cursorSet.moveToLineStart(this.doc,s),void this._afterCursorMove();case"End":return e.preventDefault(),this._wasPaired=!1,this.cursorSet.moveToLineEnd(this.doc,s),void this._afterCursorMove();case"Escape":if(e.preventDefault(),this._isAutoCompleteActive)return void this._doHideAutocomplete();if(this._doHideSearch())return;this.cursorSet.removeSecondaryCursors();const n=this.cursorSet.getPrimary().head;return this.cursorSet.set(n.line,n.col),void this._afterCursorMove()}switch(e.key){case"Backspace":return e.preventDefault(),void this._doBackspace(t);case"Delete":return e.preventDefault(),void this._doDelete(t);case"Enter":return e.preventDefault(),void this._doEnter(t);case"Tab":return e.preventDefault(),void this._doTab(s)}1!==e.key.length||t||(e.preventDefault(),this._doInsertChar(e.key))}_flushIfActionChanged(e){this._lastAction!==e&&(this.undoManager.flush(this.cursorSet.getCursorPositions()),this._lastAction=e)}_flushAction(){this.undoManager.flush(this.cursorSet.getCursorPositions()),this._lastAction=""}_doInsertChar(e){if(e in wt.PAIR_KEYS&&this.cursorSet.hasSelection())return void this._encloseSelection(e,wt.PAIR_KEYS[e]);this._flushIfActionChanged("insert"),this._deleteSelectionIfAny();const t=new Set;let s=!1;for(const o of this.cursorSet.sortedIndicesBottomUp()){const n=this.cursorSet.cursors[o],{line:i,col:a}=n.head,r=this.doc.getCharAt(i,a);if(this._wasPaired&&r===e){n.head={line:i,col:a+1},n.anchor={...n.head};continue}const l=this.doc.insert(i,a,e);this.undoManager.record(l,this.cursorSet.getCursorPositions());const c=e in wt.PAIR_KEYS&&(!r||/\s/.test(r)),d=c?2:1;if(c){const t=this.doc.insert(i,a+1,wt.PAIR_KEYS[e]);this.undoManager.record(t,this.cursorSet.getCursorPositions()),s=!0}n.head={line:i,col:a+1},n.anchor={...n.head},this.cursorSet.adjustOthers(o,i,a,d),t.add(i)}this._wasPaired=s;for(const e of t)this._updateLine(e);this._afterCursorMove(),/[\w$]/.test(e)?this._doOpenAutocomplete():this._doHideAutocomplete()}_getAffectedLines(){const e=this.cursorSet.getPrimary(),t=e.anchor.line,s=e.head.line;return t<=s?[t,s]:[s,t]}_commentLines(){const e=this.language.lineComment;if(!e)return;const[t,s]=this._getAffectedLines(),o=e+" ";let n=1/0;for(let e=t;e<=s;e++){0!==this.doc.getLine(e).trim().length&&(n=Math.min(n,this.doc.getIndent(e)))}n===1/0&&(n=0),this._flushAction();for(let e=t;e<=s;e++){if(0===this.doc.getLine(e).trim().length)continue;const t=this.doc.insert(e,n,o);this.undoManager.record(t,this.cursorSet.getCursorPositions()),this._updateLine(e)}this._afterCursorMove()}_uncommentLines(){const e=this.language.lineComment;if(!e)return;const[t,s]=this._getAffectedLines();this._flushAction();for(let o=t;o<=s;o++){const t=this.doc.getLine(o),s=this.doc.getIndent(o),n=t.substring(s);if(n.startsWith(e+" ")){const t=this.doc.delete(o,s,e.length+1);this.undoManager.record(t,this.cursorSet.getCursorPositions())}else if(n.startsWith(e)){const t=this.doc.delete(o,s,e.length);this.undoManager.record(t,this.cursorSet.getCursorPositions())}}this._rebuildLines(),this._afterCursorMove()}_doFindNextOcurrence(){const e=this.cursorSet.getPrimary();let t=this.cursorSet.getSelectedText(this.doc);if(!t){const{line:t,col:s}=e.head,[o,n,i]=this.doc.getWordAt(t,s);if(!o)return;return e.anchor={line:t,col:n},e.head={line:t,col:i},this._renderCursors(),void this._renderSelections()}const s=this.cursorSet.cursors[this.cursorSet.cursors.length-1],o=pt(s.anchor,s.head)?s.head:s.anchor,n=this.doc.findNext(t,o.line,o.col);if(!n)return;this.cursorSet.cursors.some(e=>{const t=pt(e.anchor,e.head)?e.anchor:e.head;return t.line===n.line&&t.col===n.col})||(this.cursorSet.cursors.push({anchor:{line:n.line,col:n.col},head:{line:n.line,col:n.col+t.length}}),this._renderCursors(),this._renderSelections(),this._scrollCursorIntoView())}_doOpenSearch(t=!1){if(!this.searchBox)return;this._doHideSearch(),e.LX.addClass(this.searchBox,"opened"),this._isSearchBoxActive=!0;const s=this.searchBox.querySelector("input");s&&(t?s.value="":this.cursorSet.hasSelection()&&(s.value=this.cursorSet.getSelectedText(this.doc)),s.selectionStart=0,s.selectionEnd=s.value.length,s.focus())}_doOpenLineSearch(){if(!this.searchLineBox)return;this._doHideSearch(),e.LX.emitSignal("@line-number-range",`Type a line number to go to (from 1 to ${this.doc.lineCount}).`),e.LX.addClass(this.searchLineBox,"opened"),this._isSearchLineBoxActive=!0;const t=this.searchLineBox.querySelector("input");t&&(t.value=":",t.focus())}_doHideSearch(){if(!this.searchBox||!this.searchLineBox)return!1;const e=this._isSearchBoxActive,t=this._isSearchLineBoxActive;return e?(this.searchBox.classList.remove("opened"),this._isSearchBoxActive=!1,this._lastSearchPos=null):t&&(this.searchLineBox.classList.remove("opened"),this._isSearchLineBoxActive=!1),e!=this._isSearchBoxActive||t!=this._isSearchLineBoxActive}_doSearch(e,t=!1,s,o=!0,n=!0){if(!(e=e??this._lastTextFound))return;const i=this.doc;let a,r;if(this._lastSearchPos)a=this._lastSearchPos.line,r=this._lastSearchPos.col+(t?-e.length:e.length);else{const e=this.cursorSet.getPrimary();a=e.head.line,r=e.head.col}const l=(s,o)=>{let n=i.getLine(s),a=e;if(this._searchMatchCase||(n=n.toLowerCase(),a=a.toLowerCase()),t){return n.substring(0,o).lastIndexOf(a)}return n.indexOf(a,o)};let c=-1,d=-1;if(t){for(let e=a;e>=0;e--){const t=l(e,e===a?r:i.getLine(e).length);if(t>-1){c=e,d=t;break}}if(-1===c)for(let e=i.lineCount-1;e>a;e--){const t=l(e,i.getLine(e).length);if(t>-1){c=e,d=t;break}}}else{for(let e=a;e<i.lineCount;e++){const t=l(e,e===a?r:0);if(t>-1){c=e,d=t;break}}if(-1===c)for(let e=0;e<a;e++){const t=l(e,0);if(t>-1){c=e,d=t;break}}}if(-1===c)return o||alert("No results!"),void(this._lastSearchPos=null);if(this._lastTextFound=e,this._lastSearchPos={line:c,col:d},s)s(d,c);else{const t=this.cursorSet.getPrimary();t.anchor={line:c,col:d},t.head={line:c,col:d+e.length},this._renderCursors(),this._renderSelections()}if(this.codeScroller.scrollTop=Math.max((c-10)*this.lineHeight,0),this.codeScroller.scrollLeft=Math.max(d*this.charWidth-this.codeScroller.clientWidth/2,0),n){const e=this.searchBox?.querySelector("input");e?.focus()}}_doGotoLine(e){Number.isNaN(e)||e<1||e>this.doc.lineCount||(this.cursorSet.set(e-1,0),this._afterCursorMove())}_encloseSelection(e,t){const s=this.cursorSet.getPrimary(),o=s.anchor,n=s.head,i=o.line<n.line||o.line===n.line&&o.col<n.col?o:n,a=i===o?n:o;if(i.line!==a.line)return;const r=i.line,l=i.col,c=a.col;this._flushAction();const d=this.doc.insert(r,l,e);this.undoManager.record(d,this.cursorSet.getCursorPositions());const h=this.doc.insert(r,c+1,t);this.undoManager.record(h,this.cursorSet.getCursorPositions()),s.anchor={line:r,col:l+1},s.head={line:r,col:c+1},this._updateLine(r),this._afterCursorMove()}_doBackspace(e){if(this._flushIfActionChanged("backspace"),this.cursorSet.hasSelection())return this._deleteSelectionIfAny(),this._rebuildLines(),void this._afterCursorMove();for(const t of this.cursorSet.sortedIndicesBottomUp()){const s=this.cursorSet.cursors[t],{line:o,col:n}=s.head;if(0!==o||0!==n)if(0===n){const e=this.doc.getLine(o-1).length,n=this.doc.delete(o-1,e,1);this.undoManager.record(n,this.cursorSet.getCursorPositions()),s.head={line:o-1,col:e},s.anchor={...s.head},this.cursorSet.adjustOthers(t,o,0,e,-1)}else if(e){const[e,i]=this.doc.getWordAt(o,n-1),a=e.length>0?i:n-1,r=n-a,l=this.doc.delete(o,a,r);this.undoManager.record(l,this.cursorSet.getCursorPositions()),s.head={line:o,col:a},s.anchor={...s.head},this.cursorSet.adjustOthers(t,o,n,-r)}else{const e=this.doc.delete(o,n-1,1);this.undoManager.record(e,this.cursorSet.getCursorPositions()),s.head={line:o,col:n-1},s.anchor={...s.head},this.cursorSet.adjustOthers(t,o,n,-1)}}this._rebuildLines(),this._afterCursorMove(),this._doOpenAutocomplete()}_doDelete(e){if(this.cursorSet.hasSelection())return this._deleteSelectionIfAny(),this._rebuildLines(),void this._afterCursorMove();this._flushIfActionChanged("delete");for(const t of this.cursorSet.sortedIndicesBottomUp()){const s=this.cursorSet.cursors[t],{line:o,col:n}=s.head,i=this.doc.getLine(o);if(!(n>=i.length&&o>=this.doc.lineCount-1))if(n>=i.length){const e=this.doc.delete(o,n,1);this.undoManager.record(e,this.cursorSet.getCursorPositions()),this.cursorSet.adjustOthers(t,o,n,0,-1)}else if(e){const[e,,s]=this.doc.getWordAt(o,n),i=e.length>0?s-n:1,a=this.doc.delete(o,n,i);this.undoManager.record(a,this.cursorSet.getCursorPositions()),this.cursorSet.adjustOthers(t,o,n,-i)}else{const e=this.doc.delete(o,n,1);this.undoManager.record(e,this.cursorSet.getCursorPositions()),this.cursorSet.adjustOthers(t,o,n,-1)}}this._rebuildLines(),this._afterCursorMove()}_doEnter(e){if(this._isAutoCompleteActive)this._doAutocompleteWord();else if(e&&this.onRun)this.onRun(this.getText(),this);else{this._deleteSelectionIfAny(),this._flushAction();for(const e of this.cursorSet.sortedIndicesBottomUp()){const t=this.cursorSet.cursors[e],{line:s,col:o}=t.head,n=this.doc.getIndent(s),i=" ".repeat(n),a=this.doc.getCharAt(s,o-1),r=this.doc.getCharAt(s,o);if(a&&r&&{"{":"}","[":"]","(":")"}[a]===r){const a="\n"+" ".repeat(n+this.tabSize)+"\n"+i,r=this.doc.insert(s,o,a);this.undoManager.record(r,this.cursorSet.getCursorPositions()),t.head={line:s+1,col:n+this.tabSize},t.anchor={...t.head},this.cursorSet.adjustOthers(e,s,o,0,2)}else{const a=this.doc.insert(s,o,"\n"+i);this.undoManager.record(a,this.cursorSet.getCursorPositions()),t.head={line:s+1,col:n},t.anchor={...t.head},this.cursorSet.adjustOthers(e,s,o,0,1)}}this._rebuildLines(),this._afterCursorMove()}}_doTab(e){if(this._isAutoCompleteActive)this._doAutocompleteWord();else{this._flushAction();for(const t of this.cursorSet.sortedIndicesBottomUp()){const s=this.cursorSet.cursors[t],{line:o,col:n}=s.head,i=s.anchor.line,a=Math.min(o,i),r=Math.max(o,i);if(a!==r){for(let t=a;t<=r;t++)if(e){const e=this.doc.getLine(t);let s=0;for(;s<this.tabSize&&s<e.length&&" "===e[s];)s++;if(s>0){const e=this.doc.delete(t,0,s);this.undoManager.record(e,this.cursorSet.getCursorPositions())}}else{const e=" ".repeat(this.tabSize),s=this.doc.insert(t,0,e);this.undoManager.record(s,this.cursorSet.getCursorPositions())}const t=e?-this.tabSize:this.tabSize;s.head={line:o,col:Math.max(0,n+t)},s.anchor={line:i,col:Math.max(0,s.anchor.col+t)}}else if(e){const e=this.doc.getLine(o);let i=0;for(;i<this.tabSize&&i<e.length&&" "===e[i];)i++;if(i>0){const e=this.doc.delete(o,0,i);this.undoManager.record(e,this.cursorSet.getCursorPositions()),s.head={line:o,col:Math.max(0,n-i)},s.anchor={...s.head},this.cursorSet.adjustOthers(t,o,0,-i)}}else{const e=this.tabSize-n%this.tabSize,i=" ".repeat(e),a=this.doc.insert(o,n,i);this.undoManager.record(a,this.cursorSet.getCursorPositions()),s.head={line:o,col:n+e},s.anchor={...s.head},this.cursorSet.adjustOthers(t,o,n,e)}}this._rebuildLines(),this._afterCursorMove()}}_deleteSelectionIfAny(){let e=!1;for(const t of this.cursorSet.sortedIndicesBottomUp()){const s=this.cursorSet.cursors[t];if(ft(s))continue;const o=mt(s),n=gt(s),i=this.cursorSet.getSelectedText(this.doc,t);if(!i)continue;const a=n.line-o.line,r=0===a?n.col-o.col:o.col,l=this.doc.delete(o.line,o.col,i.length);this.undoManager.record(l,this.cursorSet.getCursorPositions()),s.head={...o},s.anchor={...o},this.cursorSet.adjustOthers(t,o.line,o.col,-r,-a),e=!0}e&&(this._rebuildLines(),this._doHideAutocomplete())}_doCopy(){const e=this.cursorSet.getSelectedText(this.doc);e&&navigator.clipboard.writeText(e)}_doCut(){this._flushAction();const e=this.cursorSet.getSelectedText(this.doc);if(e)navigator.clipboard.writeText(e),this._deleteSelectionIfAny();else{const e=this.cursorSet.getPrimary(),t=e.head.line,s=this.doc.getLine(t),o=t===this.doc.lineCount-1;navigator.clipboard.writeText(s+(o?"":"\n"));const n=this.doc.removeLine(t);this.undoManager.record(n,this.cursorSet.getCursorPositions());const i=Math.min(t,this.doc.lineCount-1);e.head={line:i,col:0},e.anchor={...e.head}}this._rebuildLines(),this._afterCursorMove()}_swapLine(e){const t=this.cursorSet.getPrimary(),s=t.head.line,o=s+e;if(o<0||o>=this.doc.lineCount)return;const n=this.doc.getLine(s),i=this.doc.getLine(o);this._flushAction();const a=this.doc.replaceLine(s,i);this.undoManager.record(a,this.cursorSet.getCursorPositions());const r=this.doc.replaceLine(o,n);this.undoManager.record(r,this.cursorSet.getCursorPositions()),t.head={line:o,col:t.head.col},t.anchor={...t.head},this._rebuildLines(),this._afterCursorMove()}_duplicateLine(e){const t=this.cursorSet.getPrimary(),s=t.head.line,o=this.doc.getLine(s);this._flushAction();const n=this.doc.insertLine(s,o);this.undoManager.record(n,this.cursorSet.getCursorPositions());const i=1===e?s+1:s;t.head={line:i,col:t.head.col},t.anchor={...t.head},this._rebuildLines(),this._afterCursorMove()}_normalizeText(e){return e.replace(/\r\n?/g,"\n").replace(/\t/g," ".repeat(this.tabSize))}async _doPaste(){const e=await navigator.clipboard.readText();if(!e)return;const t=this._normalizeText(e);this._flushAction(),this._deleteSelectionIfAny();const s=this.cursorSet.getPrimary(),o=this.doc.insert(s.head.line,s.head.col,t);this.undoManager.record(o,this.cursorSet.getCursorPositions());const n=t.split("\n");1===n.length?this.cursorSet.set(s.head.line,s.head.col+t.length):this.cursorSet.set(s.head.line+n.length-1,n[n.length-1].length),this._rebuildLines(),this._afterCursorMove()}_doUndo(){const e=this.undoManager.undo(this.doc,this.cursorSet.getCursorPositions());if(e){if(e.cursors.length>0){const t=e.cursors[0];this.cursorSet.set(t.line,t.col)}this._rebuildLines(),this._afterCursorMove()}}_doRedo(){const e=this.undoManager.redo(this.doc);if(e){if(e.cursors.length>0){const t=e.cursors[0];this.cursorSet.set(t.line,t.col)}this._rebuildLines(),this._afterCursorMove()}}_onMouseDown(t){if(!this.currentTab)return;if(this.searchBox&&this.searchBox.contains(t.target))return;if(this.autocomplete&&this.autocomplete.contains(t.target))return;if(t.ctrlKey&&0===t.button){const e=t.target.closest(".code-link");if(e?.dataset.url)return void window.open(e.dataset.url,"_blank")}t.preventDefault(),this._wasPaired=!1;const s=this.codeContainer.getBoundingClientRect(),o=t.clientX-s.left-this.xPadding,n=t.clientY-s.top,i=e.LX.clamp(Math.floor(n/this.lineHeight),0,this.doc.lineCount-1),a=e.LX.clamp(Math.round(o/this.charWidth),0,this.doc.getLine(i).length);if("contextmenu"===t.type)return void this._onContextMenu(t,i,a);if(0!==t.button)return;const r=Date.now();if(r-this._lastClickTime<400&&i===this._lastClickLine?this._clickCount=Math.min(this._clickCount+1,3):this._clickCount=1,this._lastClickTime=r,this._lastClickLine=i,3===this._clickCount){const e=this.cursorSet.getPrimary();e.anchor={line:i,col:0},e.head={line:i,col:this.doc.getLine(i).length}}else if(2===this._clickCount){const[,e,t]=this.doc.getWordAt(i,a),s=this.cursorSet.getPrimary();s.anchor={line:i,col:e},s.head={line:i,col:t}}else if(t.shiftKey){this.cursorSet.getPrimary().head={line:i,col:a}}else this.cursorSet.set(i,a);this._afterCursorMove(),this._inputArea.focus();const l=e=>{const t=e.clientX-s.left-this.xPadding,o=e.clientY-s.top,n=Math.max(0,Math.min(Math.floor(o/this.lineHeight),this.doc.lineCount-1)),i=Math.max(0,Math.min(Math.round(t/this.charWidth),this.doc.getLine(n).length));this.cursorSet.getPrimary().head={line:n,col:i},this._renderCursors(),this._renderSelections()},c=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",c)}_onContextMenu(t,s,o){t.preventDefault();const n=[{name:"Copy",icon:"Copy",callback:()=>this._doCopy(),kbd:["Ctrl","C"],useKbdSpecialKeys:!1}];if(this.disableEdition||(n.push({name:"Cut",icon:"Scissors",callback:()=>this._doCut(),kbd:["Ctrl","X"],useKbdSpecialKeys:!1}),n.push({name:"Paste",icon:"Paste",callback:()=>this._doPaste(),kbd:["Ctrl","V"],useKbdSpecialKeys:!1})),this.onContextMenu){const e=this.cursorSet.getSelectedText(this.doc),s=this.onContextMenu(this,e,t);if(s?.length){n.push(null);for(const e of s)n.push({name:e.path,disabled:e.disabled,callback:e.callback})}}e.LX.addDropdownMenu(t.target,n,{event:t,side:"bottom",align:"start"})}_getWordAtCursor(){const e=this.cursorSet.getPrimary().head,t=this.doc.getLine(e.line);let s=e.col,o=e.col;for(;s>0&&/[\w$]/.test(t[s-1]);)s--;for(;o<t.length&&/[\w$]/.test(t[o]);)o++;return{word:t.slice(s,o),start:s,end:o}}_doOpenAutocomplete(){if(!this.autocomplete||!this.useAutoComplete)return;this.autocomplete.innerHTML="";const{word:t}=this._getWordAtCursor();if(!t||0===t.length)return void this._doHideAutocomplete();const s=[],o=new Set,n=e=>{o.has(e.label)||(s.push(e),o.add(e.label))},i=(e,t)=>{const s=t.toLowerCase();return e.filterText?e.filterText.split(" ").some(e=>e.toLowerCase().trim().startsWith(s)):e.label.toLowerCase().startsWith(s)},a=this.symbolTable.getAllSymbols();for(const e of a){const s={label:e.name,kind:e.kind,scope:e.scope,detail:`${e.kind} in ${e.scope}`};i(s,t)&&n(s)}for(const e of this.language.reservedWords){const s={label:e};i(s,t)&&n(s)}for(const e of this.customSuggestions)i(e,t)&&n(e);if(0===s.length)return void this._doHideAutocomplete();const r=t.toLowerCase();s.sort((e,t)=>{const s=(e.sortText??e.label).toLowerCase(),o=(t.sortText??t.label).toLowerCase(),n=s===r?0:1,i=o===r?0:1;return n!==i?n-i:s.localeCompare(o)}),this._selectedAutocompleteIndex=0,s.forEach((s,o)=>{const n=document.createElement("pre");n.insertText=s.insertText??s.label,o===this._selectedAutocompleteIndex&&n.classList.add("selected");const i=s.label;let a=s.icon??"CaseLower",r=s.iconClass??"text-gray-500";switch(s.kind){case"class":a="CircleNodes",r="text-orange-500";break;case"struct":a="Form",r="text-orange-400";break;case"interface":a="FileType",r="text-cyan-500";break;case"enum":a="ListTree",r="text-yellow-500";break;case"enum-value":a="Dot",r="text-yellow-400";break;case"type":a="Type",r="text-teal-500";break;case"function":a="Function",r="text-purple-500";break;case"method":a="Box",r="text-fuchsia-500";break;case"variable":a="Cuboid",r="text-blue-400";break;case"property":a="Layers",r="text-blue-300";break;case"constructor-call":a="Hammer",r="text-green-500";break;case"method-call":a="Parentheses",r="text-gray-400"}n.appendChild(e.LX.makeIcon(a,{iconClass:"ml-1 mr-2",svgClass:"sm "+r}));const l=i.toLowerCase().indexOf(t.toLowerCase());var c=document.createElement("span");c.textContent=i.substring(0,l),n.appendChild(c);var d=document.createElement("span");d.textContent=i.substring(l,l+t.length),d.classList.add("word-highlight"),n.appendChild(d);var h=document.createElement("span");if(h.textContent=i.substring(l+t.length),n.appendChild(h),s.kind){const e=document.createElement("span");e.textContent=` (${s.kind})`,e.className="kind text-muted-foreground text-xs! ml-2",n.appendChild(e)}n.addEventListener("click",()=>{this._doAutocompleteWord()}),this.autocomplete.appendChild(n)}),this._isAutoCompleteActive=!0;const l=e=>{this.autocomplete?.contains(e.target)||this._doHideAutocomplete()};setTimeout(()=>document.addEventListener("click",l,{once:!0}),0),this.autocomplete._cleanup=()=>{document.removeEventListener("click",l)},this.autocomplete.classList.toggle("show",!0),this.autocomplete.classList.toggle("no-scrollbar",!(this.autocomplete.scrollHeight>this.autocomplete.offsetHeight));const c=this.cursorSet.getPrimary().head,d=c.col*this.charWidth+this.xPadding,h=(c.line+1)*this.lineHeight+this._cachedTabsHeight-this.codeScroller.scrollTop;this.autocomplete.style.left=d+"px",this.autocomplete.style.top=h+"px"}_doHideAutocomplete(){this.autocomplete&&this._isAutoCompleteActive&&(this.autocomplete.innerHTML="",this.autocomplete.classList.remove("show"),this._isAutoCompleteActive=!1,this.autocomplete._cleanup&&(this.autocomplete._cleanup(),delete this.autocomplete._cleanup))}_doAutocompleteWord(){const e=this._getSelectedAutoCompleteWord();if(!e)return;const t=this.cursorSet.getPrimary().head,{start:s,end:o}=this._getWordAtCursor(),n=t.line,i=this.cursorSet.getCursorPositions();if(o>s){const e=this.doc.delete(n,s,o-s);this.undoManager.record(e,i)}const a=this.doc.insert(n,s,e),r=e.split(/\r?\n/);1===r.length?this.cursorSet.set(n,s+e.length):this.cursorSet.set(n+r.length-1,r[r.length-1].length);const l=this.cursorSet.getCursorPositions();this.undoManager.record(a,l),this._rebuildLines(),this._afterCursorMove(),this._doHideAutocomplete()}_getSelectedAutoCompleteWord(){if(!this.autocomplete||!this._isAutoCompleteActive)return null;return this.autocomplete.childNodes[this._selectedAutocompleteIndex].insertText}_afterCursorMove(){this._renderCursors(),this._renderSelections(),this._resetBlinker(),this.resize(),this._scrollCursorIntoView(),this._updateBracketHighlight()}_getScopeAtCursor(){const e=this.cursorSet.getPrimary().head,t=e.line,s=e.col,o=this.doc.getLine(t),n=[...this.symbolTable.getScopeAtLine(t)];let i=0,a=!1,r="";for(;i<s&&i<o.length;){const e=o[i];if(a){if("\\"===e){i+=2;continue}e===r&&(a=!1),i++}else{if("/"===e&&"/"===o[i+1])break;if("/"!==e||"*"!==o[i+1])'"'!==e&&"'"!==e&&"`"!==e?("{"===e?n.push({name:"anonymous",type:"anonymous",line:t}):"}"===e&&n.length>1&&n.pop(),i++):(a=!0,r=e,i++);else{for(i+=2;i<s&&("*"!==o[i]||"/"!==o[i+1]);)i++;i+=2}}}return n}_updateBracketHighlight(){const e=this._getScopeAtCursor();let t=null;for(let s=e.length-1;s>=0;s--)if("global"!==e[s].type){t=e[s];break}const s=this._bracketOpenLine,o=this._bracketCloseLine;if(t){const s=t.line,o=e.length;let n=s;for(let e=s+1;e<this.doc.lineCount&&this.symbolTable.getScopeAtLine(e).length>=o;e++)n=e;this._bracketOpenLine=s,this._bracketCloseLine=n}else this._bracketOpenLine=-1,this._bracketCloseLine=-1;const n=new Set;s!==this._bracketOpenLine&&(n.add(s),n.add(this._bracketOpenLine)),o!==this._bracketCloseLine&&(n.add(o),n.add(this._bracketCloseLine));for(const e of n)e>=0&&e<this.doc.lineCount&&this._updateLine(e)}_onColorSwatchClick(t){const s=t.target.closest(".code-color");if(!s)return;t.stopPropagation(),t.preventDefault();const o=s.dataset.color,n=parseInt(s.dataset.line),i=parseInt(s.dataset.col);let a=o.length;this._colorPopover&&(this._colorPopover.destroy(),this._colorPopover=null);const r=new e.LX.ColorPicker(o,{colorModel:"Hex",onChange:e=>{const t=e.hex.replace(/^#/,""),o=a-1,r="#"+(o<=4?t.slice(0,o).padEnd(o,"0"):t.slice(0,Math.min(o,8)).padEnd(o,"0"));if(this.doc.getLine(n).slice(i,i+a)!==s.dataset.color)return;const l=this.doc.delete(n,i,a);this.undoManager.record(l,this.cursorSet.getCursorPositions());const c=this.doc.insert(n,i,r);this.undoManager.record(c,this.cursorSet.getCursorPositions()),this._updateLine(n),a=r.length,s.dataset.color=r,s.dataset.col=String(i),s.style.setProperty("--code-color",r)}});this._colorPopover=new e.LX.Popover(s,[r],{side:"bottom",align:"start",sideOffset:4})}_getSymbolParams(e){if(e<0||e>=this.doc.lineCount)return"()";const t=this.doc.getLine(e).match(/\(([^)]*)\)/);return t?`(${t[1].trim()})`:"()"}_findConstructorParams(e){const t=this.symbolTable.getScopeAtLine(e).length,s=Math.min(e+50,this.doc.lineCount);for(let o=e+1;o<s&&!(this.symbolTable.getScopeAtLine(o).length<t+1);o++){const e=this.doc.getLine(o).match(/\bconstructor\s*\(([^)]*)\)/);if(e)return`(${e[1].trim()})`}return null}_pickBestSymbol(e,t,s,o,n){if(1===e.length)return e[0];const i=this.symbolTable.getScopeAtLine(n),a=[...i].reverse().find(e=>"global"!==e.type)?.name??"global",r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=new RegExp(`\\bnew\\s+${r}\\b`).test(o),c=new RegExp(`\\b${r}\\s*[(<]`).test(o),d=new RegExp(`(?::\\s*|<\\s*|[,>]\\s*)${r}\\b`).test(o),h=new Set(["class","interface","type","enum","struct"]),u=new Set(["function","method"]),p=e.map(e=>{let t=0;if(e.scope===a&&(t+=5),"method"===s&&u.has(e.kind)&&(t+=3),"type"===s&&h.has(e.kind)&&(t+=3),l&&"constructor-call"===e.kind&&(t+=20),l&&"class"===e.kind&&(t+=3),c&&u.has(e.kind)&&(t+=3),d&&h.has(e.kind)&&(t+=2),e.line>=0&&e.line<this.doc.lineCount){const s=this.doc.getLine(e.line);/\bfunction\b/.test(s)&&u.has(e.kind)&&(t+=4),/\bclass\b/.test(s)&&"class"===e.kind&&(t+=4),/\binterface\b/.test(s)&&"interface"===e.kind&&(t+=4),/\btype\b/.test(s)&&"type"===e.kind&&(t+=4),/\benum\b/.test(s)&&"enum"===e.kind&&(t+=4),/\b(?:const|let|var)\b/.test(s)&&"variable"===e.kind&&(t+=3)}const o=Math.abs(e.line-n);return t+=Math.max(0,4-Math.floor(o/20)),{sym:e,score:t}});return p.sort((e,t)=>t.score-e.score),p[0].sym}_clearHoverPopup(){this._hoverTimer&&(clearTimeout(this._hoverTimer),this._hoverTimer=null),this._hoverPopup&&(this._hoverPopup.remove(),this._hoverPopup=null),this._hoverWord=""}_onCodeAreaMouseMove(t){if(0!==t.buttons)return void this._clearHoverPopup();const s=this.codeContainer.getBoundingClientRect(),o=t.clientX-s.left-this.xPadding,n=t.clientY-s.top,i=e.LX.clamp(Math.floor(n/this.lineHeight),0,this.doc.lineCount-1),a=e.LX.clamp(Math.round(o/this.charWidth),0,this.doc.getLine(i).length),[r,l]=this.doc.getWordAt(i,a);r&&r!==this._hoverWord&&(this._clearHoverPopup(),r.trim()&&(this._hoverWord=r,this._hoverTimer=setTimeout(()=>{this._hoverTimer=null;const t=i>0?this._lineStates[i-1]??_e.initialState():_e.initialState(),{tokens:s}=_e.tokenizeLine(this.doc.getLine(i),this.language,t);let o="text",n=0;for(const e of s){if(l>=n&&l<n+e.value.length){o=e.type;break}n+=e.value.length}if("comment"===o||"string"===o||"number"===o)return;const c=this.symbolTable.getSymbols(r),d={word:r,tokenType:o,symbols:c};let h;if(this.onHoverSymbol&&(h=this.onHoverSymbol(d,this)),null===h)return;const u=c.length>0;if(!h&&!u)return;const p=this._hoverPopup=e.LX.makeElement("div","code-hover-popup [&_span]:text-sm");if(h)"string"==typeof h?p.innerHTML=h:p.appendChild(h);else{const e=this._pickBestSymbol(c,r,o,this.doc.getLine(i),i);let t=e.kind,s=`<span class="font-semibold">${r}</span>`;if("constructor-call"===e.kind){const e=this.symbolTable.getSymbols(r).find(e=>"class"===e.kind);t="constructor",s=`${s}<span class="text-muted-foreground">${null!=e?this._findConstructorParams(e.line)??"()":"()"}</span>`}else if("function"===e.kind){s=`${s}<span class="text-muted-foreground">${this._getSymbolParams(e.line)}</span>`}else if(e.scope&&"global"!==e.scope&&"anonymous"!==e.scope)if("property"===e.kind||"method"===e.kind){const t=`<span class="text-muted-foreground">${e.scope}.</span>`;if("method"===e.kind){s=`${t}${s}<span class="text-muted-foreground">${this._getSymbolParams(e.line)}</span>`}else s=`${t}${s}`}else if("variable"===e.kind){const t=this.symbolTable.getScopeAtLine(e.line).find(t=>t.name===e.scope),o=new Set(["class","interface","struct"]);t&&o.has(t.type)&&(s=`<span class="text-muted-foreground">${e.scope}.</span>${s}`)}p.innerHTML=`<span class="text-info">(${t})</span> ${s}`}document.body.appendChild(p);const m=this._lineElements[i];if(m){const e=m.getBoundingClientRect(),t=e.left+this.xPadding+a*this.charWidth,s=e.bottom+4;p.style.left=Math.min(t,window.innerWidth-p.offsetWidth-8)+"px",p.style.top=s+"px"}},500)))}_scrollCursorIntoView(){const e=this.cursorSet.getPrimary().head,t=e.line*this.lineHeight,s=e.col*this.charWidth;t<this.codeScroller.scrollTop?this.codeScroller.scrollTop=t:t+this.lineHeight>this.codeScroller.scrollTop+this.codeScroller.clientHeight&&(this.codeScroller.scrollTop=t+this.lineHeight-this.codeScroller.clientHeight);const o=2*_t.SIZE;s<this.codeScroller.scrollLeft?this.codeScroller.scrollLeft=s:s+o>this.codeScroller.scrollLeft+this.codeScroller.clientWidth-this.xPadding&&(this.codeScroller.scrollLeft=s+o-this.codeScroller.clientWidth+this.xPadding)}_resetGutter(){const e=this._cachedTabsHeight||(this.tabs?.root.getBoundingClientRect().height??0),t=this._cachedStatusPanelHeight||(this.statusPanel?.root.getBoundingClientRect().height??0);this.lineGutter.style.height=`calc(100% - ${e+t}px)`}getMaxLineLength(){if(!this.currentTab)return 0;let e=0;for(let t=0;t<this.doc.lineCount;t++){const s=this.doc.getLine(t).length;s>e&&(e=s)}return e}resize(e=!1){if(!this.charWidth)return;this._cachedTabsHeight=this.tabs?.root.getBoundingClientRect().height??0,this._cachedStatusPanelHeight=this.statusPanel?.root.getBoundingClientRect().height??0;const t=this.getMaxLineLength(),s=this.currentTab?this.doc.lineCount:0,o=Math.floor((this.codeScroller.clientWidth-this.xPadding)/this.charWidth),n=Math.floor(this.codeScroller.clientHeight/this.lineHeight);let i=t!==this._lastMaxLineLength&&(t>=o||this._lastMaxLineLength>=o),a=s!==this._lastLineCount&&(s>=n||this._lastLineCount>=n);i=i||t<o&&this.hScrollbar?.visible,a=a||s<n&&this.vScrollbar?.visible,(e||i||a)&&(this._lastMaxLineLength=t,this._lastLineCount=s,(e||i)&&(this.codeSizer.style.minWidth=t*this.charWidth+this.xPadding+2*_t.SIZE+"px"),(e||a)&&(this.codeSizer.style.minHeight=s*this.lineHeight+2*_t.SIZE+"px"),this._resetGutter(),setTimeout(()=>this._resizeScrollBars(),10))}_resizeScrollBars(){if(!this.vScrollbar)return;const e=this._cachedTabsHeight,t=this._cachedStatusPanelHeight,s=this.codeScroller.scrollHeight;this.vScrollbar.setThumbRatio(s>0?this.codeScroller.clientHeight/s:1),this.vScrollbar.root.style.top=e+"px",this.vScrollbar.root.style.height=`calc(100% - ${e+t}px)`;const o=this.codeScroller.scrollWidth;this.hScrollbar.setThumbRatio(o>0?this.codeScroller.clientWidth/o:1),this.hScrollbar.root.style.bottom=t+"px",this.hScrollbar.root.style.width=`calc(100% - ${this.xPadding+(this.vScrollbar.visible?_t.SIZE:0)}px)`}_syncScrollBars(){this.vScrollbar&&(this.vScrollbar.syncToScroll(this.codeScroller.scrollTop,this.codeScroller.scrollHeight-this.codeScroller.clientHeight),this.hScrollbar.syncToScroll(this.codeScroller.scrollLeft,this.codeScroller.scrollWidth-this.codeScroller.clientWidth))}_doLoadFromFile(){const t=e.LX.makeElement("input","","",document.body);t.type="file",t.click(),t.addEventListener("change",e=>{const s=e.target;s.files&&s.files[0]&&this.loadFile(s.files[0]),t.remove()})}async _setFontSize(t,s=!0){this.fontSize=t;const o=document.querySelector(":root");o.style.setProperty("--code-editor-font-size",`${this.fontSize}px`),window.localStorage.setItem("lexcodeeditor-font-size",`${this.fontSize}`),await this._measureChar();const n=this.fontSize+6;o.style.setProperty("--code-editor-row-height",`${n}px`),this.lineHeight=n,s&&(this._rebuildLines(),this._afterCursorMove()),e.LX.emitSignal("@font-size",this.fontSize)}_applyFontSizeOffset(t=0){const s=e.LX.clamp(this.fontSize+t,wt.CODE_MIN_FONT_SIZE,wt.CODE_MAX_FONT_SIZE);this._setFontSize(s)}_increaseFontSize(){this._applyFontSizeOffset(1)}_decreaseFontSize(){this._applyFontSizeOffset(-1)}}e.LX.CodeEditor=wt,e.LX.init=async function(t={}){if(this.ready)return this.mainArea;await e.LX.loadScriptSync("https://unpkg.com/lucide@latest"),console.log(`LexGUI v${this.version}`);const s=e.LX.makeElement("div",e.LX.mergeClass("lexcontainer",t.rootClass));function o(e){e.preventDefault(),e.stopPropagation()}s.id="lexroot",s.tabIndex=-1,this.modal=e.LX.makeElement("div","inset-0 hidden-opacity bg-black/50 fixed z-100 transition-opacity duration-100 ease-in"),this.modal.id="modal",this.modal.toggle=function(e){this.classList.toggle("hidden-opacity",e)},this.modal.addEventListener("wheel",o,{passive:!1}),this.modal.addEventListener("touchmove",o,{passive:!1}),this.root=s,this.container=document.body,t.container&&(this.container=t.container.constructor===String?document.getElementById(t.container):t.container),this.layoutMode=t.layoutMode??"app",document.documentElement.setAttribute("data-layout",this.layoutMode),this.layoutMode,this.spacingMode=t.spacingMode??"default",document.documentElement.setAttribute("data-spacing",this.spacingMode),this.container.appendChild(this.modal),t.skipRoot?this.root=document.body:this.container.appendChild(s);{const e=document.createElement("section");e.className="notifications",this.notifications=document.createElement("ol"),this.notifications.className="fixed flex flex-col-reverse m-0 p-0 gap-1 z-1000",this.notifications.iWidth=0,e.appendChild(this.notifications),document.body.appendChild(e),this.notifications.addEventListener("mouseenter",()=>{this.notifications.classList.add("list")}),this.notifications.addEventListener("mouseleave",()=>{this.notifications.classList.remove("list")})}s.addEventListener("dragover",function(e){e.preventDefault()},!1),document.addEventListener("contextmenu",function(e){e.preventDefault()},!1),this.DEFAULT_NAME_WIDTH="30%",this.DEFAULT_SPLITBAR_SIZE=4,this.OPEN_CONTEXTMENU_ENTRY="click",this.componentResizeObserver=new ResizeObserver(e=>{for(const t of e){const e=t.target?.jsInstance;e&&e.onResize&&e.onResize(t.contentRect)}}),this.ready=!0,this.menubars=[],this.sidebars=[],this.commandbar=this._createCommandbar(this.container),t.skipRoot||t.skipDefaultArea||(this.mainArea=new se({id:t.id??"mainarea"})),this._onChangeSystemTheme=function(t){localStorage.getItem("lxColorScheme")||e.LX.setMode(t.matches?"dark":"light",!1)},this._mqlPrefersDarkScheme=window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const n=localStorage.getItem("lxColorScheme");return n?e.LX.setMode(n):this._mqlPrefersDarkScheme&&(t.autoTheme??1)&&(window.matchMedia("(prefers-color-scheme: light)").matches&&e.LX.setMode("light",!1),this._mqlPrefersDarkScheme.addEventListener("change",this._onChangeSystemTheme)),this.mainArea},e.LX.setSpacingMode=function(e){this.spacingMode=e,document.documentElement.setAttribute("data-spacing",this.spacingMode)},e.LX.setLayoutMode=function(e){this.layoutMode=e,document.documentElement.setAttribute("data-layout",this.layoutMode)},e.LX.addSignal=function(t,s,o){s[t]=o,e.LX.signals[t]||(e.LX.signals[t]=[]),e.LX.signals[t].indexOf(s)>-1||e.LX.signals[t].push(s)},e.LX.removeSignal=function(t,s){const o=e.LX.signals[t];if(o)if(s){for(let e=0;e<o.length;++e)if(o[e]==s){o.splice(e,1);break}}else delete e.LX.signals[t]},e.LX.emitSignal=function(t,s,o={}){const n=e.LX.signals[t];if(!n)return;const i=o.target;if(i)i[t]&&i[t].call(i,s);else for(let e of n)if(e instanceof a)e.set(s,o.skipCallback??!0);else if(e.constructor===Function){e(null,s)}else{const o=e[t];console.assert(o,`No callback registered with _${t}_ signal`),o.bind(e)(s)}},e.LX._createCommandbar=function(t){let s=document.createElement("dialog");s.className="commandbar absolute border-color rounded-lg m-0",s.tabIndex=-1,t.appendChild(s);let o=[],n=null;s.addEventListener("keydown",function(e){if(e.stopPropagation(),e.stopImmediatePropagation(),n=n??-1,"Escape"==e.key)s.close(),d(!0);else if("Enter"==e.key){const e=o[n];e&&(null!=e.item.checked&&(e.item.checked=!e.item.checked),s.close(),e.callback.call(window,e.item.name,e.item.checked))}else if("ArrowDown"==e.key&&n<o.length-1){n++,s.querySelectorAll(".hovered").forEach(e=>e.classList.remove("hovered"));const e=o[n];e.classList.add("hovered");let t=e.offsetHeight*(n+1)-l.offsetHeight;t>0&&l.scrollTo({top:t,behavior:"smooth"})}else if("ArrowUp"==e.key&&n>0){n--,s.querySelectorAll(".hovered").forEach(e=>e.classList.remove("hovered"));o[n].classList.add("hovered")}}),s.addEventListener("focusout",function(t){t.relatedTarget!=t.currentTarget&&(t.stopPropagation(),t.stopImmediatePropagation(),e.LX.setCommandbarState(!1),d(!0))}),t.addEventListener("keydown",t=>{if(" "==t.key&&t.ctrlKey)t.stopImmediatePropagation(),t.stopPropagation(),e.LX.setCommandbarState(!0);else for(let s of e.LX.extensions){if(!e.LX[s]||!e.LX[s].prototype.onKeyPressed)continue;const o=e.LX.CodeEditor.getInstances();for(let e of o)e.onKeyPressed(t)}});const i=e.LX.makeContainer(["100%","auto"],"flex flex-row"),a=new h(null,"",e=>{s._addElements(e.toLowerCase())},{width:"100%",icon:"Search",trigger:"input",placeholder:"Search..."});i.appendChild(a.root);const r=new se({width:"100%",skipAppend:!0,className:"cb-tabs"});{const e=(e,t)=>{};r.addTabs({parentClass:"p-2"}).add("All",document.createElement("div"),{selected:!0,onSelect:e})}const l=e.LX.makeElement("div","searchitembox overflow-y-scroll basis-full scrollbar-hidden");let c=null;const d=e=>{l.innerHTML="",o.length=0,n=null,e&&a.set("",!0)},u=function(t,s){if(!s?.length)return!1;return e.LX.stripTags(t).toLowerCase().includes(s.toLowerCase())},p=(t,i,a)=>{if(!t||t.constructor!=Object)return;t.callback&&((t,i,a,r)=>{if(!t.length)return;c&&c.classList.remove("last");let h=document.createElement("div");if(h.className="searchitem last",void 0!==r?.checked){const s=r.checked?e.LX.makeIcon("Check").innerHTML:"";h.innerHTML=s+(a+t)}else h.innerHTML=a+t;h.callback=i,h.item=r,h.addEventListener("click",s=>{null!=r.checked&&(r.checked=!r.checked),i.call(window,t,r.checked),e.LX.setCommandbarState(!1),d(!0)}),h.addEventListener("mouseenter",function(e){s.querySelectorAll(".hovered").forEach(e=>e.classList.remove("hovered")),h.classList.add("hovered"),n=o.indexOf(h)}),h.addEventListener("mouseleave",function(e){h.classList.remove("hovered")}),o.push(h),l.appendChild(h),c=h})(t.name,t.callback,i,t);const r=t.submenu??t[t.name];if(!r)return;const h=e.LX.makeIcon("ChevronRight",{svgClass:"sm text-muted-foreground separator"});i+=t.name+h.innerHTML;for(let e of r)p(e,i)};return s._addElements=t=>{d();let s=function(t){const s=[];for(let o of e.LX.menubars)for(let e of o.items)u(e.name,t)&&s.push(e);for(let o of e.LX.sidebars)for(let e of o.items)u(e.name,t)&&s.push(e);for(let o of e.LX.extraCommandbarEntries)u(o.name,t)&&s.push(o);if(e.LX.has("CodeEditor")){const o=e.LX.CodeEditor.getInstances();if(!o.length||!o[0].area.root.offsetHeight)return s;for(let n of e.LX.Tokenizer.getRegisteredLanguages()){const i=_e.getLanguage(n);if(!i)continue;const a="Language: "+n,r=i?.icon,l=(e=>{const t=e.constructor===String?e:Object.values(e)[0];return e?t.split(" "):[]})(r);let c=e.LX.makeIcon(l[0],{svgClass:`${l.slice(1).join(" ")}`}).innerHTML;c+=a+" <span class='lang-ext'>("+i.extensions+")</span>",u(a,t)&&s.push({name:c,callback:()=>{for(let e of o)e.setLanguage(n)}})}}return s}(t);function o(e,t){return e.startsWith(t)?0:e.includes(t)?1:2}s=s.sort((s,n)=>{const i=e.LX.stripTags(s.name),a=e.LX.stripTags(n.name);return o(i,t)-o(a,t)||i.localeCompare(a)}),s=s.slice(0,48);for(let e of s)p(e,"")},s.appendChild(i),s.appendChild(r.root),s.appendChild(l),s},e.LX._registerIconsAndColors=function(t="./"){e.LX.requestJSON(t+"registry/colors.json",t=>{for(const s in t){const o=t[s];Array.isArray(o)&&o.forEach(t=>{const o=`${s}-${t.scale}`,n=`<span class="flex bg-${o} w-3 h-3 rounded-full mr-2"></span>${o}`;e.LX.registerCommandbarEntry(n,()=>{navigator.clipboard.writeText(o),e.LX.toast(`${e.LX.makeIcon("CircleCheck").innerHTML} Copied ${o} to clipboard.`,null,{position:"top-center",timeout:3e3})})})}});const s=window.lucide,o={...e.LX.ICONS,...s.icons};for(const t in o){const s="regular",o=`${e.LX.makeIcon(t,{svgClass:"mr-2 pointer-events-none",variant:s}).innerHTML}${t}`;e.LX.registerCommandbarEntry(o,()=>{navigator.clipboard.writeText(t),e.LX.toast(`${e.LX.makeIcon("CircleCheck").innerHTML} Copied ${t} to clipboard.`,null,{position:"top-center",timeout:3e3})})}},e.LX.setCommandbarState=function(t,s=!0){const o=this.commandbar;e.LX.modal.toggle(!t),t?(o.style.top=`calc(15% + ${document.scrollingElement?.scrollTop??0}px)`,o.show(),o.querySelector("input").focus(),s&&o._addElements(void 0),e.LX.modal.toggle(!1)):o.close()},e.LX.REGISTER_COMPONENT=function(t,s={}){let o=e.LX.guidGenerator();ee.prototype["add"+t]=function(i,r,l){const c=Array.from(arguments).slice(3);let d=new a(e.ComponentType.CUSTOM,i,null,s);this._attachComponent(d),d.customName=t,d.customIdx=o,d.onGetValue=()=>r,d.onSetValue=(e,t,s)=>{r=e,g(),h.querySelector(".lexcustomitems").toggleAttribute("hidden",!1),t||d._trigger(new n(i,r,s),l)},d.onResize=()=>{const e=d.root.domName?.style.width??"0px";u.style.width=`calc( 100% - ${e})`};const h=d.root;let u,p,m=s.default??{};const g=()=>{u&&u.remove(),p&&p.remove(),u=document.createElement("div"),u.className="lexcustomcontainer w-full",h.appendChild(u),h.dataset.opened=!1;const o=e.LX.makeIcon(s.icon??"Box"),a=e.LX.makeIcon("Menu");let f=t+(r?"":" [empty]"),L=this.addButton(null,f,(s,o)=>{r?(h.querySelector(".lexcustomitems").toggleAttribute("hidden"),h.dataset.opened=!h.querySelector(".lexcustomitems").hasAttribute("hidden")):e.LX.addContextMenu(null,o,e=>{e.add("New "+t,()=>{r={},g(),h.querySelector(".lexcustomitems").toggleAttribute("hidden",!1),h.dataset.opened=!h.querySelector(".lexcustomitems").hasAttribute("hidden")})})},{buttonClass:"outline custom"});const b=L.root.querySelector("button");if(b.prepend(o),b.appendChild(a),u.appendChild(L.root),r&&a.addEventListener("click",t=>{t.stopImmediatePropagation(),t.stopPropagation(),e.LX.addContextMenu(null,t,e=>{e.add("Clear",()=>{r=null,g()})})}),p=document.createElement("div"),p.className="lexcustomitems",p.toggleAttribute("hidden",!0),h.appendChild(p),r){this.queue(p);const e=(e,t,o)=>{const a=s[`_set_${e}`];a?a.call(r,t):r[e]=t,d._trigger(new n(i,r,o),l)};for(let t in m){let o=null;const n=s[`_get_${t}`];if(o=n?r[t]?n.call(r):n.call(m):r[t]??m[t],o)switch(o.constructor){case String:"#"===o[0]?this.addColor(t,o,e.bind(this,t)):this.addText(t,o,e.bind(this,t));break;case Number:this.addNumber(t,o,e.bind(this,t));break;case Boolean:this.addCheckbox(t,o,e.bind(this,t));break;case Array:o.length>4?this.addArray(t,o,e.bind(this,t)):this._addVector(o.length,t,o,e.bind(this,t));break;default:console.warn(`Unsupported property type: ${o.constructor.name}`)}}s.onCreate&&s.onCreate.call(this,this,...c),this.clearQueue()}};g()}},e.AlertDialog=de,e.Area=se,e.AreaOverlayButtons=te,e.ArrayInput=p,e.Avatar=re,e.BaseComponent=a,e.Branch=Q,e.Button=r,e.Checkbox=g,e.ColorInput=y,e.ComboButtons=v,e.ContextMenu=he,e.Counter=C,e.Curve=_,e.DatePicker=k,e.Dial=M,e.Dialog=ce,e.DropdownMenu=ue,e.FileInput=T,e.Footer=me,e.Form=A,e.IEvent=n,e.Layers=X,e.List=z,e.Map2D=I,e.NodeTree=R,e.NumberInput=d,e.OTPInput=O,e.Pad=H,e.Pagination=q,e.Panel=ee,e.PocketDialog=ge,e.Popover=b,e.Progress=B,e.RadioGroup=$,e.RangeInput=V,e.Rate=F,e.Select=u,e.Sheet=fe,e.Sidebar=Le,e.SizeInput=W,e.Skeleton=be,e.Spinner=le,e.TabSections=j,e.Table=U,e.Tabs=c,e.Tags=G,e.TextArea=Z,e.TextInput=h,e.Title=Y,e.Toggle=K,e.Tour=ye,e.Tree=D,e.Vector=J,e.addDropdownMenu=pe,e.vec2=P});
|