From 9a82b14dd50b0781da51e8092d5a06761562a0b6 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Wed, 30 Oct 2024 22:48:11 +0100 Subject: [PATCH] fixed prompt examples --- docs/youtube/lollms_context_short.md | 168 +++++++++ web/dist/assets/index-BkP4Zio6.css | 8 + .../{index-hg90DEcF.js => index-C6H27J5x.js} | 322 +++++++++--------- web/dist/assets/index-DlO61W0c.css | 8 - web/dist/index.html | 4 +- web/src/views/DiscussionsView.vue | 209 ++++++------ zoos/personalities_zoo | 2 +- 7 files changed, 452 insertions(+), 269 deletions(-) create mode 100644 docs/youtube/lollms_context_short.md create mode 100644 web/dist/assets/index-BkP4Zio6.css rename web/dist/assets/{index-hg90DEcF.js => index-C6H27J5x.js} (97%) delete mode 100644 web/dist/assets/index-DlO61W0c.css diff --git a/docs/youtube/lollms_context_short.md b/docs/youtube/lollms_context_short.md new file mode 100644 index 00000000..7d03179a --- /dev/null +++ b/docs/youtube/lollms_context_short.md @@ -0,0 +1,168 @@ +# lollms: The Ever-Evolving AI Ecosystem That Rules Them All + +## The Visionary Behind lollms + +lollms, short for "Lord of Large Language & Multimodal Systems," is the brainchild of ParisNeo, a visionary expert in AI and robotics. ParisNeo's journey in coding began at the tender age of 11, igniting a lifelong passion that has never waned. As the creator of lollms, ParisNeo's dream was to develop an accessible, free-of-charge tool that could "rule them all" - a sentiment that echoes throughout the project's philosophy. Today ParisNeo, holds two Engineering degrees and a Ph.D. His passion lies in exploring the applications of Artificial Intelligence across various fields. ParisNeo's work focuses on practical implementations of AI technology, aiming to solve real-world problems and advance the field of machine learning and natural language processing. As a computer geek with a strong academic background, ParisNeo is very active in the open-source community, contributing significantly to AI projects and tools. His commitment to open-source development reflects a belief in collaborative innovation and the democratization of AI technology. Through these efforts, ParisNeo continues to make impactful contributions to the AI community, fostering the growth and accessibility of cutting-edge AI solutions. + +## The Evolution of lollms: From Google chrome Plugin to Powerhouse + +The journey of lollms is a testament to rapid innovation and adaptability in the fast-paced world of AI development: + +### Early Beginnings: The chrome Plugin named "chatgpt personality selector" +- ParisNeo's foray into AI tools began with a chrome plugin called chatgpt personality selector, it adds buttons to the Chatgpt interface to condition the AI to be any personality out of the list that he developed. +- Developed just months after ChatGPT's release +- Demonstrated ParisNeo's quick recognition of AI's potential and his ability to build upon emerging technologies + +### The Standalone Application: GPT4All WebUI as a ui to interact with GPT4All model + +GPT4all is a model not built by ParisNeo. it is built by a company named Nomic AI. But ParisNeo built a ui that ccan interface this model. + +- 1st of april 2023, was the date ParisNeo moved from his chrome plugin, to a standalone app. +- ParisNeo wanted to build a webui for a local AI instead of continuing to hijack the chatgpt page. +- Inspired by the release of LLaMA and early versions of GPT4All (a model built by Nomic AI that was one of the first models trained on llama architecture) +- ParisNeo built a web user interface named: GPT4AL Webui which is a webui for the GPT4All model (not to be confused with their own GPT4All application built using QT) + +### The Birth of lollms +- Parisneo felt the need to broaden the content of his tool and did not want people to get confused between his tool and the GPT4All tool, so he split from using GPT4All and instead changed the name to something way more ambitious and continued building it mainly alone. +- At the beginning, he got some help in the UI development from few experts but then he went really solo mode +- As the project grew in scope and capability, a new name was needed +- Renamed to "lollms - Lord of Large Language Models" +- The new name reflected the tool's expanding compatibility with various AI systems +- One tool to rule them all. +- Emphasized the project's ambition to be a comprehensive solution for language models + +### Embracing Multimodality +- With the emergence of multimodal AI systems, lollms evolved further +- The name was expanded to "Lord of Large Language and Multimodal Systems" +- This change signified lollms' growth beyond text-based AI, incorporating image, speech, and other modalities + +This evolution highlights lollms' adaptability, vision, rapid development, and forward-thinking approach, positioning it uniquely in the AI landscape. + +## The Expansive lollms Ecosystem + +lollms is not just an AI system; it's a comprehensive ecosystem that pushes the boundaries of what's possible in artificial intelligence: + +### 1. Core Features +- Released under the Apache 2.0 license, ensuring versatility in various applications +- Offers bindings to connect with multiple AI systems +- Boasts a robust personality system with over 500 distinct personas + +### 2. Service Suite +lollms provides a wide array of services, including: +- Text-to-text +- Text-to-image +- Image-to-text +- Image-to-image +- Speech-to-text +- Text-to-speech +- Text-to-music +- Text-to-video + +### 3. The lollms Zoo + +#### Application Zoo +- Features hundreds of applications +- Diverse range of tools and utilities built on the lollms framework +- Enables users to leverage AI capabilities for various specific tasks + +#### Models Zoo +- Houses thousands of AI models +- Covers a wide spectrum of AI capabilities and specializations +- Each binding (connection to different AI systems) has its own set of compatible models + +#### Personalities Zoo +- Over 500 distinct AI personas +- Allows for highly customizable AI interactions +- Enables lollms to adapt to different contexts and user needs + +## Daily Innovation and Ethical Development + +What sets lollms apart is not just its impressive capabilities, but the passion and ethical considerations driving its development: + +### Rapid Development Cycle +- New version released almost every day +- Continuous improvements and expansions to the ecosystem +- Driven by ParisNeo's unwavering passion for AI and coding + +### Ethical Considerations and Community Focus +- All developments are shared openly with the community +- Motivated by a genuine desire to help people through technology +- Promotes transparency and collaboration in AI development + +## How to Pronounce "lollms" + +ParisNeo envisioned a pronunciation that's both easy and distinctive. Here are two approved ways to pronounce lollms: + +### Option 1: The Smooth Blend +Pronunciation: "lahms" (rhymes with "palms") + +### Option 2: The Fluid Fusion +Pronunciation: "lolmz" (rhymes with "holmes") + +## The Impact of Daily Development + +The daily release cycle of lollms has significant implications: +- Rapid adaptation to new AI breakthroughs +- Quick integration of community feedback +- Constant refinement of existing features +- Regular introduction of new capabilities + +## Community Engagement and Ethical AI + +ParisNeo's commitment to sharing lollms with the community goes beyond just open-sourcing the code: +- Encourages collaborative improvement of the ecosystem +- Facilitates discussions on ethical AI development +- Provides a platform for exploring AI's potential to benefit society +- Demonstrates how passion-driven projects can have a significant impact in the tech world + +## Security + +Somehow, huntr.com, a bounty hunting platform did spot lollms and they added it to their catalogue of open source apps that they deemed worthy of being protected. So they listed lollms on their platform to increase the platform security. +Parisneo did not ask for this, but he had to accept to do the fixes as he wants his tool to be secure. + +In huntr.com, pentesters and white hackers get payed to find vulenerabilities in the systems that are listed on their website. +When a vulenerability is discovered, ParisNeo is notified by the platform and he has to fix the vulenerabilities before they get released. This leads to a better more secure tool. +Listing lollms on huntr means more work for ParisNeo, but he did do the job and fixed all reported vulenerabilities. + +Also, the project has a dependabot that keeps checking for vulenerabilities in packages he is using and automatically upgrade to the more secure versions of the updates. + +Finally, ParisNeo buit a personality and an app for detecting vulenerabilities in his own code and fix them before they're even released. + +## Lollms + +Lollms is not built by a company. It is a work of love, built by ParisNeo as a way to give back to the community and to get satisfaction from being useful. As he came to a conclusion that hapiness doesn't come from wealth but from the feeling of being useful and embracing his own passions. + + +## Extra information + +ParisNeo also loves space. He used to dream of becoming an astronaut. When he is not coding, he tryes to learn as much as he can about space, astrophisics, orbital mecanics, spacecfraft building, engines etc. He likes playing Kerbal space Program. Although he has reduced this in the advantage of lollms. + +## The Future of lollms: A Dream Realized + +As lollms continues to evolve and expand its ecosystem, it raises intriguing questions about the future of AI: +- How will the vast array of applications in the lollms zoo shape various industries? +- Can the thousands of models in the models zoo lead to breakthroughs in AI research and application? +- Will the personalities zoo redefine how we interact with AI in our daily lives? +- Does this level of AI versatility and power lead us towards a utopian future or potential dystopian concerns? +- How will the rapid development cycle of lollms influence the broader AI industry? +- Can this model of passionate, ethical, and community-focused development become a standard in AI research? +- What new applications and use cases will emerge from the constantly expanding lollms ecosystem? + +lollms stands as a testament to what can be achieved when cutting-edge technology is driven by passion, ethical considerations, and a genuine desire to help people. It embodies the idea that AI development can be both innovative and responsible, pushing the boundaries of what's possible while remaining grounded in community values. + +For podcasters, tech enthusiasts, researchers, and anyone interested in the future of AI, lollms offers a fascinating glimpse into a world where artificial intelligence is not just powerful, but also ethically developed and community-driven. As it continues to evolve daily, lollms remains true to its slogan: "One tool to rule them all" - not through dominance, but through innovation, collaboration, and a steadfast commitment to ethical AI development. + +Whether lollms leads us to utopia or raises important questions about potential dystopian futures, one thing is certain: it's a name we'll be hearing - and pronouncing - a lot more in the years to come. It represents not just the culmination of a childhood dream, but a powerful vision for the future of AI that has the potential to shape our world in profound and exciting ways. + + +# Lollms age +Lollms has now one year and a half of existance. From humble beggingings to the tool that rules them all. + +# Current development status + +ParisNeo is coding lollms in his free time, nights, weekends, holidays. Building stuff he likes. Just taking it as a hobby. + +# Problems that needs to be solved + +Lollms is built by a single person. Although some persons did contribute, it is mainly a one man show, which has its own limits as PerisNeo is not getting enough help. +The install of lollms is still challenging as it is packing loads of uncompatible libraries and tools, and making them all work together is a huge work that ParisNeo is doing. But when a library upgrades, many times dependancies break, so ParisNeo has to spend a lot of time to fix all that. Which is exhausting sometimes. \ No newline at end of file diff --git a/web/dist/assets/index-BkP4Zio6.css b/web/dist/assets/index-BkP4Zio6.css new file mode 100644 index 00000000..a6707b25 --- /dev/null +++ b/web/dist/assets/index-BkP4Zio6.css @@ -0,0 +1,8 @@ +@import"https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap";.topbar-container[data-v-13593b99]{position:fixed;top:0;left:0;right:0;z-index:1000}.topbar[data-v-13593b99]{background-color:#ffffff1a;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);transition:transform .3s ease-in-out;display:flex;justify-content:center}.topbar-hidden[data-v-13593b99]{transform:translateY(-100%)}.topbar-content[data-v-13593b99]{display:flex;justify-content:space-between;align-items:center;max-width:1200px;width:100%}.pin-button[data-v-13593b99]{background-color:transparent;border:none;cursor:pointer;padding:5px;display:flex;align-items:center;justify-content:center}.pin-button svg[data-v-13593b99]{width:24px;height:24px;transition:transform .3s ease}.pin-button:hover svg[data-v-13593b99]{transform:scale(1.2)}.placeholder[data-v-13593b99]{height:10px}.toolbar-button[data-v-13593b99]{cursor:pointer;border-style:none;background-color:transparent;padding:.5rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.toolbar-button[data-v-13593b99]:hover{--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.topbar-container[data-v-13593b99]{position:relative;width:100%}.hover-zone[data-v-13593b99]{opacity:0}.error[data-v-13593b99]{color:red;margin-left:1rem}.toastItem-enter-active[data-v-46f379e5],.toastItem-leave-active[data-v-46f379e5]{transition:all .5s ease}.toastItem-enter-from[data-v-46f379e5],.toastItem-leave-to[data-v-46f379e5]{opacity:0;transform:translate(-30px)}.hljs-comment,.hljs-quote{color:#7285b7}.hljs-variable,.hljs-template-variable,.hljs-tag,.hljs-name,.hljs-selector-id,.hljs-selector-class,.hljs-regexp,.hljs-deletion{color:#ff9da4}.hljs-number,.hljs-built_in,.hljs-literal,.hljs-type,.hljs-params,.hljs-meta,.hljs-link{color:#ffc58f}.hljs-attribute{color:#ffeead}.hljs-string,.hljs-symbol,.hljs-bullet,.hljs-addition{color:#d1f1a9}.hljs-title,.hljs-section{color:#bbdaff}.hljs-keyword,.hljs-selector-tag{color:#ebbbff}.hljs{background:#002451;color:#fff}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + Theme: Tokyo-night-Dark + origin: https://github.com/enkia/tokyo-night-vscode-theme + Description: Original highlight.js style + Author: (c) Henri Vandersleyen + License: see project LICENSE + Touched: 2022 +*/.hljs-meta,.hljs-comment{color:#565f89}.hljs-tag,.hljs-doctag,.hljs-selector-id,.hljs-selector-class,.hljs-regexp,.hljs-template-tag,.hljs-selector-pseudo,.hljs-selector-attr,.hljs-variable.language_,.hljs-deletion{color:#f7768e}.hljs-variable,.hljs-template-variable,.hljs-number,.hljs-literal,.hljs-type,.hljs-params,.hljs-link{color:#ff9e64}.hljs-built_in,.hljs-attribute{color:#e0af68}.hljs-selector-tag{color:#2ac3de}.hljs-keyword,.hljs-title.function_,.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-subst,.hljs-property{color:#7dcfff}.hljs-selector-tag{color:#73daca}.hljs-quote,.hljs-string,.hljs-symbol,.hljs-bullet,.hljs-addition{color:#9ece6a}.hljs-code,.hljs-formula,.hljs-section{color:#7aa2f7}.hljs-name,.hljs-keyword,.hljs-operator,.hljs-char.escape_,.hljs-attr{color:#bb9af7}.hljs-punctuation{color:#c0caf5}.hljs{background:#1a1b26;color:#9aa5ce}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.code-container{display:flex;margin:0}.line-numbers{flex-shrink:0;padding-right:5px;color:#999;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;margin:0}.code-content{flex-grow:1;margin:0;outline:none}.overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1000}.hovered{transform:scale(1.05);transition:transform .2s ease-in-out}.active{transform:scale(1.1);transition:transform .2s ease-in-out}.dropdown-shadow[data-v-6c3ea3a5]{box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}:root.dark .dropdown-shadow[data-v-6c3ea3a5]{box-shadow:0 4px 6px -1px #ffffff1a,0 2px 4px -1px #ffffff0f}select{width:200px}body{background-color:#fafafa;font-family:sans-serif}.container{margin:4px auto;width:800px}.settings{position:fixed;top:0;right:0;width:500px;background-color:#fff;z-index:1000;overflow-y:auto;height:100%}.slider-container{margin-top:20px}.slider-value{display:inline-block;margin-left:10px;color:#6b7280;font-size:14px}.small-button{padding:.5rem .75rem;font-size:.875rem}.active-tab{font-weight:700}.help-view[data-v-8c1798f3]{min-height:100vh}.big-card[data-v-8c1798f3]{margin-left:auto;margin-right:auto;border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:2rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.big-card[data-v-8c1798f3]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.help-sections-container[data-v-8c1798f3]{max-height:70vh;overflow-y:auto;padding-right:1rem}.help-section[data-v-8c1798f3]{transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.help-content[data-v-8c1798f3]{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.help-content[data-v-8c1798f3]:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.help-sections-container[data-v-8c1798f3]::-webkit-scrollbar{width:12px}.help-sections-container[data-v-8c1798f3]::-webkit-scrollbar-track{background:#f1f1f1;border-radius:10px}.help-sections-container[data-v-8c1798f3]::-webkit-scrollbar-thumb{background:#888;border-radius:10px;border:3px solid #f1f1f1}.help-sections-container[data-v-8c1798f3]::-webkit-scrollbar-thumb:hover{background:#555}.help-sections-container[data-v-8c1798f3]{scrollbar-width:thin;scrollbar-color:#888 #f1f1f1}.menu-container{position:relative;display:inline-block}.menu-button{background-color:#007bff;color:#fff;padding:10px;border:none;cursor:pointer;border-radius:4px}.menu-list{position:absolute;background-color:#fff;color:#000;border:1px solid #ccc;border-radius:4px;box-shadow:0 2px 4px #0003;padding:10px;max-width:500px;z-index:1000}.slide-enter-active,.slide-leave-active{transition:transform .2s}.slide-enter-to,.slide-leave-from{transform:translateY(-10px)}.menu-ul{list-style:none;padding:0;margin:0}.menu-li{cursor:pointer;display:flex;align-items:center;padding:5px}.menu-icon{width:20px;height:20px;margin-right:8px}.menu-command{min-width:200px;text-align:left}.fade-enter-active[data-v-f43216be],.fade-leave-active[data-v-f43216be]{transition:opacity .3s}.fade-enter[data-v-f43216be],.fade-leave-to[data-v-f43216be]{opacity:0}.heartbeat-text[data-v-f29485cf]{font-size:24px;animation:pulsate-f29485cf 1.5s infinite}@keyframes pulsate-f29485cf{0%{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}to{transform:scale(1);opacity:1}}.list-move[data-v-f29485cf],.list-enter-active[data-v-f29485cf],.list-leave-active[data-v-f29485cf]{transition:all .5s ease}.list-enter-from[data-v-f29485cf]{transform:translatey(-30px)}.list-leave-to[data-v-f29485cf]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-f29485cf]{position:absolute}.bounce-enter-active[data-v-f29485cf]{animation:bounce-in-f29485cf .5s}.bounce-leave-active[data-v-f29485cf]{animation:bounce-in-f29485cf .5s reverse}@keyframes bounce-in-f29485cf{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.bg-primary-light[data-v-f29485cf]{background-color:#0ff}.hover[data-v-f29485cf]:bg-primary-light:hover{background-color:#7fffd4}.font-bold[data-v-f29485cf]{font-weight:700}.control-buttons[data-v-5bb76742]{position:absolute;top:0;right:0;height:100%;display:flex;align-items:center;transform:translate(100%);transition:transform .3s}.group:hover .control-buttons[data-v-5bb76742]{transform:translate(0)}.control-buttons-inner[data-v-5bb76742]{display:flex;gap:10px;align-items:center;background-color:#fff;padding:8px;border-radius:0 0 0 8px;box-shadow:0 2px 8px #0000001a}.json-tree-view[data-v-40406ec6]{margin-left:16px}.json-item[data-v-40406ec6]{margin-bottom:4px}.json-key[data-v-40406ec6]{cursor:pointer;display:flex;align-items:center}.toggle-icon[data-v-40406ec6]{margin-right:4px;width:12px}.key[data-v-40406ec6]{font-weight:700;margin-right:4px}.value[data-v-40406ec6]{margin-left:4px}.string[data-v-40406ec6]{color:#0b7285}.number[data-v-40406ec6]{color:#d9480f}.boolean[data-v-40406ec6]{color:#5c940d}.null[data-v-40406ec6]{color:#868e96}.json-nested[data-v-40406ec6]{margin-left:16px;border-left:1px dashed #ccc;padding-left:8px}.json-viewer[data-v-83fc9727]{font-family:Monaco,Menlo,Ubuntu Mono,Consolas,source-code-pro,monospace;font-size:14px;line-height:1.5;color:#333}.collapsible-section[data-v-83fc9727]{cursor:pointer;padding:8px;background-color:#f0f0f0;border-radius:4px;display:flex;align-items:center;transition:background-color .2s}.collapsible-section[data-v-83fc9727]:hover{background-color:#e0e0e0}.toggle-icon[data-v-83fc9727]{margin-right:8px;transition:transform .2s}.json-content[data-v-83fc9727]{margin-top:8px;padding-left:16px}.step-container[data-v-78f415f6]{margin-bottom:1rem}.step-wrapper[data-v-78f415f6]{display:flex;align-items:flex-start;border-radius:.5rem;padding:1rem;--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.step-icon[data-v-78f415f6]{margin-right:1rem;display:flex;height:1.5rem;width:1.5rem;flex-shrink:0;align-items:center;justify-content:center}.feather-icon[data-v-78f415f6]{height:1.5rem;width:1.5rem;stroke:currentColor;stroke-width:2}.spinner[data-v-78f415f6]{height:1.5rem;width:1.5rem}@keyframes spin-78f415f6{to{transform:rotate(360deg)}}.spinner[data-v-78f415f6]{animation:spin-78f415f6 1s linear infinite;border-radius:9999px;border-width:2px;border-top-width:2px;border-color:rgb(75 85 99 / var(--tw-border-opacity));--tw-border-opacity: 1;border-top-color:rgb(28 100 242 / var(--tw-border-opacity))}.step-content[data-v-78f415f6]{flex-grow:1}.step-text[data-v-78f415f6]{margin-bottom:.25rem;font-size:1.125rem;line-height:1.75rem;font-weight:600}.step-description[data-v-78f415f6]{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.step-description[data-v-78f415f6]:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.expand-button{margin-left:10px;margin-right:10px;background:none;border:none;padding:0;cursor:pointer}.htmljs{background:none}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.animate-fadeIn{animation:fadeIn .5s ease-out forwards}details[open] summary~*{animation:slideDown .3s ease-in-out}details summary::marker{display:none}details summary::-webkit-details-marker{display:none}@keyframes slideDown{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.custom-scrollbar[data-v-8a34bb65]{scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.5) transparent}.custom-scrollbar[data-v-8a34bb65]::-webkit-scrollbar{width:6px}.custom-scrollbar[data-v-8a34bb65]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-8a34bb65]::-webkit-scrollbar-thumb{background-color:#9ca3af80;border-radius:3px}.custom-scrollbar[data-v-8a34bb65]::-webkit-scrollbar-thumb:hover{background-color:#9ca3afb3}.bounce-enter-active[data-v-f44002af]{animation:bounce-in-f44002af .5s}.bounce-leave-active[data-v-f44002af]{animation:bounce-in-f44002af .5s reverse}@keyframes bounce-in-f44002af{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar-track{background-color:#f1f1f1}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar-thumb{background-color:#888;border-radius:4px}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar-thumb:hover{background-color:#555}.menu[data-v-1a32c141]{display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper[data-v-1a32c141]{position:relative;display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper>#commands-menu-items[data-v-1a32c141]{top:calc(-100% - 2rem)}.personalities-hover-area[data-v-e3d676fa]{position:relative;padding-top:10px}.custom-scrollbar[data-v-e3d676fa]{scrollbar-width:thin;scrollbar-color:rgba(155,155,155,.5) transparent}.custom-scrollbar[data-v-e3d676fa]::-webkit-scrollbar{width:6px}.custom-scrollbar[data-v-e3d676fa]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-e3d676fa]::-webkit-scrollbar-thumb{background-color:#9b9b9b80;border-radius:20px;border:transparent}.chat-bar[data-v-e3d676fa]{transition:all .3s ease}.chat-bar[data-v-e3d676fa]:hover{box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.list-move[data-v-e3d676fa],.list-enter-active[data-v-e3d676fa],.list-leave-active[data-v-e3d676fa]{transition:all .5s ease}.list-enter-from[data-v-e3d676fa]{transform:translatey(-30px)}.list-leave-to[data-v-e3d676fa]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-e3d676fa]{position:absolute}@keyframes rolling-ball-1756add6{0%{transform:translate(-50px) rotate(0)}25%{transform:translate(0) rotate(90deg)}50%{transform:translate(50px) rotate(180deg)}75%{transform:translate(0) rotate(270deg)}to{transform:translate(-50px) rotate(360deg)}}@keyframes bounce-1756add6{0%,to{transform:translateY(0)}50%{transform:translateY(-20px)}}@keyframes fade-in-up-1756add6{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.animate-rolling-ball[data-v-1756add6]{animation:rolling-ball-1756add6 4s infinite ease-in-out,bounce-1756add6 1s infinite ease-in-out}.animate-fade-in-up[data-v-1756add6]{animation:fade-in-up-1756add6 1.5s ease-out}.progress-bar-container{background-color:#f0f0f0;border-radius:4px;height:8px;overflow:hidden}.progress-bar{background-color:#3498db;height:100%;transition:width .3s ease}.popup-container[data-v-d504dfc9]{background-color:#fff;color:#333;border-radius:8px;box-shadow:0 4px 6px #0000001a;padding:24px;width:100%;height:100%;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center}.close-button[data-v-d504dfc9]{position:absolute;top:16px;right:16px;background-color:#3490dc;color:#fff;font-weight:700;padding:8px 16px;border-radius:8px;cursor:pointer;transition:background-color .3s ease}.close-button[data-v-d504dfc9]:hover{background-color:#2779bd}.iframe-content[data-v-d504dfc9]{width:100%;height:80%;border:none;margin-bottom:16px}.checkbox-container[data-v-d504dfc9]{display:flex;align-items:center;justify-content:center}.styled-checkbox[data-v-d504dfc9]{width:24px;height:24px;accent-color:#3490dc;cursor:pointer}.checkbox-label[data-v-d504dfc9]{margin-left:8px;font-size:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.fade-enter-active[data-v-d504dfc9],.fade-leave-active[data-v-d504dfc9]{transition:opacity .5s}.fade-enter[data-v-d504dfc9],.fade-leave-to[data-v-d504dfc9]{opacity:0}@keyframes giggle-94731cc1{0%,to{transform:translate(0) rotate(0) scale(1)}25%{transform:translate(-5px) rotate(-10deg) scale(1.05)}50%{transform:translate(5px) rotate(10deg) scale(.95)}75%{transform:translate(-5px) rotate(-10deg) scale(1.05)}}.animate-giggle[data-v-94731cc1]{animation:giggle-94731cc1 1.5s infinite ease-in-out}.custom-scrollbar[data-v-94731cc1]{scrollbar-width:thin;scrollbar-color:rgba(155,155,155,.5) transparent}.custom-scrollbar[data-v-94731cc1]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-94731cc1]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-94731cc1]::-webkit-scrollbar-thumb{background-color:#9b9b9b80;border-radius:20px;border:transparent}@keyframes custom-pulse-94731cc1{0%,to{box-shadow:0 0 #3b82f680}50%{box-shadow:0 0 0 15px #3b82f600}}.animate-pulse[data-v-94731cc1]{animation:custom-pulse-94731cc1 2s infinite}.slide-right-enter-active[data-v-94731cc1],.slide-right-leave-active[data-v-94731cc1]{transition:transform .3s ease}.slide-right-enter[data-v-94731cc1],.slide-right-leave-to[data-v-94731cc1]{transform:translate(-100%)}.slide-left-enter-active[data-v-94731cc1],.slide-left-leave-active[data-v-94731cc1]{transition:transform .3s ease}.slide-left-enter[data-v-94731cc1],.slide-left-leave-to[data-v-94731cc1]{transform:translate(100%)}.fade-and-fly-enter-active[data-v-94731cc1]{animation:fade-and-fly-enter-94731cc1 .5s ease}.fade-and-fly-leave-active[data-v-94731cc1]{animation:fade-and-fly-leave-94731cc1 .5s ease}@keyframes fade-and-fly-enter-94731cc1{0%{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes fade-and-fly-leave-94731cc1{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-20px) scale(1.2)}}.list-move[data-v-94731cc1],.list-enter-active[data-v-94731cc1],.list-leave-active[data-v-94731cc1]{transition:all .5s ease}.list-enter-from[data-v-94731cc1]{transform:translatey(-30px)}.list-leave-to[data-v-94731cc1]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-94731cc1]{position:absolute}@keyframes float-94731cc1{0%,to{transform:translateY(0)}50%{transform:translateY(-20px)}}.animate-float[data-v-94731cc1]{animation:float-94731cc1 linear infinite}@keyframes star-move-94731cc1{0%{transform:translate(0) rotate(0)}50%{transform:translate(20px,20px) rotate(180deg)}to{transform:translate(0) rotate(360deg)}}.animate-star[data-v-94731cc1]{animation:star-move-94731cc1 linear infinite}@keyframes fall-94731cc1{0%{transform:translateY(-20px) rotate(0);opacity:1}to{transform:translateY(calc(100vh + 20px)) rotate(360deg);opacity:0}}.animate-fall[data-v-94731cc1]{animation:fall-94731cc1 linear infinite}@keyframes glow-94731cc1{0%,to{text-shadow:0 0 5px rgba(66,153,225,.5),0 0 10px rgba(66,153,225,.5)}50%{text-shadow:0 0 20px rgba(66,153,225,.8),0 0 30px rgba(66,153,225,.8)}}.animate-glow[data-v-94731cc1]{animation:glow-94731cc1 2s ease-in-out infinite}@media (prefers-color-scheme: dark){@keyframes glow-94731cc1{0%,to{text-shadow:0 0 5px rgba(147,197,253,.5),0 0 10px rgba(147,197,253,.5)}50%{text-shadow:0 0 20px rgba(147,197,253,.8),0 0 30px rgba(147,197,253,.8)}0%,to{text-shadow:0 0 5px rgba(147,197,253,.5),0 0 10px rgba(147,197,253,.5)}50%{text-shadow:0 0 20px rgba(147,197,253,.8),0 0 30px rgba(147,197,253,.8)}}}@keyframes roll-94731cc1{0%{transform:translate(-50%) rotate(0)}to{transform:translate(50%) rotate(360deg)}}.animate-roll[data-v-94731cc1]{animation:roll-94731cc1 4s linear infinite}.toolbar[data-v-94731cc1]{position:relative;width:100%}.toolbar-container[data-v-94731cc1]{display:flex;height:2.5rem;align-items:center}.toolbar-button[data-v-94731cc1]{cursor:pointer;border-style:none;background-color:transparent;padding:.5rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.toolbar-button[data-v-94731cc1]:hover{--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.menu-container[data-v-94731cc1]{position:relative}.expandable-menu[data-v-94731cc1]{position:absolute;top:100%;left:.625rem;flex-direction:column;border-radius:.25rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity));--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.menu-container:hover .expandable-menu[data-v-94731cc1],.menu-visible[data-v-94731cc1]{display:flex}.menu-item[data-v-94731cc1]{background:none;border:none;cursor:pointer;padding:8px;color:#333;transition:background-color .3s}.menu-item[data-v-94731cc1]:hover{background-color:#f0f0f0}.dot[data-v-94731cc1]{width:10px;height:10px;border-radius:50%}.dot-green[data-v-94731cc1]{background-color:green}.dot-red[data-v-94731cc1]{background-color:red}.animate-pulse[data-v-94731cc1]{animation:pulse-94731cc1 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes pulse-94731cc1{0%,to{opacity:1}50%{opacity:.7}}.logo-container[data-v-94731cc1]{position:relative;width:48px;height:48px}.logo-image[data-v-94731cc1]{width:100%;height:100%;border-radius:50%;-o-object-fit:cover;object-fit:cover}@keyframes bounce-94731cc1{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:translateY(0);animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce[data-v-94731cc1]{animation:bounce-94731cc1 1s infinite}@keyframes roll-and-bounce-94731cc1{0%,to{transform:translate(0) rotate(0)}45%{transform:translate(100px) rotate(360deg)}50%{transform:translate(90px) rotate(390deg)}55%{transform:translate(100px) rotate(360deg)}95%{transform:translate(0) rotate(0)}}@keyframes spin-94731cc1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.container{display:flex;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap}.floating-frame{margin:15px;float:left;height:auto;border:1px solid #000;border-radius:4px;overflow:hidden;z-index:5000;position:fixed;cursor:move;bottom:0;right:0}.handle{width:100%;height:20px;background:#ccc;cursor:move;text-align:center}.floating-frame img{width:100%;height:auto}.controls{margin-top:10px}#webglContainer{top:0;left:0}.floating-frame2{margin:15px;width:800px;height:auto;border:1px solid #000;border-radius:4px;overflow:hidden;min-height:200px;z-index:5000}:root{--baklava-control-color-primary: #e28b46;--baklava-control-color-error: #d00000;--baklava-control-color-background: #2c3748;--baklava-control-color-foreground: white;--baklava-control-color-hover: #455670;--baklava-control-color-active: #556986;--baklava-control-color-disabled-foreground: #666c75;--baklava-control-border-radius: 3px;--baklava-sidebar-color-background: #1b202c;--baklava-sidebar-color-foreground: white;--baklava-node-color-background: #1b202c;--baklava-node-color-foreground: white;--baklava-node-color-hover: #e28c4677;--baklava-node-color-selected: var(--baklava-control-color-primary);--baklava-node-color-resize-handle: var(--baklava-control-color-background);--baklava-node-title-color-background: #151a24;--baklava-node-title-color-foreground: white;--baklava-group-node-title-color-background: #215636;--baklava-group-node-title-color-foreground: white;--baklava-node-interface-port-tooltip-color-foreground: var(--baklava-control-color-primary);--baklava-node-interface-port-tooltip-color-background: var(--baklava-editor-background-pattern-black);--baklava-node-border-radius: 6px;--baklava-color-connection-default: #737f96;--baklava-color-connection-allowed: #48bc79;--baklava-color-connection-forbidden: #bc4848;--baklava-editor-background-pattern-default: #202b3c;--baklava-editor-background-pattern-line: #263140;--baklava-editor-background-pattern-black: #263140;--baklava-context-menu-background: #1b202c;--baklava-context-menu-shadow: 0 0 8px rgba(0, 0, 0, .65);--baklava-toolbar-background: #1b202caa;--baklava-toolbar-foreground: white;--baklava-node-palette-background: #1b202caa;--baklava-node-palette-foreground: white;--baklava-selectionbox-color-border: var(--baklava-node-color-background);--baklava-selectionbox-color-background: var(--baklava-node-color-hover);--baklava-visual-transition: .1s linear}.baklava-button{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);transition:background-color var(--baklava-visual-transition);border:none;padding:.45em .35em;border-radius:var(--baklava-control-border-radius);font-size:inherit;cursor:pointer;overflow-x:hidden}.baklava-button:hover{background-color:var(--baklava-control-color-hover)}.baklava-button:active{background-color:var(--baklava-control-color-primary)}.baklava-button.--block{width:100%}.baklava-checkbox{display:flex;padding:.35em 0;cursor:pointer;overflow-x:hidden;align-items:center}.baklava-checkbox .__checkmark-container{display:flex;background-color:var(--baklava-control-color-background);border-radius:var(--baklava-control-border-radius);transition:background-color var(--baklava-visual-transition);width:18px;height:18px}.baklava-checkbox:hover .__checkmark-container{background-color:var(--baklava-control-color-hover)}.baklava-checkbox:active .__checkmark-container{background-color:var(--baklava-control-color-active)}.baklava-checkbox .__checkmark{stroke-dasharray:15;stroke-dashoffset:15;stroke:var(--baklava-control-color-foreground);stroke-width:2px;fill:none;transition:stroke-dashoffset var(--baklava-visual-transition)}.baklava-checkbox.--checked .__checkmark{stroke-dashoffset:0}.baklava-checkbox.--checked .__checkmark-container{background-color:var(--baklava-control-color-primary)}.baklava-checkbox .__label{margin-left:.5rem}.baklava-context-menu{color:var(--baklava-control-color-foreground);position:absolute;display:inline-block;z-index:100;background-color:var(--baklava-context-menu-background);box-shadow:var(--baklava-context-menu-shadow);border-radius:0 0 var(--baklava-control-border-radius) var(--baklava-control-border-radius);min-width:6rem;width:-moz-max-content;width:max-content}.baklava-context-menu>.item{display:flex;align-items:center;padding:.35em 1em;transition:background .05s linear;position:relative}.baklava-context-menu>.item>.__label{flex:1 1 auto}.baklava-context-menu>.item>.__submenu-icon{margin-left:.75rem}.baklava-context-menu>.item.--disabled{color:var(--baklava-control-color-hover)}.baklava-context-menu>.item:not(.--header):not(.--active):not(.--disabled):hover{background:var(--baklava-control-color-primary)}.baklava-context-menu>.item.--active{background:var(--baklava-control-color-primary)}.baklava-context-menu.--nested{left:100%;top:0}.baklava-context-menu.--flipped-x.--nested{left:unset;right:100%}.baklava-context-menu.--flipped-y.--nested{top:unset;bottom:0}.baklava-context-menu>.divider{margin:.35em 0;height:1px;background-color:var(--baklava-control-color-hover)}.baklava-icon{display:block;height:100%}.baklava-icon.--clickable{cursor:pointer;transition:color var(--baklava-visual-transition)}.baklava-icon.--clickable:hover{color:var(--baklava-control-color-primary)}.baklava-input{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);caret-color:var(--baklava-control-color-primary);border:none;border-radius:var(--baklava-control-border-radius);padding:.45em .75em;width:100%;transition:background-color var(--baklava-visual-transition);font-size:inherit;font:inherit}.baklava-input:hover{background-color:var(--baklava-control-color-hover)}.baklava-input:active{background-color:var(--baklava-control-color-active)}.baklava-input:focus-visible{outline:1px solid var(--baklava-control-color-primary)}.baklava-input[type=number]::-webkit-inner-spin-button,.baklava-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.baklava-input.--invalid{box-shadow:0 0 2px 2px var(--baklava-control-color-error)}.baklava-num-input{background:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);border-radius:var(--baklava-control-border-radius);width:100%;display:grid;grid-template-columns:20px 1fr 20px}.baklava-num-input>.__button{display:flex;flex:0 0 auto;width:20px;justify-content:center;align-items:center;transition:background var(--baklava-visual-transition);cursor:pointer}.baklava-num-input>.__button:hover{background-color:var(--baklava-control-color-hover)}.baklava-num-input>.__button:active{background-color:var(--baklava-control-color-active)}.baklava-num-input>.__button.--dec{grid-area:1/1/span 1/span 1}.baklava-num-input>.__button.--dec>svg{transform:rotate(90deg)}.baklava-num-input>.__button.--inc{grid-area:1/3/span 1/span 1}.baklava-num-input>.__button.--inc>svg{transform:rotate(-90deg)}.baklava-num-input>.__button path{stroke:var(--baklava-control-color-foreground);fill:var(--baklava-control-color-foreground)}.baklava-num-input>.__content{grid-area:1/2/span 1/span 1;display:inline-flex;cursor:pointer;max-width:100%;min-width:0;align-items:center;transition:background-color var(--baklava-visual-transition)}.baklava-num-input>.__content:hover{background-color:var(--baklava-control-color-hover)}.baklava-num-input>.__content:active{background-color:var(--baklava-control-color-active)}.baklava-num-input>.__content>.__label,.baklava-num-input>.__content>.__value{margin:.35em 0;padding:0 .5em}.baklava-num-input>.__content>.__label{flex:1;min-width:0;overflow:hidden}.baklava-num-input>.__content>.__value{text-align:right}.baklava-num-input>.__content>input{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);caret-color:var(--baklava-control-color-primary);padding:.35em;width:100%}.baklava-select{width:100%;position:relative;color:var(--baklava-control-color-foreground)}.baklava-select.--open>.__selected{border-bottom-left-radius:0;border-bottom-right-radius:0}.baklava-select.--open>.__selected>.__icon{transform:rotate(180deg)}.baklava-select>.__selected{background-color:var(--baklava-control-color-background);padding:.35em .75em;border-radius:var(--baklava-control-border-radius);transition:background var(--baklava-visual-transition);min-height:1.7em;display:flex;align-items:center;cursor:pointer}.baklava-select>.__selected:hover{background:var(--baklava-control-color-hover)}.baklava-select>.__selected:active{background:var(--baklava-control-color-active)}.baklava-select>.__selected>.__text{flex:1 0 auto;flex-basis:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.baklava-select>.__selected>.__icon{flex:0 0 auto;display:flex;justify-content:center;align-items:center;transition:transform .25s ease;width:18px;height:18px}.baklava-select>.__selected>.__icon path{stroke:var(--baklava-control-color-foreground);fill:var(--baklava-control-color-foreground)}.baklava-select>.__dropdown{position:absolute;top:100%;left:0;right:0;z-index:10;background-color:var(--baklava-context-menu-background);filter:drop-shadow(0 0 4px black);border-radius:0 0 var(--baklava-control-border-radius) var(--baklava-control-border-radius);max-height:15em;overflow-y:scroll}.baklava-select>.__dropdown::-webkit-scrollbar{width:0px;background:transparent}.baklava-select>.__dropdown>.item{padding:.35em .35em .35em 1em;transition:background .05s linear}.baklava-select>.__dropdown>.item:not(.--header):not(.--active){cursor:pointer}.baklava-select>.__dropdown>.item:not(.--header):not(.--active):hover{background:var(--baklava-control-color-hover)}.baklava-select>.__dropdown>.item.--active{background:var(--baklava-control-color-primary)}.baklava-select>.__dropdown>.item.--header{color:var(--baklava-control-color-disabled-foreground);border-bottom:1px solid var(--baklava-control-color-disabled-foreground);padding:.5em .35em .5em 1em}.baklava-slider{background:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);border-radius:var(--baklava-control-border-radius);position:relative;cursor:pointer}.baklava-slider>.__content{display:flex;position:relative}.baklava-slider>.__content>.__label,.baklava-slider>.__content>.__value{flex:1 1 auto;margin:.35em 0;padding:0 .5em;text-overflow:ellipsis}.baklava-slider>.__content>.__value{text-align:right}.baklava-slider>.__content>input{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);caret-color:var(--baklava-control-color-primary);padding:.35em;width:100%}.baklava-slider>.__slider{position:absolute;top:0;bottom:0;left:0;background-color:var(--baklava-control-color-primary);border-radius:var(--baklava-control-border-radius)}.baklava-connection{stroke:var(--baklava-color-connection-default);stroke-width:2px;fill:none}.baklava-connection.--temporary{stroke-width:4px;stroke-dasharray:5 5;stroke-dashoffset:0;animation:dash 1s linear infinite;transform:translateY(-1px)}@keyframes dash{to{stroke-dashoffset:20}}.baklava-connection.--allowed{stroke:var(--baklava-color-connection-allowed)}.baklava-connection.--forbidden{stroke:var(--baklava-color-connection-forbidden)}.baklava-minimap{position:absolute;height:15%;width:15%;min-width:150px;max-width:90%;top:20px;right:20px;z-index:900}.baklava-editor{width:100%;height:100%;position:relative;overflow:hidden;outline:none!important;font-family:Lato,Segoe UI,Tahoma,Geneva,Verdana,sans-serif;font-size:15px;touch-action:none}.baklava-editor .background{background-color:var(--baklava-editor-background-pattern-default);background-image:linear-gradient(var(--baklava-editor-background-pattern-black) 2px,transparent 2px),linear-gradient(90deg,var(--baklava-editor-background-pattern-black) 2px,transparent 2px),linear-gradient(var(--baklava-editor-background-pattern-line) 1px,transparent 1px),linear-gradient(90deg,var(--baklava-editor-background-pattern-line) 1px,transparent 1px);background-repeat:repeat;width:100%;height:100%;pointer-events:none!important}.baklava-editor .selection-box{position:absolute;border:1px solid var(--baklava-selectionbox-color-border);background-color:var(--baklava-selectionbox-color-background);pointer-events:none;opacity:.5}.baklava-editor.--start-selection-box{cursor:crosshair}.baklava-editor *:not(input):not(textarea){user-select:none;-moz-user-select:none;-webkit-user-select:none;touch-action:none}.baklava-editor .input-user-select{user-select:auto;-moz-user-select:auto;-webkit-user-select:auto}.baklava-editor *,.baklava-editor *:after,.baklava-editor *:before{box-sizing:border-box}.baklava-editor.--temporary-connection{cursor:crosshair}.baklava-editor .connections-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none!important}.baklava-editor .node-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.baklava-editor .node-container *{pointer-events:all}.baklava-ignore-mouse *{pointer-events:none!important}.baklava-ignore-mouse .__port{pointer-events:all!important}.baklava-node-interface{padding:.25em 0;position:relative}.baklava-node-interface .__port{position:absolute;width:10px;height:10px;background:#fff;border-radius:50%;top:calc(50% - 5px);cursor:crosshair}.baklava-node-interface .__port.--selected{outline:2px var(--baklava-color-connection-default) solid;outline-offset:4px}.baklava-node-interface.--input{text-align:left;padding-left:.5em}.baklava-node-interface.--input .__port{left:-1.1em}.baklava-node-interface.--output{text-align:right;padding-right:.5em}.baklava-node-interface.--output .__port{right:-1.1em}.baklava-node-interface .__tooltip{position:absolute;left:5px;top:15px;transform:translate(-50%);background:var(--baklava-node-interface-port-tooltip-color-background);color:var(--baklava-node-interface-port-tooltip-color-foreground);padding:.25em .5em;text-align:center;z-index:2}.baklava-node-palette{position:absolute;left:0;top:60px;width:250px;height:calc(100% - 60px);z-index:3;padding:2rem;overflow-y:auto;background:var(--baklava-node-palette-background);color:var(--baklava-node-palette-foreground)}.baklava-node-palette h1{margin-top:2rem}.baklava-node.--palette{position:unset;margin:1rem 0;cursor:grab}.baklava-node.--palette:first-child{margin-top:0}.baklava-node.--palette .__title{padding:.5rem;border-radius:var(--baklava-node-border-radius)}.baklava-dragged-node{position:absolute;width:calc(250px - 4rem);height:40px;z-index:4;pointer-events:none}.baklava-node{background:var(--baklava-node-color-background);color:var(--baklava-node-color-foreground);border:1px solid transparent;border-radius:var(--baklava-node-border-radius);position:absolute;box-shadow:0 0 4px #000c;transition:border-color var(--baklava-visual-transition),box-shadow var(--baklava-visual-transition);width:var(--width)}.baklava-node:hover{border-color:var(--baklava-node-color-hover)}.baklava-node:hover .__resize-handle:after{opacity:1}.baklava-node.--selected{z-index:5;border-color:var(--baklava-node-color-selected)}.baklava-node.--dragging{box-shadow:0 0 12px #000c}.baklava-node.--dragging>.__title{cursor:grabbing}.baklava-node>.__title{display:flex;background:var(--baklava-node-title-color-background);color:var(--baklava-node-title-color-foreground);padding:.4em .75em;border-radius:var(--baklava-node-border-radius) var(--baklava-node-border-radius) 0 0;cursor:grab}.baklava-node>.__title>*:first-child{flex-grow:1}.baklava-node>.__title>.__title-label{pointer-events:none}.baklava-node>.__title>.__menu{position:relative;cursor:initial}.baklava-node[data-node-type^=__baklava_]>.__title{background:var(--baklava-group-node-title-color-background);color:var(--baklava-group-node-title-color-foreground)}.baklava-node>.__content{padding:.75em}.baklava-node>.__content.--reverse-y{display:flex;flex-direction:column-reverse}.baklava-node>.__content>div>div{margin:.5em 0}.baklava-node.--two-column>.__content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto;grid-template-areas:". ." ". ."}.baklava-node.--two-column>.__content>.__inputs{grid-row:1;grid-column:1}.baklava-node.--two-column>.__content>.__outputs{grid-row:1;grid-column:2}.baklava-node .__resize-handle{position:absolute;right:0;bottom:0;width:1rem;height:1rem;transform:translate(50%);cursor:ew-resize}.baklava-node .__resize-handle:after{content:"";position:absolute;bottom:0;left:-.5rem;width:1rem;height:1rem;opacity:0;border-bottom-right-radius:var(--baklava-node-border-radius);transition:opacity var(--baklava-visual-transition);background:linear-gradient(-45deg,transparent 10%,var(--baklava-node-color-resize-handle) 10%,var(--baklava-node-color-resize-handle) 15%,transparent 15%,transparent 30%,var(--baklava-node-color-resize-handle) 30%,var(--baklava-node-color-resize-handle) 35%,transparent 35%,transparent 50%,var(--baklava-node-color-resize-handle) 50%,var(--baklava-node-color-resize-handle) 55%,transparent 55%)}.baklava-sidebar{position:absolute;height:100%;width:25%;min-width:300px;max-width:90%;top:0;right:0;z-index:1000;background-color:var(--baklava-sidebar-color-background);color:var(--baklava-sidebar-color-foreground);box-shadow:none;overflow-x:hidden;padding:1em;transform:translate(100%);transition:transform .5s;display:flex;flex-direction:column}.baklava-sidebar.--open{transform:translate(0);box-shadow:0 0 15px #000}.baklava-sidebar .__resizer{position:absolute;left:0;top:0;height:100%;width:4px;cursor:col-resize}.baklava-sidebar .__header{display:flex;align-items:center}.baklava-sidebar .__header .__node-name{margin-left:.5rem}.baklava-sidebar .__close{font-size:2em;border:none;background:none;color:inherit;cursor:pointer}.baklava-sidebar .__interface{margin:.5em 0}.baklava-toolbar{position:absolute;left:0;top:0;width:100%;height:60px;z-index:3;padding:.5rem 2rem;background:var(--baklava-toolbar-background);color:var(--baklava-toolbar-foreground);display:flex;align-items:center}.baklava-toolbar-entry{margin-left:.5rem;margin-right:.5rem}.baklava-toolbar-button{color:var(--baklava-toolbar-foreground);background:none;border:none;transition:color var(--baklava-visual-transition)}.baklava-toolbar-button:not([disabled]){cursor:pointer}.baklava-toolbar-button:hover:not([disabled]){color:var(--baklava-control-color-primary)}.baklava-toolbar-button[disabled]{color:var(--baklava-control-color-disabled-foreground)}.slide-fade-enter-active,.slide-fade-leave-active{transition:all .1s ease-out}.slide-fade-enter-from,.slide-fade-leave-to{transform:translateY(5px);opacity:0}.fade-enter-active,.fade-leave-active{transition:opacity .1s ease-out!important}.fade-enter-from,.fade-leave-to{opacity:0}.loading-indicator[data-v-fcb6b036]{display:flex;justify-content:center;align-items:center;height:100px;font-size:1.2em;color:#666}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(63 131 248 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(63 131 248 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:PTSans,Roboto,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.tooltip-arrow,.tooltip-arrow:before{position:absolute;width:8px;height:8px;background:inherit}.tooltip-arrow{visibility:hidden}.tooltip-arrow:before{content:"";visibility:visible;transform:rotate(45deg)}[data-tooltip-style^=light]+.tooltip>.tooltip-arrow:before{border-style:solid;border-color:#e5e7eb}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=top]>.tooltip-arrow:before{border-bottom-width:1px;border-right-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=right]>.tooltip-arrow:before{border-bottom-width:1px;border-left-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=bottom]>.tooltip-arrow:before{border-top-width:1px;border-left-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=left]>.tooltip-arrow:before{border-top-width:1px;border-right-width:1px}.tooltip[data-popper-placement^=top]>.tooltip-arrow{bottom:-4px}.tooltip[data-popper-placement^=bottom]>.tooltip-arrow{top:-4px}.tooltip[data-popper-placement^=left]>.tooltip-arrow{right:-4px}.tooltip[data-popper-placement^=right]>.tooltip-arrow{left:-4px}.tooltip.invisible>.tooltip-arrow:before{visibility:hidden}[data-popper-arrow],[data-popper-arrow]:before{position:absolute;width:8px;height:8px;background:inherit}[data-popper-arrow]{visibility:hidden}[data-popper-arrow]:before{content:"";visibility:visible;transform:rotate(45deg)}[data-popper-arrow]:after{content:"";visibility:visible;transform:rotate(45deg);position:absolute;width:9px;height:9px;background:inherit}[role=tooltip]>[data-popper-arrow]:before{border-style:solid;border-color:#e5e7eb}.dark [role=tooltip]>[data-popper-arrow]:before{border-style:solid;border-color:#4b5563}[role=tooltip]>[data-popper-arrow]:after{border-style:solid;border-color:#e5e7eb}.dark [role=tooltip]>[data-popper-arrow]:after{border-style:solid;border-color:#4b5563}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]:before{border-bottom-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]:after{border-bottom-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]:before{border-bottom-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]:after{border-bottom-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]:before{border-top-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]:after{border-top-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]:before{border-top-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]:after{border-top-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]{bottom:-5px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]{top:-5px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]{right:-5px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]{left:-5px}[role=tooltip].invisible>[data-popper-arrow]:before{visibility:hidden}[role=tooltip].invisible>[data-popper-arrow]:after{visibility:hidden}[type=text],[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow: 0 0 #0000}[type=text]:focus,[type=email]:focus,[type=url]:focus,[type=password]:focus,[type=number]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=month]:focus,[type=search]:focus,[type=tel]:focus,[type=time]:focus,[type=week]:focus,[multiple]:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #1C64F2;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#1c64f2}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}select:not([size]){background-image:url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 10 6'%3e %3cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 1 4 4 4-4'/%3e %3c/svg%3e");background-position:right .75rem center;background-repeat:no-repeat;background-size:.75em .75em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple]{background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#1c64f2;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow: 0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 2px;--tw-ring-offset-color: #fff;--tw-ring-color: #1C64F2;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked,.dark [type=checkbox]:checked,.dark [type=radio]:checked{border-color:transparent;background-color:currentColor;background-size:.55em .55em;background-position:center;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3e %3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3e %3c/svg%3e");background-repeat:no-repeat;background-size:.55em .55em;-webkit-print-color-adjust:exact;print-color-adjust:exact}[type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");background-size:1em 1em}.dark [type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");background-size:1em 1em}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3e %3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3e %3c/svg%3e");background-color:currentColor;border-color:transparent;background-position:center;background-repeat:no-repeat;background-size:.55em .55em;-webkit-print-color-adjust:exact;print-color-adjust:exact}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{border-color:transparent;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px auto inherit}input[type=file]::file-selector-button{color:#fff;background:#1f2937;border:0;font-weight:500;font-size:.875rem;cursor:pointer;padding:.625rem 1rem .625rem 2rem;margin-inline-start:-1rem;margin-inline-end:1rem}input[type=file]::file-selector-button:hover{background:#374151}.dark input[type=file]::file-selector-button{color:#fff;background:#4b5563}.dark input[type=file]::file-selector-button:hover{background:#6b7280}input[type=range]::-webkit-slider-thumb{height:1.25rem;width:1.25rem;background:#1c64f2;border-radius:9999px;border:0;appearance:none;-moz-appearance:none;-webkit-appearance:none;cursor:pointer}input[type=range]:disabled::-webkit-slider-thumb{background:#9ca3af}.dark input[type=range]:disabled::-webkit-slider-thumb{background:#6b7280}input[type=range]:focus::-webkit-slider-thumb{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1px;--tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity))}input[type=range]::-moz-range-thumb{height:1.25rem;width:1.25rem;background:#1c64f2;border-radius:9999px;border:0;appearance:none;-moz-appearance:none;-webkit-appearance:none;cursor:pointer}input[type=range]:disabled::-moz-range-thumb{background:#9ca3af}.dark input[type=range]:disabled::-moz-range-thumb{background:#6b7280}input[type=range]::-moz-range-progress{background:#3f83f8}input[type=range]::-ms-fill-lower{background:#3f83f8}.toggle-bg:after{content:"";position:absolute;top:.125rem;left:.125rem;background:#fff;border-color:#d1d5db;border-width:1px;border-radius:9999px;height:1.25rem;width:1.25rem;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-duration:.15s;box-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color)}input:checked+.toggle-bg:after{transform:translate(100%);border-color:#fff}input:checked+.toggle-bg{background:#1c64f2;border-color:#1c64f2}*{scrollbar-color:initial;scrollbar-width:initial}body{min-height:100vh;background-image:linear-gradient(to bottom right,var(--tw-gradient-stops));--tw-gradient-from: #e0eaff var(--tw-gradient-from-position);--tw-gradient-to: rgb(224 234 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #f0e6ff var(--tw-gradient-to-position)}body:is(.dark *){background-image:linear-gradient(to bottom right,var(--tw-gradient-stops));--tw-gradient-from: #0f2647 var(--tw-gradient-from-position);--tw-gradient-to: rgb(15 38 71 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #1e1b4b var(--tw-gradient-to-position)}html{scroll-behavior:smooth}body{font-family:Roboto,sans-serif}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.-bottom-0\.5{bottom:-.125rem}.-bottom-1{bottom:-.25rem}.-bottom-1\.5{bottom:-.375rem}.-bottom-2{bottom:-.5rem}.-bottom-4{bottom:-1rem}.-left-1\.5{left:-.375rem}.-right-0\.5{right:-.125rem}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-top-1\.5{top:-.375rem}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-16{bottom:4rem}.bottom-2{bottom:.5rem}.bottom-2\.5{bottom:.625rem}.bottom-20{bottom:5rem}.bottom-4{bottom:1rem}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.bottom-\[60px\]{bottom:60px}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-20{left:5rem}.left-3{left:.75rem}.right-0{right:0}.right-2{right:.5rem}.right-2\.5{right:.625rem}.right-20{right:5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-20{top:5rem}.top-3{top:.75rem}.top-full{top:100%}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.-m-1{margin:-.25rem}.-m-2{margin:-.5rem}.-m-4{margin:-1rem}.m-0{margin:0}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-4{margin:1rem}.-mx-1\.5{margin-left:-.375rem;margin-right:-.375rem}.-mx-5{margin-left:-1.25rem;margin-right:-1.25rem}.-my-1\.5{margin-top:-.375rem;margin-bottom:-.375rem}.mx-0{margin-left:0;margin-right:0}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-1\.5{margin-left:.375rem;margin-right:.375rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-8{margin-top:2rem;margin-bottom:2rem}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-3\.5{margin-bottom:.875rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-5{margin-left:1.25rem}.ml-auto{margin-left:auto}.mr-0{margin-right:0}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-14{margin-top:3.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-0{height:0px}.h-0\.5{height:.125rem}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-4\/5{height:80%}.h-48{height:12rem}.h-5{height:1.25rem}.h-5\/6{height:83.333333%}.h-56{height:14rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[200px\]{height:200px}.h-auto{height:auto}.h-full{height:100%}.h-modal{height:calc(100% - 2rem)}.h-px{height:1px}.h-screen{height:100vh}.max-h-60{max-height:15rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.max-h-\[400px\]{max-height:400px}.max-h-\[60vh\]{max-height:60vh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-\[220px\]{min-height:220px}.min-h-\[500px\]{min-height:500px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-11\/12{width:91.666667%}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-3\/5{width:60%}.w-36{width:9rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[300px\]{width:300px}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.min-w-80{min-width:20rem}.min-w-96{min-width:24rem}.min-w-\[120px\]{min-width:120px}.min-w-\[14rem\]{min-width:14rem}.min-w-\[15rem\]{min-width:15rem}.min-w-\[23rem\]{min-width:23rem}.min-w-\[24rem\]{min-width:24rem}.min-w-\[300px\]{min-width:300px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-6xl{max-width:72rem}.max-w-7xl{max-width:80rem}.max-w-\[14rem\]{max-width:14rem}.max-w-\[15rem\]{max-width:15rem}.max-w-\[23rem\]{max-width:23rem}.max-w-\[24rem\]{max-width:24rem}.max-w-\[300px\]{max-width:300px}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.flex-grow-0{flex-grow:0}.grow{flex-grow:1}.origin-left{transform-origin:left}.origin-top{transform-origin:top}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-0{--tw-translate-y: -0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-full{--tw-translate-y: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\/2{--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1\/2{--tw-translate-y: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-x-0{--tw-scale-x: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-none{transform:none}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-\[50px\,1fr\]{grid-template-columns:50px 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.-space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-1rem * var(--tw-space-x-reverse));margin-left:calc(-1rem * calc(1 - var(--tw-space-x-reverse)))}.-space-x-px>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-1px * var(--tw-space-x-reverse));margin-left:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.self-center{align-self:center}.self-stretch{align-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.\!rounded-full{border-radius:9999px!important}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-t-2{border-top-width:2px}.border-t-4{border-top-width:4px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-bg-dark{border-color:var(--color-bg-dark)}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(195 221 253 / var(--tw-border-opacity))}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity))}.border-blue-700{--tw-border-opacity: 1;border-color:rgb(26 86 219 / var(--tw-border-opacity))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-500{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(14 159 110 / var(--tw-border-opacity))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(5 122 85 / var(--tw-border-opacity))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(4 108 78 / var(--tw-border-opacity))}.border-pink-600{--tw-border-opacity: 1;border-color:rgb(214 31 105 / var(--tw-border-opacity))}.border-pink-700{--tw-border-opacity: 1;border-color:rgb(191 18 93 / var(--tw-border-opacity))}.border-primary{border-color:var(--color-primary)}.border-primary-light{border-color:var(--color-primary-light)}.border-purple-600{--tw-border-opacity: 1;border-color:rgb(126 58 242 / var(--tw-border-opacity))}.border-purple-700{--tw-border-opacity: 1;border-color:rgb(108 43 217 / var(--tw-border-opacity))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(240 82 82 / var(--tw-border-opacity))}.border-red-600{--tw-border-opacity: 1;border-color:rgb(224 36 36 / var(--tw-border-opacity))}.border-red-700{--tw-border-opacity: 1;border-color:rgb(200 30 30 / var(--tw-border-opacity))}.border-secondary{border-color:var(--color-secondary)}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(227 160 8 / var(--tw-border-opacity))}.border-yellow-500{--tw-border-opacity: 1;border-color:rgb(194 120 3 / var(--tw-border-opacity))}.border-t-blue-600{--tw-border-opacity: 1;border-top-color:rgb(28 100 242 / var(--tw-border-opacity))}.bg-accent{background-color:var(--color-accent)}.bg-bg-dark-tone-panel{background-color:var(--color-bg-dark-tone-panel)}.bg-bg-light{background-color:var(--color-bg-light)}.bg-bg-light-tone{background-color:var(--color-bg-light-tone)}.bg-bg-light-tone-panel{background-color:var(--color-bg-light-tone-panel)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity))}.bg-blue-200{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(118 169 250 / var(--tw-bg-opacity))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(235 245 255 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(222 247 236 / var(--tw-bg-opacity))}.bg-green-200{--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(49 196 141 / var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(14 159 110 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}.bg-green-700{--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}.bg-green-900{--tw-bg-opacity: 1;background-color:rgb(1 71 55 / var(--tw-bg-opacity))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(229 237 255 / var(--tw-bg-opacity))}.bg-indigo-200{--tw-bg-opacity: 1;background-color:rgb(205 219 254 / var(--tw-bg-opacity))}.bg-indigo-500{--tw-bg-opacity: 1;background-color:rgb(104 117 245 / var(--tw-bg-opacity))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(88 80 236 / var(--tw-bg-opacity))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(254 236 220 / var(--tw-bg-opacity))}.bg-pink-100{--tw-bg-opacity: 1;background-color:rgb(252 232 243 / var(--tw-bg-opacity))}.bg-pink-200{--tw-bg-opacity: 1;background-color:rgb(250 209 232 / var(--tw-bg-opacity))}.bg-pink-700{--tw-bg-opacity: 1;background-color:rgb(191 18 93 / var(--tw-bg-opacity))}.bg-primary{background-color:var(--color-primary)}.bg-primary-light{background-color:var(--color-primary-light)}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(237 235 254 / var(--tw-bg-opacity))}.bg-purple-200{--tw-bg-opacity: 1;background-color:rgb(220 215 254 / var(--tw-bg-opacity))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}.bg-purple-600{--tw-bg-opacity: 1;background-color:rgb(126 58 242 / var(--tw-bg-opacity))}.bg-purple-700{--tw-bg-opacity: 1;background-color:rgb(108 43 217 / var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(253 232 232 / var(--tw-bg-opacity))}.bg-red-200{--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(249 128 128 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(240 82 82 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}.bg-red-700{--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}.bg-red-900{--tw-bg-opacity: 1;background-color:rgb(119 29 29 / var(--tw-bg-opacity))}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-white\/30{background-color:#ffffff4d}.bg-white\/50{background-color:#ffffff80}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(253 246 178 / var(--tw-bg-opacity))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(227 160 8 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-70{--tw-bg-opacity: .7}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-bg-light{--tw-gradient-from: var(--color-bg-light) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-bg-light-tone{--tw-gradient-from: var(--color-bg-light-tone) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-400{--tw-gradient-from: #76A9FA var(--tw-gradient-from-position);--tw-gradient-to: rgb(118 169 250 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-500{--tw-gradient-from: #3F83F8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(63 131 248 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-500\/10{--tw-gradient-from: rgb(63 131 248 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(63 131 248 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-500{--tw-gradient-from: #06b6d4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-400{--tw-gradient-from: #31C48D var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 196 141 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #0E9F6E var(--tw-gradient-from-position);--tw-gradient-to: rgb(14 159 110 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-600{--tw-gradient-from: #5850EC var(--tw-gradient-from-position);--tw-gradient-to: rgb(88 80 236 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-lime-500{--tw-gradient-from: #84cc16 var(--tw-gradient-from-position);--tw-gradient-to: rgb(132 204 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-pink-500{--tw-gradient-from: #E74694 var(--tw-gradient-from-position);--tw-gradient-to: rgb(231 70 148 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #9061F9 var(--tw-gradient-from-position);--tw-gradient-to: rgb(144 97 249 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-600{--tw-gradient-from: #7E3AF2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-200{--tw-gradient-from: #FBD5D5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 213 213 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #F05252 var(--tw-gradient-from-position);--tw-gradient-to: rgb(240 82 82 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-200{--tw-gradient-from: #AFECEF var(--tw-gradient-from-position);--tw-gradient-to: rgb(175 236 239 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-300{--tw-gradient-from: #7EDCE2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 220 226 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-500{--tw-gradient-from: #0694A2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 148 162 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-5\%{--tw-gradient-from-position: 5%}.via-bg-light{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--color-bg-light) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-blue-600{--tw-gradient-to: rgb(28 100 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #1C64F2 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-cyan-600{--tw-gradient-to: rgb(8 145 178 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #0891b2 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-green-600{--tw-gradient-to: rgb(5 122 85 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #057A55 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-lime-600{--tw-gradient-to: rgb(101 163 13 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #65a30d var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-pink-600{--tw-gradient-to: rgb(214 31 105 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #D61F69 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-purple-600{--tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #7E3AF2 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-red-300{--tw-gradient-to: rgb(248 180 180 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #F8B4B4 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-red-600{--tw-gradient-to: rgb(224 36 36 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #E02424 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-teal-600{--tw-gradient-to: rgb(4 116 129 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #047481 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-10\%{--tw-gradient-via-position: 10%}.to-blue-500{--tw-gradient-to: #3F83F8 var(--tw-gradient-to-position)}.to-blue-600{--tw-gradient-to: #1C64F2 var(--tw-gradient-to-position)}.to-blue-700{--tw-gradient-to: #1A56DB var(--tw-gradient-to-position)}.to-cyan-700{--tw-gradient-to: #0e7490 var(--tw-gradient-to-position)}.to-green-700{--tw-gradient-to: #046C4E var(--tw-gradient-to-position)}.to-lime-200{--tw-gradient-to: #d9f99d var(--tw-gradient-to-position)}.to-lime-300{--tw-gradient-to: #bef264 var(--tw-gradient-to-position)}.to-lime-700{--tw-gradient-to: #4d7c0f var(--tw-gradient-to-position)}.to-orange-400{--tw-gradient-to: #FF8A4C var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #E74694 var(--tw-gradient-to-position)}.to-pink-700{--tw-gradient-to: #BF125D var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #9061F9 var(--tw-gradient-to-position)}.to-purple-500\/10{--tw-gradient-to: rgb(144 97 249 / .1) var(--tw-gradient-to-position)}.to-purple-600{--tw-gradient-to: #7E3AF2 var(--tw-gradient-to-position)}.to-purple-700{--tw-gradient-to: #6C2BD9 var(--tw-gradient-to-position)}.to-red-700{--tw-gradient-to: #C81E1E var(--tw-gradient-to-position)}.to-teal-700{--tw-gradient-to: #036672 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-yellow-200{--tw-gradient-to: #FCE96A var(--tw-gradient-to-position)}.to-100\%{--tw-gradient-to-position: 100%}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.fill-blue-600{fill:#1c64f2}.fill-current{fill:currentColor}.fill-gray-300{fill:#d1d5db}.fill-gray-600{fill:#4b5563}.fill-green-500{fill:#0e9f6e}.fill-pink-600{fill:#d61f69}.fill-purple-600{fill:#7e3af2}.fill-red-600{fill:#e02424}.fill-secondary{fill:var(--color-secondary)}.fill-white{fill:#fff}.fill-yellow-400{fill:#e3a008}.stroke-2{stroke-width:2}.object-cover{-o-object-fit:cover;object-fit:cover}.object-fill{-o-object-fit:fill;object-fit:fill}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-20{padding-bottom:5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pb-80{padding-bottom:20rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pr-10{padding-right:2.5rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-12{padding-top:3rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-bottom{vertical-align:bottom}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:PTSans,Roboto,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-6xl{font-size:3.75rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-100{--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-200{--tw-text-opacity: 1;color:rgb(188 240 218 / var(--tw-text-opacity))}.text-green-400{--tw-text-opacity: 1;color:rgb(49 196 141 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(5 122 85 / var(--tw-text-opacity))}.text-green-700{--tw-text-opacity: 1;color:rgb(4 108 78 / var(--tw-text-opacity))}.text-green-800{--tw-text-opacity: 1;color:rgb(3 84 63 / var(--tw-text-opacity))}.text-green-900{--tw-text-opacity: 1;color:rgb(1 71 55 / var(--tw-text-opacity))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(104 117 245 / var(--tw-text-opacity))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(81 69 205 / var(--tw-text-opacity))}.text-indigo-800{--tw-text-opacity: 1;color:rgb(66 56 157 / var(--tw-text-opacity))}.text-indigo-900{--tw-text-opacity: 1;color:rgb(54 47 120 / var(--tw-text-opacity))}.text-light-text-panel{color:var(--color-light-text-panel)}.text-orange-200{--tw-text-opacity: 1;color:rgb(252 217 189 / var(--tw-text-opacity))}.text-orange-500{--tw-text-opacity: 1;color:rgb(255 90 31 / var(--tw-text-opacity))}.text-orange-600{--tw-text-opacity: 1;color:rgb(208 56 1 / var(--tw-text-opacity))}.text-pink-500{--tw-text-opacity: 1;color:rgb(231 70 148 / var(--tw-text-opacity))}.text-pink-600{--tw-text-opacity: 1;color:rgb(214 31 105 / var(--tw-text-opacity))}.text-pink-700{--tw-text-opacity: 1;color:rgb(191 18 93 / var(--tw-text-opacity))}.text-pink-800{--tw-text-opacity: 1;color:rgb(153 21 75 / var(--tw-text-opacity))}.text-pink-900{--tw-text-opacity: 1;color:rgb(117 26 61 / var(--tw-text-opacity))}.text-purple-500{--tw-text-opacity: 1;color:rgb(144 97 249 / var(--tw-text-opacity))}.text-purple-600{--tw-text-opacity: 1;color:rgb(126 58 242 / var(--tw-text-opacity))}.text-purple-700{--tw-text-opacity: 1;color:rgb(108 43 217 / var(--tw-text-opacity))}.text-purple-800{--tw-text-opacity: 1;color:rgb(85 33 181 / var(--tw-text-opacity))}.text-purple-900{--tw-text-opacity: 1;color:rgb(74 29 150 / var(--tw-text-opacity))}.text-red-100{--tw-text-opacity: 1;color:rgb(253 232 232 / var(--tw-text-opacity))}.text-red-200{--tw-text-opacity: 1;color:rgb(251 213 213 / var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(249 128 128 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(224 36 36 / var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(200 30 30 / var(--tw-text-opacity))}.text-red-800{--tw-text-opacity: 1;color:rgb(155 28 28 / var(--tw-text-opacity))}.text-red-900{--tw-text-opacity: 1;color:rgb(119 29 29 / var(--tw-text-opacity))}.text-secondary{color:var(--color-secondary)}.text-slate-50{--tw-text-opacity: 1;color:rgb(248 250 252 / var(--tw-text-opacity))}.text-slate-950{--tw-text-opacity: 1;color:rgb(2 6 23 / var(--tw-text-opacity))}.text-teal-500{--tw-text-opacity: 1;color:rgb(6 148 162 / var(--tw-text-opacity))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(227 160 8 / var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(194 120 3 / var(--tw-text-opacity))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(142 75 16 / var(--tw-text-opacity))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(114 59 19 / var(--tw-text-opacity))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(99 49 18 / var(--tw-text-opacity))}.text-opacity-95{--tw-text-opacity: .95}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-blue-500\/50{--tw-shadow-color: rgb(63 131 248 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-blue-800\/80{--tw-shadow-color: rgb(30 66 159 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-cyan-500\/50{--tw-shadow-color: rgb(6 182 212 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-cyan-800\/80{--tw-shadow-color: rgb(21 94 117 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-green-500\/50{--tw-shadow-color: rgb(14 159 110 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-green-800\/80{--tw-shadow-color: rgb(3 84 63 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-lime-500\/50{--tw-shadow-color: rgb(132 204 22 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-lime-800\/80{--tw-shadow-color: rgb(63 98 18 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-pink-500\/50{--tw-shadow-color: rgb(231 70 148 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-pink-800\/80{--tw-shadow-color: rgb(153 21 75 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-500\/50{--tw-shadow-color: rgb(144 97 249 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-800\/80{--tw-shadow-color: rgb(85 33 181 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-red-500\/50{--tw-shadow-color: rgb(240 82 82 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-red-800\/80{--tw-shadow-color: rgb(155 28 28 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-teal-500\/50{--tw-shadow-color: rgb(6 148 162 / .5);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.ring-blue-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity))}.ring-cyan-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(21 94 117 / var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.ring-gray-600{--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}.ring-gray-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity))}.ring-green-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(3 84 63 / var(--tw-ring-opacity))}.ring-pink-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(153 21 75 / var(--tw-ring-opacity))}.ring-pink-900{--tw-ring-opacity: 1;--tw-ring-color: rgb(117 26 61 / var(--tw-ring-opacity))}.ring-purple-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(85 33 181 / var(--tw-ring-opacity))}.ring-purple-900{--tw-ring-opacity: 1;--tw-ring-color: rgb(74 29 150 / var(--tw-ring-opacity))}.ring-red-400{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}.ring-red-900{--tw-ring-opacity: 1;--tw-ring-color: rgb(119 29 29 / var(--tw-ring-opacity))}.ring-opacity-5{--tw-ring-opacity: .05}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-sm{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-75{transition-duration:75ms}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.scrollbar{scrollbar-width:auto;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar::-webkit-scrollbar{display:block;width:var(--scrollbar-width, 16px);height:var(--scrollbar-height, 16px)}.scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-thin::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar-thin::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-thin::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar-thin::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-thin::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar-thin::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar-thin{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-thin::-webkit-scrollbar{display:block;width:8px;height:8px}.scrollbar-track-bg-light{--scrollbar-track: var(--color-bg-light) !important}.scrollbar-track-bg-light-tone{--scrollbar-track: var(--color-bg-light-tone) !important}.scrollbar-track-gray-200{--scrollbar-track: #E5E7EB !important}.scrollbar-thumb-bg-light-tone{--scrollbar-thumb: var(--color-bg-light-tone) !important}.scrollbar-thumb-bg-light-tone-panel{--scrollbar-thumb: var(--color-bg-light-tone-panel) !important}.scrollbar-thumb-gray-400{--scrollbar-thumb: #9CA3AF !important}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.display-none{display:none}h1{margin-bottom:1.5rem;font-size:2.25rem;line-height:2.5rem;font-weight:700;--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}h1:is(.dark *){--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}@media (min-width: 768px){h1{font-size:3rem;line-height:1}}h2{margin-bottom:1rem;font-size:1.875rem;line-height:2.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}h2:is(.dark *){--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}h3{margin-bottom:.75rem;font-size:1.5rem;line-height:2rem;font-weight:500;--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}h3:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}h4{margin-bottom:.5rem;font-size:1.25rem;line-height:1.75rem;font-weight:500;--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}h4:is(.dark *){--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}h1,h2{border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity));padding-bottom:.5rem}h1:is(.dark *),h2:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity))}p{overflow-wrap:break-word;font-size:1rem;line-height:1.5rem;--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}p:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}ul{margin-left:0;list-style-type:disc}li{margin-left:1.25rem;list-style-type:disc}ol{margin-left:1.25rem;list-style-type:decimal}:root{--color-primary: #4a90e2;--color-primary-light: #6ab7f1;--color-secondary: #8ab8e0;--color-accent: #3a7ca1;--color-light-text-panel: #ffffff;--color-dark-text-panel: #e0e0e0;--color-bg-light-panel: #f0faff;--color-bg-light: #ffffff;--color-bg-light-tone: #e0f0ff;--color-bg-light-code-block: #f5faff;--color-bg-light-tone-panel: #d0e0f0;--color-bg-light-discussion: #f8faff;--color-bg-light-discussion-odd: #f0faff;--color-bg-dark: #0a0a1a;--color-bg-dark-tone: #151521;--color-bg-dark-tone-panel: #1c1c2a;--color-bg-dark-code-block: #151521;--color-bg-dark-discussion: #0e0e1a;--color-bg-dark-discussion-odd: #0d0d1a}textarea,input,select{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity))}textarea:is(.dark *),input:is(.dark *),select:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}.background-color{min-height:100vh;background-image:linear-gradient(to bottom right,var(--tw-gradient-stops));--tw-gradient-from: #E1EFFE var(--tw-gradient-from-position);--tw-gradient-to: rgb(225 239 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #CABFFD var(--tw-gradient-to-position)}.background-color:is(.dark *){--tw-gradient-from: #1E429F var(--tw-gradient-from-position);--tw-gradient-to: rgb(30 66 159 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #4A1D96 var(--tw-gradient-to-position)}.toolbar-color{border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity));--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.toolbar-color:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.panels-color{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.panels-color:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.unicolor-panels-color{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.unicolor-panels-color:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.chatbox-color{--tw-bg-opacity: 1;background-color:rgb(235 245 255 / var(--tw-bg-opacity))}.chatbox-color:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.message{position:relative;margin:.5rem;display:flex;width:100%;flex-grow:1;flex-direction:column;flex-wrap:wrap;overflow:visible;border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity));padding:1.25rem 1.25rem .75rem;font-size:1.125rem;line-height:1.75rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.message:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity))}.message{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(35 56 118 / var(--tw-text-opacity))}.message:is(.dark *){background-image:linear-gradient(to bottom right,var(--tw-gradient-stops));--tw-gradient-from: #233876 var(--tw-gradient-from-position);--tw-gradient-to: rgb(35 56 118 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #1E429F var(--tw-gradient-to-position);--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.message:hover{--tw-border-opacity: 1;border-color:rgb(118 169 250 / var(--tw-border-opacity))}.message:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.message:nth-child(2n){--tw-bg-opacity: 1;background-color:rgb(235 245 255 / var(--tw-bg-opacity))}.message:nth-child(2n):is(.dark *){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}.message:nth-child(odd){--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity))}.message:nth-child(odd):is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.message-header{margin-bottom:.5rem;font-size:1.25rem;line-height:1.75rem;font-weight:600}.message-content{font-size:1.125rem;line-height:1.75rem;line-height:1.625}body{min-height:100vh;--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity));font-size:1rem;line-height:1.5rem}body:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}.discussion{margin-right:.5rem;font-size:.75rem;line-height:1rem}.discussion-hilighted{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity));font-size:.75rem;line-height:1rem}.discussion-hilighted:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.bg-gradient-welcome{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops));--tw-gradient-from: #E1EFFE var(--tw-gradient-from-position);--tw-gradient-to: rgb(225 239 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #CABFFD var(--tw-gradient-to-position)}.bg-gradient-welcome:is(.dark *){--tw-gradient-from: #1E429F var(--tw-gradient-from-position);--tw-gradient-to: rgb(30 66 159 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #4A1D96 var(--tw-gradient-to-position)}.bg-gradient-progress{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #C3DDFD var(--tw-gradient-from-position);--tw-gradient-to: rgb(195 221 253 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #A4CAFE var(--tw-gradient-to-position)}.bg-gradient-progress:is(.dark *){--tw-gradient-from: #1A56DB var(--tw-gradient-from-position);--tw-gradient-to: rgb(26 86 219 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #1C64F2 var(--tw-gradient-to-position)}.text-gradient-title{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #1A56DB var(--tw-gradient-from-position);--tw-gradient-to: rgb(26 86 219 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #3F83F8 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.text-gradient-title:is(.dark *){--tw-gradient-from: #A4CAFE var(--tw-gradient-from-position);--tw-gradient-to: rgb(164 202 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #3F83F8 var(--tw-gradient-to-position)}.text-subtitle{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.text-subtitle:is(.dark *){--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.text-author{--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.text-author:is(.dark *){--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.text-loading{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.text-loading:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}.text-progress{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.text-progress:is(.dark *){--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.btn-primary{border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity));padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-secondary{border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(118 169 250 / var(--tw-bg-opacity));padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-secondary:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.card{border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:1.5rem;--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.card:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.input{border-radius:.375rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity));padding:.5rem 1rem}.input:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity))}.input:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.input:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(118 169 250 / var(--tw-ring-opacity))}.label{margin-bottom:.25rem;display:block;font-size:.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.label:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}.link{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.link:hover{--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.link:is(.dark *){--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.link:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.navbar-container{border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity));--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.navbar-container:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.game-menu{position:relative;display:flex;align-items:center;justify-content:center}.text-shadow-custom{text-shadow:1px 1px 0px #e0e0e0,-1px -1px 0px #e0e0e0,1px -1px 0px #e0e0e0,-1px 1px 0px #e0e0e0}.menu-item{margin-bottom:.5rem;padding:.5rem 1rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity));transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.menu-item:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}.menu-item:hover{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.menu-item:is(.dark *):hover{--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.menu-item.active-link{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-top-left-radius:.375rem;border-top-right-radius:.375rem;--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity));font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity));transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);text-shadow:1px 1px 0px #e0e0e0,-1px -1px 0px #e0e0e0,1px -1px 0px #e0e0e0,-1px 1px 0px #e0e0e0}.menu-item.active-link:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}.menu-item.active-link:hover{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-text-opacity: 1;color:rgb(35 56 118 / var(--tw-text-opacity))}.menu-item.active-link:is(.dark *):hover{--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.menu-item.active-link{text-shadow:0 0 10px rgba(128,128,128,.5)}.menu-item.active-link:before{content:"";position:absolute;bottom:-5px;left:0;width:100%;height:5px;background:linear-gradient(to right,#4a90e2,#8ab8e0,#4a90e2);border-radius:10px;animation:shimmer 2s infinite}.dark .menu-item.active-link:before{background:linear-gradient(to right,#6ab7f1,#aaa,#6ab7f1)}@keyframes shimmer{0%{background-position:-100% 0}to{background-position:100% 0}}@keyframes bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-5px)}}.feather-emoji{display:inline-block;margin-left:5px;animation:bounce 2s infinite}.app-card{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity));--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.app-card:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.app-card:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.app-card:hover{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}button{transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}button:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scrollbar-thin{scrollbar-width:thin;scrollbar-color:#76A9FA #C3DDFD}.dark .scrollbar-thin{scrollbar-color:#1C64F2 #1E429F}.scrollbar-thin::-webkit-scrollbar{width:.5rem}.scrollbar-thin::-webkit-scrollbar-track{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.scrollbar-thin:is(.dark *)::-webkit-scrollbar-track{--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.scrollbar-thin::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(118 169 250 / var(--tw-bg-opacity))}.scrollbar-thin:is(.dark *)::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.scrollbar-thin::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.scrollbar-thin:is(.dark *)::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.btn{display:flex;align-items:center;border-radius:.5rem;padding:.5rem 1rem;font-weight:600;--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.btn-primary{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-primary:hover{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.btn-primary:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity))}.btn-primary:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(28 100 242 / var(--tw-ring-opacity))}.btn-secondary{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.btn-secondary:hover{--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}.btn-secondary:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(195 221 253 / var(--tw-ring-opacity))}.btn-secondary:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.btn-secondary:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.btn-secondary:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(28 100 242 / var(--tw-ring-opacity))}.search-input{width:100%;border-bottom-width:2px;--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity));background-color:transparent;padding:.5rem 1rem .5rem 2.5rem;--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.search-input:focus{--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity));outline:2px solid transparent;outline-offset:2px}.search-input:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.search-input:focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(118 169 250 / var(--tw-border-opacity))}.scrollbar::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar::-webkit-scrollbar{display:block;width:8px;height:8px}.scrollbar{--scrollbar-track: #C3DDFD;--scrollbar-thumb: #76A9FA;scrollbar-width:thin;scrollbar-color:#76A9FA #C3DDFD}.dark .scrollbar{scrollbar-color:#1C64F2 #1E429F}.scrollbar::-webkit-scrollbar{width:.5rem}.scrollbar::-webkit-scrollbar-track{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.scrollbar:is(.dark *)::-webkit-scrollbar-track{--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(118 169 250 / var(--tw-bg-opacity))}.scrollbar:is(.dark *)::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.scrollbar::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.scrollbar:is(.dark *)::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.scrollbar{--scrollbar-thumb-hover: #3F83F8}.scrollbar:is(.dark *){--scrollbar-track: #1A56DB;--scrollbar-thumb: #1C64F2;--scrollbar-thumb-hover: #3F83F8}.card-title{margin-bottom:.5rem;font-size:1.25rem;line-height:1.75rem;font-weight:700;--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.card-title:is(.dark *){--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.card-content{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.card-content:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}.card-footer{margin-top:1rem;display:flex;align-items:center;justify-content:space-between}.card-footer-button{border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity));padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.card-footer-button:hover{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.subcard{border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(235 245 255 / var(--tw-bg-opacity));padding:1rem;--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.subcard:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.subcard-title{margin-bottom:.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.subcard-title:is(.dark *){--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.subcard-content{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.subcard-content:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}.subcard-footer{margin-top:1rem;display:flex;align-items:center;justify-content:space-between}.subcard-footer-button{border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity));padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.subcard-footer-button:hover{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.last\:mb-0:last-child{margin-bottom:0}.last\:\!border-transparent:last-child{border-color:transparent!important}.last\:pb-0:last-child{padding-bottom:0}.even\:bg-bg-light-discussion-odd:nth-child(2n){background-color:var(--color-bg-light-discussion-odd)}.group:hover .group-hover\:visible{visibility:visible}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\/item:hover .group-hover\/item\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\/item:hover .group-hover\/item\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:border-secondary{border-color:var(--color-secondary)}.group:hover .group-hover\:bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.group:hover .group-hover\:bg-white\/50{background-color:#ffffff80}.group:hover .group-hover\:bg-opacity-0{--tw-bg-opacity: 0}.group:hover .group-hover\:from-cyan-500{--tw-gradient-from: #06b6d4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-green-400{--tw-gradient-from: #31C48D var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 196 141 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-pink-500{--tw-gradient-from: #E74694 var(--tw-gradient-from-position);--tw-gradient-to: rgb(231 70 148 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-purple-500{--tw-gradient-from: #9061F9 var(--tw-gradient-from-position);--tw-gradient-to: rgb(144 97 249 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-purple-600{--tw-gradient-from: #7E3AF2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-red-200{--tw-gradient-from: #FBD5D5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 213 213 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-teal-300{--tw-gradient-from: #7EDCE2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 220 226 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:via-red-300{--tw-gradient-to: rgb(248 180 180 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #F8B4B4 var(--tw-gradient-via-position), var(--tw-gradient-to)}.group:hover .group-hover\:to-blue-500{--tw-gradient-to: #3F83F8 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-blue-600{--tw-gradient-to: #1C64F2 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-lime-300{--tw-gradient-to: #bef264 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-orange-400{--tw-gradient-to: #FF8A4C var(--tw-gradient-to-position)}.group:hover .group-hover\:to-pink-500{--tw-gradient-to: #E74694 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-yellow-200{--tw-gradient-to: #FCE96A var(--tw-gradient-to-position)}.group:hover .group-hover\:text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.group\/item:hover .group-hover\/item\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group:focus .group-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.group:focus .group-focus\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group:focus .group-focus\:ring-white{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity))}.peer:checked~.peer-checked\:text-primary{color:var(--color-primary)}.hover\:z-10:hover{z-index:10}.hover\:z-20:hover{z-index:20}.hover\:h-8:hover{height:2rem}.hover\:-translate-y-1:hover{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:-translate-y-2:hover{--tw-translate-y: -.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-x-100:hover{--tw-scale-x: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-2:hover{border-width:2px}.hover\:border-solid:hover{border-style:solid}.hover\:border-blue-300:hover{--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity))}.hover\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.hover\:border-gray-600:hover{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.hover\:border-green-200:hover{--tw-border-opacity: 1;border-color:rgb(188 240 218 / var(--tw-border-opacity))}.hover\:border-primary:hover{border-color:var(--color-primary)}.hover\:border-primary-light:hover{border-color:var(--color-primary-light)}.hover\:border-secondary:hover{border-color:var(--color-secondary)}.hover\:bg-bg-light-tone:hover{background-color:var(--color-bg-light-tone)}.hover\:bg-bg-light-tone-panel:hover{background-color:var(--color-bg-light-tone-panel)}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity))}.hover\:bg-blue-200:hover{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.hover\:bg-blue-300:hover{--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}.hover\:bg-blue-400:hover{--tw-bg-opacity: 1;background-color:rgb(118 169 250 / var(--tw-bg-opacity))}.hover\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.hover\:bg-blue-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.hover\:bg-gray-400:hover{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.hover\:bg-gray-900:hover{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.hover\:bg-green-200:hover{--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}.hover\:bg-green-300:hover{--tw-bg-opacity: 1;background-color:rgb(132 225 188 / var(--tw-bg-opacity))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}.hover\:bg-green-800:hover{--tw-bg-opacity: 1;background-color:rgb(3 84 63 / var(--tw-bg-opacity))}.hover\:bg-pink-800:hover{--tw-bg-opacity: 1;background-color:rgb(153 21 75 / var(--tw-bg-opacity))}.hover\:bg-primary:hover{background-color:var(--color-primary)}.hover\:bg-primary-light:hover{background-color:var(--color-primary-light)}.hover\:bg-purple-800:hover{--tw-bg-opacity: 1;background-color:rgb(85 33 181 / var(--tw-bg-opacity))}.hover\:bg-red-200:hover{--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}.hover\:bg-red-300:hover{--tw-bg-opacity: 1;background-color:rgb(248 180 180 / var(--tw-bg-opacity))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}.hover\:bg-red-800:hover{--tw-bg-opacity: 1;background-color:rgb(155 28 28 / var(--tw-bg-opacity))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.hover\:bg-yellow-200:hover{--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}.hover\:bg-yellow-500:hover{--tw-bg-opacity: 1;background-color:rgb(194 120 3 / var(--tw-bg-opacity))}.hover\:bg-gradient-to-bl:hover{background-image:linear-gradient(to bottom left,var(--tw-gradient-stops))}.hover\:bg-gradient-to-br:hover{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.hover\:bg-gradient-to-l:hover{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.hover\:bg-gradient-to-r:hover{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.hover\:from-blue-50:hover{--tw-gradient-from: #EBF5FF var(--tw-gradient-from-position);--tw-gradient-to: rgb(235 245 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-teal-200:hover{--tw-gradient-from: #AFECEF var(--tw-gradient-from-position);--tw-gradient-to: rgb(175 236 239 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-lime-200:hover{--tw-gradient-to: #d9f99d var(--tw-gradient-to-position)}.hover\:to-purple-50:hover{--tw-gradient-to: #F6F5FF var(--tw-gradient-to-position)}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\:text-green-300:hover{--tw-text-opacity: 1;color:rgb(132 225 188 / var(--tw-text-opacity))}.hover\:text-green-500:hover{--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}.hover\:text-green-600:hover{--tw-text-opacity: 1;color:rgb(5 122 85 / var(--tw-text-opacity))}.hover\:text-indigo-600:hover{--tw-text-opacity: 1;color:rgb(88 80 236 / var(--tw-text-opacity))}.hover\:text-primary:hover{color:var(--color-primary)}.hover\:text-purple-600:hover{--tw-text-opacity: 1;color:rgb(126 58 242 / var(--tw-text-opacity))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(248 180 180 / var(--tw-text-opacity))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(224 36 36 / var(--tw-text-opacity))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(200 30 30 / var(--tw-text-opacity))}.hover\:text-secondary:hover{color:var(--color-secondary)}.hover\:text-teal-600:hover{--tw-text-opacity: 1;color:rgb(4 116 129 / var(--tw-text-opacity))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.hover\:text-yellow-600:hover{--tw-text-opacity: 1;color:rgb(159 88 10 / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:no-underline:hover{text-decoration-line:none}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-none:hover{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:scrollbar-thumb-primary{--scrollbar-thumb-hover: var(--color-primary) !important}.focus\:z-10:focus{z-index:10}.focus\:border-blue-300:focus{--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity))}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.focus\:border-secondary:focus{border-color:var(--color-secondary)}.focus\:border-transparent:focus{border-color:transparent}.focus\:text-blue-700:focus{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-4:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(195 221 253 / var(--tw-ring-opacity))}.focus\:ring-blue-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity))}.focus\:ring-blue-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(118 169 250 / var(--tw-ring-opacity))}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity))}.focus\:ring-blue-500\/50:focus{--tw-ring-color: rgb(63 131 248 / .5)}.focus\:ring-blue-700:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(26 86 219 / var(--tw-ring-opacity))}.focus\:ring-cyan-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(165 243 252 / var(--tw-ring-opacity))}.focus\:ring-cyan-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(103 232 249 / var(--tw-ring-opacity))}.focus\:ring-gray-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity))}.focus\:ring-gray-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.focus\:ring-gray-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus\:ring-green-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(188 240 218 / var(--tw-ring-opacity))}.focus\:ring-green-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(132 225 188 / var(--tw-ring-opacity))}.focus\:ring-green-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(49 196 141 / var(--tw-ring-opacity))}.focus\:ring-lime-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(217 249 157 / var(--tw-ring-opacity))}.focus\:ring-lime-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(190 242 100 / var(--tw-ring-opacity))}.focus\:ring-pink-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(250 209 232 / var(--tw-ring-opacity))}.focus\:ring-pink-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 180 217 / var(--tw-ring-opacity))}.focus\:ring-purple-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(220 215 254 / var(--tw-ring-opacity))}.focus\:ring-purple-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(202 191 253 / var(--tw-ring-opacity))}.focus\:ring-red-100:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(253 232 232 / var(--tw-ring-opacity))}.focus\:ring-red-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 180 180 / var(--tw-ring-opacity))}.focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}.focus\:ring-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(240 82 82 / var(--tw-ring-opacity))}.focus\:ring-secondary:focus{--tw-ring-color: var(--color-secondary)}.focus\:ring-teal-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(126 220 226 / var(--tw-ring-opacity))}.focus\:ring-yellow-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(250 202 21 / var(--tw-ring-opacity))}.focus\:ring-yellow-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(227 160 8 / var(--tw-ring-opacity))}.focus\:ring-opacity-50:focus{--tw-ring-opacity: .5}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.active\:scale-75:active{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:bg-gray-300:active{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.active\:scrollbar-thumb-secondary{--scrollbar-thumb-active: var(--color-secondary) !important}.dark\:divide-gray-700:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity))}.dark\:border-bg-light:is(.dark *){border-color:var(--color-bg-light)}.dark\:border-blue-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(26 86 219 / var(--tw-border-opacity))}.dark\:border-gray-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}.dark\:border-gray-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.dark\:border-gray-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity))}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity))}.dark\:border-green-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(14 159 110 / var(--tw-border-opacity))}.dark\:border-pink-400:is(.dark *){--tw-border-opacity: 1;border-color:rgb(241 126 184 / var(--tw-border-opacity))}.dark\:border-pink-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(231 70 148 / var(--tw-border-opacity))}.dark\:border-purple-400:is(.dark *){--tw-border-opacity: 1;border-color:rgb(172 148 250 / var(--tw-border-opacity))}.dark\:border-purple-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(144 97 249 / var(--tw-border-opacity))}.dark\:border-red-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(240 82 82 / var(--tw-border-opacity))}.dark\:border-transparent:is(.dark *){border-color:transparent}.dark\:border-yellow-300:is(.dark *){--tw-border-opacity: 1;border-color:rgb(250 202 21 / var(--tw-border-opacity))}.dark\:bg-bg-dark:is(.dark *){background-color:var(--color-bg-dark)}.dark\:bg-bg-dark-tone:is(.dark *){background-color:var(--color-bg-dark-tone)}.dark\:bg-bg-dark-tone-panel:is(.dark *){background-color:var(--color-bg-dark-tone-panel)}.dark\:bg-black:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.dark\:bg-blue-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.dark\:bg-blue-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.dark\:bg-blue-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.dark\:bg-blue-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.dark\:bg-blue-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}.dark\:bg-gray-300:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.dark\:bg-gray-400:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.dark\:bg-gray-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.dark\:bg-gray-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\:bg-gray-800\/30:is(.dark *){background-color:#1f29374d}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.dark\:bg-green-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}.dark\:bg-green-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(14 159 110 / var(--tw-bg-opacity))}.dark\:bg-green-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}.dark\:bg-green-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 84 63 / var(--tw-bg-opacity))}.dark\:bg-green-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(1 71 55 / var(--tw-bg-opacity))}.dark\:bg-indigo-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(205 219 254 / var(--tw-bg-opacity))}.dark\:bg-indigo-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(104 117 245 / var(--tw-bg-opacity))}.dark\:bg-orange-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(180 52 3 / var(--tw-bg-opacity))}.dark\:bg-orange-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(138 44 13 / var(--tw-bg-opacity))}.dark\:bg-pink-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(250 209 232 / var(--tw-bg-opacity))}.dark\:bg-pink-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(214 31 105 / var(--tw-bg-opacity))}.dark\:bg-purple-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(220 215 254 / var(--tw-bg-opacity))}.dark\:bg-purple-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}.dark\:bg-purple-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(126 58 242 / var(--tw-bg-opacity))}.dark\:bg-red-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}.dark\:bg-red-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(240 82 82 / var(--tw-bg-opacity))}.dark\:bg-red-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}.dark\:bg-red-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(155 28 28 / var(--tw-bg-opacity))}.dark\:bg-red-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(119 29 29 / var(--tw-bg-opacity))}.dark\:bg-white:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.dark\:bg-yellow-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}.dark\:bg-opacity-70:is(.dark *){--tw-bg-opacity: .7}.dark\:bg-opacity-80:is(.dark *){--tw-bg-opacity: .8}.dark\:from-bg-dark:is(.dark *){--tw-gradient-from: var(--color-bg-dark) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-bg-dark-tone:is(.dark *){--tw-gradient-from: var(--color-bg-dark-tone) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-blue-400\/20:is(.dark *){--tw-gradient-from: rgb(118 169 250 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(118 169 250 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-indigo-400:is(.dark *){--tw-gradient-from: #8DA2FB var(--tw-gradient-from-position);--tw-gradient-to: rgb(141 162 251 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:via-bg-dark:is(.dark *){--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--color-bg-dark) var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark\:to-purple-400:is(.dark *){--tw-gradient-to: #AC94FA var(--tw-gradient-to-position)}.dark\:to-purple-400\/20:is(.dark *){--tw-gradient-to: rgb(172 148 250 / .2) var(--tw-gradient-to-position)}.dark\:fill-gray-300:is(.dark *){fill:#d1d5db}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.dark\:text-blue-500:is(.dark *){--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.dark\:text-blue-800:is(.dark *){--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.dark\:text-dark-text-panel:is(.dark *){color:var(--color-dark-text-panel)}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity))}.dark\:text-gray-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.dark\:text-gray-500:is(.dark *){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.dark\:text-gray-800:is(.dark *){--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.dark\:text-green-200:is(.dark *){--tw-text-opacity: 1;color:rgb(188 240 218 / var(--tw-text-opacity))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(49 196 141 / var(--tw-text-opacity))}.dark\:text-green-500:is(.dark *){--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}.dark\:text-green-800:is(.dark *){--tw-text-opacity: 1;color:rgb(3 84 63 / var(--tw-text-opacity))}.dark\:text-green-900:is(.dark *){--tw-text-opacity: 1;color:rgb(1 71 55 / var(--tw-text-opacity))}.dark\:text-indigo-500:is(.dark *){--tw-text-opacity: 1;color:rgb(104 117 245 / var(--tw-text-opacity))}.dark\:text-indigo-900:is(.dark *){--tw-text-opacity: 1;color:rgb(54 47 120 / var(--tw-text-opacity))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(252 217 189 / var(--tw-text-opacity))}.dark\:text-pink-400:is(.dark *){--tw-text-opacity: 1;color:rgb(241 126 184 / var(--tw-text-opacity))}.dark\:text-pink-500:is(.dark *){--tw-text-opacity: 1;color:rgb(231 70 148 / var(--tw-text-opacity))}.dark\:text-pink-900:is(.dark *){--tw-text-opacity: 1;color:rgb(117 26 61 / var(--tw-text-opacity))}.dark\:text-primary:is(.dark *){color:var(--color-primary)}.dark\:text-purple-400:is(.dark *){--tw-text-opacity: 1;color:rgb(172 148 250 / var(--tw-text-opacity))}.dark\:text-purple-500:is(.dark *){--tw-text-opacity: 1;color:rgb(144 97 249 / var(--tw-text-opacity))}.dark\:text-purple-900:is(.dark *){--tw-text-opacity: 1;color:rgb(74 29 150 / var(--tw-text-opacity))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(251 213 213 / var(--tw-text-opacity))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(248 180 180 / var(--tw-text-opacity))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(249 128 128 / var(--tw-text-opacity))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}.dark\:text-red-800:is(.dark *){--tw-text-opacity: 1;color:rgb(155 28 28 / var(--tw-text-opacity))}.dark\:text-red-900:is(.dark *){--tw-text-opacity: 1;color:rgb(119 29 29 / var(--tw-text-opacity))}.dark\:text-slate-50:is(.dark *){--tw-text-opacity: 1;color:rgb(248 250 252 / var(--tw-text-opacity))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(250 202 21 / var(--tw-text-opacity))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(227 160 8 / var(--tw-text-opacity))}.dark\:text-yellow-500:is(.dark *){--tw-text-opacity: 1;color:rgb(194 120 3 / var(--tw-text-opacity))}.dark\:text-yellow-800:is(.dark *){--tw-text-opacity: 1;color:rgb(114 59 19 / var(--tw-text-opacity))}.dark\:text-yellow-900:is(.dark *){--tw-text-opacity: 1;color:rgb(99 49 18 / var(--tw-text-opacity))}.dark\:placeholder-gray-400:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}.dark\:placeholder-gray-400:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}.dark\:shadow-lg:is(.dark *){--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\:shadow-blue-800\/80:is(.dark *){--tw-shadow-color: rgb(30 66 159 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-cyan-800\/80:is(.dark *){--tw-shadow-color: rgb(21 94 117 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-green-800\/80:is(.dark *){--tw-shadow-color: rgb(3 84 63 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-lime-800\/80:is(.dark *){--tw-shadow-color: rgb(63 98 18 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-pink-800\/80:is(.dark *){--tw-shadow-color: rgb(153 21 75 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-purple-800\/80:is(.dark *){--tw-shadow-color: rgb(85 33 181 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-red-800\/80:is(.dark *){--tw-shadow-color: rgb(155 28 28 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-teal-800\/80:is(.dark *){--tw-shadow-color: rgb(5 80 92 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:ring-gray-500:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}.dark\:ring-white:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity))}.dark\:ring-opacity-20:is(.dark *){--tw-ring-opacity: .2}.dark\:ring-offset-gray-700:is(.dark *){--tw-ring-offset-color: #374151}.dark\:ring-offset-gray-800:is(.dark *){--tw-ring-offset-color: #1F2937}.dark\:scrollbar-track-bg-dark:is(.dark *){--scrollbar-track: var(--color-bg-dark) !important}.dark\:scrollbar-track-bg-dark-tone:is(.dark *){--scrollbar-track: var(--color-bg-dark-tone) !important}.dark\:scrollbar-track-gray-700:is(.dark *){--scrollbar-track: #374151 !important}.dark\:scrollbar-track-gray-800:is(.dark *){--scrollbar-track: #1F2937 !important}.dark\:scrollbar-thumb-bg-dark-tone:is(.dark *){--scrollbar-thumb: var(--color-bg-dark-tone) !important}.dark\:scrollbar-thumb-bg-dark-tone-panel:is(.dark *){--scrollbar-thumb: var(--color-bg-dark-tone-panel) !important}.dark\:scrollbar-thumb-gray-500:is(.dark *){--scrollbar-thumb: #6B7280 !important}.dark\:scrollbar-thumb-gray-600:is(.dark *){--scrollbar-thumb: #4B5563 !important}.dark\:even\:bg-bg-dark-discussion-odd:nth-child(2n):is(.dark *){background-color:var(--color-bg-dark-discussion-odd)}.group:hover .dark\:group-hover\:bg-gray-800\/60:is(.dark *){background-color:#1f293799}.group:hover .dark\:group-hover\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.group:focus .dark\:group-focus\:ring-gray-800\/70:is(.dark *){--tw-ring-color: rgb(31 41 55 / .7)}.dark\:hover\:border-blue-600:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity))}.dark\:hover\:border-gray-600:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.dark\:hover\:border-primary:hover:is(.dark *){border-color:var(--color-primary)}.dark\:hover\:bg-blue-300:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}.dark\:hover\:bg-blue-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.dark\:hover\:bg-blue-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.dark\:hover\:bg-blue-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}.dark\:hover\:bg-gray-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\:hover\:bg-green-300:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(132 225 188 / var(--tw-bg-opacity))}.dark\:hover\:bg-green-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}.dark\:hover\:bg-green-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}.dark\:hover\:bg-pink-500:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(231 70 148 / var(--tw-bg-opacity))}.dark\:hover\:bg-pink-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(191 18 93 / var(--tw-bg-opacity))}.dark\:hover\:bg-primary:hover:is(.dark *){background-color:var(--color-primary)}.dark\:hover\:bg-purple-500:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}.dark\:hover\:bg-purple-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(108 43 217 / var(--tw-bg-opacity))}.dark\:hover\:bg-red-300:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(248 180 180 / var(--tw-bg-opacity))}.dark\:hover\:bg-red-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}.dark\:hover\:bg-red-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}.dark\:hover\:bg-yellow-300:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(250 202 21 / var(--tw-bg-opacity))}.dark\:hover\:bg-yellow-400:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(227 160 8 / var(--tw-bg-opacity))}.hover\:dark\:bg-bg-dark-tone:is(.dark *):hover{background-color:var(--color-bg-dark-tone)}.hover\:dark\:bg-bg-dark-tone-panel:is(.dark *):hover{background-color:var(--color-bg-dark-tone-panel)}.dark\:hover\:from-blue-900\/30:hover:is(.dark *){--tw-gradient-from: rgb(35 56 118 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(35 56 118 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:hover\:to-purple-900\/30:hover:is(.dark *){--tw-gradient-to: rgb(74 29 150 / .3) var(--tw-gradient-to-position)}.dark\:hover\:text-blue-500:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.dark\:hover\:text-gray-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.dark\:hover\:text-gray-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.dark\:hover\:text-gray-900:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.dark\:hover\:text-green-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(132 225 188 / var(--tw-text-opacity))}.dark\:hover\:text-green-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(49 196 141 / var(--tw-text-opacity))}.dark\:hover\:text-primary:hover:is(.dark *){color:var(--color-primary)}.dark\:hover\:text-red-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(249 128 128 / var(--tw-text-opacity))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:hover\:scrollbar-thumb-primary:is(.dark *){--scrollbar-thumb-hover: var(--color-primary) !important}.dark\:focus\:border-blue-500:focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.dark\:focus\:border-secondary:focus:is(.dark *){border-color:var(--color-secondary)}.dark\:focus\:text-white:focus:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:focus\:ring-blue-500:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity))}.dark\:focus\:ring-blue-600:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(28 100 242 / var(--tw-ring-opacity))}.dark\:focus\:ring-blue-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity))}.dark\:focus\:ring-cyan-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(21 94 117 / var(--tw-ring-opacity))}.dark\:focus\:ring-gray-500:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}.dark\:focus\:ring-gray-600:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}.dark\:focus\:ring-gray-700:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity))}.dark\:focus\:ring-gray-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity))}.dark\:focus\:ring-green-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(3 84 63 / var(--tw-ring-opacity))}.dark\:focus\:ring-lime-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(63 98 18 / var(--tw-ring-opacity))}.dark\:focus\:ring-pink-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(153 21 75 / var(--tw-ring-opacity))}.dark\:focus\:ring-pink-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(117 26 61 / var(--tw-ring-opacity))}.dark\:focus\:ring-purple-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(85 33 181 / var(--tw-ring-opacity))}.dark\:focus\:ring-purple-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(74 29 150 / var(--tw-ring-opacity))}.dark\:focus\:ring-red-400:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}.dark\:focus\:ring-red-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(155 28 28 / var(--tw-ring-opacity))}.dark\:focus\:ring-red-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(119 29 29 / var(--tw-ring-opacity))}.dark\:focus\:ring-secondary:focus:is(.dark *){--tw-ring-color: var(--color-secondary)}.dark\:focus\:ring-teal-700:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(3 102 114 / var(--tw-ring-opacity))}.dark\:focus\:ring-teal-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(5 80 92 / var(--tw-ring-opacity))}.dark\:focus\:ring-yellow-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(99 49 18 / var(--tw-ring-opacity))}.dark\:focus\:ring-offset-gray-700:focus:is(.dark *){--tw-ring-offset-color: #374151}.dark\:active\:bg-gray-600:active:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}@media (min-width: 640px){.sm\:mt-0{margin-top:0}.sm\:h-10{height:2.5rem}.sm\:h-6{height:1.5rem}.sm\:h-64{height:16rem}.sm\:w-1\/4{width:25%}.sm\:w-10{width:2.5rem}.sm\:w-6{width:1.5rem}.sm\:w-auto{width:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:rounded-lg{border-radius:.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:text-center{text-align:center}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media (min-width: 768px){.md\:inset-0{top:0;right:0;bottom:0;left:0}.md\:order-2{order:2}.md\:mr-6{margin-right:1.5rem}.md\:mt-0{margin-top:0}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-auto{height:auto}.md\:h-full{height:100%}.md\:w-1\/4{width:25%}.md\:w-48{width:12rem}.md\:w-auto{width:auto}.md\:max-w-xl{max-width:36rem}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.md\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.md\:rounded-none{border-radius:0}.md\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.md\:border-0{border-width:0px}.md\:bg-transparent{background-color:transparent}.md\:p-0{padding:0}.md\:p-6{padding:1.5rem}.md\:text-5xl{font-size:3rem;line-height:1}.md\:text-6xl{font-size:3.75rem;line-height:1}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:font-medium{font-weight:500}.md\:text-blue-700{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.md\:hover\:bg-transparent:hover{background-color:transparent}.md\:hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.md\:dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.md\:dark\:hover\:bg-transparent:hover:is(.dark *){background-color:transparent}.md\:dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}}@media (min-width: 1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}}@media (min-width: 1280px){.xl\:h-80{height:20rem}.xl\:w-1\/6{width:16.666667%}}@media (min-width: 1536px){.\32xl\:h-96{height:24rem}} diff --git a/web/dist/assets/index-hg90DEcF.js b/web/dist/assets/index-C6H27J5x.js similarity index 97% rename from web/dist/assets/index-hg90DEcF.js rename to web/dist/assets/index-C6H27J5x.js index 3cf1c94e..27196187 100644 --- a/web/dist/assets/index-hg90DEcF.js +++ b/web/dist/assets/index-C6H27J5x.js @@ -241,7 +241,7 @@ If You are using windows, this will install wsl so you need to activate it. `+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),p=p+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},copyContentToClipboard(){this.$emit("copy",this)},deleteMsg(){this.$emit("delete",this.message.id),this.deleteMsgMode=!1},rankUp(){this.$emit("rankUp",this.message.id)},rankDown(){this.$emit("rankDown",this.message.id)},updateMessage(){this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url),this.editMsgMode=!1},resendMessage(n){this.$emit("resendMessage",this.message.id,this.message.content,n)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?Eut+this.avatar:(console.log("No avatar found"),Bs)},defaultImg(n){n.target.src=Bs},parseDate(n){let e=new Date(Date.parse(n)),s=Math.floor((new Date-e)/1e3);return s<=1?"just now":s<20?s+" seconds ago":s<40?"half a minute ago":s<60?"less than a minute ago":s<=90?"one minute ago":s<=3540?Math.round(s/60)+" minutes ago":s<=5400?"1 hour ago":s<=86400?Math.round(s/3600)+" hours ago":s<=129600?"1 day ago":s<604800?Math.round(s/86400)+" days ago":s<=777600?"1 week ago":n},prettyDate(n){let e=new Date((n||"").replace(/-/g,"/").replace(/[TZ]/g," ")),t=(new Date().getTime()-e.getTime())/1e3,s=Math.floor(t/86400);if(!(isNaN(s)||s<0||s>=31))return s==0&&(t<60&&"just now"||t<120&&"1 minute ago"||t<3600&&Math.floor(t/60)+" minutes ago"||t<7200&&"1 hour ago"||t<86400&&Math.floor(t/3600)+" hours ago")||s==1&&"Yesterday"||s<7&&s+" days ago"||s<31&&Math.ceil(s/7)+" weeks ago"},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{audio_url(n){n&&(this.$refs.audio_player.src=n)},"message.content":function(n){this.$store.state.config.auto_speak&&(this.$store.state.config.xtts_enable&&this.$store.state.config.xtts_use_streaming_mode||this.isSpeaking||this.checkForFullSentence())},"message.ui":function(n){console.log("ui changed to",n),this.ui_componentKey++},showConfirmation(){Fe(()=>{Ve.replace()})},deleteMsgMode(){Fe(()=>{Ve.replace()})}},computed:{editMsgMode:{get(){return this.message.hasOwnProperty("open")?this.editMsgMode_||this.message.open:this.editMsgMode_},set(n){this.message.open=n,this.editMsgMode_=n,Fe(()=>{Ve.replace()})}},isTalking:{get(){return this.isSpeaking}},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){return new Date(Date.parse(this.message.created_at)).toLocaleString()},finished_generating_at_parsed(){return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()},time_spent(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===n.getTime()||!n.getTime()||!e.getTime())return;let[s,r,i]=this.computeTimeDiff(n,e);function o(c){return c<10&&(c="0"+c),c}return o(s)+"h:"+o(r)+"m:"+o(i)+"s"},warmup_duration(){const n=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.started_generating_at));if(console.log("Computing the warmup duration, ",n," -> ",e),e.getTime()===n.getTime())return 0;if(!n.getTime()||!e.getTime())return;let s,r,i;[s,r,i]=this.computeTimeDiff(n,e);function o(c){return c<10&&(c="0"+c),c}return o(s)+"h:"+o(r)+"m:"+o(i)+"s"},generation_rate(){const n=new Date(Date.parse(this.message.started_generating_at)),e=new Date(Date.parse(this.message.finished_generating_at)),t=this.message.nb_tokens;if(e.getTime()===n.getTime()||!t||!n.getTime()||!e.getTime())return;let r=e.getTime()-n.getTime();const i=Math.floor(r/1e3),o=t/i;return Math.round(o)+" t/s"}}},Sut={class:"relative message w-full group rounded-lg m-2 shadow-lg hover:border-primary dark:hover:border-primary hover:border-solid hover:border-2 border-2 border-transparent flex flex-col flex-grow flex-wrap overflow-visible p-4 pb-2"},Tut={class:"flex flex-row gap-2"},xut={class:"flex-shrink-0"},Cut={class:"group/avatar"},wut=["src","data-popover-target"],Rut={class:"flex flex-col w-full flex-grow-0"},Aut={class:"flex flex-row flex-grow items-start"},Mut={class:"flex flex-col mb-2"},Nut={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},Out=["title"],Iut={class:"overflow-x-auto w-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},kut={key:1},Dut=["src"],Lut={class:"message-details"},Put={key:0,class:"flex w-full cursor-pointer rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900 mb-3.5 max-w-full transition-all duration-300 ease-in-out"},Fut={class:"grid min-w-80 select-none grid-cols-[50px,1fr] items-center gap-3 p-3 bg-gray-50 dark:bg-gray-800 rounded-lg shadow-sm hover:shadow-md transition-all duration-300"},Uut={class:"relative grid aspect-square place-content-center overflow-hidden rounded-full bg-gradient-to-br from-blue-400 to-purple-500 transform transition-transform duration-300 hover:scale-105"},But={class:"leading-5"},Gut={class:"flex items-center gap-1 truncate whitespace-nowrap text-sm text-gray-500 dark:text-gray-400"},Vut={class:"px-5 pb-5 pt-4 transition-all duration-300 ease-in-out"},zut={class:"list-none"},Hut={class:"flex flex-col items-start w-full overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},qut={class:"flex-row justify-end mx-2"},Yut={class:"invisible group-hover:visible flex flex-row"},$ut={key:0},Wut={key:1},Kut={key:2},jut={key:3},Qut={key:4,class:"flex items-center duration-75"},Xut={class:"flex flex-row items-center"},Zut={class:"flex flex-row items-center"},Jut={key:6,class:"flex flex-row items-center"},ept=["src"],tpt={class:"text-sm text-gray-400 mt-2"},npt={class:"flex flex-row items-center gap-2"},spt={key:0},rpt={class:"font-thin"},ipt={key:1},opt={class:"font-thin"},apt={key:2},lpt={class:"font-thin"},cpt={key:3},dpt=["title"],upt={key:4},ppt=["title"],fpt={key:5},_pt=["title"],mpt={key:6},hpt=["title"];function gpt(n,e,t,s,r,i){var b;const o=nt("MarkdownRenderer"),a=nt("JsonViewer"),c=nt("DynamicUIRenderer"),d=nt("StatusIcon"),u=nt("StatusIndicator"),_=nt("Step"),m=nt("RenderHTMLJS"),h=nt("ToolbarButton"),f=nt("DropdownSubmenu"),y=nt("DropdownMenu");return T(),x("div",Sut,[l("div",Tut,[l("div",xut,[l("div",Cut,[l("img",{src:i.getImgUrl(),onError:e[0]||(e[0]=g=>i.defaultImg(g)),"data-popover-target":"avatar"+t.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,wut)])]),l("div",Rut,[l("div",Aut,[l("div",Mut,[l("div",Nut,Y(t.message.sender),1),t.message.created_at?(T(),x("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+i.created_at_parsed},Y(i.created_at),9,Out)):B("",!0)]),e[45]||(e[45]=l("div",{class:"flex-grow"},null,-1))]),l("div",Iut,[i.editMsgMode?B("",!0):(T(),at(o,{key:0,ref:"mdRender",host:t.host,"markdown-text":t.message.content,message_id:t.message.id,discussion_id:t.message.discussion_id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])),l("div",null,[t.message.open?k((T(),x("textarea",{key:0,ref:"mdTextarea",onKeydown:e[1]||(e[1]=ws($((...g)=>i.insertTab&&i.insertTab(...g),["prevent"]),["tab"])),class:"block min-h-[500px] p-2.5 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",rows:4,placeholder:"Enter message here...","onUpdate:modelValue":e[2]||(e[2]=g=>t.message.content=g)}," ",544)),[[ae,t.message.content]]):B("",!0)]),t.message.metadata!==null?(T(),x("div",kut,[(T(!0),x(Be,null,Ke(((b=t.message.metadata)==null?void 0:b.filter(g=>g!=null&&g.hasOwnProperty("title")&&g.hasOwnProperty("content")))||[],(g,E)=>(T(),x("div",{key:"json-"+t.message.id+"-"+E,class:"json font-bold"},[(T(),at(a,{jsonFormText:g.title,jsonData:g.content,key:"msgjson-"+t.message.id},null,8,["jsonFormText","jsonData"]))]))),128))])):B("",!0),t.message.ui?(T(),at(c,{ref:"ui",class:"w-full",ui:t.message.ui,key:"msgui-"+t.message.id},null,8,["ui"])):B("",!0),r.audio_url!=null?(T(),x("audio",{controls:"",key:r.audio_url},[l("source",{src:r.audio_url,type:"audio/wav",ref:"audio_player"},null,8,Dut),e[46]||(e[46]=Ze(" Your browser does not support the audio element. "))])):B("",!0),l("div",Lut,[t.message&&t.message.steps&&t.message.steps.length>0?(T(),x("details",Put,[l("summary",Fut,[l("div",Uut,[z(d,{status:t.message.status_message},null,8,["status"])]),l("dl",But,[e[47]||(e[47]=l("dd",{class:"text-lg font-semibold text-gray-800 dark:text-gray-200"},"Processing Info",-1)),l("dt",Gut,[z(u,{status:t.message.status_message},null,8,["status"]),Ze(" "+Y(t.message.status_message),1)])])]),l("div",Vut,[l("ol",zut,[(T(!0),x(Be,null,Ke(t.message.steps,(g,E)=>(T(),x("li",{key:`step-${t.message.id}-${E}`,class:Le(["group border-l pb-6 last:!border-transparent last:pb-0 dark:border-gray-800 transition-all duration-300 ease-in-out",{"bg-transparent":g.done}]),style:Bt({animationDelay:`${E*100}ms`})},[z(_,{done:g.done,text:g.text,status:g.status,step_type:g.step_type},null,8,["done","text","status","step_type"])],6))),128))])])])):B("",!0),l("div",Hut,[(T(!0),x(Be,null,Ke(t.message.html_js_s,(g,E)=>(T(),x("div",{key:`htmljs-${t.message.id}-${E}`,class:"font-bold animate-fadeIn",style:Bt({animationDelay:`${E*200}ms`})},[z(m,{htmlContent:g},null,8,["htmlContent"])],4))),128))])])]),l("div",qut,[l("div",Yut,[i.editMsgMode?(T(),x("div",$ut,[z(h,{onClick:e[3]||(e[3]=$(g=>i.editMsgMode=!1,["stop"])),title:"Cancel edit",icon:"x"}),z(h,{onClick:$(i.updateMessage,["stop"]),title:"Update message",icon:"check"},null,8,["onClick"]),z(y,{title:"Add Block"},{default:Ie(()=>[z(f,{title:"Programming Languages",icon:"code"},{default:Ie(()=>[z(h,{onClick:e[4]||(e[4]=$(g=>i.addBlock("python"),["stop"])),title:"Python",icon:"python"}),z(h,{onClick:e[5]||(e[5]=$(g=>i.addBlock("javascript"),["stop"])),title:"JavaScript",icon:"js"}),z(h,{onClick:e[6]||(e[6]=$(g=>i.addBlock("typescript"),["stop"])),title:"TypeScript",icon:"typescript"}),z(h,{onClick:e[7]||(e[7]=$(g=>i.addBlock("java"),["stop"])),title:"Java",icon:"java"}),z(h,{onClick:e[8]||(e[8]=$(g=>i.addBlock("c++"),["stop"])),title:"C++",icon:"cplusplus"}),z(h,{onClick:e[9]||(e[9]=$(g=>i.addBlock("csharp"),["stop"])),title:"C#",icon:"csharp"}),z(h,{onClick:e[10]||(e[10]=$(g=>i.addBlock("go"),["stop"])),title:"Go",icon:"go"}),z(h,{onClick:e[11]||(e[11]=$(g=>i.addBlock("rust"),["stop"])),title:"Rust",icon:"rust"}),z(h,{onClick:e[12]||(e[12]=$(g=>i.addBlock("swift"),["stop"])),title:"Swift",icon:"swift"}),z(h,{onClick:e[13]||(e[13]=$(g=>i.addBlock("kotlin"),["stop"])),title:"Kotlin",icon:"kotlin"}),z(h,{onClick:e[14]||(e[14]=$(g=>i.addBlock("r"),["stop"])),title:"R",icon:"r-project"})]),_:1}),z(f,{title:"Web Technologies",icon:"web"},{default:Ie(()=>[z(h,{onClick:e[15]||(e[15]=$(g=>i.addBlock("html"),["stop"])),title:"HTML",icon:"html5"}),z(h,{onClick:e[16]||(e[16]=$(g=>i.addBlock("css"),["stop"])),title:"CSS",icon:"css3"}),z(h,{onClick:e[17]||(e[17]=$(g=>i.addBlock("vue"),["stop"])),title:"Vue.js",icon:"vuejs"}),z(h,{onClick:e[18]||(e[18]=$(g=>i.addBlock("react"),["stop"])),title:"React",icon:"react"}),z(h,{onClick:e[19]||(e[19]=$(g=>i.addBlock("angular"),["stop"])),title:"Angular",icon:"angular"})]),_:1}),z(f,{title:"Markup and Data",icon:"file-code"},{default:Ie(()=>[z(h,{onClick:e[20]||(e[20]=$(g=>i.addBlock("xml"),["stop"])),title:"XML",icon:"xml"}),z(h,{onClick:e[21]||(e[21]=$(g=>i.addBlock("json"),["stop"])),title:"JSON",icon:"json"}),z(h,{onClick:e[22]||(e[22]=$(g=>i.addBlock("yaml"),["stop"])),title:"YAML",icon:"yaml"}),z(h,{onClick:e[23]||(e[23]=$(g=>i.addBlock("markdown"),["stop"])),title:"Markdown",icon:"markdown"}),z(h,{onClick:e[24]||(e[24]=$(g=>i.addBlock("latex"),["stop"])),title:"LaTeX",icon:"latex"})]),_:1}),z(f,{title:"Scripting and Shell",icon:"terminal"},{default:Ie(()=>[z(h,{onClick:e[25]||(e[25]=$(g=>i.addBlock("bash"),["stop"])),title:"Bash",icon:"bash"}),z(h,{onClick:e[26]||(e[26]=$(g=>i.addBlock("powershell"),["stop"])),title:"PowerShell",icon:"powershell"}),z(h,{onClick:e[27]||(e[27]=$(g=>i.addBlock("perl"),["stop"])),title:"Perl",icon:"perl"})]),_:1}),z(f,{title:"Diagramming",icon:"sitemap"},{default:Ie(()=>[z(h,{onClick:e[28]||(e[28]=$(g=>i.addBlock("mermaid"),["stop"])),title:"Mermaid",icon:"mermaid"}),z(h,{onClick:e[29]||(e[29]=$(g=>i.addBlock("graphviz"),["stop"])),title:"Graphviz",icon:"graphviz"}),z(h,{onClick:e[30]||(e[30]=$(g=>i.addBlock("plantuml"),["stop"])),title:"PlantUML",icon:"plantuml"})]),_:1}),z(f,{title:"Database",icon:"database"},{default:Ie(()=>[z(h,{onClick:e[31]||(e[31]=$(g=>i.addBlock("sql"),["stop"])),title:"SQL",icon:"sql"}),z(h,{onClick:e[32]||(e[32]=$(g=>i.addBlock("mongodb"),["stop"])),title:"MongoDB",icon:"mongodb"})]),_:1}),z(h,{onClick:e[33]||(e[33]=$(g=>i.addBlock(""),["stop"])),title:"Generic Block",icon:"code"})]),_:1})])):(T(),x("div",Wut,[z(h,{onClick:e[34]||(e[34]=$(g=>i.editMsgMode=!0,["stop"])),title:"Edit message",icon:"edit"})])),z(h,{onClick:i.copyContentToClipboard,title:"Copy message to clipboard",icon:"copy"},null,8,["onClick"]),!i.editMsgMode&&t.message.sender!==n.$store.state.mountedPers.name?(T(),x("div",Kut,[z(h,{onClick:e[35]||(e[35]=$(g=>i.resendMessage("full_context"),["stop"])),title:"Resend message with full context",icon:"send"}),z(h,{onClick:e[36]||(e[36]=$(g=>i.resendMessage("full_context_with_internet"),["stop"])),title:"Resend message with internet search",icon:"globe"}),z(h,{onClick:e[37]||(e[37]=$(g=>i.resendMessage("simple_question"),["stop"])),title:"Resend message without context",icon:"sendSimple"})])):B("",!0),!i.editMsgMode&&t.message.sender===n.$store.state.mountedPers.name?(T(),x("div",jut,[z(h,{onClick:i.continueMessage,title:"Continue message",icon:"fastForward"},null,8,["onClick"])])):B("",!0),r.deleteMsgMode?(T(),x("div",Qut,[l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Cancel removal",type:"button",onClick:e[38]||(e[38]=$(g=>r.deleteMsgMode=!1,["stop"]))},e[48]||(e[48]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Confirm removal",type:"button",onClick:e[39]||(e[39]=$(g=>i.deleteMsg(),["stop"]))},e[49]||(e[49]=[l("i",{"data-feather":"check"},null,-1)]))])):B("",!0),!i.editMsgMode&&!r.deleteMsgMode?(T(),x("div",{key:5,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Remove message",onClick:e[40]||(e[40]=g=>r.deleteMsgMode=!0)},e[50]||(e[50]=[l("i",{"data-feather":"trash"},null,-1)]))):B("",!0),l("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Upvote",onClick:e[41]||(e[41]=$(g=>i.rankUp(),["stop"]))},e[51]||(e[51]=[l("i",{"data-feather":"thumbs-up"},null,-1)])),l("div",Xut,[l("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Downvote",onClick:e[42]||(e[42]=$(g=>i.rankDown(),["stop"]))},e[52]||(e[52]=[l("i",{"data-feather":"thumbs-down"},null,-1)])),t.message.rank!=0?(T(),x("div",{key:0,class:Le(["rounded-full px-2 text-sm flex items-center justify-center font-bold cursor-pointer",t.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},Y(t.message.rank),3)):B("",!0)]),l("div",Zut,[this.$store.state.config.active_tts_service!="None"?(T(),x("div",{key:0,class:Le(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",{"text-red-500":i.isTalking}]),title:"speak",onClick:e[43]||(e[43]=$(g=>i.speak(),["stop"]))},e[53]||(e[53]=[l("i",{"data-feather":"volume-2"},null,-1)]),2)):B("",!0)]),this.$store.state.config.xtts_enable&&!this.$store.state.config.xtts_use_streaming_mode?(T(),x("div",Jut,[r.isSynthesizingVoice?(T(),x("img",{key:1,src:r.loading_svg},null,8,ept)):(T(),x("div",{key:0,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"generate_audio",onClick:e[44]||(e[44]=$(g=>i.read(),["stop"]))},e[54]||(e[54]=[l("i",{"data-feather":"voicemail"},null,-1)])))])):B("",!0)])]),l("div",tpt,[l("div",npt,[t.message.binding?(T(),x("p",spt,[e[55]||(e[55]=Ze("Binding: ")),l("span",rpt,Y(t.message.binding),1)])):B("",!0),t.message.model?(T(),x("p",ipt,[e[56]||(e[56]=Ze("Model: ")),l("span",opt,Y(t.message.model),1)])):B("",!0),t.message.seed?(T(),x("p",apt,[e[57]||(e[57]=Ze("Seed: ")),l("span",lpt,Y(t.message.seed),1)])):B("",!0),t.message.nb_tokens?(T(),x("p",cpt,[e[58]||(e[58]=Ze("Number of tokens: ")),l("span",{class:"font-thin",title:"Number of Tokens: "+t.message.nb_tokens},Y(t.message.nb_tokens),9,dpt)])):B("",!0),i.warmup_duration?(T(),x("p",upt,[e[59]||(e[59]=Ze("Warmup duration: ")),l("span",{class:"font-thin",title:"Warmup duration: "+i.warmup_duration},Y(i.warmup_duration),9,ppt)])):B("",!0),i.time_spent?(T(),x("p",fpt,[e[60]||(e[60]=Ze("Generation duration: ")),l("span",{class:"font-thin",title:"Finished generating: "+i.time_spent},Y(i.time_spent),9,_pt)])):B("",!0),i.generation_rate?(T(),x("p",mpt,[e[61]||(e[61]=Ze("Rate: ")),l("span",{class:"font-thin",title:"Generation rate: "+i.generation_rate},Y(i.generation_rate),9,hpt)])):B("",!0)])])])])])}const mN=rt(vut,[["render",gpt]]),bpt={setup(){return{}},name:"UniversalForm",data(){return{show:!1,resolve:null,controls_array:[],title:"Universal form",ConfirmButtonText:"Submit",DenyButtonText:"Cancel"}},mounted(){Fe(()=>{Ve.replace()})},methods:{btn_clicked(n){console.log(n)},hide(n){this.show=!1,this.resolve&&n&&(this.resolve(this.controls_array),this.resolve=null)},showForm(n,e,t,s){this.ConfirmButtonText=t||this.ConfirmButtonText,this.DenyButtonText=s||this.DenyButtonText;for(let r=0;r{this.controls_array=n,this.show=!0,this.title=e||this.title,this.resolve=r,console.log("show form",this.controls_array)})},openFileDialog(n){const e=document.createElement("input");e.type="file",n.type==="folder"&&(e.webkitdirectory=!0,e.directory=!0),n.accept&&(e.accept=n.accept),e.onchange=t=>{t.target.files.length>0&&(n.value=t.target.files[0].path)},e.click()}},watch:{controls_array:{deep:!0,handler(n){n.forEach(e=>{e.type==="int"?e.value=parseInt(e.value):e.type==="float"&&(e.value=parseFloat(e.value))})}},show(){Fe(()=>{Ve.replace()})}}},ypt={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 p-4 overflow-hidden"},Ept={class:"relative w-full max-w-md max-h-[80vh]"},vpt={class:"flex flex-col rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel shadow-lg"},Spt={class:"flex flex-row items-center p-4 border-b border-gray-200 dark:border-gray-700"},Tpt={class:"grow flex items-center"},xpt={class:"text-lg font-semibold select-none"},Cpt={class:"overflow-y-auto p-4 max-h-[60vh] custom-scrollbar"},wpt={class:"space-y-2"},Rpt={key:0},Apt={key:0},Mpt={class:"text-base font-semibold"},Npt={key:0,class:"relative inline-flex"},Opt=["onUpdate:modelValue"],Ipt={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},kpt=["onUpdate:modelValue"],Dpt={key:1},Lpt={class:"text-base font-semibold"},Ppt={key:0,class:"relative inline-flex"},Fpt=["onUpdate:modelValue"],Upt={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},Bpt=["onUpdate:modelValue"],Gpt=["value","selected"],Vpt={key:1},zpt={class:"",onclick:"btn_clicked(item)"},Hpt={key:2},qpt={key:0},Ypt={class:"text-base font-semibold"},$pt={key:0,class:"relative inline-flex"},Wpt=["onUpdate:modelValue"],Kpt={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},jpt=["onUpdate:modelValue"],Qpt={key:1},Xpt={class:"text-base font-semibold"},Zpt={key:0,class:"relative inline-flex"},Jpt=["onUpdate:modelValue"],eft={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},tft=["onUpdate:modelValue"],nft=["value","selected"],sft={key:3},rft={class:"text-base font-semibold"},ift={key:0,class:"relative inline-flex"},oft=["onUpdate:modelValue"],aft={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},lft=["onUpdate:modelValue"],cft=["onUpdate:modelValue","min","max"],dft={key:4},uft={class:"text-base font-semibold"},pft={key:0,class:"relative inline-flex"},fft=["onUpdate:modelValue"],_ft={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},mft=["onUpdate:modelValue"],hft=["onUpdate:modelValue","min","max"],gft={key:5},bft={class:"mb-2 relative flex items-center gap-2"},yft={for:"default-checkbox",class:"text-base font-semibold"},Eft=["onUpdate:modelValue"],vft={key:0,class:"relative inline-flex"},Sft=["onUpdate:modelValue"],Tft={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},xft={key:6},Cft={class:"text-base font-semibold"},wft={key:0,class:"relative inline-flex"},Rft=["onUpdate:modelValue"],Aft={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},Mft=["onUpdate:modelValue"],Nft={key:7,class:"space-y-2"},Oft={class:"flex items-center gap-2"},Ift={class:"text-base font-semibold"},kft={key:0,class:"relative inline-flex"},Dft=["onUpdate:modelValue"],Lft={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},Pft={class:"flex gap-2"},Fft=["onUpdate:modelValue","placeholder"],Uft=["onClick"],Bft={key:8,class:"h-px my-4 bg-gray-200 border-0 dark:bg-gray-700"},Gft={class:"flex justify-center gap-3 p-4 border-t border-gray-200 dark:border-gray-700"};function Vft(n,e,t,s,r,i){return r.show?(T(),x("div",ypt,[l("div",Ept,[l("div",vpt,[l("div",Spt,[l("div",Tpt,[e[3]||(e[3]=l("i",{"data-feather":"sliders",class:"mr-2 flex-shrink-0"},null,-1)),l("h3",xpt,Y(r.title),1)]),l("button",{onClick:e[0]||(e[0]=$(o=>i.hide(!1),["stop"])),title:"Close",class:"p-1.5 hover:bg-gray-200 rounded-lg dark:hover:bg-gray-800"},e[4]||(e[4]=[l("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"})],-1)]))]),l("div",Cpt,[l("div",wpt,[(T(!0),x(Be,null,Ke(r.controls_array,(o,a)=>(T(),x("div",{key:a,class:"p-1"},[o.type=="str"||o.type=="string"?(T(),x("div",Rpt,[o.options?B("",!0):(T(),x("div",Apt,[l("label",{class:Le(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Mpt,Y(o.name)+": ",1),o.help?(T(),x("label",Npt,[k(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Opt),[[He,o.isHelp]]),e[5]||(e[5]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),x("p",Ipt,Y(o.help),1)):B("",!0),k(l("input",{type:"text","onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter string"},null,8,kpt),[[ae,o.value]])])),o.options?(T(),x("div",Dpt,[l("label",{class:Le(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Lpt,Y(o.name)+": ",1),o.help?(T(),x("label",Ppt,[k(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Fpt),[[He,o.isHelp]]),e[6]||(e[6]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),x("p",Upt,Y(o.help),1)):B("",!0),k(l("select",{"onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(T(!0),x(Be,null,Ke(o.options,c=>(T(),x("option",{value:c,selected:o.value===c},Y(c),9,Gpt))),256))],8,Bpt),[[Ot,o.value]])])):B("",!0)])):B("",!0),o.type=="btn"?(T(),x("div",Vpt,[l("button",zpt,Y(o.name),1)])):B("",!0),o.type=="text"?(T(),x("div",Hpt,[o.options?B("",!0):(T(),x("div",qpt,[l("label",{class:Le(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Ypt,Y(o.name)+": ",1),o.help?(T(),x("label",$pt,[k(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Wpt),[[He,o.isHelp]]),e[7]||(e[7]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),x("p",Kpt,Y(o.help),1)):B("",!0),k(l("textarea",{"onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter string"},null,8,jpt),[[ae,o.value]])])),o.options?(T(),x("div",Qpt,[l("label",{class:Le(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Xpt,Y(o.name)+": ",1),o.help?(T(),x("label",Zpt,[k(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Jpt),[[He,o.isHelp]]),e[8]||(e[8]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),x("p",eft,Y(o.help),1)):B("",!0),k(l("select",{"onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(T(!0),x(Be,null,Ke(o.options,c=>(T(),x("option",{value:c,selected:o.value===c},Y(c),9,nft))),256))],8,tft),[[Ot,o.value]])])):B("",!0)])):B("",!0),o.type=="int"?(T(),x("div",sft,[l("label",{class:Le(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",rft,Y(o.name)+": ",1),o.help?(T(),x("label",ift,[k(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,oft),[[He,o.isHelp]]),e[9]||(e[9]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),x("p",aft,Y(o.help),1)):B("",!0),k(l("input",{type:"number","onUpdate:modelValue":c=>o.value=c,step:"1",class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter number"},null,8,lft),[[ae,o.value]]),o.min!=null&&o.max!=null?k((T(),x("input",{key:1,type:"range","onUpdate:modelValue":c=>o.value=c,min:o.min,max:o.max,step:"1",class:"flex-none h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,8,cft)),[[ae,o.value]]):B("",!0)])):B("",!0),o.type=="float"?(T(),x("div",dft,[l("label",{class:Le(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",uft,Y(o.name)+": ",1),o.help?(T(),x("label",pft,[k(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,fft),[[He,o.isHelp]]),e[10]||(e[10]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),x("p",_ft,Y(o.help),1)):B("",!0),k(l("input",{type:"number","onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter number"},null,8,mft),[[ae,o.value]]),o.min!=null&&o.max!=null?k((T(),x("input",{key:1,type:"range","onUpdate:modelValue":c=>o.value=c,min:o.min,max:o.max,step:"0.1",class:"flex-none h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,8,hft)),[[ae,o.value]]):B("",!0)])):B("",!0),o.type=="bool"?(T(),x("div",gft,[l("div",bft,[l("label",yft,Y(o.name)+": ",1),k(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.value=c,class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"},null,8,Eft),[[He,o.value]]),o.help?(T(),x("label",vft,[k(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Sft),[[He,o.isHelp]]),e[11]||(e[11]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)]),o.isHelp?(T(),x("p",Tft,Y(o.help),1)):B("",!0)])):B("",!0),o.type=="list"?(T(),x("div",xft,[l("label",{class:Le(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",o.help?"cursor-pointer ":""])},[l("div",Cft,Y(o.name)+": ",1),o.help?(T(),x("label",wft,[k(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Rft),[[He,o.isHelp]]),e[12]||(e[12]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)],2),o.isHelp?(T(),x("p",Aft,Y(o.help),1)):B("",!0),k(l("input",{type:"text","onUpdate:modelValue":c=>o.value=c,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter comma separated values"},null,8,Mft),[[ae,o.value]])])):B("",!0),o.type==="file"||o.type==="folder"?(T(),x("div",Nft,[l("label",Oft,[l("span",Ift,Y(o.name)+":",1),o.help?(T(),x("label",kft,[k(l("input",{type:"checkbox","onUpdate:modelValue":c=>o.isHelp=c,class:"sr-only peer"},null,8,Dft),[[He,o.isHelp]]),e[13]||(e[13]=l("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[l("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1))])):B("",!0)]),o.isHelp?(T(),x("p",Lft,Y(o.help),1)):B("",!0),l("div",Pft,[k(l("input",{type:"text","onUpdate:modelValue":c=>o.value=c,readonly:"",class:"flex-1 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white",placeholder:o.type==="file"?"Select file...":"Select folder..."},null,8,Fft),[[ae,o.value]]),l("button",{onClick:c=>i.openFileDialog(o),class:"px-3 py-2 text-sm font-medium text-gray-900 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600"}," ... ",8,Uft)])])):B("",!0),ai.hide(!0),["stop"])),class:"px-5 py-2.5 text-sm font-medium text-white bg-blue-700 rounded-lg hover:bg-blue-800 dark:bg-blue-600 dark:hover:bg-blue-700"},Y(r.ConfirmButtonText),1),l("button",{onClick:e[2]||(e[2]=$(o=>i.hide(!1),["stop"])),class:"px-5 py-2.5 text-sm font-medium text-gray-500 bg-white rounded-lg border border-gray-200 hover:bg-gray-100 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:bg-gray-600"},Y(r.DenyButtonText),1)])])])])):B("",!0)}const X0=rt(bpt,[["render",Vft],["__scopeId","data-v-8a34bb65"]]);ne.defaults.baseURL="/";const zft={components:{InteractiveMenu:W0},props:{commandsList:{type:Array,required:!0},sendCommand:Function,onShowToastMessage:Function},data(){return{loading:!1,selectedFile:null,showMenu:!1,showHelpText:!1,helpText:"",commands:[]}},async mounted(){this.commands=this.commandsList,console.log("Commands",this.commands),document.addEventListener("click",this.handleClickOutside),Fe(()=>{Ve.replace()})},methods:{isHTML(n){const t=new DOMParser().parseFromString(n,"text/html");return Array.from(t.body.childNodes).some(s=>s.nodeType===Node.ELEMENT_NODE)},selectFile(n,e){const t=document.createElement("input");t.type="file",t.accept=n,t.onchange=s=>{this.selectedFile=s.target.files[0],console.log("File selected"),e()},t.click()},uploadFile(){new FormData().append("file",this.selectedFile),console.log("Uploading file"),this.loading=!0;const e=new FileReader;e.onload=()=>{const t={filename:this.selectedFile.name,fileData:e.result};Ye.on("file_received",s=>{s.status?this.onShowToastMessage("File uploaded successfully",4,!0):this.onShowToastMessage(`Couldn't upload file `+s.error,4,!1),this.loading=!1,Ye.off("file_received")}),Ye.emit("send_file",t)},e.readAsDataURL(this.selectedFile)},async constructor(){Fe(()=>{Ve.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(n){this.showMenu=!this.showMenu,n.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(n.hasOwnProperty("file_types")?n.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(n.value)},handleClickOutside(n){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(n.target)&&(this.showMenu=!1)}},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},Hft={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"};function qft(n,e,t,s,r,i){const o=nt("InteractiveMenu");return r.loading?(T(),x("div",Hft,e[0]||(e[0]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)]))):(T(),at(o,{key:1,commands:t.commandsList,execute_cmd:i.execute_cmd},null,8,["commands","execute_cmd"]))}const Yft=rt(zft,[["render",qft],["__scopeId","data-v-1a32c141"]]),$ft="data:image/svg+xml,%3csvg%20aria-hidden='true'%20class='w-6%20h-6%20animate-spin%20fill-secondary'%20viewBox='0%200%20100%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M100%2050.5908C100%2078.2051%2077.6142%20100.591%2050%20100.591C22.3858%20100.591%200%2078.2051%200%2050.5908C0%2022.9766%2022.3858%200.59082%2050%200.59082C77.6142%200.59082%20100%2022.9766%20100%2050.5908ZM9.08144%2050.5908C9.08144%2073.1895%2027.4013%2091.5094%2050%2091.5094C72.5987%2091.5094%2090.9186%2073.1895%2090.9186%2050.5908C90.9186%2027.9921%2072.5987%209.67226%2050%209.67226C27.4013%209.67226%209.08144%2027.9921%209.08144%2050.5908Z'%20fill='currentColor'%20/%3e%3cpath%20d='M93.9676%2039.0409C96.393%2038.4038%2097.8624%2035.9116%2097.0079%2033.5539C95.2932%2028.8227%2092.871%2024.3692%2089.8167%2020.348C85.8452%2015.1192%2080.8826%2010.7238%2075.2124%207.41289C69.5422%204.10194%2063.2754%201.94025%2056.7698%201.05124C51.7666%200.367541%2046.6976%200.446843%2041.7345%201.27873C39.2613%201.69328%2037.813%204.19778%2038.4501%206.62326C39.0873%209.04874%2041.5694%2010.4717%2044.0505%2010.1071C47.8511%209.54855%2051.7191%209.52689%2055.5402%2010.0491C60.8642%2010.7766%2065.9928%2012.5457%2070.6331%2015.2552C75.2735%2017.9648%2079.3347%2021.5619%2082.5849%2025.841C84.9175%2028.9121%2086.7997%2032.2913%2088.1811%2035.8758C89.083%2038.2158%2091.5421%2039.6781%2093.9676%2039.0409Z'%20fill='currentFill'%20/%3e%3c/svg%3e",Wft="/",Kft={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},components:{PersonalitiesCommands:Yft,ChatBarButton:DM},setup(){},data(){return{isSendMenuVisible:!1,is_rt:!1,bindingHoveredIndex:null,modelHoveredIndex:null,personalityHoveredIndex:null,loader_v0:$ft,sendGlobe:_N,bUrl:Wft,message:"",selecting_binding:!1,selecting_model:!1,selectedModel:"",isListeningToVoice:!1,filesList:[],isFileSentList:[],totalSize:0,showfilesList:!0,models_menu_icon:"",posts_headers:{accept:"application/json","Content-Type":"application/json"}}},computed:{leftPanelCollapsed(){return this.$store.state.leftPanelCollapsed},rightPanelCollapsed(){return this.$store.state.rightPanelCollapsed},isCompactMode(){return this.$store.state.view_mode==="compact"},isDataSourceNamesValid(){return console.log("dataSourceNames:",this.dataSourceNames),console.log("Type of dataSourceNames:",typeof this.dataSourceNames),Array.isArray(this.dataSourceNames)&&this.dataSourceNames.length>0},dataSourceNames(){console.log("dataSourceNames",this.$store.state.config.rag_databases);const n=this.$store.state.config.rag_databases.map(e=>{console.log("entry",e);const t=e.split("::");console.log("extracted",t[0]);const r=e.endsWith("mounted")?"feather:check":"";return console.log("icon decision",r),{name:t[0],value:t[0]||"default_value",icon:r,help:"mounts the database"}});return console.log("formatted data sources",n),n}},methods:{showSendMenu(){clearTimeout(this.hideSendMenuTimeout),this.isSendMenuVisible=!0},hideSendMenu(){this.hideSendMenuTimeout=setTimeout(()=>{this.isSendMenuVisible=!1},300)},toggleLeftPanel(){console.log(this.leftPanelCollapsed),this.$store.commit("setLeftPanelCollapsed",!this.leftPanelCollapsed)},async toggleRightPanel(){console.log(this.rightPanelCollapsed),this.$store.commit("setRightPanelCollapsed",!this.rightPanelCollapsed),this.rightPanelCollapsed&&(this.$store.commit("setleftPanelCollapsed",!0),this.$nextTick(()=>{this.extractHtml()})),console.log(this.rightPanelCollapsed)},handlePaste(n){const e=(n.clipboardData||n.originalEvent.clipboardData).items;let t=[];for(let s of e)if(s.type.indexOf("image")!==-1){const r=s.getAsFile(),o=`image_${Date.now()+"_"+Math.random().toString(36).substr(2,9)}.png`;console.log("newFileName",o);const a=new File([r],o,{type:r.type});this.addFiles([a])}else if(s.kind==="file"){const r=s.getAsFile();t.push(r)}t.length>0&&this.addFiles(t)},emitloaded(){this.$emit("loaded")},download_files(){ne.get("/download_files")},remove_file(n){ne.get("/remove_discussion_file",{client_id:this.$store.state.client_id,name:n}).then(e=>{console.log(e)})},clear_files(){ne.post("/clear_discussion_files_list",{client_id:this.$store.state.client_id}).then(n=>{console.log(n),n.data.state?(this.$store.state.toast.showToast("File removed successfully",4,!0),this.filesList.length=0,this.isFileSentList.length=0,this.totalSize=0):this.$store.state.toast.showToast("Files couldn't be removed",4,!1)})},send_file(n,e){console.log("Send file triggered");const t=new FileReader,s=24*1024;let r=0,i=0;t.onloadend=()=>{if(t.error){console.error("Error reading file:",t.error);return}const a=t.result,c=r+a.byteLength>=n.size;Ye.emit("send_file_chunk",{filename:n.name,chunk:a,offset:r,isLastChunk:c,chunkIndex:i}),r+=a.byteLength,i++,c?(console.log("File sent successfully"),this.isFileSentList[this.filesList.length-1]=!0,console.log(this.isFileSentList),this.$store.state.toast.showToast("File uploaded successfully",4,!0),e()):o()};function o(){const a=n.slice(r,r+s);t.readAsArrayBuffer(a)}console.log("Uploading file"),o()},makeAnEmptyUserMessage(){this.$emit("createEmptyUserMessage",this.message),this.message=""},makeAnEmptyAIMessage(){this.$emit("createEmptyAIMessage")},startRTCom(){this.is_rt=!0,console.log("is_rt:",this.is_rt),Ye.emit("start_bidirectional_audio_stream"),Fe(()=>{Ve.replace()})},stopRTCom(){this.is_rt=!1,console.log("is_rt:",this.is_rt),Ye.emit("stop_bidirectional_audio_stream"),Fe(()=>{Ve.replace()})},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isListeningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onresult=n=>{let e="";for(let t=n.resultIndex;t{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.isListeningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isListeningToVoice=!1,clearTimeout(this.silenceTimer),this.submit()},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")},computedFileSize(n){return Fe(()=>{Ve.replace()}),sr(n)},removeItem(n){console.log("Removing ",n.name),ne.post("/remove_discussion_file",{client_id:this.$store.state.client_id,name:n.name},{headers:this.posts_headers}).then(()=>{this.filesList=this.filesList.filter(e=>e!=n)}),console.log(this.filesList)},sendMessageEvent(n,e="no_internet"){this.$emit("messageSentEvent",n,e)},sendCMDEvent(n){this.$emit("sendCMDEvent",n)},async mountDB(n){await ne.post("/toggle_mount_rag_database",{client_id:this.$store.state.client_id,database_name:n}),await this.$store.dispatch("refreshConfig"),console.log("Refreshed")},addWebLink(){console.log("Emitting addWebLink"),this.$emit("addWebLink")},add_file(){const n=document.createElement("input");n.type="file",n.style.display="none",n.multiple=!0,document.body.appendChild(n),n.addEventListener("change",()=>{console.log("Calling Add file..."),this.addFiles(n.files),document.body.removeChild(n)}),n.click()},takePicture(){Ye.emit("take_picture"),Ye.on("picture_taken",()=>{ne.post("/get_discussion_files_list",{client_id:this.$store.state.client_id}).then(n=>{this.filesList=n.data.files,this.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.filesList}`)})})},submitOnEnter(n){this.loading||n.which===13&&(n.preventDefault(),n.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},submitWithInternetSearch(){this.message&&(this.sendMessageEvent(this.message,"internet"),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(n){console.log("Adding files");const e=[...n];let t=0;const s=()=>{if(t>=e.length){console.log(`Files_list: ${this.filesList}`);return}const r=e[t];this.filesList.push(r),this.isFileSentList.push(!1),this.send_file(r,()=>{t++,s()})};s()}},watch:{installedModels:{immediate:!0,handler(n){this.$nextTick(()=>{this.installedModels=n})}},model_name:{immediate:!0,handler(n){this.$nextTick(()=>{this.model_name=n})}},showfilesList(){Fe(()=>{Ve.replace()})},loading(n,e){Fe(()=>{Ve.replace()})},filesList:{handler(n,e){let t=0;if(n.length>0)for(let s=0;s{Ve.replace()}),console.log("Chatbar mounted"),Ye.on("rtcom_status_changed",n=>{this.$store.dispatch("fetchisRTOn"),console.log("rtcom_status_changed: ",n.status),console.log("active_tts_service: ",this.$store.state.config.active_tts_service),console.log("is_rt_on: ",this.$store.state.is_rt_on)}),this.$store.dispatch("fetchisRTOn")},activated(){Fe(()=>{Ve.replace()})}},jft={class:"absolute bottom-0 left-0 w-fit min-w-96 w-full justify-center text-center"},Qft={key:0,class:"items-center gap-2 panels-color shadow-sm hover:shadow-none dark:border-gray-800 w-fit"},Xft={class:"flex"},Zft=["title"],Jft={key:0},e_t={class:"flex flex-col max-h-64"},t_t=["title"],n_t={class:"flex flex-row items-center gap-1 text-left p-2 text-sm font-medium items-center gap-2 rounded-lg border bg-gray-100 p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-700 hover:bg-primary dark:hover:bg-primary"},s_t={key:0,filesList:"",role:"status"},r_t={class:"flex flex-row items-center"},i_t={class:"whitespace-nowrap"},o_t=["onClick"],a_t={key:1,class:"flex mx-1 w-500"},l_t={class:"whitespace-nowrap flex flex-row gap-2"},c_t={key:1,title:"Selecting model",class:"flex flex-row flex-grow justify-end panels-color"},d_t={role:"status"},u_t=["src"],p_t={class:"flex w-fit relative grow w-full"},f_t={class:"relative text-light-text-panel dark:text-dark-text-panel grow flex h-12.5 cursor-pointer select-none items-center gap-2 chatbox-color p-1 shadow-sm hover:shadow-none dark:border-gray-800",tabindex:"0"},__t={key:0,title:"Waiting for reply"},m_t=["src"],h_t={class:"w-fit"},g_t={class:"w-fit"},b_t={class:"relative grow m-0 p-0"},y_t={class:"m-0 p-0"},E_t={class:"flex items-center space-x-3"},v_t={class:"relative inline-block"},S_t={class:"p-4 m-0 flex flex-col gap-4 max-h-96 overflow-y-auto custom-scrollbar"},T_t={class:"flex flex-col gap-2"};function x_t(n,e,t,s,r,i){const o=nt("ChatBarButton"),a=nt("PersonalitiesCommands");return T(),x("div",jft,[r.filesList.length>0?(T(),x("div",Qft,[l("div",Xft,[l("button",{class:"mx-1 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:r.showfilesList?"Hide file list":"Show file list",type:"button",onClick:e[0]||(e[0]=$(c=>r.showfilesList=!r.showfilesList,["stop"]))},e[12]||(e[12]=[l("i",{"data-feather":"list"},null,-1)]),8,Zft)]),r.filesList.length>0&&r.showfilesList==!0?(T(),x("div",Jft,[l("div",e_t,[z(Ir,{name:"list",tag:"div",class:"flex flex-col flex-grow overflow-y-auto scrollbar-thin scrollbar-track-bg-light scrollbar-thumb-bg-light-tone hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark dark:scrollbar-thumb-bg-dark-tone dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},{default:Ie(()=>[(T(!0),x(Be,null,Ke(r.filesList,(c,d)=>(T(),x("div",{key:d+"-"+c.name},[l("div",{class:"m-1",title:c.name},[l("div",n_t,[r.isFileSentList[d]?B("",!0):(T(),x("div",s_t,e[13]||(e[13]=[l("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),l("span",{class:"sr-only"},"Loading...",-1)]))),e[15]||(e[15]=l("div",null,[l("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),l("div",{class:Le(["line-clamp-1 w-3/5",r.isFileSentList[d]?"text-green-500":"text-red-200"])},Y(c.name),3),e[16]||(e[16]=l("div",{class:"grow"},null,-1)),l("div",r_t,[l("p",i_t,Y(i.computedFileSize(c.size)),1),l("button",{type:"button",title:"Remove item",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:u=>i.removeItem(c)},e[14]||(e[14]=[l("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)]),8,o_t)])])],8,t_t)]))),128))]),_:1})])])):B("",!0),r.filesList.length>0?(T(),x("div",a_t,[l("div",l_t,[e[17]||(e[17]=l("p",{class:"font-bold"}," Total size: ",-1)),Ze(" "+Y(r.totalSize)+" ("+Y(r.filesList.length)+") ",1)]),e[20]||(e[20]=l("div",{class:"grow"},null,-1)),l("button",{type:"button",title:"Clear all",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:e[1]||(e[1]=(...c)=>i.clear_files&&i.clear_files(...c))},e[18]||(e[18]=[l("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)])),l("button",{type:"button",title:"Download database",class:"flex items-center p-0.5 text-sm rounded-sm hover:text-red-600 active:scale-75",onClick:e[2]||(e[2]=(...c)=>i.download_files&&i.download_files(...c))},e[19]||(e[19]=[l("i",{"data-feather":"download-cloud",class:"w-5 h-5"},null,-1)]))])):B("",!0)])):B("",!0),r.selecting_model||r.selecting_binding?(T(),x("div",c_t,[l("div",d_t,[l("img",{src:r.loader_v0,class:"w-50 h-50"},null,8,u_t),e[21]||(e[21]=l("span",{class:"sr-only"},"Selecting model...",-1))])])):B("",!0),l("div",p_t,[l("div",f_t,[t.loading?(T(),x("div",__t,[l("img",{src:r.loader_v0},null,8,m_t),e[22]||(e[22]=l("div",{role:"status"},[l("span",{class:"sr-only"},"Loading...")],-1))])):B("",!0),z(o,{onClick:i.toggleLeftPanel,class:Le({"text-red-500":i.leftPanelCollapsed}),title:"Toggle View Mode"},{default:Ie(()=>[k(l("div",null,e[23]||(e[23]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[l("polyline",{points:"9 18 15 12 9 6"})],-1)]),512),[[ht,i.leftPanelCollapsed]]),k(l("div",null,e[24]||(e[24]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[l("polyline",{points:"15 18 9 12 15 6"})],-1)]),512),[[ht,!i.leftPanelCollapsed]])]),_:1},8,["onClick","class"]),l("div",h_t,[this.$store.state.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(T(),at(a,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:i.sendCMDEvent,"on-show-toast-message":t.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):B("",!0)]),l("div",g_t,[i.isDataSourceNamesValid?(T(),at(a,{key:0,icon:"feather:book",commandsList:i.dataSourceNames,sendCommand:i.mountDB,"on-show-toast-message":t.onShowToastMessage,ref:"databasesList"},null,8,["commandsList","sendCommand","on-show-toast-message"])):B("",!0)]),l("div",b_t,[l("form",y_t,[k(l("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[3]||(e[3]=c=>r.message=c),onPaste:e[4]||(e[4]=(...c)=>i.handlePaste&&i.handlePaste(...c)),onKeydown:e[5]||(e[5]=ws($(c=>i.submitOnEnter(c),["exact"]),["enter"])),class:"w-full p-2 text-sm text-gray-900 dark:text-white bg-gray-100 dark:bg-gray-700 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Send message..."},null,544),[[ae,r.message]])])]),l("div",E_t,[t.loading?(T(),at(o,{key:0,onClick:i.stopGenerating,class:"bg-red-500 dark:bg-red-600 hover:bg-red-600 dark:hover:bg-red-700"},{icon:Ie(()=>e[25]||(e[25]=[l("svg",{class:"animate-spin h-5 w-5",viewBox:"0 0 24 24"},[l("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),l("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])),default:Ie(()=>[e[26]||(e[26]=l("span",null,"Stop",-1))]),_:1},8,["onClick"])):(T(),at(o,{key:1,onClick:i.submit,title:"Send"},{icon:Ie(()=>e[27]||(e[27]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})],-1)])),_:1},8,["onClick"])),z(o,{onClick:i.submitWithInternetSearch,title:"Send with internet search"},{icon:Ie(()=>e[28]||(e[28]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})],-1)])),_:1},8,["onClick"]),z(o,{onClick:i.startSpeechRecognition,class:Le({"text-red-500":r.isListeningToVoice}),title:"Voice input"},{icon:Ie(()=>e[29]||(e[29]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})],-1)])),_:1},8,["onClick","class"]),n.$store.state.config.active_tts_service!="None"&&n.$store.state.config.active_tts_service!=null&&this.$store.state.config.active_stt_service!="None"&&this.$store.state.config.active_stt_service!=null?(T(),at(o,{key:2,onClick:e[6]||(e[6]=c=>r.is_rt?i.stopRTCom:i.startRTCom),class:Le(r.is_rt?"bg-red-500 dark:bg-red-600":"bg-green-500 dark:bg-green-600"),title:"Real-time audio mode"},{icon:Ie(()=>e[30]||(e[30]=[Ze(" 🌟 ")])),_:1},8,["class"])):B("",!0),t.loading?B("",!0):(T(),x("div",{key:3,class:"relative",onMouseleave:e[10]||(e[10]=(...c)=>i.hideSendMenu&&i.hideSendMenu(...c))},[l("div",v_t,[k(l("div",{onMouseenter:e[7]||(e[7]=(...c)=>i.showSendMenu&&i.showSendMenu(...c)),class:"absolute m-0 p-0 z-10 bottom-full left-1/2 transform -translate-x-1/2 w-25 bg-white dark:bg-gray-900 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2"},[l("div",S_t,[l("div",T_t,[z(o,{onClick:i.add_file,title:"Send file"},{icon:Ie(()=>e[31]||(e[31]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)])),_:1},8,["onClick"]),z(o,{onClick:i.takePicture,title:"Take picture"},{icon:Ie(()=>e[32]||(e[32]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])),_:1},8,["onClick"]),z(o,{onClick:i.addWebLink,title:"Add web link"},{icon:Ie(()=>e[33]||(e[33]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})],-1)])),_:1},8,["onClick"])])])],544),[[ht,r.isSendMenuVisible]]),l("div",{onMouseenter:e[9]||(e[9]=(...c)=>i.showSendMenu&&i.showSendMenu(...c))},[l("button",{onClick:e[8]||(e[8]=$((...c)=>n.toggleSendMenu&&n.toggleSendMenu(...c),["prevent"])),class:"p-2 rounded-full transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"},e[34]||(e[34]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"black"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)]))],32)])],32)),z(o,{onClick:i.makeAnEmptyUserMessage,title:"New user message",class:"text-gray-600 dark:text-gray-300"},{icon:Ie(()=>e[35]||(e[35]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1)])),_:1},8,["onClick"]),z(o,{onClick:i.makeAnEmptyAIMessage,title:"New AI message",class:"text-red-400 dark:text-red-300"},{icon:Ie(()=>e[36]||(e[36]=[l("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})],-1)])),_:1},8,["onClick"]),z(o,{onClick:i.toggleRightPanel,class:Le({"text-red-500":!i.rightPanelCollapsed}),title:"Toggle right Panel"},{default:Ie(()=>[k(l("div",null,e[37]||(e[37]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[l("polyline",{points:"15 18 9 12 15 6"})],-1)]),512),[[ht,i.rightPanelCollapsed]]),k(l("div",null,e[38]||(e[38]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[l("polyline",{points:"9 18 15 12 9 6"})],-1)]),512),[[ht,!i.rightPanelCollapsed]])]),_:1},8,["onClick","class"])]),l("input",{type:"file",ref:"fileDialog",onChange:e[11]||(e[11]=(...c)=>i.addFiles&&i.addFiles(...c)),multiple:"",style:{display:"none"}},null,544)]),e[39]||(e[39]=l("div",{class:"ml-auto gap-2"},null,-1))])])}const hN=rt(Kft,[["render",x_t],["__scopeId","data-v-e3d676fa"]]),C_t={name:"WelcomeComponent",setup(){const n=XD();return{logoSrc:Je(()=>n.state.config&&n.state.config.app_custom_logo?`/user_infos/${n.state.config.app_custom_logo}`:Bs)}}},w_t={class:"flex flex-col items-center justify-center w-full h-full min-h-screen p-8"},R_t={class:"text-center max-w-4xl"},A_t={class:"flex items-center justify-center gap-8 mb-12"},M_t={class:"relative w-24 h-24"},N_t=["src"];function O_t(n,e,t,s,r,i){return T(),x("div",w_t,[l("div",R_t,[l("div",A_t,[l("div",M_t,[l("img",{src:s.logoSrc,alt:"LoLLMS Logo",class:"w-24 h-24 rounded-full absolute animate-rolling-ball"},null,8,N_t)]),e[0]||(e[0]=l("div",{class:"flex flex-col items-start"},[l("h1",{class:"text-6xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-indigo-600 to-purple-600 dark:from-indigo-400 dark:to-purple-400"}," L🌟LLMS "),l("p",{class:"text-2xl text-gray-600 dark:text-gray-300 italic mt-2"}," Lord of Large Language And Multimodal Systems ")],-1))]),e[1]||(e[1]=mi('

Welcome to L🌟LLMS WebUI

Embark on a journey through the realm of advanced AI with L🌟LLMS, your ultimate companion for intelligent conversations and multimodal interactions. Unleash the power of large language models and explore new frontiers in artificial intelligence.

Discover the capabilities of L🌟LLMS:

  • Engage in natural language conversations
  • Generate creative content and ideas
  • Analyze complex data and provide insights
  • Assist with coding and technical tasks
  • Process and understand multimodal inputs
',1))])])}const gN=rt(C_t,[["render",O_t],["__scopeId","data-v-1756add6"]]);var I_t=function(){function n(e,t){t===void 0&&(t=[]),this._eventType=e,this._eventFunctions=t}return n.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(t){typeof window<"u"&&window.addEventListener(e._eventType,t)})},n}(),ou=function(){return ou=Object.assign||function(n){for(var e,t=1,s=arguments.length;ti.hide&&i.hide(...a)),class:"bg-primary hover:bg-primary-light active:scale-95 duration-150 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-secondary-dark"}," OK ")):B("",!0),r.has_button?B("",!0):(T(),x("svg",G_t,e[1]||(e[1]=[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1)])))])])])):B("",!0)}const MN=rt(D_t,[["render",V_t]]),z_t={props:{progress:{type:Number,required:!0}}},H_t={class:"progress-bar-container"};function q_t(n,e,t,s,r,i){return T(),x("div",H_t,[l("div",{class:"progress-bar",style:Bt({width:`${t.progress}%`})},null,4)])}const mu=rt(z_t,[["render",q_t]]),Y_t={data(){return{show:!1,message:"",resolve:null,ConfirmButtonText:"Yes, I'm sure",DenyButtonText:"No, cancel"}},methods:{hide(n){this.show=!1,this.resolve&&(this.resolve(n),this.resolve=null)},askQuestion(n,e,t){return this.ConfirmButtonText=e||this.ConfirmButtonText,this.DenyButtonText=t||this.DenyButtonText,new Promise(s=>{this.message=n,this.show=!0,this.resolve=s})}}},$_t={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},W_t={class:"relative w-full max-w-md max-h-full"},K_t={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},j_t={class:"p-4 text-center"},Q_t={class:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400 select-none break-all"};function X_t(n,e,t,s,r,i){return r.show?(T(),x("div",$_t,[l("div",W_t,[l("div",K_t,[l("button",{type:"button",onClick:e[0]||(e[0]=o=>i.hide(!1)),class:"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},e[3]||(e[3]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),l("span",{class:"sr-only"},"Close modal",-1)])),l("div",j_t,[e[4]||(e[4]=l("svg",{"aria-hidden":"true",class:"mx-auto mb-4 text-gray-400 w-14 h-14 dark:text-gray-200",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),l("h3",Q_t,Y(r.message),1),l("button",{onClick:e[1]||(e[1]=o=>i.hide(!0)),type:"button",class:"text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"},Y(r.ConfirmButtonText),1),l("button",{onClick:e[2]||(e[2]=o=>i.hide(!1)),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},Y(r.DenyButtonText),1)])])])])):B("",!0)}const NN=rt(Y_t,[["render",X_t]]),Z_t={props:{personality:{type:Object,required:!0},config:{type:Object,required:!0}},data(){return{show:!1,title:"Add AI Agent",iconUrl:"",file:null,tempConfig:{}}},methods:{showForm(){this.showDialog=!0},hideForm(){this.showDialog=!1},selectIcon(n){n.target.files&&(this.file=n.target.files[0],this.iconUrl=URL.createObjectURL(this.file))},showPanel(){this.show=!0},hide(){this.show=!1},submitForm(){ne.post("/set_personality_config",{client_id:this.$store.state.client_id,category:this.personality.category,name:this.personality.folder,config:this.config}).then(n=>{const e=n.data;console.log("Done"),e.status?(this.currentPersonConfig=e.config,this.showPersonalityEditor=!0):console.error(e.error)}).catch(n=>{console.error(n)})}}},J_t={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 z-20"},emt={class:"relative w-full max-h-full bg-bg-light dark:bg-bg-dark"},tmt={class:"w-full h-full relative items-center gap-2 rounded-lg border bg-bg-light dark:bg-bg-dark p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 dark:bg-gray-900"},nmt={class:"justify-center text-center items-center w-full bg-bg-light dark:bg-bg-dark"},smt={class:"w-full flex flex-row mt-4 text-center justify-center"},rmt={class:"w-full max-h-full container bg-bg-light dark:bg-bg-dark"},imt={class:"mb-4 w-full"},omt={class:"w-full bg-bg-light dark:bg-bg-dark"};function amt(n,e,t,s,r,i){return r.show?(T(),x("div",J_t,[l("div",emt,[l("div",tmt,[l("button",{type:"button",onClick:e[0]||(e[0]=o=>i.hide()),class:"absolute top-1 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},e[17]||(e[17]=[l("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),l("span",{class:"sr-only"},"Close modal",-1)])),l("div",nmt,[l("div",smt,[l("button",{type:"submit",onClick:e[1]||(e[1]=$((...o)=>i.submitForm&&i.submitForm(...o),["prevent"])),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"}," Commit AI to Server "),l("button",{onClick:e[2]||(e[2]=$(o=>i.hide(),["prevent"])),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"}," Close ")]),l("div",rmt,[l("form",imt,[l("table",omt,[l("tr",null,[e[18]||(e[18]=l("td",null,[l("label",{for:"personalityConditioning"},"Personality Conditioning:")],-1)),l("td",null,[k(l("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"personalityConditioning","onUpdate:modelValue":e[3]||(e[3]=o=>t.config.personality_conditioning=o)},null,512),[[ae,t.config.personality_conditioning]])])]),l("tr",null,[e[19]||(e[19]=l("td",null,[l("label",{for:"userMessagePrefix"},"User Message Prefix:")],-1)),l("td",null,[k(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"userMessagePrefix","onUpdate:modelValue":e[4]||(e[4]=o=>t.config.user_message_prefix=o)},null,512),[[ae,t.config.user_message_prefix]])])]),l("tr",null,[e[20]||(e[20]=l("td",null,[l("label",{for:"aiMessagePrefix"},"AI Message Prefix:")],-1)),l("td",null,[k(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"aiMessagePrefix","onUpdate:modelValue":e[5]||(e[5]=o=>t.config.ai_message_prefix=o)},null,512),[[ae,t.config.ai_message_prefix]])])]),l("tr",null,[e[21]||(e[21]=l("td",null,[l("label",{for:"linkText"},"Link Text:")],-1)),l("td",null,[k(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"linkText","onUpdate:modelValue":e[6]||(e[6]=o=>t.config.link_text=o)},null,512),[[ae,t.config.link_text]])])]),l("tr",null,[e[22]||(e[22]=l("td",null,[l("label",{for:"welcomeMessage"},"Welcome Message:")],-1)),l("td",null,[k(l("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"welcomeMessage","onUpdate:modelValue":e[7]||(e[7]=o=>t.config.welcome_message=o)},null,512),[[ae,t.config.welcome_message]])])]),l("tr",null,[e[23]||(e[23]=l("td",null,[l("label",{for:"modelTemperature"},"Model Temperature:")],-1)),l("td",null,[k(l("input",{type:"number",id:"modelTemperature","onUpdate:modelValue":e[8]||(e[8]=o=>t.config.model_temperature=o)},null,512),[[ae,t.config.model_temperature]])])]),l("tr",null,[e[24]||(e[24]=l("td",null,[l("label",{for:"modelTopK"},"Model Top K:")],-1)),l("td",null,[k(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelTopK","onUpdate:modelValue":e[9]||(e[9]=o=>t.config.model_top_k=o)},null,512),[[ae,t.config.model_top_k]])])]),l("tr",null,[e[25]||(e[25]=l("td",null,[l("label",{for:"modelTopP"},"Model Top P:")],-1)),l("td",null,[k(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelTopP","onUpdate:modelValue":e[10]||(e[10]=o=>t.config.model_top_p=o)},null,512),[[ae,t.config.model_top_p]])])]),l("tr",null,[e[26]||(e[26]=l("td",null,[l("label",{for:"modelRepeatPenalty"},"Model Repeat Penalty:")],-1)),l("td",null,[k(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelRepeatPenalty","onUpdate:modelValue":e[11]||(e[11]=o=>t.config.model_repeat_penalty=o)},null,512),[[ae,t.config.model_repeat_penalty]])])]),l("tr",null,[e[27]||(e[27]=l("td",null,[l("label",{for:"modelRepeatLastN"},"Model Repeat Last N:")],-1)),l("td",null,[k(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"number",id:"modelRepeatLastN","onUpdate:modelValue":e[12]||(e[12]=o=>t.config.model_repeat_last_n=o)},null,512),[[ae,t.config.model_repeat_last_n]])])]),l("tr",null,[e[28]||(e[28]=l("td",null,[l("label",{for:"recommendedBinding"},"Recommended Binding:")],-1)),l("td",null,[k(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"recommendedBinding","onUpdate:modelValue":e[13]||(e[13]=o=>t.config.recommended_binding=o)},null,512),[[ae,t.config.recommended_binding]])])]),l("tr",null,[e[29]||(e[29]=l("td",null,[l("label",{for:"recommendedModel"},"Recommended Model:")],-1)),l("td",null,[k(l("input",{class:"dark:bg-black dark:text-primary w-full",type:"text",id:"recommendedModel","onUpdate:modelValue":e[14]||(e[14]=o=>t.config.recommended_model=o)},null,512),[[ae,t.config.recommended_model]])])]),l("tr",null,[e[30]||(e[30]=l("td",null,[l("label",{class:"dark:bg-black dark:text-primary w-full",for:"dependencies"},"Dependencies:")],-1)),l("td",null,[k(l("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"dependencies","onUpdate:modelValue":e[15]||(e[15]=o=>t.config.dependencies=o)},null,512),[[ae,t.config.dependencies]])])]),l("tr",null,[e[31]||(e[31]=l("td",null,[l("label",{for:"antiPrompts"},"Anti Prompts:")],-1)),l("td",null,[k(l("textarea",{class:"dark:bg-black dark:text-primary w-full",id:"antiPrompts","onUpdate:modelValue":e[16]||(e[16]=o=>t.config.anti_prompts=o)},null,512),[[ae,t.config.anti_prompts]])])])])])])])])])])):B("",!0)}const ON=rt(Z_t,[["render",amt]]),lmt={data(){return{showPopup:!1,webpageUrl:"https://lollms.com/"}},methods:{show(){this.showPopup=!0},hide(){this.showPopup=!1},save_configuration(){ne.post("/apply_settings",{client_id:this.$store.state.client_id,config:this.$store.state.config}).then(n=>{this.isLoading=!1,n.data.status?(this.$store.state.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1)})}}},cmt={key:0,class:"fixed inset-0 flex items-center justify-center z-50"},dmt={class:"popup-container"},umt=["src"],pmt={class:"checkbox-container"};function fmt(n,e,t,s,r,i){return T(),at(Or,{name:"fade"},{default:Ie(()=>[r.showPopup?(T(),x("div",cmt,[l("div",dmt,[l("button",{onClick:e[0]||(e[0]=(...o)=>i.hide&&i.hide(...o)),class:"close-button"}," X "),l("iframe",{src:r.webpageUrl,class:"iframe-content"},null,8,umt),l("div",pmt,[k(l("input",{type:"checkbox",id:"startup",class:"styled-checkbox","onUpdate:modelValue":e[1]||(e[1]=o=>this.$store.state.config.show_news_panel=o),onChange:e[2]||(e[2]=(...o)=>i.save_configuration&&i.save_configuration(...o))},null,544),[[He,this.$store.state.config.show_news_panel]]),e[3]||(e[3]=l("label",{for:"startup",class:"checkbox-label"},"Show at startup",-1))])])])):B("",!0)]),_:1})}const IN=rt(lmt,[["render",fmt],["__scopeId","data-v-d504dfc9"]]),_mt="/assets/fastapi-BQj-rjUJ.png",mmt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20127.14%2096.36'%3e%3cg%20id='图层_2'%20data-name='图层%202'%3e%3cg%20id='Discord_Logos'%20data-name='Discord%20Logos'%3e%3cg%20id='Discord_Logo_-_Large_-_White'%20data-name='Discord%20Logo%20-%20Large%20-%20White'%3e%3cpath%20d='M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",hmt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='50'%3e%3ccircle%20cx='25'%20cy='25'%20r='20'%20fill='none'%20stroke='black'%20stroke-width='3'%3e%3c/circle%3e%3cline%20x1='25'%20y1='30'%20x2='25'%20y2='15'%20style='stroke:black;stroke-width:3'%3e%3c/line%3e%3ccircle%20cx='25'%20cy='35'%20r='3'%20fill='black'%3e%3c/circle%3e%3c/svg%3e",gmt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='50'%20height='50'%3e%3ccircle%20cx='25'%20cy='25'%20r='20'%20fill='none'%20stroke='black'%20stroke-width='3'%3e%3c/circle%3e%3cline%20x1='25'%20y1='30'%20x2='25'%20y2='15'%20style='stroke:black;stroke-width:3'%3e%3canimate%20attributeName='y1'%20values='30;25;30'%20dur='1s'%20repeatCount='indefinite'%3e%3c/animate%3e%3canimate%20attributeName='y2'%20values='15;20;15'%20dur='1s'%20repeatCount='indefinite'%3e%3c/animate%3e%3c/line%3e%3ccircle%20cx='25'%20cy='35'%20r='3'%20fill='black'%3e%3canimate%20attributeName='cy'%20values='35;30;35'%20dur='1s'%20repeatCount='indefinite'%3e%3c/animate%3e%3c/circle%3e%3c/svg%3e",bmt="data:image/svg+xml,%3c?xml%20version='1.0'%20?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23000000'%20width='800px'%20height='800px'%20viewBox='0%200%2064%2064'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20data-name='Layer%205'%20id='Layer_5'%3e%3cpath%20d='M47,33H17a1,1,0,0,0-1,1c0,9.93,7.18,18,16,18s16-8.07,16-18A1,1,0,0,0,47,33ZM18,35H46a18,18,0,0,1-.67,4H18.71A18,18,0,0,1,18,35ZM26.7,48.8a6.42,6.42,0,0,1,10.6,0,12.3,12.3,0,0,1-10.6,0Zm12.34-1A8.81,8.81,0,0,0,32,44a8.81,8.81,0,0,0-7,3.81A15.56,15.56,0,0,1,19.43,41H44.57A15.56,15.56,0,0,1,39,47.81ZM36,22a1.1,1.1,0,0,1,0-.18,1.17,1.17,0,0,1,.06-.2s0-.05,0-.07a.28.28,0,0,1,.07-.09.71.71,0,0,1,.28-.28s.06-.06.09-.07l10-5a1,1,0,1,1,.9,1.78L39.24,22l8.21,4.11a1,1,0,0,1,.44,1.34A1,1,0,0,1,47,28a.93.93,0,0,1-.45-.11l-10-5h0a1.18,1.18,0,0,1-.28-.22l0-.06a.65.65,0,0,1-.1-.15s0-.05,0-.07a1.17,1.17,0,0,1-.06-.2A1.1,1.1,0,0,1,36,22ZM16.55,26.11,24.76,22l-8.21-4.11a1,1,0,1,1,.9-1.78l10,5s.06.05.09.07a.71.71,0,0,1,.28.28.28.28,0,0,1,.07.09s0,.05,0,.07a1.17,1.17,0,0,1,.06.2.82.82,0,0,1,0,.36,1.17,1.17,0,0,1-.06.2s0,.05,0,.07a.65.65,0,0,1-.1.15.21.21,0,0,0,0,.06,1.18,1.18,0,0,1-.28.22h0l-10,5A.93.93,0,0,1,17,28a1,1,0,0,1-.89-.55A1,1,0,0,1,16.55,26.11ZM60.66,36.45A29.69,29.69,0,0,0,61,32,29,29,0,0,0,3,32a29.69,29.69,0,0,0,.34,4.45,4.65,4.65,0,0,0,2.39,7.82,29,29,0,0,0,52.54,0,4.65,4.65,0,0,0,2.39-7.82ZM4.78,41.58a2.91,2.91,0,0,1-.24-.27A2.62,2.62,0,0,1,4,39.71a.61.61,0,0,1,0-.14,2.58,2.58,0,0,1,.77-1.73,4.38,4.38,0,0,1,.74-.55C7,36.38,10,34.9,12.69,33.67c-1.52,3.3-3.42,7.17-4.17,7.91a2.59,2.59,0,0,1-1.47.72A2.66,2.66,0,0,1,4.78,41.58ZM32,59A27,27,0,0,1,7.92,44.18a4.56,4.56,0,0,0,2-1.18c1.48-1.49,5-9.36,5.66-10.92a1,1,0,0,0-1.32-1.32c-.78.34-3.14,1.39-5.49,2.53-1.29.63-2.58,1.29-3.6,1.88A25.58,25.58,0,0,1,5,32a27,27,0,0,1,54,0,25.58,25.58,0,0,1-.19,3.17c-2.88-1.66-7.88-3.88-9.09-4.41a1,1,0,0,0-1.32,1.32c.69,1.56,4.18,9.43,5.66,10.92a4.56,4.56,0,0,0,2,1.18A27,27,0,0,1,32,59ZM59.46,41.31a2.91,2.91,0,0,1-.24.27A2.66,2.66,0,0,1,57,42.3a2.59,2.59,0,0,1-1.47-.72c-.75-.74-2.65-4.61-4.17-7.91,1.65.76,3.44,1.61,4.91,2.37.91.47,1.7.9,2.26,1.25a4.38,4.38,0,0,1,.74.55A2.58,2.58,0,0,1,60,39.57a.61.61,0,0,1,0,.14A2.62,2.62,0,0,1,59.46,41.31Z'/%3e%3c/g%3e%3c/svg%3e",ymt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23000000'%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512.001%20512.001'%20xml:space='preserve'%3e%3cg%3e%3cg%3e%3cpath%20d='M256.001,0C114.841,0,0,114.841,0,256.001s114.841,256.001,256.001,256.001S512.001,397.16,512.001,256.001%20S397.16,0,256.001,0z%20M256.001,493.701c-131.069,0-237.702-106.631-237.702-237.7S124.932,18.299,256.001,18.299%20s237.702,106.632,237.702,237.702S387.068,493.701,256.001,493.701z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M371.284,296.658H138.275c-5.054,0-9.15,4.097-9.15,9.15s4.095,9.15,9.15,9.15h233.008c5.054,0,9.15-4.097,9.15-9.15%20C380.433,300.754,376.337,296.658,371.284,296.658z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M297.481,330.816h-85.403c-5.054,0-9.15,4.097-9.15,9.15s4.095,9.15,9.15,9.15h85.403c5.054,0,9.15-4.097,9.15-9.15%20S302.534,330.816,297.481,330.816z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M146.725,192.982c-18.666,0-33.852,15.186-33.852,33.852c0,18.666,15.186,33.852,33.852,33.852%20c18.666,0,33.852-15.186,33.852-33.852C180.577,208.168,165.391,192.982,146.725,192.982z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cpath%20d='M365.275,192.982c-18.666,0-33.852,15.186-33.852,33.852c0,18.666,15.186,33.852,33.852,33.852%20s33.852-15.186,33.852-33.852C399.128,208.168,383.942,192.982,365.275,192.982z'/%3e%3c/g%3e%3c/g%3e%3cg%3e%3cg%3e%3cg%3e%3ccircle%20cx='155.969'%20cy='219.735'%20r='9.15'/%3e%3ccircle%20cx='374.338'%20cy='219.735'%20r='9.15'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Emt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23000000'%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20299.92%20299.92'%20xml:space='preserve'%3e%3cg%3e%3cg%3e%3cg%3e%3cpath%20d='M293.4,65.2H6.52C2.914,65.2,0,68.114,0,71.72v117.36c0,3.606,2.914,6.52,6.52,6.52h6.52v32.6%20c0,3.606,2.914,6.52,6.52,6.52h260.8c3.606,0,6.52-2.914,6.52-6.52v-32.6h6.52c3.606,0,6.52-2.914,6.52-6.52V71.72%20C299.92,68.114,297.006,65.2,293.4,65.2z%20M273.84,221.68h-19.56H228.2h-26.08h-26.08h-26.08h-26.08H97.8H71.72H45.64H26.08V195.6%20h19.56h26.08H97.8h26.08h26.08h26.08h26.08h26.08h26.08h19.56V221.68z%20M286.88,182.56h-6.52H19.56h-6.52V78.24h273.84V182.56z'/%3e%3cpath%20d='M32.6,169.52h39.12c3.606,0,6.52-2.914,6.52-6.52V97.8c0-3.606-2.914-6.52-6.52-6.52H32.6c-3.606,0-6.52,2.914-6.52,6.52%20V163C26.08,166.606,28.994,169.52,32.6,169.52z%20M39.12,104.32H65.2v52.16H39.12V104.32z'/%3e%3cpath%20d='M97.8,169.52h39.12c3.606,0,6.52-2.914,6.52-6.52V97.8c0-3.606-2.914-6.52-6.52-6.52H97.8c-3.606,0-6.52,2.914-6.52,6.52%20V163C91.28,166.606,94.194,169.52,97.8,169.52z%20M104.32,104.32h26.08v52.16h-26.08V104.32z'/%3e%3cpath%20d='M163,169.52h39.12c3.606,0,6.52-2.914,6.52-6.52V97.8c0-3.606-2.914-6.52-6.52-6.52H163c-3.606,0-6.52,2.914-6.52,6.52%20V163C156.48,166.606,159.394,169.52,163,169.52z%20M169.52,104.32h26.08v52.16h-26.08V104.32z'/%3e%3cpath%20d='M228.2,169.52h39.12c3.606,0,6.52-2.914,6.52-6.52V97.8c0-3.606-2.914-6.52-6.52-6.52H228.2%20c-3.606,0-6.52,2.914-6.52,6.52V163C221.68,166.606,224.594,169.52,228.2,169.52z%20M234.72,104.32h26.08v52.16h-26.08V104.32z'/%3e%3cpath%20d='M52.16,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52%20C49.246,221.68,52.16,218.766,52.16,215.16z'/%3e%3cpath%20d='M78.24,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52%20C75.326,221.68,78.24,218.766,78.24,215.16z'/%3e%3cpath%20d='M104.32,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52%20C101.406,221.68,104.32,218.766,104.32,215.16z'/%3e%3cpath%20d='M130.4,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52%20C127.486,221.68,130.4,218.766,130.4,215.16z'/%3e%3cpath%20d='M156.48,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52s-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52%20S156.48,218.766,156.48,215.16z'/%3e%3cpath%20d='M182.56,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52%20C179.646,221.68,182.56,218.766,182.56,215.16z'/%3e%3cpath%20d='M208.64,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52%20C205.726,221.68,208.64,218.766,208.64,215.16z'/%3e%3cpath%20d='M234.72,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52%20C231.806,221.68,234.72,218.766,234.72,215.16z'/%3e%3cpath%20d='M260.8,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52%20C257.886,221.68,260.8,218.766,260.8,215.16z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",vmt="data:image/svg+xml,%3csvg%20width='100'%20height='100'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='50'%20cy='50'%20r='40'%20stroke='green'%20stroke-width='4'%20fill='green'%20/%3e%3cpath%20stroke='white'%20stroke-width='4'%20d='M40%2050%20l10%2010%2020%20-20'%20fill='none'%20/%3e%3c/svg%3e",Smt="data:image/svg+xml,%3csvg%20width='100'%20height='100'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='50'%20cy='50'%20r='40'%20stroke='red'%20stroke-width='4'%20fill='red'%20/%3e%3cline%20x1='35'%20y1='35'%20x2='65'%20y2='65'%20stroke='white'%20stroke-width='4'%20/%3e%3cline%20x1='65'%20y1='35'%20x2='35'%20y2='65'%20stroke='white'%20stroke-width='4'%20/%3e%3c/svg%3e",Tmt="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20fill='%23000000'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='800px'%20height='800px'%20viewBox='0%200%20461.759%20461.759'%20xml:space='preserve'%3e%3cg%3e%3cpath%20d='M0,301.058h147.916v147.919H0V301.058z%20M194.432,448.977H342.35V301.058H194.432V448.977z%20M2.802,257.347h147.916V109.434%20H2.802V257.347z%20M325.476,92.219l-51.603-79.437l-79.441,51.601l51.604,79.437L325.476,92.219z%20M219.337,213.733l71.045,62.663%20l62.66-71.039l-71.044-62.669L219.337,213.733z%20M412.107,57.967l-80.668,49.656l49.652,80.666l80.668-49.65L412.107,57.967z'/%3e%3c/g%3e%3c/svg%3e",xmt="/assets/robot-CQPaMbxU.svg",Cmt="/";ne.defaults.baseURL="/";const wmt={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{Toast:Xu,UniversalForm:X0},data(){return{bUrl:Cmt,isMounted:!1,show:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.constructor()},computed:{configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},mountedPers:{get(){return this.$store.state.mountedPers},set(n){this.$store.commit("setMountedPers",n)}},personalities:{get(){return this.$store.state.personalities},set(n){this.$store.commit("setPersonalities",n)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(n){this.$store.commit("setMountedPers",n)}}},methods:{async handleOnTalk(){const n=this.mountedPers;console.log("pers:",n),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating);let e=await ne.get("/get_generation_status",{});if(e)if(e.data.status)console.log("Already generating");else{const t=this.$store.state.config.personalities.findIndex(r=>r===n.full_path),s={client_id:this.$store.state.client_id,id:t};e=await ne.post("/select_personality",s),console.log("Generating message from ",e.data.status),Ye.emit("generate_msg_from",{id:-1})}},async remount_personality(){const n=this.mountedPers;if(console.log("Remounting personality ",n),!n)return{status:!1,error:"no personality - mount_personality"};try{console.log("before");const e={client_id:this.$store.state.client_id,category:n.category,folder:n.folder,language:n.language};console.log("after");const t=await ne.post("/remount_personality",e);if(console.log("Remounting personality executed:",t),t)return console.log("Remounting personality res"),this.$store.state.toast.showToast("Personality remounted",4,!0),t.data;console.log("failed remount_personality")}catch(e){console.log(e.message,"remount_personality - settings");return}},onSettingsPersonality(n){try{ne.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+n.name,"Save changes","Cancel").then(t=>{try{ne.post("/set_active_personality_settings",t).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. `+s,4,!1)})}catch(s){this.$refs.toast.showToast(`Did not get Personality settings responses. - Endpoint error: `+s.message,4,!1)}}):this.$refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},async constructor(){for(Fe(()=>{Ve.replace()});this.$store.state.ready===!1;)await new Promise(n=>setTimeout(n,100));this.onReady()},async api_get_req(n){try{const e=await ne.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=K0}}},Rmt={class:"relative group/item"},Amt=["src","alt"],Mmt={class:"absolute bottom-6 left-0 w-full flex items-center justify-center opacity-0 group-hover/item:opacity-100 transition-opacity duration-200 p-1"},Nmt={class:"p-1 bg-gray-500 rounded-full text-white hover:bg-gray-600 focus:outline-none ml-1",title:"Show more"},Omt={class:"text-xs font-bold"};function Imt(n,e,t,s,r,i){const o=nt("UniversalForm");return T(),x(Be,null,[l("div",Rmt,[l("button",{onClick:e[1]||(e[1]=$((...a)=>i.onSettingsPersonality&&i.onSettingsPersonality(...a),["prevent"])),class:"w-6 h-6 rounded-full overflow-hidden transition-transform duration-200 transform group-hover/item:scale-110 focus:outline-none"},[l("img",{src:r.bUrl+i.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>i.personalityImgPlacehodler&&i.personalityImgPlacehodler(...a)),alt:i.mountedPers.name,class:Le(["w-full h-full object-cover",{"border-2 border-secondary":n.isActive}])},null,42,Amt)]),l("div",Mmt,[l("button",{onClick:e[2]||(e[2]=$(a=>i.remount_personality(),["prevent"])),class:"p-1 bg-blue-500 rounded-full text-white hover:bg-blue-600 focus:outline-none",title:"Remount"},e[4]||(e[4]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)])),l("button",{onClick:e[3]||(e[3]=$(a=>i.handleOnTalk(),["prevent"])),class:"p-1 bg-green-500 rounded-full text-white hover:bg-green-600 focus:outline-none ml-1",title:"Talk"},e[5]||(e[5]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})],-1)])),l("button",Nmt,[l("span",Omt,"+"+Y(i.mountedPersArr.length-1),1)])])]),z(o,{ref:"universalForm",class:"z-50"},null,512)],64)}const kN=rt(wmt,[["render",Imt]]),kmt={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center overflow-hidden"},Dmt={class:"absolute inset-0 pointer-events-none overflow-hidden"},Lmt={class:"flex flex-col items-center text-center max-w-4xl w-full px-4 relative z-10"},Pmt={class:"mb-8 w-full"},Fmt={class:"bottom-0 text-2xl text-gray-600 dark:text-gray-300 italic"},Umt={class:"text-lg text-gray-700 dark:text-gray-300"},Bmt=["innerHTML"],Gmt={class:"animated-progressbar-bg"},Vmt={class:"w-full max-w-2xl"},zmt={role:"status",class:"w-full"},Hmt={class:"text-xl text-gray-700 dark:text-gray-300"},qmt={class:"text-2xl font-bold text-blue-600 dark:text-blue-400 mt-2"},Ymt={key:0,class:"relative flex flex-col no-scrollbar shadow-lg min-w-[15rem] max-w-[15rem]"},$mt={class:"logo-container"},Wmt=["src"],Kmt={class:"toolbar discussion"},jmt={class:"toolbar-container"},Qmt={class:"p-4 flex flex-wrap gap-2 items-center"},Xmt={class:"relative"},Zmt={class:"relative"},Jmt={key:4,title:"Loading..",class:"flex justify-center"},eht={key:5,class:"flex justify-center space-x-4"},tht={key:6,class:"flex flex-col space-y-2"},nht={class:"relative inline-block"},sht={class:"p-2 border-b border-gray-200 dark:border-gray-700"},rht={class:"p-4 grid grid-cols-3 gap-4 max-h-80 overflow-y-auto custom-scrollbar"},iht={class:"flex flex-col items-center hover:bg-blue-100 dark:hover:bg-blue-900 p-2 rounded-md w-full cursor-pointer"},oht=["onClick","title"],aht=["src","alt"],lht=["title"],cht={class:"absolute top-0 left-0 w-full h-full opacity-0 group-hover/item:opacity-100 transition-opacity duration-200 bg-white dark:bg-gray-900 rounded-md shadow-md p-2 flex flex-col items-center justify-center"},dht=["onClick"],uht={class:"flex space-x-1"},pht=["onClick"],fht=["src","title"],_ht={class:"relative inline-block"},mht={class:"p-2 border-b border-gray-200 dark:border-gray-700"},hht={class:"p-4 grid grid-cols-3 gap-4 max-h-80 overflow-y-auto custom-scrollbar"},ght={class:"flex flex-col items-center hover:bg-blue-100 dark:hover:bg-blue-900 p-2 rounded-md w-full cursor-pointer"},bht=["onClick","title"],yht=["src","alt"],Eht=["title"],vht={class:"absolute top-0 left-0 w-full h-full opacity-0 group-hover/item:opacity-100 transition-opacity duration-200 bg-white dark:bg-gray-900 rounded-md shadow-md p-2 flex flex-col items-center justify-center"},Sht=["onClick"],Tht={class:"flex space-x-1"},xht=["onClick"],Cht=["src","title"],wht={class:"relative inline-block"},Rht={class:"p-2 border-b border-gray-200 dark:border-gray-700"},Aht={class:"p-4 grid grid-cols-3 gap-4 max-h-80 overflow-y-auto custom-scrollbar"},Mht={class:"flex flex-col items-center hover:bg-blue-100 dark:hover:bg-blue-900 p-2 rounded-md w-full cursor-pointer"},Nht=["onClick","title"],Oht=["src","alt"],Iht=["title"],kht={class:"absolute top-0 left-0 w-full h-full opacity-0 group-hover/item:opacity-100 transition-opacity duration-200 bg-white dark:bg-gray-900 rounded-md shadow-md p-2 flex flex-col items-center justify-center"},Dht=["onClick"],Lht={class:"flex space-x-1"},Pht=["onClick"],Fht=["onClick"],Uht=["onClick"],Bht={class:"w-auto max-w-md mx-auto p-2"},Ght={class:"flex items-center"},Vht={class:"relative flex-grow"},zht={key:0,class:"w-full p-4 bg-bg-light dark:bg-bg-dark"},Hht={class:"flex flex-col space-y-2"},qht={key:0},Yht={key:1,class:"flex space-x-2"},$ht={key:1,class:"flex space-x-2"},Wht={class:"flex space-x-2"},Kht={class:"relative flex flex-row flex-grow mb-10 z-0 w-full"},jht={key:1,class:"gap-2 py-2 my-2 hover:shadow-md hover:bg-primary-light dark:hover:bg-primary rounded-md p-2 duration-75 group cursor-pointer"},Qht={class:"flex flex-row panels-color"},Xht={class:"text-center font-large font-bold text-l drop-shadow-md align-middle"},Zht={key:0,class:"relative flex flex-col flex-grow"},Jht={class:"container pt-4 pb-50 mb-50 w-full"},egt={key:0,class:"w-full rounded-lg m-2 shadow-lg hover:border-primary dark:hover:border-primary hover:border-solid hover:border-2 border-2 border-transparent even:bg-bg-light-discussion-odd dark:even:bg-bg-dark-discussion-odd flex flex-col overflow-hidden p-4 pb-2"},tgt={class:"overflow-x-auto flex-grow scrollbar-thin scrollbar-thumb-gray-400 dark:scrollbar-thumb-gray-600 scrollbar-track-gray-200 dark:scrollbar-track-gray-800 scrollbar-thumb-rounded-full scrollbar-track-rounded-full"},ngt={class:"flex flex-nowrap gap-4 p-2 min-w-full"},sgt=["onClick"],rgt=["title"],igt={class:"absolute inset-0 overflow-hidden"},ogt={key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"},agt={class:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow-xl max-w-4xl w-full"},lgt={class:"mb-4 p-4 bg-gray-100 dark:bg-gray-700 rounded-lg"},cgt={class:"text-base"},dgt={class:"space-y-4 max-h-[60vh] overflow-y-auto"},ugt=["for"],pgt=["id","onUpdate:modelValue","placeholder"],fgt=["id","onUpdate:modelValue"],_gt=["id","onUpdate:modelValue"],mgt=["id","onUpdate:modelValue"],hgt={key:4,class:"border rounded-md overflow-hidden"},ggt={class:"bg-gray-200 dark:bg-gray-900 p-2 text-sm"},bgt=["id","onUpdate:modelValue"],ygt=["id","onUpdate:modelValue"],Egt=["value"],vgt={class:"mt-6 flex justify-end space-x-4"},Sgt={key:0,class:"flex flex-row items-center justify-center h-10"},Tgt={key:0,class:"relative flex flex-col no-scrollbar shadow-lg w-1/2 bg-bg-light-tone dark:bg-bg-dark-tone h-full"},xgt={ref:"isolatedContent",class:"h-full"},Cgt={role:"status",class:"fixed m-0 p-2 left-2 bottom-2 min-w-[24rem] max-w-[24rem] h-20 flex flex-col justify-center items-center pb-4 bg-blue-500 rounded-lg shadow-lg z-50 background-a"},wgt={class:"text-2xl animate-pulse mt-2 text-light-text-panel dark:text-dark-text-panel"},Rgt={role:"status",class:"fixed m-0 p-2 left-2 bottom-2 min-w-[24rem] max-w-[24rem] h-20 flex flex-col justify-center items-center pb-4 bg-blue-500 rounded-lg shadow-lg z-50 background-a"},Agt={class:"text-2xl animate-pulse mt-2 text-white"},Mgt={id:"app"},Ngt=n=>{const e=n.replace("[","").replace("]","").split("::"),t=e[0];if(e.length===1)return{label:t,type:"text",fullText:n};const s=e[1],r={label:t,type:s,fullText:n};switch(s){case"int":case"float":case"multiline":break;case"code":r.language=e[2]||"plaintext";break;case"options":r.options=e[2]?e[2].split(",").map(i=>i.trim()):[];break;default:r.type="text"}return r},Ogt="/",Igt={setup(){},data(){return{interestingFacts:["Saïph, the new version of LoLLMs, is named after a star in Orion's constellation (Kappa Orionis), representing bright guidance in AI!","Did you know? The first computer programmer was a woman - Ada Lovelace!","Large Language Models (LLMs) have evolved from having millions of parameters to hundreds of billions in just a few years.","LoLLMs (Lord of Large Language Multimodal Systems) is an open-source AI assistant platform created by ParisNeo.","Saïph (κ Orionis) is a blue-white supergiant star approximately 650 light-years away from Earth.","Neural networks were first proposed in 1943 by Warren McCulloch and Walter Pitts.","Modern LLMs like GPT-4 can understand and generate multiple languages, code, and even analyze images.","LoLLMs supports multiple AI models and can perform tasks like code interpretation, image analysis, and internet searches.","The term 'transformer' in AI, which powers most modern LLMs, was introduced in the 'Attention is All You Need' paper in 2017.","LoLLMs can generate various types of diagrams, including SVG, Graphviz, and Mermaid diagrams.","The Python programming language was named after Monty Python.","LoLLMs features a built-in code interpreter that can execute multiple programming languages.","Quantum computers can perform calculations in minutes that would take classical computers thousands of years.","LoLLMs supports multimodal interactions, allowing users to work with both text and images.","The name Saïph in Arabic (سيف) means 'sword', symbolizing cutting-edge AI technology.",'
'],randomFact:"",showPlaceholderModal:!1,selectedPrompt:"",placeholders:[],placeholderValues:{},previewPrompt:"",uniquePlaceholders:new Map,bindingSearchQuery:"",modelSearchQuery:"",personalitySearchQuery:"",isSearching:!1,isPersonalitiesMenuVisible:!1,isModelsMenuVisible:!1,isBindingsMenuVisible:!1,isMenuVisible:!1,isNavMenuVisible:!1,static_info:hmt,animated_info:gmt,normal_mode:ymt,fun_mode:bmt,is_first_connection:!0,discord:mmt,FastAPI:_mt,modelImgPlaceholder:$n,customLanguage:"",rebooting_audio:new Audio("rebooting.wav"),connection_lost_audio:new Audio("connection_lost.wav"),connection_recovered_audio:new Audio("connection_recovered.wav"),database_selectorDialogVisible:!1,progress_visibility:!1,progress_value:0,codeBlockStylesheet:"",lastMessageHtml:"",defaultMessageHtml:` + Endpoint error: `+s.message,4,!1)}}):this.$refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},async constructor(){for(Fe(()=>{Ve.replace()});this.$store.state.ready===!1;)await new Promise(n=>setTimeout(n,100));this.onReady()},async api_get_req(n){try{const e=await ne.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=K0}}},Rmt={class:"relative group/item"},Amt=["src","alt"],Mmt={class:"absolute bottom-6 left-0 w-full flex items-center justify-center opacity-0 group-hover/item:opacity-100 transition-opacity duration-200 p-1"},Nmt={class:"p-1 bg-gray-500 rounded-full text-white hover:bg-gray-600 focus:outline-none ml-1",title:"Show more"},Omt={class:"text-xs font-bold"};function Imt(n,e,t,s,r,i){const o=nt("UniversalForm");return T(),x(Be,null,[l("div",Rmt,[l("button",{onClick:e[1]||(e[1]=$((...a)=>i.onSettingsPersonality&&i.onSettingsPersonality(...a),["prevent"])),class:"w-6 h-6 rounded-full overflow-hidden transition-transform duration-200 transform group-hover/item:scale-110 focus:outline-none"},[l("img",{src:r.bUrl+i.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>i.personalityImgPlacehodler&&i.personalityImgPlacehodler(...a)),alt:i.mountedPers.name,class:Le(["w-full h-full object-cover",{"border-2 border-secondary":n.isActive}])},null,42,Amt)]),l("div",Mmt,[l("button",{onClick:e[2]||(e[2]=$(a=>i.remount_personality(),["prevent"])),class:"p-1 bg-blue-500 rounded-full text-white hover:bg-blue-600 focus:outline-none",title:"Remount"},e[4]||(e[4]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)])),l("button",{onClick:e[3]||(e[3]=$(a=>i.handleOnTalk(),["prevent"])),class:"p-1 bg-green-500 rounded-full text-white hover:bg-green-600 focus:outline-none ml-1",title:"Talk"},e[5]||(e[5]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})],-1)])),l("button",Nmt,[l("span",Omt,"+"+Y(i.mountedPersArr.length-1),1)])])]),z(o,{ref:"universalForm",class:"z-50"},null,512)],64)}const kN=rt(wmt,[["render",Imt]]),kmt={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center overflow-hidden"},Dmt={class:"absolute inset-0 pointer-events-none overflow-hidden"},Lmt={class:"flex flex-col items-center text-center max-w-4xl w-full px-4 relative z-10"},Pmt={class:"mb-8 w-full"},Fmt={class:"bottom-0 text-2xl text-gray-600 dark:text-gray-300 italic"},Umt={class:"text-lg text-gray-700 dark:text-gray-300"},Bmt=["innerHTML"],Gmt={class:"animated-progressbar-bg"},Vmt={class:"w-full max-w-2xl"},zmt={role:"status",class:"w-full"},Hmt={class:"text-xl text-gray-700 dark:text-gray-300"},qmt={class:"text-2xl font-bold text-blue-600 dark:text-blue-400 mt-2"},Ymt={key:0,class:"relative flex flex-col no-scrollbar shadow-lg min-w-[15rem] max-w-[15rem]"},$mt={class:"logo-container"},Wmt=["src"],Kmt={class:"toolbar discussion"},jmt={class:"toolbar-container"},Qmt={class:"p-4 flex flex-wrap gap-2 items-center"},Xmt={class:"relative"},Zmt={class:"relative"},Jmt={key:4,title:"Loading..",class:"flex justify-center"},eht={key:5,class:"flex justify-center space-x-4"},tht={key:6,class:"flex flex-col space-y-2"},nht={class:"relative inline-block"},sht={class:"p-2 border-b border-gray-200 dark:border-gray-700"},rht={class:"p-4 grid grid-cols-3 gap-4 max-h-80 overflow-y-auto custom-scrollbar"},iht={class:"flex flex-col items-center hover:bg-blue-100 dark:hover:bg-blue-900 p-2 rounded-md w-full cursor-pointer"},oht=["onClick","title"],aht=["src","alt"],lht=["title"],cht={class:"absolute top-0 left-0 w-full h-full opacity-0 group-hover/item:opacity-100 transition-opacity duration-200 bg-white dark:bg-gray-900 rounded-md shadow-md p-2 flex flex-col items-center justify-center"},dht=["onClick"],uht={class:"flex space-x-1"},pht=["onClick"],fht=["src","title"],_ht={class:"relative inline-block"},mht={class:"p-2 border-b border-gray-200 dark:border-gray-700"},hht={class:"p-4 grid grid-cols-3 gap-4 max-h-80 overflow-y-auto custom-scrollbar"},ght={class:"flex flex-col items-center hover:bg-blue-100 dark:hover:bg-blue-900 p-2 rounded-md w-full cursor-pointer"},bht=["onClick","title"],yht=["src","alt"],Eht=["title"],vht={class:"absolute top-0 left-0 w-full h-full opacity-0 group-hover/item:opacity-100 transition-opacity duration-200 bg-white dark:bg-gray-900 rounded-md shadow-md p-2 flex flex-col items-center justify-center"},Sht=["onClick"],Tht={class:"flex space-x-1"},xht=["onClick"],Cht=["src","title"],wht={class:"relative inline-block"},Rht={class:"p-2 border-b border-gray-200 dark:border-gray-700"},Aht={class:"p-4 grid grid-cols-3 gap-4 max-h-80 overflow-y-auto custom-scrollbar"},Mht={class:"flex flex-col items-center hover:bg-blue-100 dark:hover:bg-blue-900 p-2 rounded-md w-full cursor-pointer"},Nht=["onClick","title"],Oht=["src","alt"],Iht=["title"],kht={class:"absolute top-0 left-0 w-full h-full opacity-0 group-hover/item:opacity-100 transition-opacity duration-200 bg-white dark:bg-gray-900 rounded-md shadow-md p-2 flex flex-col items-center justify-center"},Dht=["onClick"],Lht={class:"flex space-x-1"},Pht=["onClick"],Fht=["onClick"],Uht=["onClick"],Bht={class:"w-auto max-w-md mx-auto p-2"},Ght={class:"flex items-center"},Vht={class:"relative flex-grow"},zht={key:0,class:"w-full p-4 bg-bg-light dark:bg-bg-dark"},Hht={class:"flex flex-col space-y-2"},qht={key:0},Yht={key:1,class:"flex space-x-2"},$ht={key:1,class:"flex space-x-2"},Wht={class:"flex space-x-2"},Kht={class:"relative flex flex-row flex-grow mb-10 z-0 w-full"},jht={key:1,class:"gap-2 py-2 my-2 hover:shadow-md hover:bg-primary-light dark:hover:bg-primary rounded-md p-2 duration-75 group cursor-pointer"},Qht={class:"flex flex-row panels-color"},Xht={class:"text-center font-large font-bold text-l drop-shadow-md align-middle"},Zht={key:0,class:"relative flex flex-col flex-grow"},Jht={class:"container pt-4 pb-50 mb-50 w-full"},egt={key:0,class:"w-full rounded-lg m-2 shadow-lg hover:border-primary dark:hover:border-primary hover:border-solid hover:border-2 border-2 border-transparent even:bg-bg-light-discussion-odd dark:even:bg-bg-dark-discussion-odd flex flex-col overflow-hidden p-4 pb-2"},tgt={class:"overflow-x-auto flex-grow scrollbar-thin scrollbar-thumb-gray-400 dark:scrollbar-thumb-gray-600 scrollbar-track-gray-200 dark:scrollbar-track-gray-800 scrollbar-thumb-rounded-full scrollbar-track-rounded-full"},ngt={class:"flex flex-nowrap gap-6 p-4 min-w-full"},sgt=["onClick"],rgt={class:"space-y-3"},igt={class:"font-bold text-lg text-gray-900 dark:text-gray-100 mb-2 truncate"},ogt=["title"],agt={key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"},lgt={class:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow-xl max-w-4xl w-full max-h-[90vh] flex flex-col"},cgt={class:"flex-1 flex flex-col min-h-0"},dgt={class:"mb-4 p-4 bg-gray-100 dark:bg-gray-700 rounded-lg"},ugt={class:"flex-1 h-[200px] overflow-y-auto scrollbar scrollbar-thumb-gray-400 dark:scrollbar-thumb-gray-500 scrollbar-track-gray-200 dark:scrollbar-track-gray-700 scrollbar-thin rounded-md"},pgt={class:"text-base whitespace-pre-wrap"},fgt={class:"flex-1 overflow-y-auto"},_gt={class:"space-y-4"},mgt=["for"],hgt=["id","onUpdate:modelValue","placeholder"],ggt=["id","onUpdate:modelValue"],bgt=["id","onUpdate:modelValue"],ygt=["id","onUpdate:modelValue"],Egt={key:4,class:"border rounded-md overflow-hidden"},vgt={class:"bg-gray-200 dark:bg-gray-900 p-2 text-sm"},Sgt=["id","onUpdate:modelValue"],Tgt=["id","onUpdate:modelValue"],xgt=["value"],Cgt={class:"mt-6 flex justify-end space-x-4"},wgt={key:0,class:"flex flex-row items-center justify-center h-10"},Rgt={key:0,class:"relative flex flex-col no-scrollbar shadow-lg w-1/2 bg-bg-light-tone dark:bg-bg-dark-tone h-full"},Agt={ref:"isolatedContent",class:"h-full"},Mgt={role:"status",class:"fixed m-0 p-2 left-2 bottom-2 min-w-[24rem] max-w-[24rem] h-20 flex flex-col justify-center items-center pb-4 bg-blue-500 rounded-lg shadow-lg z-50 background-a"},Ngt={class:"text-2xl animate-pulse mt-2 text-light-text-panel dark:text-dark-text-panel"},Ogt={role:"status",class:"fixed m-0 p-2 left-2 bottom-2 min-w-[24rem] max-w-[24rem] h-20 flex flex-col justify-center items-center pb-4 bg-blue-500 rounded-lg shadow-lg z-50 background-a"},Igt={class:"text-2xl animate-pulse mt-2 text-white"},kgt={id:"app"},Dgt=n=>{const e=n.replace("[","").replace("]","").split("::"),t=e[0];if(e.length===1)return{label:t,type:"text",fullText:n};const s=e[1],r={label:t,type:s,fullText:n};switch(s){case"int":case"float":case"multiline":break;case"code":r.language=e[2]||"plaintext";break;case"options":r.options=e[2]?e[2].split(",").map(i=>i.trim()):[];break;default:r.type="text"}return r},Lgt="/",Pgt={setup(){},data(){return{interestingFacts:["Saïph, the new version of LoLLMs, is named after a star in Orion's constellation (Kappa Orionis), representing bright guidance in AI!","Did you know? The first computer programmer was a woman - Ada Lovelace!","Large Language Models (LLMs) have evolved from having millions of parameters to hundreds of billions in just a few years.","LoLLMs (Lord of Large Language Multimodal Systems) is an open-source AI assistant platform created by ParisNeo.","Saïph (κ Orionis) is a blue-white supergiant star approximately 650 light-years away from Earth.","Neural networks were first proposed in 1943 by Warren McCulloch and Walter Pitts.","Modern LLMs like GPT-4 can understand and generate multiple languages, code, and even analyze images.","LoLLMs supports multiple AI models and can perform tasks like code interpretation, image analysis, and internet searches.","The term 'transformer' in AI, which powers most modern LLMs, was introduced in the 'Attention is All You Need' paper in 2017.","LoLLMs can generate various types of diagrams, including SVG, Graphviz, and Mermaid diagrams.","The Python programming language was named after Monty Python.","LoLLMs features a built-in code interpreter that can execute multiple programming languages.","Quantum computers can perform calculations in minutes that would take classical computers thousands of years.","LoLLMs supports multimodal interactions, allowing users to work with both text and images.","The name Saïph in Arabic (سيف) means 'sword', symbolizing cutting-edge AI technology.",'
'],randomFact:"",showPlaceholderModal:!1,selectedPrompt:"",placeholders:[],placeholderValues:{},previewPrompt:"",uniquePlaceholders:new Map,bindingSearchQuery:"",modelSearchQuery:"",personalitySearchQuery:"",isSearching:!1,isPersonalitiesMenuVisible:!1,isModelsMenuVisible:!1,isBindingsMenuVisible:!1,isMenuVisible:!1,isNavMenuVisible:!1,static_info:hmt,animated_info:gmt,normal_mode:ymt,fun_mode:bmt,is_first_connection:!0,discord:mmt,FastAPI:_mt,modelImgPlaceholder:$n,customLanguage:"",rebooting_audio:new Audio("rebooting.wav"),connection_lost_audio:new Audio("connection_lost.wav"),connection_recovered_audio:new Audio("connection_recovered.wav"),database_selectorDialogVisible:!1,progress_visibility:!1,progress_value:0,codeBlockStylesheet:"",lastMessageHtml:"",defaultMessageHtml:` @@ -321,19 +321,19 @@ ${e} ${c}`;navigator.clipboard.writeText(d)}else navigator.clipboard.writeText(e);this.$store.state.toast.showToast("Copied to clipboard successfully",4,!0),Fe(()=>{Ve.replace()})},closeToast(){this.showToast=!1},saveJSONtoFile(n,e){e=e||"data.json";const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([JSON.stringify(n,null,2)],{type:"text/plain"})),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)},saveMarkdowntoFile(n,e){e=e||"data.md";const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([n],{type:"text/plain"})),t.setAttribute("download",e),document.body.appendChild(t),t.click(),document.body.removeChild(t)},parseJsonObj(n){try{return JSON.parse(n)}catch(e){return this.$store.state.toast.showToast(`Could not parse JSON. `+e.message,4,!1),null}},async parseJsonFile(n){return new Promise((e,t)=>{const s=new FileReader;s.onload=r=>e(this.parseJsonObj(r.target.result)),s.onerror=r=>t(r),s.readAsText(n)})},async exportDiscussionsAsMarkdown(){const n=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(n.length>0){console.log("export",n);let e=new Date;const t=e.getFullYear(),s=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getDate().toString().padStart(2,"0"),i=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),d="discussions_export_"+(t+"."+s+"."+r+"."+i+o+a)+".md";this.loading=!0;const u=await this.export_multiple_discussions(n,"markdown");u?(this.saveMarkdowntoFile(u,d),this.$store.state.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this.$store.state.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async exportDiscussions(){},async exportDiscussionsAsJson(){const n=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(n.length>0){console.log("export",n);let e=new Date;const t=e.getFullYear(),s=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getDate().toString().padStart(2,"0"),i=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),d="discussions_export_"+(t+"."+s+"."+r+"."+i+o+a)+".json";this.loading=!0;const u=await this.export_multiple_discussions(n,"json");u?(this.saveJSONtoFile(u,d),this.$store.state.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this.$store.state.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async importDiscussionsBundle(n){},async importDiscussions(n){const e=await this.parseJsonFile(n.target.files[0]);await this.import_multiple_discussions(e)?(this.$store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$store.state.toast.showToast("Failed to import discussions",4,!1)},async getPersonalityAvatars(){for(;this.$store.state.personalities===null;)await new Promise(e=>setTimeout(e,100));let n=this.$store.state.personalities;this.personalityAvatars=n.map(e=>({name:e.name,avatar:e.avatar}))},getAvatar(n){if(n.toLowerCase().trim()==this.$store.state.config.user_name.toLowerCase().trim())return"user_infos/"+this.$store.state.config.user_avatar;const e=this.personalityAvatars.findIndex(s=>s.name===n),t=this.personalityAvatars[e];if(t)return console.log("Avatar",t.avatar),t.avatar},setFileListChat(n){try{this.$refs.chatBox.fileList=this.$refs.chatBox.fileList.concat(n)}catch(e){this.$store.state.toast.showToast(`Failed to set filelist in chatbox -`+e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(n){if(n.length>1){this.$store.state.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(n[0]);await this.import_multiple_discussions(e)?(this.$store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$store.state.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1}},async created(){this.randomFact=this.interestingFacts[Math.floor(Math.random()*this.interestingFacts.length)],console.log("Created discussions view");const e=(await ne.get("/get_versionID")).data.versionId;Ye.onopen=()=>{console.log("WebSocket connection established."),this.currentDiscussion!=null&&(this.setPageTitle(item),localStorage.setItem("selected_discussion",this.currentDiscussion.id),console.log(`Saved discussion to : ${this.currentDiscussion.id}`),this.load_discussion(item.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)}))},this.versionId!==e&&(this.$store.commit("updateVersionId",e),window.location.reload(!0)),this.$nextTick(()=>{Ve.replace()}),console.log("Connected to socket io");try{this.$store.state.loading_infos="Getting version",this.$store.state.loading_progress=30,await this.$store.dispatch("getVersion")}catch(t){console.log("Error cought:",t)}try{for(this.$store.state.loading_infos="Loading Configuration";Ye.id===void 0;)await new Promise(t=>setTimeout(t,100));this.$store.state.client_id=Ye.id,console.log(this.$store.state.client_id),await this.$store.dispatch("refreshConfig"),console.log("Config ready")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Loading Database",this.$store.state.loading_progress=20,await this.$store.dispatch("refreshDatabase")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting Bindings list",this.$store.state.loading_progress=40,await this.$store.dispatch("refreshBindings")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting personalities zoo",this.$store.state.loading_progress=70,await this.$store.dispatch("refreshPersonalitiesZoo")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting mounted personalities",this.$store.state.loading_progress=80,await this.$store.dispatch("refreshMountedPersonalities")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting models zoo",this.$store.state.loading_progress=90,await this.$store.dispatch("refreshModelsZoo")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting active models",this.$store.state.loading_progress=100,await this.$store.dispatch("refreshModels"),await this.$store.dispatch("refreshModelStatus")}catch(t){console.log("Error cought:",t)}try{await this.$store.dispatch("fetchLanguages"),await this.$store.dispatch("fetchLanguage")}catch(t){console.log("Error cought:",t)}try{await this.$store.dispatch("fetchisRTOn")}catch(t){console.log("Error cought:",t)}this.$store.state.isConnected=!0,this.$store.state.client_id=Ye.id,console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),this.isCreated=!0,this.$store.state.ready=!0,Ye.on("connected",this.socketIOConnected),Ye.on("disconnected",this.socketIODisconnected),console.log("Added events"),Ye.on("show_progress",this.show_progress),Ye.on("hide_progress",this.hide_progress),Ye.on("update_progress",this.update_progress),Ye.on("notification",this.notify),Ye.on("new_message",this.new_message),Ye.on("update_message",this.update_message),Ye.on("close_message",this.finalMsgEvent),Ye.on("disucssion_renamed",t=>{console.log("Received new title",t.discussion_id,t.title);const s=this.list.findIndex(i=>i.id==t.discussion_id),r=this.list[s];r.title=t.title}),Ye.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},Ye.on("connect_error",t=>{t.message==="ERR_CONNECTION_REFUSED"?console.error("Connection refused. The server is not available."):console.error("Connection error:",t),this.$store.state.isConnected=!1}),Ye.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),Ye.disconnect()}},beforeUnmount(){window.removeEventListener("resize",this.adjustMenuPosition)},async mounted(){window.addEventListener("keydown",this.handleShortcut),this.$store.state.toast=this.$refs.toast,this.$store.state.news=this.$refs.news,this.$store.state.messageBox=this.$refs.messageBox,this.$store.state.universalForm=this.$refs.universalForm,this.$store.state.yesNoDialog=this.$refs.yesNoDialog,this.$store.state.personality_editor=this.$refs.personality_editor,window.addEventListener("resize",this.adjustMenuPosition),Ye.on("refresh_files",()=>{this.recoverFiles()})},async activated(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&Fe(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)}),this.$store.state.config.show_news_panel&&this.$store.state.news.show()},components:{Discussion:Q0,Message:mN,ChatBox:hN,WelcomeComponent:gN,ChoiceDialog:j0,ProgressBar:mu,InputBox:pN,SkillsLibraryViewer:fN,Toast:Xu,MessageBox:MN,ProgressBar:mu,UniversalForm:X0,YesNoDialog:NN,PersonalityEditor:ON,PopupViewer:IN,ActionButton:kA,SocialIcon:DA,MountedPersonalities:kN},watch:{installedModels:{immediate:!0,handler(n){this.$nextTick(()=>{this.installedModels=n})}},"$store.state.config.fun_mode":function(n,e){console.log(`Fun mode changed from ${e} to ${n}! 🎉`)},"$store.state.isConnected":function(n,e){this.isConnected?(console.log("this.is_first_connection"),console.log(this.is_first_connection),this.is_first_connection||(this.$store.state.messageBox.hideMessage(),this.$store.state.messageBox.showMessage("Server connected."),this.$store.state.config.activate_audio_infos&&this.connection_recovered_audio.play())):(this.$store.state.messageBox.showBlockingMessage("Server suddenly disconnected. Please reboot the server to recover the connection"),this.is_first_connection=!1,console.log("this.is_first_connection set to false"),console.log(this.is_first_connection),this.$store.state.config.activate_audio_infos&&this.connection_lost_audio.play()),Fe(()=>{Ve.replace()})},messages:{handler:"extractHtml",deep:!0},progress_visibility_val(n){console.log("progress_visibility changed to "+n)},filterTitle(n){n==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(n){Fe(()=>{Ve.replace()}),n||(this.isSelectAll=!1)},socketConnected(n){console.log("Websocket connected (watch)",n)},showConfirmation(){Fe(()=>{Ve.replace()})}},computed:{parsedPlaceholders(){const n=new Map;return this.placeholders.forEach(e=>{const t=Ngt(e);n.set(t.fullText,t)}),Array.from(n.values())},filteredBindings(){return this.installedBindings.filter(n=>n.name.toLowerCase().includes(this.bindingSearchQuery.toLowerCase()))},filteredModels(){return this.installedModels.filter(n=>n.name.toLowerCase().includes(this.modelSearchQuery.toLowerCase()))},filteredPersonalities(){return this.mountedPersonalities.filter(n=>n.name.toLowerCase().includes(this.personalitySearchQuery.toLowerCase()))},currentModel(){return this.$store.state.currentModel||{}},currentModelIcon(){return this.currentModel.icon||this.modelImgPlaceholder},binding_name(){return this.$store.state.config.binding_name},installedModels(){return this.$store.state.installedModels},model_name(){return this.$store.state.config.model_name},mountedPersonalities(){return this.$store.state.mountedPersArr},personality_name(){return this.$store.state.config.active_personality_id},config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},installedBindings(){return this.$store.state.installedBindings},currentBindingIcon(){return this.currentBinding.icon||this.modelImgPlaceholder},currentBinding(){return this.$store.state.currentBinding||{}},isFullMode(){return this.$store.state.view_mode==="full"},storeLogo(){return this.$store.state.config?Bs:this.$store.state.config.app_custom_logo!=""?"/user_infos/"+this.$store.state.config.app_custom_logo:Bs},currentPersonConfig(){try{return this.$store.state.currentPersonConfig}catch{console.log("Error finding current personality configuration");return}},selectedPersonality(){try{return this.$store.state.selectedPersonality}catch{console.log("Error finding current personality configuration");return}},loading_infos(){return this.$store.state.loading_infos},is_fun_mode(){try{return this.$store.state.config?this.$store.state.config.fun_mode:!1}catch(n){return console.error("Oopsie! Looks like we hit a snag: ",n),!1}},isModelOK(){return this.$store.state.isModelOk},isGenerating(){return this.$store.state.isGenerating},isConnected(){return this.$store.state.isConnected},..._L({versionId:n=>n.versionId}),progress_visibility:{get(){return self.progress_visibility_val}},version_info:{get(){return this.$store.state.version!=null&&this.$store.state.version!="unknown"?this.$store.state.version:"..."}},loading_infos:{get(){return this.$store.state.loading_infos}},loading_progress:{get(){return this.$store.state.loading_progress}},isModelOk:{get(){return this.$store.state.isModelOk},set(n){this.$store.state.isModelOk=n}},isGenerating:{get(){return this.$store.state.isGenerating},set(n){this.$store.state.isGenerating=n}},personality(){console.log("personality:",this.$store.state.config.personalities[this.$store.state.config.active_personality_id]);const n=this.$store.state.config.personalities[this.$store.state.config.active_personality_id];console.log("peronslities",this.$store.state.personalities[0]);const e=this.$store.state.personalities.find(t=>t.full_path===n);return console.log("personality:",e),e},prompts_list(){return console.log(this.personality.prompts_list),this.personality.prompts_list},formatted_database_name(){return this.$store.state.config.discussion_db_name},UseDiscussionHistory(){return this.$store.state.config.activate_skills_lib},isReady(){return this.$store.state.ready},databases(){return this.$store.state.databases},client_id(){return Ye.id},showLeftPanel(){return console.log("showLeftPanel"),console.log(this.$store.state.leftPanelCollapsed),this.$store.state.ready&&!this.$store.state.leftPanelCollapsed},showRightPanel(){return console.log("showRightPanel"),console.log(this.$store.state.rightPanelCollapsed),this.$store.state.ready&&!this.$store.state.rightPanelCollapsed},socketConnected(){return console.log(" --- > Websocket connected"),this.$store.commit("setIsConnected",!0),!0},socketDisconnected(){return this.$store.commit("setIsConnected",!1),console.log(" --- > Websocket disconnected"),!0},selectedDiscussions(){return Fe(()=>{Ve.replace()}),this.list.filter(n=>n.checkBoxValue==!0)}}},kgt=Object.assign(Igt,{__name:"DiscussionsView",setup(n){return cr(()=>{AN()}),ne.defaults.baseURL="/",(e,t)=>(T(),x(Be,null,[z(Or,{name:"fade-and-fly"},{default:Ie(()=>[e.isReady?B("",!0):(T(),x("div",kmt,[l("div",Dmt,[(T(),x(Be,null,Ke(50,s=>l("div",{key:s,class:"absolute animate-fall animate-giggle",style:Bt({left:`${Math.random()*100}%`,top:"-20px",animationDuration:`${3+Math.random()*7}s`,animationDelay:`${Math.random()*5}s`})}," 🌟 ",4)),64))]),l("div",Lmt,[l("div",Pmt,[t[59]||(t[59]=l("div",{class:"text-5xl md:text-6xl font-bold text-amber-500 mb-2 hover:scale-105 transition-transform",style:{"text-shadow":`2px 2px 4px rgba(0,0,0,0.2), \r +`+e.message,4,!1)}this.isDragOverChat=!1},async setFileListDiscussion(n){if(n.length>1){this.$store.state.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(n[0]);await this.import_multiple_discussions(e)?(this.$store.state.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$store.state.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1}},async created(){this.randomFact=this.interestingFacts[Math.floor(Math.random()*this.interestingFacts.length)],console.log("Created discussions view");const e=(await ne.get("/get_versionID")).data.versionId;Ye.onopen=()=>{console.log("WebSocket connection established."),this.currentDiscussion!=null&&(this.setPageTitle(item),localStorage.setItem("selected_discussion",this.currentDiscussion.id),console.log(`Saved discussion to : ${this.currentDiscussion.id}`),this.load_discussion(item.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)}))},this.versionId!==e&&(this.$store.commit("updateVersionId",e),window.location.reload(!0)),this.$nextTick(()=>{Ve.replace()}),console.log("Connected to socket io");try{this.$store.state.loading_infos="Getting version",this.$store.state.loading_progress=30,await this.$store.dispatch("getVersion")}catch(t){console.log("Error cought:",t)}try{for(this.$store.state.loading_infos="Loading Configuration";Ye.id===void 0;)await new Promise(t=>setTimeout(t,100));this.$store.state.client_id=Ye.id,console.log(this.$store.state.client_id),await this.$store.dispatch("refreshConfig"),console.log("Config ready")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Loading Database",this.$store.state.loading_progress=20,await this.$store.dispatch("refreshDatabase")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting Bindings list",this.$store.state.loading_progress=40,await this.$store.dispatch("refreshBindings")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting personalities zoo",this.$store.state.loading_progress=70,await this.$store.dispatch("refreshPersonalitiesZoo")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting mounted personalities",this.$store.state.loading_progress=80,await this.$store.dispatch("refreshMountedPersonalities")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting models zoo",this.$store.state.loading_progress=90,await this.$store.dispatch("refreshModelsZoo")}catch(t){console.log("Error cought:",t)}try{this.$store.state.loading_infos="Getting active models",this.$store.state.loading_progress=100,await this.$store.dispatch("refreshModels"),await this.$store.dispatch("refreshModelStatus")}catch(t){console.log("Error cought:",t)}try{await this.$store.dispatch("fetchLanguages"),await this.$store.dispatch("fetchLanguage")}catch(t){console.log("Error cought:",t)}try{await this.$store.dispatch("fetchisRTOn")}catch(t){console.log("Error cought:",t)}this.$store.state.isConnected=!0,this.$store.state.client_id=Ye.id,console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),this.isCreated=!0,this.$store.state.ready=!0,Ye.on("connected",this.socketIOConnected),Ye.on("disconnected",this.socketIODisconnected),console.log("Added events"),Ye.on("show_progress",this.show_progress),Ye.on("hide_progress",this.hide_progress),Ye.on("update_progress",this.update_progress),Ye.on("notification",this.notify),Ye.on("new_message",this.new_message),Ye.on("update_message",this.update_message),Ye.on("close_message",this.finalMsgEvent),Ye.on("disucssion_renamed",t=>{console.log("Received new title",t.discussion_id,t.title);const s=this.list.findIndex(i=>i.id==t.discussion_id),r=this.list[s];r.title=t.title}),Ye.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},Ye.on("connect_error",t=>{t.message==="ERR_CONNECTION_REFUSED"?console.error("Connection refused. The server is not available."):console.error("Connection error:",t),this.$store.state.isConnected=!1}),Ye.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),Ye.disconnect()}},beforeUnmount(){window.removeEventListener("resize",this.adjustMenuPosition)},async mounted(){window.addEventListener("keydown",this.handleShortcut),this.$store.state.toast=this.$refs.toast,this.$store.state.news=this.$refs.news,this.$store.state.messageBox=this.$refs.messageBox,this.$store.state.universalForm=this.$refs.universalForm,this.$store.state.yesNoDialog=this.$refs.yesNoDialog,this.$store.state.personality_editor=this.$refs.personality_editor,window.addEventListener("resize",this.adjustMenuPosition),Ye.on("refresh_files",()=>{this.recoverFiles()})},async activated(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&Fe(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)}),this.$store.state.config.show_news_panel&&this.$store.state.news.show()},components:{Discussion:Q0,Message:mN,ChatBox:hN,WelcomeComponent:gN,ChoiceDialog:j0,ProgressBar:mu,InputBox:pN,SkillsLibraryViewer:fN,Toast:Xu,MessageBox:MN,ProgressBar:mu,UniversalForm:X0,YesNoDialog:NN,PersonalityEditor:ON,PopupViewer:IN,ActionButton:kA,SocialIcon:DA,MountedPersonalities:kN},watch:{installedModels:{immediate:!0,handler(n){this.$nextTick(()=>{this.installedModels=n})}},"$store.state.config.fun_mode":function(n,e){console.log(`Fun mode changed from ${e} to ${n}! 🎉`)},"$store.state.isConnected":function(n,e){this.isConnected?(console.log("this.is_first_connection"),console.log(this.is_first_connection),this.is_first_connection||(this.$store.state.messageBox.hideMessage(),this.$store.state.messageBox.showMessage("Server connected."),this.$store.state.config.activate_audio_infos&&this.connection_recovered_audio.play())):(this.$store.state.messageBox.showBlockingMessage("Server suddenly disconnected. Please reboot the server to recover the connection"),this.is_first_connection=!1,console.log("this.is_first_connection set to false"),console.log(this.is_first_connection),this.$store.state.config.activate_audio_infos&&this.connection_lost_audio.play()),Fe(()=>{Ve.replace()})},messages:{handler:"extractHtml",deep:!0},progress_visibility_val(n){console.log("progress_visibility changed to "+n)},filterTitle(n){n==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(n){Fe(()=>{Ve.replace()}),n||(this.isSelectAll=!1)},socketConnected(n){console.log("Websocket connected (watch)",n)},showConfirmation(){Fe(()=>{Ve.replace()})}},computed:{parsedPlaceholders(){const n=new Map;return this.placeholders.forEach(e=>{const t=Dgt(e);n.set(t.fullText,t)}),Array.from(n.values())},filteredBindings(){return this.installedBindings.filter(n=>n.name.toLowerCase().includes(this.bindingSearchQuery.toLowerCase()))},filteredModels(){return this.installedModels.filter(n=>n.name.toLowerCase().includes(this.modelSearchQuery.toLowerCase()))},filteredPersonalities(){return this.mountedPersonalities.filter(n=>n.name.toLowerCase().includes(this.personalitySearchQuery.toLowerCase()))},currentModel(){return this.$store.state.currentModel||{}},currentModelIcon(){return this.currentModel.icon||this.modelImgPlaceholder},binding_name(){return this.$store.state.config.binding_name},installedModels(){return this.$store.state.installedModels},model_name(){return this.$store.state.config.model_name},mountedPersonalities(){return this.$store.state.mountedPersArr},personality_name(){return this.$store.state.config.active_personality_id},config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},installedBindings(){return this.$store.state.installedBindings},currentBindingIcon(){return this.currentBinding.icon||this.modelImgPlaceholder},currentBinding(){return this.$store.state.currentBinding||{}},isFullMode(){return this.$store.state.view_mode==="full"},storeLogo(){return this.$store.state.config?Bs:this.$store.state.config.app_custom_logo!=""?"/user_infos/"+this.$store.state.config.app_custom_logo:Bs},currentPersonConfig(){try{return this.$store.state.currentPersonConfig}catch{console.log("Error finding current personality configuration");return}},selectedPersonality(){try{return this.$store.state.selectedPersonality}catch{console.log("Error finding current personality configuration");return}},loading_infos(){return this.$store.state.loading_infos},is_fun_mode(){try{return this.$store.state.config?this.$store.state.config.fun_mode:!1}catch(n){return console.error("Oopsie! Looks like we hit a snag: ",n),!1}},isModelOK(){return this.$store.state.isModelOk},isGenerating(){return this.$store.state.isGenerating},isConnected(){return this.$store.state.isConnected},..._L({versionId:n=>n.versionId}),progress_visibility:{get(){return self.progress_visibility_val}},version_info:{get(){return this.$store.state.version!=null&&this.$store.state.version!="unknown"?this.$store.state.version:"..."}},loading_infos:{get(){return this.$store.state.loading_infos}},loading_progress:{get(){return this.$store.state.loading_progress}},isModelOk:{get(){return this.$store.state.isModelOk},set(n){this.$store.state.isModelOk=n}},isGenerating:{get(){return this.$store.state.isGenerating},set(n){this.$store.state.isGenerating=n}},personality(){console.log("personality:",this.$store.state.config.personalities[this.$store.state.config.active_personality_id]);const n=this.$store.state.config.personalities[this.$store.state.config.active_personality_id];console.log("peronslities",this.$store.state.personalities[0]);const e=this.$store.state.personalities.find(t=>t.full_path===n);return console.log("personality:",e),e},prompts_list(){return console.log(this.personality.prompts_list),this.personality.prompts_list},formatted_database_name(){return this.$store.state.config.discussion_db_name},UseDiscussionHistory(){return this.$store.state.config.activate_skills_lib},isReady(){return this.$store.state.ready},databases(){return this.$store.state.databases},client_id(){return Ye.id},showLeftPanel(){return console.log("showLeftPanel"),console.log(this.$store.state.leftPanelCollapsed),this.$store.state.ready&&!this.$store.state.leftPanelCollapsed},showRightPanel(){return console.log("showRightPanel"),console.log(this.$store.state.rightPanelCollapsed),this.$store.state.ready&&!this.$store.state.rightPanelCollapsed},socketConnected(){return console.log(" --- > Websocket connected"),this.$store.commit("setIsConnected",!0),!0},socketDisconnected(){return this.$store.commit("setIsConnected",!1),console.log(" --- > Websocket disconnected"),!0},selectedDiscussions(){return Fe(()=>{Ve.replace()}),this.list.filter(n=>n.checkBoxValue==!0)}}},Fgt=Object.assign(Pgt,{__name:"DiscussionsView",setup(n){return cr(()=>{AN()}),ne.defaults.baseURL="/",(e,t)=>(T(),x(Be,null,[z(Or,{name:"fade-and-fly"},{default:Ie(()=>[e.isReady?B("",!0):(T(),x("div",kmt,[l("div",Dmt,[(T(),x(Be,null,Ke(50,s=>l("div",{key:s,class:"absolute animate-fall animate-giggle",style:Bt({left:`${Math.random()*100}%`,top:"-20px",animationDuration:`${3+Math.random()*7}s`,animationDelay:`${Math.random()*5}s`})}," 🌟 ",4)),64))]),l("div",Lmt,[l("div",Pmt,[t[59]||(t[59]=l("div",{class:"text-5xl md:text-6xl font-bold text-amber-500 mb-2 hover:scale-105 transition-transform",style:{"text-shadow":`2px 2px 4px rgba(0,0,0,0.2), \r 2px 2px 0px white, \r -2px -2px 0px white, \r 2px -2px 0px white, \r - -2px 2px 0px white`,background:"linear-gradient(45deg, #f59e0b, #fbbf24)","-webkit-background-clip":"text","background-clip":"text"}},[Ze(" L"),l("span",{class:"animate-pulse"},"⭐"),Ze("LLMS ")],-1)),t[60]||(t[60]=l("p",{class:"text-2xl text-gray-600 dark:text-gray-300 italic"}," One tool to rule them all ",-1)),t[61]||(t[61]=l("p",{class:"text-xl text-gray-500 dark:text-gray-400 mb-6"}," by ParisNeo ",-1)),l("p",Fmt,Y(e.version_info),1),l("div",{class:"interesting-facts transition-transform duration-300 cursor-pointer",onClick:t[0]||(t[0]=(...s)=>e.updateRandomFact&&e.updateRandomFact(...s))},[l("p",Umt,[t[57]||(t[57]=l("span",{class:"font-semibold text-blue-600 dark:text-blue-400"},"🤔 Fun Fact: ",-1)),l("span",{innerHTML:e.randomFact},null,8,Bmt)])]),l("div",Gmt,[l("div",{class:"animated-progressbar-fg",style:Bt({width:`${e.loading_progress}%`})},null,4),l("div",{class:"absolute top-0 h-full flex items-center transition-all duration-300",style:Bt({left:`${e.loading_progress}%`,transform:"translateX(-50%)"})},t[58]||(t[58]=[l("p",{style:{"font-size":"48px","line-height":"1"}},"🌟",-1)]),4)])]),l("div",Vmt,[l("div",zmt,[l("p",Hmt,Y(e.loading_infos)+"... ",1),l("p",qmt,Y(Math.round(e.loading_progress))+"% ",1)])])])]))]),_:1}),z(Or,{name:"slide-right"},{default:Ie(()=>[e.showLeftPanel?(T(),x("div",Ymt,[z(bt(Xd),{to:{name:"discussions"},class:"flex items-center space-x-2"},{default:Ie(()=>[l("div",$mt,[l("img",{class:"w-12 h-12 rounded-full object-cover logo-image",src:e.$store.state.config==null?bt(Bs):e.$store.state.config.app_custom_logo!=""?"/user_infos/"+e.$store.state.config.app_custom_logo:bt(Bs),alt:"Logo",title:"LoLLMS WebUI"},null,8,Wmt)]),t[62]||(t[62]=l("div",{class:"flex flex-col justify-center"},[l("div",{class:"text-center p-2"},[l("div",{class:"text-md relative inline-block"},[l("span",{class:"relative inline-block font-bold tracking-wide text-black dark:text-white"}," LoLLMS "),l("div",{class:"absolute -bottom-0.5 left-0 w-full h-0.5 bg-black dark:bg-white transform origin-left transition-transform duration-300 hover:scale-x-100 scale-x-0"})])]),l("p",{class:"text-gray-400 text-sm"},"One tool to rule them all")],-1))]),_:1}),l("div",Kmt,[l("div",jmt,[l("button",{class:"toolbar-button",title:"Create new discussion",onClick:t[1]||(t[1]=(...s)=>e.createNewDiscussion&&e.createNewDiscussion(...s))},t[63]||(t[63]=[l("i",{"data-feather":"plus"},null,-1)])),e.loading?B("",!0):(T(),x("div",{key:0,class:"toolbar-button",onMouseleave:t[19]||(t[19]=(...s)=>e.hideMenu&&e.hideMenu(...s))},[k(l("div",{onMouseenter:t[17]||(t[17]=(...s)=>e.showMenu&&e.showMenu(...s)),class:"absolute m-0 p-0 z-50 top-full left-0 transform bg-white dark:bg-bg-dark rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2"},[l("div",Qmt,[l("button",{class:Le(["text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95",e.isCheckbox?"text-secondary dark:text-secondary-light":"text-gray-700 dark:text-gray-300"]),title:"Edit discussion list",type:"button",onClick:t[2]||(t[2]=s=>e.isCheckbox=!e.isCheckbox)},t[64]||(t[64]=[l("i",{"data-feather":"check-square"},null,-1)]),2),l("button",{class:"text-3xl hover:text-red-500 dark:hover:text-red-400 duration-150 active:scale-95",title:"Reset database, remove all discussions",onClick:t[3]||(t[3]=$(()=>{},["stop"]))},t[65]||(t[65]=[l("i",{"data-feather":"trash-2"},null,-1)])),l("button",{class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95",title:"Export database",type:"button",onClick:t[4]||(t[4]=$(s=>e.database_selectorDialogVisible=!0,["stop"]))},t[66]||(t[66]=[l("i",{"data-feather":"database"},null,-1)])),l("div",Xmt,[l("input",{type:"file",ref:"fileDialog",class:"hidden",onChange:t[5]||(t[5]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},null,544),l("button",{class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95 rotate-90",title:"Import discussions",type:"button",onClick:t[6]||(t[6]=$(s=>e.$refs.fileDialog.click(),["stop"]))},t[67]||(t[67]=[l("i",{"data-feather":"log-in"},null,-1)]))]),l("div",Zmt,[l("input",{type:"file",ref:"bundleLoadingDialog",class:"hidden",onChange:t[7]||(t[7]=(...s)=>e.importDiscussionsBundle&&e.importDiscussionsBundle(...s))},null,544),e.showSaveConfirmation?B("",!0):(T(),x("button",{key:0,title:"Import discussion bundle",onClick:t[8]||(t[8]=$(s=>e.$refs.bundleLoadingDialog.click(),["stop"])),class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95"},t[68]||(t[68]=[l("i",{"data-feather":"folder"},null,-1)])))]),e.loading?B("",!0):(T(),x("button",{key:0,type:"button",onClick:t[9]||(t[9]=$((...s)=>e.addDiscussion2SkillsLibrary&&e.addDiscussion2SkillsLibrary(...s),["stop"])),title:"Add this discussion content to skills database",class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95"},t[69]||(t[69]=[l("i",{"data-feather":"hard-drive"},null,-1)]))),!e.loading&&e.$store.state.config.activate_skills_lib?(T(),x("button",{key:1,type:"button",onClick:t[10]||(t[10]=$((...s)=>e.toggleSkillsLib&&e.toggleSkillsLib(...s),["stop"])),title:"Skills database is activated",class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95"},t[70]||(t[70]=[l("i",{"data-feather":"check-circle"},null,-1)]))):B("",!0),!e.loading&&!e.$store.state.config.activate_skills_lib?(T(),x("button",{key:2,type:"button",onClick:t[11]||(t[11]=$((...s)=>e.toggleSkillsLib&&e.toggleSkillsLib(...s),["stop"])),title:"Skills database is deactivated",class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95"},t[71]||(t[71]=[l("i",{"data-feather":"x-octagon"},null,-1)]))):B("",!0),e.loading?B("",!0):(T(),x("button",{key:3,type:"button",onClick:t[12]||(t[12]=$((...s)=>e.showSkillsLib&&e.showSkillsLib(...s),["stop"])),title:"Show Skills database",class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95"},t[72]||(t[72]=[l("i",{"data-feather":"book"},null,-1)]))),e.loading?(T(),x("div",Jmt,t[73]||(t[73]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"w-8 h-8 animate-spin fill-secondary dark:fill-secondary-light",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)]))):B("",!0),e.showSaveConfirmation?(T(),x("div",eht,[l("button",{class:"text-3xl hover:text-red-500 dark:hover:text-red-400 duration-150 active:scale-95",title:"Cancel",type:"button",onClick:t[13]||(t[13]=$(s=>e.showSaveConfirmation=!1,["stop"]))},t[74]||(t[74]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"text-3xl hover:text-green-500 dark:hover:text-green-400 duration-150 active:scale-95",title:"Confirm save changes",type:"button",onClick:t[14]||(t[14]=$(s=>e.save_configuration(),["stop"]))},t[75]||(t[75]=[l("i",{"data-feather":"check"},null,-1)]))])):B("",!0),e.isOpen?(T(),x("div",tht,[l("button",{onClick:t[15]||(t[15]=(...s)=>e.importDiscussions&&e.importDiscussions(...s)),class:"text-sm hover:text-secondary dark:hover:text-secondary-light"},"LOLLMS"),l("button",{onClick:t[16]||(t[16]=(...s)=>e.importChatGPT&&e.importChatGPT(...s)),class:"text-sm hover:text-secondary dark:hover:text-secondary-light"},"ChatGPT")])):B("",!0)])],544),[[ht,e.isMenuVisible]]),l("div",{onMouseenter:t[18]||(t[18]=(...s)=>e.showMenu&&e.showMenu(...s)),class:"menu-hover-area"},t[76]||(t[76]=[l("button",{class:"w-8 h-8",title:"Toggle menu"},[l("i",{"data-feather":"menu"})],-1)]),32)],32)),e.loading?B("",!0):(T(),x("div",{key:1,class:"toolbar-button",onMouseleave:t[25]||(t[25]=(...s)=>e.hideBindingsMenu&&e.hideBindingsMenu(...s))},[l("div",nht,[k(l("div",{onMouseenter:t[22]||(t[22]=(...s)=>e.showBindingsMenu&&e.showBindingsMenu(...s)),class:"absolute m-0 p-0 z-10 top-full left-0 transform w-80 bg-white dark:bg-gray-900 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2"},[l("div",sht,[k(l("input",{type:"text","onUpdate:modelValue":t[20]||(t[20]=s=>e.bindingSearchQuery=s),placeholder:"Search bindings...",class:"w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[ae,e.bindingSearchQuery]])]),l("div",rht,[(T(!0),x(Be,null,Ke(e.filteredBindings,(s,r)=>(T(),x("div",{key:r,class:"relative group/item flex flex-col items-center"},[l("div",iht,[l("button",{onClick:$(i=>e.setBinding(s),["prevent"]),title:s.name,class:"w-12 h-12 rounded-md overflow-hidden transition-transform duration-200 transform group-hover/item:scale-105 focus:outline-none"},[l("img",{src:s.icon?s.icon:bt($n),onError:t[21]||(t[21]=(...i)=>bt($n)&&bt($n)(...i)),alt:s.name,class:Le(["w-full h-full object-cover",{"border-2 border-secondary":s.name==e.binding_name}])},null,42,aht)],8,oht),l("span",{class:"mt-1 text-xs text-center w-full truncate",title:s.name},Y(s.name),9,lht)]),l("div",cht,[l("span",{class:"text-xs font-medium mb-2 text-center",onClick:$(i=>e.setBinding(s),["prevent"])},Y(s.name),9,dht),l("div",uht,[l("button",{onClick:$(i=>e.showModelConfig(s),["prevent"]),class:"p-1 bg-blue-500 rounded-full text-white hover:bg-blue-600 focus:outline-none",title:"Configure Binding"},t[77]||(t[77]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)]),8,pht)])])]))),128))])],544),[[ht,e.isBindingsMenuVisible]]),l("div",{onMouseenter:t[24]||(t[24]=(...s)=>e.showBindingsMenu&&e.showBindingsMenu(...s)),class:"bindings-hover-area"},[l("button",{onClick:t[23]||(t[23]=$(s=>e.showModelConfig(),["prevent"])),class:"w-6 h-6"},[l("img",{src:e.currentBindingIcon,class:"w-6 h-6 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary hover:scale-110 hover:-translate-y-1 duration-200",title:e.currentBinding?e.currentBinding.name:"unknown"},null,8,fht)])],32)])],32)),e.loading?B("",!0):(T(),x("div",{key:2,class:"toolbar-button",onMouseleave:t[31]||(t[31]=(...s)=>e.hideModelsMenu&&e.hideModelsMenu(...s))},[l("div",_ht,[k(l("div",{onMouseenter:t[28]||(t[28]=(...s)=>e.showModelsMenu&&e.showModelsMenu(...s)),class:"absolute m-0 p-0 z-10 top-full left-0 transform w-80 bg-white dark:bg-gray-900 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2"},[l("div",mht,[k(l("input",{type:"text","onUpdate:modelValue":t[26]||(t[26]=s=>e.modelSearchQuery=s),placeholder:"Search models...",class:"w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[ae,e.modelSearchQuery]])]),l("div",hht,[(T(!0),x(Be,null,Ke(e.filteredModels,(s,r)=>(T(),x("div",{key:r,class:"relative group/item flex flex-col items-center"},[l("div",ght,[l("button",{onClick:$(i=>e.setModel(s),["prevent"]),title:s.name,class:"w-12 h-12 rounded-md overflow-hidden transition-transform duration-200 transform group-hover/item:scale-105 focus:outline-none"},[l("img",{src:s.icon?s.icon:bt($n),onError:t[27]||(t[27]=(...i)=>e.personalityImgPlacehodler&&e.personalityImgPlacehodler(...i)),alt:s.name,class:Le(["w-full h-full object-cover",{"border-2 border-secondary":s.name==e.model_name}])},null,42,yht)],8,bht),l("span",{class:"mt-1 text-xs text-center w-full truncate",title:s.name},Y(s.name),9,Eht)]),l("div",vht,[l("span",{class:"text-xs font-medium mb-2 text-center",onClick:$(i=>e.setModel(s),["prevent"])},Y(s.name),9,Sht),l("div",Tht,[l("button",{onClick:$(i=>e.copyModelNameFrom(s.name),["prevent"]),class:"p-1 bg-blue-500 rounded-full text-white hover:bg-blue-600 focus:outline-none",title:"Copy Model Name"},t[78]||(t[78]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)]),8,xht)])])]))),128))])],544),[[ht,e.isModelsMenuVisible]]),l("div",{onMouseenter:t[30]||(t[30]=(...s)=>e.showModelsMenu&&e.showModelsMenu(...s)),class:"models-hover-area"},[l("button",{onClick:t[29]||(t[29]=$(s=>e.copyModelName(),["prevent"])),class:"w-6 h-6"},[l("img",{src:e.currentModelIcon,class:"w-6 h-6 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary hover:scale-110 hover:-translate-y-1 duration-400",title:e.currentModel?e.currentModel.name:"unknown"},null,8,Cht)])],32)])],32)),e.loading?B("",!0):(T(),x("div",{key:3,class:"toolbar-button",onMouseleave:t[36]||(t[36]=(...s)=>e.hidePersonalitiesMenu&&e.hidePersonalitiesMenu(...s))},[l("div",wht,[k(l("div",{onMouseenter:t[34]||(t[34]=(...s)=>e.showPersonalitiesMenu&&e.showPersonalitiesMenu(...s)),class:"absolute m-0 p-0 z-10 top-full left-0 transform w-80 bg-white dark:bg-gray-900 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2"},[l("div",Rht,[k(l("input",{type:"text","onUpdate:modelValue":t[32]||(t[32]=s=>e.personalitySearchQuery=s),placeholder:"Search personalities...",class:"w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[ae,e.personalitySearchQuery]])]),l("div",Aht,[(T(!0),x(Be,null,Ke(e.filteredPersonalities,(s,r)=>(T(),x("div",{key:r,class:"relative group/item flex flex-col items-center"},[l("div",Mht,[l("button",{onClick:$(i=>e.onPersonalitySelected(s),["prevent"]),title:s.name,class:"w-12 h-12 rounded-md overflow-hidden transition-transform duration-200 transform group-hover/item:scale-105 focus:outline-none"},[l("img",{src:bt(Ogt)+s.avatar,onError:t[33]||(t[33]=(...i)=>e.personalityImgPlacehodler&&e.personalityImgPlacehodler(...i)),alt:s.name,class:Le(["w-full h-full object-cover",{"border-2 border-secondary":e.$store.state.active_personality_id==e.$store.state.personalities.indexOf(s.full_path)}])},null,42,Oht)],8,Nht),l("span",{class:"mt-1 text-xs text-center w-full truncate",title:s.name},Y(s.name),9,Iht)]),l("div",kht,[l("span",{class:"text-xs font-medium mb-2 text-center",onClick:$(i=>e.onPersonalitySelected(s),["prevent"])},Y(s.name),9,Dht),l("div",Lht,[l("button",{onClick:$(i=>e.unmountPersonality(s),["prevent"]),class:"p-1 bg-red-500 rounded-full text-white hover:bg-red-600 focus:outline-none",title:"Unmount"},t[79]||(t[79]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]),8,Pht),l("button",{onClick:$(i=>e.remount_personality(s),["prevent"]),class:"p-1 bg-blue-500 rounded-full text-white hover:bg-blue-600 focus:outline-none",title:"Remount"},t[80]||(t[80]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)]),8,Fht),l("button",{onClick:$(i=>e.handleOnTalk(s),["prevent"]),class:"p-1 bg-green-500 rounded-full text-white hover:bg-green-600 focus:outline-none",title:"Talk"},t[81]||(t[81]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})],-1)]),8,Uht)])])]))),128))])],544),[[ht,e.isPersonalitiesMenuVisible]]),l("div",{onMouseenter:t[35]||(t[35]=(...s)=>e.showPersonalitiesMenu&&e.showPersonalitiesMenu(...s)),class:"personalities-hover-area"},[z(kN,{ref:"mountedPers",onShowPersList:e.onShowPersListFun,onReady:e.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])],32)])],32))])]),l("div",Bht,[l("form",{onSubmit:t[39]||(t[39]=$((...s)=>e.handleSearch&&e.handleSearch(...s),["prevent"])),class:"relative"},[l("div",Ght,[l("div",Vht,[k(l("input",{type:"search",id:"default-search",class:"block w-full h-8 px-8 text-sm border border-gray-300 rounded-md bg-bg-light focus:ring-1 focus:ring-secondary focus:border-secondary dark:bg-bg-dark dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-secondary dark:focus:border-secondary transition-all duration-200",placeholder:"Search discussions...",title:"Filter discussions by title","onUpdate:modelValue":t[37]||(t[37]=s=>e.filterTitle=s),onKeyup:t[38]||(t[38]=ws((...s)=>e.handleSearch&&e.handleSearch(...s),["enter"]))},null,544),[[ae,e.filterTitle]]),t[82]||(t[82]=l("div",{class:"absolute left-2 top-1/2 -translate-y-1/2"},[l("i",{"data-feather":"search",class:"w-4 h-4 text-gray-400"})],-1)),t[83]||(t[83]=l("button",{type:"submit",class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-600 hover:text-secondary rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-1 focus:ring-secondary transition-all duration-150 active:scale-98",title:"Search"},[l("i",{"data-feather":"arrow-right",class:"w-4 h-4"})],-1))])])],32)]),e.isCheckbox?(T(),x("div",zht,[l("div",Hht,[e.selectedDiscussions.length>0?(T(),x("p",qht,"Selected: "+Y(e.selectedDiscussions.length),1)):B("",!0),e.selectedDiscussions.length>0?(T(),x("div",Yht,[e.showConfirmation?B("",!0):(T(),x("button",{key:0,class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove selected",type:"button",onClick:t[40]||(t[40]=$(s=>e.showConfirmation=!0,["stop"]))},t[84]||(t[84]=[l("i",{"data-feather":"trash"},null,-1)]))),e.showConfirmation?(T(),x("div",$ht,[l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:t[41]||(t[41]=$((...s)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...s),["stop"]))},t[85]||(t[85]=[l("i",{"data-feather":"check"},null,-1)])),l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:t[42]||(t[42]=$(s=>e.showConfirmation=!1,["stop"]))},t[86]||(t[86]=[l("i",{"data-feather":"x"},null,-1)]))])):B("",!0)])):B("",!0),l("div",Wht,[l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a json file",type:"button",onClick:t[43]||(t[43]=$((...s)=>e.exportDiscussionsAsJson&&e.exportDiscussionsAsJson(...s),["stop"]))},t[87]||(t[87]=[l("i",{"data-feather":"codepen"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a markdown file",type:"button",onClick:t[44]||(t[44]=$((...s)=>e.exportDiscussions&&e.exportDiscussions(...s),["stop"]))},t[88]||(t[88]=[l("i",{"data-feather":"folder"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a markdown file",type:"button",onClick:t[45]||(t[45]=$((...s)=>e.exportDiscussionsAsMarkdown&&e.exportDiscussionsAsMarkdown(...s),["stop"]))},t[89]||(t[89]=[l("i",{"data-feather":"bookmark"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:t[46]||(t[46]=$((...s)=>e.selectAllDiscussions&&e.selectAllDiscussions(...s),["stop"]))},t[90]||(t[90]=[l("i",{"data-feather":"list"},null,-1)]))])])])):B("",!0),l("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll overflow-x-hidden custom-scrollbar",onDragover:t[47]||(t[47]=$(s=>e.setDropZoneDiscussion(),["stop","prevent"]))},[l("div",Kht,[l("div",{class:Le(["mx-0 flex flex-col flex-grow w-full",e.isDragOverDiscussion?"pointer-events-none":""])},[l("div",{id:"dis-list",class:Le([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full pb-80"])},[e.list.length>0?(T(),at(Ir,{key:0,name:"list"},{default:Ie(()=>[(T(!0),x(Be,null,Ke(e.list,(s,r)=>(T(),at(Q0,{key:s.id,id:s.id,title:s.title,selected:e.currentDiscussion.id==s.id,loading:s.loading,isCheckbox:e.isCheckbox,checkBoxValue:s.checkBoxValue,onSelect:i=>e.selectDiscussion(s),onDelete:i=>e.deleteDiscussion(s.id),onOpenFolder:e.openFolder,onEditTitle:e.editTitle,onMakeTitle:e.makeTitle,onChecked:e.checkUncheckDiscussion},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","onSelect","onDelete","onOpenFolder","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):B("",!0),e.list.length<1?(T(),x("div",jht,t[91]||(t[91]=[l("p",{class:"px-3"},"No discussions are found",-1)]))):B("",!0),t[92]||(t[92]=l("div",{class:"sticky bottom-0 bg-gradient-to-t pointer-events-none from-bg-light-tone dark:from-bg-dark-tone flex flex-grow"},null,-1))],2)],2)])],32),l("div",Qht,[l("div",{class:"h-15 w-full py-4 cursor-pointer text-light-text-panel dark:text-dark-text-panel hover:text-secondary",onClick:t[48]||(t[48]=(...s)=>e.showDatabaseSelector&&e.showDatabaseSelector(...s))},[l("p",Xht,Y(e.formatted_database_name.replace("_"," ")),1)])])])):B("",!0)]),_:1}),e.isReady?(T(),x("div",Zht,[l("div",{id:"messages-list",class:Le(["w-full z-0 flex flex-col flex-grow overflow-y-auto scrollbar",e.isDragOverChat?"pointer-events-none":""])},[l("div",Jht,[e.discussionArr.length>0?(T(),at(Ir,{key:0,name:"list"},{default:Ie(()=>[(T(!0),x(Be,null,Ke(e.discussionArr,(s,r)=>(T(),at(mN,{key:s.id,message:s,id:"msg-"+s.id,ref_for:!0,ref:"msg-"+s.id,host:e.host,onCopy:e.copyToClipBoard,onDelete:e.deleteMessage,onRankUp:e.rankUpMessage,onRankDown:e.rankDownMessage,onUpdateMessage:e.updateMessage,onResendMessage:e.resendMessage,onContinueMessage:e.continueMessage,avatar:e.getAvatar(s.sender)},null,8,["message","id","host","onCopy","onDelete","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","avatar"]))),128)),e.discussionArr.length<2&&e.personality.prompts_list.length>0?(T(),x("div",egt,[t[98]||(t[98]=l("h2",{class:"text-xl font-semibold mb-4"},"Prompt examples",-1)),l("div",tgt,[l("div",ngt,[(T(!0),x(Be,null,Ke(e.personality.prompts_list,(s,r)=>(T(),x("div",{key:r,onClick:i=>e.handlePromptSelection(s),class:"flex-shrink-0 w-[300px] bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg p-4 cursor-pointer hover:shadow-lg transition-all duration-300 ease-in-out transform hover:scale-105 flex flex-col justify-between h-[220px] overflow-hidden group"},[l("div",{title:s,class:"text-base text-gray-700 dark:text-gray-300 overflow-hidden relative h-full"},[l("div",igt,Y(s),1),t[93]||(t[93]=l("div",{class:"absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-white dark:to-gray-800 group-hover:opacity-0 transition-opacity duration-300"},null,-1))],8,rgt),t[94]||(t[94]=l("div",{class:"mt-2 text-sm text-gray-500 dark:text-gray-400 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}," Click to select ",-1))],8,sgt))),128))])]),e.showPlaceholderModal?(T(),x("div",ogt,[l("div",agt,[t[97]||(t[97]=l("h3",{class:"text-lg font-semibold mb-4"},"Fill in the placeholders",-1)),l("div",lgt,[t[95]||(t[95]=l("h4",{class:"text-sm font-medium mb-2 text-gray-600 dark:text-gray-400"},"Live Preview:",-1)),l("div",cgt,Y(e.previewPrompt),1)]),l("div",dgt,[(T(!0),x(Be,null,Ke(e.parsedPlaceholders,(s,r)=>(T(),x("div",{key:s.fullText,class:"flex flex-col"},[l("label",{for:"placeholder-"+r,class:"text-sm font-medium mb-1"},Y(s.label),9,ugt),s.type==="text"?k((T(),x("input",{key:0,id:"placeholder-"+r,"onUpdate:modelValue":i=>e.placeholderValues[r]=i,type:"text",class:"border rounded-md p-2 dark:bg-gray-700 dark:border-gray-600",placeholder:s.label,onInput:t[49]||(t[49]=(...i)=>e.updatePreview&&e.updatePreview(...i))},null,40,pgt)),[[ae,e.placeholderValues[r]]]):B("",!0),s.type==="int"?k((T(),x("input",{key:1,id:"placeholder-"+r,"onUpdate:modelValue":i=>e.placeholderValues[r]=i,type:"number",step:"1",class:"border rounded-md p-2 dark:bg-gray-700 dark:border-gray-600",onInput:t[50]||(t[50]=(...i)=>e.updatePreview&&e.updatePreview(...i))},null,40,fgt)),[[ae,e.placeholderValues[r],void 0,{number:!0}]]):B("",!0),s.type==="float"?k((T(),x("input",{key:2,id:"placeholder-"+r,"onUpdate:modelValue":i=>e.placeholderValues[r]=i,type:"number",step:"0.01",class:"border rounded-md p-2 dark:bg-gray-700 dark:border-gray-600",onInput:t[51]||(t[51]=(...i)=>e.updatePreview&&e.updatePreview(...i))},null,40,_gt)),[[ae,e.placeholderValues[r],void 0,{number:!0}]]):B("",!0),s.type==="multiline"?k((T(),x("textarea",{key:3,id:"placeholder-"+r,"onUpdate:modelValue":i=>e.placeholderValues[r]=i,rows:"4",class:"border rounded-md p-2 dark:bg-gray-700 dark:border-gray-600",onInput:t[52]||(t[52]=(...i)=>e.updatePreview&&e.updatePreview(...i))},null,40,mgt)),[[ae,e.placeholderValues[r]]]):B("",!0),s.type==="code"?(T(),x("div",hgt,[l("div",ggt,Y(s.language||"Plain text"),1),k(l("textarea",{id:"placeholder-"+r,"onUpdate:modelValue":i=>e.placeholderValues[r]=i,rows:"8",class:"w-full p-2 font-mono bg-gray-100 dark:bg-gray-900 border-t",onInput:t[53]||(t[53]=(...i)=>e.updatePreview&&e.updatePreview(...i))},null,40,bgt),[[ae,e.placeholderValues[r]]])])):B("",!0),s.type==="options"?k((T(),x("select",{key:5,id:"placeholder-"+r,"onUpdate:modelValue":i=>e.placeholderValues[r]=i,class:"border rounded-md p-2 dark:bg-gray-700 dark:border-gray-600",onChange:t[54]||(t[54]=(...i)=>e.updatePreview&&e.updatePreview(...i))},[t[96]||(t[96]=l("option",{value:"",disabled:""},"Select an option",-1)),(T(!0),x(Be,null,Ke(s.options,i=>(T(),x("option",{key:i,value:i},Y(i),9,Egt))),128))],40,ygt)),[[Ot,e.placeholderValues[r]]]):B("",!0)]))),128))]),l("div",vgt,[l("button",{onClick:t[55]||(t[55]=(...s)=>e.cancelPlaceholders&&e.cancelPlaceholders(...s)),class:"px-4 py-2 text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200"}," Cancel "),l("button",{onClick:t[56]||(t[56]=(...s)=>e.applyPlaceholders&&e.applyPlaceholders(...s)),class:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600"}," Apply ")])])])):B("",!0)])):B("",!0)]),_:1})):B("",!0),e.currentDiscussion.id?B("",!0):(T(),at(gN,{key:1})),t[99]||(t[99]=l("div",null,[l("br"),l("br"),l("br"),l("br"),l("br"),l("br"),l("br")],-1))]),t[100]||(t[100]=l("div",{class:"absolute w-full bottom-0 bg-transparent p-10 pt-16 bg-gradient-to-t from-bg-light dark:from-bg-dark from-5% via-bg-light dark:via-bg-dark via-10% to-transparent to-100%"},null,-1))],2),e.currentDiscussion.id?(T(),x("div",Sgt,[z(hN,{ref:"chatBox",loading:e.isGenerating,discussionList:e.discussionArr,"on-show-toast-message":e.showToastMessage,"on-talk":e.talk,onPersonalitySelected:e.recoverFiles,onMessageSentEvent:e.sendMsg,onSendCMDEvent:e.sendCmd,onAddWebLink:e.add_webpage,onCreateEmptyUserMessage:e.createEmptyUserMessage,onCreateEmptyAIMessage:e.createEmptyAIMessage,onStopGenerating:e.stopGenerating,onLoaded:e.recoverFiles},null,8,["loading","discussionList","on-show-toast-message","on-talk","onPersonalitySelected","onMessageSentEvent","onSendCMDEvent","onAddWebLink","onCreateEmptyUserMessage","onCreateEmptyAIMessage","onStopGenerating","onLoaded"])])):B("",!0)])):B("",!0),z(Or,{name:"slide-left"},{default:Ie(()=>[e.showRightPanel?(T(),x("div",Tgt,[l("div",xgt,null,512)])):B("",!0)]),_:1}),z(j0,{reference:"database_selector",class:"z-20",show:e.database_selectorDialogVisible,choices:e.databases,"can-remove":!0,onChoiceRemoved:e.ondatabase_selectorDialogRemoved,onChoiceSelected:e.ondatabase_selectorDialogSelected,onCloseDialog:e.onclosedatabase_selectorDialog,onChoiceValidated:e.onvalidatedatabase_selectorChoice},null,8,["show","choices","onChoiceRemoved","onChoiceSelected","onCloseDialog","onChoiceValidated"]),k(l("div",Cgt,[z(mu,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),l("p",wgt,Y(e.loading_infos)+" ...",1)],512),[[ht,e.progress_visibility]]),z(pN,{"prompt-text":"Enter the url to the page to use as discussion support",onOk:e.addWebpage,ref:"web_url_input_box"},null,8,["onOk"]),z(fN,{ref:"skills_lib"},null,512),z(Xu,{ref:"toast"},null,512),z(MN,{ref:"messageBox"},null,512),k(l("div",Rgt,[z(mu,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),l("p",Agt,Y(e.loading_infos)+" ...",1)],512),[[ht,e.progress_visibility]]),z(X0,{ref:"universalForm",class:"z-20"},null,512),z(NN,{ref:"yesNoDialog",class:"z-20"},null,512),z(ON,{ref:"personality_editor",config:e.currentPersonConfig,personality:e.selectedPersonality},null,8,["config","personality"]),l("div",Mgt,[z(IN,{ref:"news"},null,512)])],64))}}),Dgt=rt(kgt,[["__scopeId","data-v-67d2e759"]]);/** + -2px 2px 0px white`,background:"linear-gradient(45deg, #f59e0b, #fbbf24)","-webkit-background-clip":"text","background-clip":"text"}},[Ze(" L"),l("span",{class:"animate-pulse"},"⭐"),Ze("LLMS ")],-1)),t[60]||(t[60]=l("p",{class:"text-2xl text-gray-600 dark:text-gray-300 italic"}," One tool to rule them all ",-1)),t[61]||(t[61]=l("p",{class:"text-xl text-gray-500 dark:text-gray-400 mb-6"}," by ParisNeo ",-1)),l("p",Fmt,Y(e.version_info),1),l("div",{class:"interesting-facts transition-transform duration-300 cursor-pointer",onClick:t[0]||(t[0]=(...s)=>e.updateRandomFact&&e.updateRandomFact(...s))},[l("p",Umt,[t[57]||(t[57]=l("span",{class:"font-semibold text-blue-600 dark:text-blue-400"},"🤔 Fun Fact: ",-1)),l("span",{innerHTML:e.randomFact},null,8,Bmt)])]),l("div",Gmt,[l("div",{class:"animated-progressbar-fg",style:Bt({width:`${e.loading_progress}%`})},null,4),l("div",{class:"absolute top-0 h-full flex items-center transition-all duration-300",style:Bt({left:`${e.loading_progress}%`,transform:"translateX(-50%)"})},t[58]||(t[58]=[l("p",{style:{"font-size":"48px","line-height":"1"}},"🌟",-1)]),4)])]),l("div",Vmt,[l("div",zmt,[l("p",Hmt,Y(e.loading_infos)+"... ",1),l("p",qmt,Y(Math.round(e.loading_progress))+"% ",1)])])])]))]),_:1}),z(Or,{name:"slide-right"},{default:Ie(()=>[e.showLeftPanel?(T(),x("div",Ymt,[z(bt(Xd),{to:{name:"discussions"},class:"flex items-center space-x-2"},{default:Ie(()=>[l("div",$mt,[l("img",{class:"w-12 h-12 rounded-full object-cover logo-image",src:e.$store.state.config==null?bt(Bs):e.$store.state.config.app_custom_logo!=""?"/user_infos/"+e.$store.state.config.app_custom_logo:bt(Bs),alt:"Logo",title:"LoLLMS WebUI"},null,8,Wmt)]),t[62]||(t[62]=l("div",{class:"flex flex-col justify-center"},[l("div",{class:"text-center p-2"},[l("div",{class:"text-md relative inline-block"},[l("span",{class:"relative inline-block font-bold tracking-wide text-black dark:text-white"}," LoLLMS "),l("div",{class:"absolute -bottom-0.5 left-0 w-full h-0.5 bg-black dark:bg-white transform origin-left transition-transform duration-300 hover:scale-x-100 scale-x-0"})])]),l("p",{class:"text-gray-400 text-sm"},"One tool to rule them all")],-1))]),_:1}),l("div",Kmt,[l("div",jmt,[l("button",{class:"toolbar-button",title:"Create new discussion",onClick:t[1]||(t[1]=(...s)=>e.createNewDiscussion&&e.createNewDiscussion(...s))},t[63]||(t[63]=[l("i",{"data-feather":"plus"},null,-1)])),e.loading?B("",!0):(T(),x("div",{key:0,class:"toolbar-button",onMouseleave:t[19]||(t[19]=(...s)=>e.hideMenu&&e.hideMenu(...s))},[k(l("div",{onMouseenter:t[17]||(t[17]=(...s)=>e.showMenu&&e.showMenu(...s)),class:"absolute m-0 p-0 z-50 top-full left-0 transform bg-white dark:bg-bg-dark rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2"},[l("div",Qmt,[l("button",{class:Le(["text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95",e.isCheckbox?"text-secondary dark:text-secondary-light":"text-gray-700 dark:text-gray-300"]),title:"Edit discussion list",type:"button",onClick:t[2]||(t[2]=s=>e.isCheckbox=!e.isCheckbox)},t[64]||(t[64]=[l("i",{"data-feather":"check-square"},null,-1)]),2),l("button",{class:"text-3xl hover:text-red-500 dark:hover:text-red-400 duration-150 active:scale-95",title:"Reset database, remove all discussions",onClick:t[3]||(t[3]=$(()=>{},["stop"]))},t[65]||(t[65]=[l("i",{"data-feather":"trash-2"},null,-1)])),l("button",{class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95",title:"Export database",type:"button",onClick:t[4]||(t[4]=$(s=>e.database_selectorDialogVisible=!0,["stop"]))},t[66]||(t[66]=[l("i",{"data-feather":"database"},null,-1)])),l("div",Xmt,[l("input",{type:"file",ref:"fileDialog",class:"hidden",onChange:t[5]||(t[5]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},null,544),l("button",{class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95 rotate-90",title:"Import discussions",type:"button",onClick:t[6]||(t[6]=$(s=>e.$refs.fileDialog.click(),["stop"]))},t[67]||(t[67]=[l("i",{"data-feather":"log-in"},null,-1)]))]),l("div",Zmt,[l("input",{type:"file",ref:"bundleLoadingDialog",class:"hidden",onChange:t[7]||(t[7]=(...s)=>e.importDiscussionsBundle&&e.importDiscussionsBundle(...s))},null,544),e.showSaveConfirmation?B("",!0):(T(),x("button",{key:0,title:"Import discussion bundle",onClick:t[8]||(t[8]=$(s=>e.$refs.bundleLoadingDialog.click(),["stop"])),class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95"},t[68]||(t[68]=[l("i",{"data-feather":"folder"},null,-1)])))]),e.loading?B("",!0):(T(),x("button",{key:0,type:"button",onClick:t[9]||(t[9]=$((...s)=>e.addDiscussion2SkillsLibrary&&e.addDiscussion2SkillsLibrary(...s),["stop"])),title:"Add this discussion content to skills database",class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95"},t[69]||(t[69]=[l("i",{"data-feather":"hard-drive"},null,-1)]))),!e.loading&&e.$store.state.config.activate_skills_lib?(T(),x("button",{key:1,type:"button",onClick:t[10]||(t[10]=$((...s)=>e.toggleSkillsLib&&e.toggleSkillsLib(...s),["stop"])),title:"Skills database is activated",class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95"},t[70]||(t[70]=[l("i",{"data-feather":"check-circle"},null,-1)]))):B("",!0),!e.loading&&!e.$store.state.config.activate_skills_lib?(T(),x("button",{key:2,type:"button",onClick:t[11]||(t[11]=$((...s)=>e.toggleSkillsLib&&e.toggleSkillsLib(...s),["stop"])),title:"Skills database is deactivated",class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95"},t[71]||(t[71]=[l("i",{"data-feather":"x-octagon"},null,-1)]))):B("",!0),e.loading?B("",!0):(T(),x("button",{key:3,type:"button",onClick:t[12]||(t[12]=$((...s)=>e.showSkillsLib&&e.showSkillsLib(...s),["stop"])),title:"Show Skills database",class:"text-3xl hover:text-secondary dark:hover:text-secondary-light duration-150 active:scale-95"},t[72]||(t[72]=[l("i",{"data-feather":"book"},null,-1)]))),e.loading?(T(),x("div",Jmt,t[73]||(t[73]=[l("div",{role:"status"},[l("svg",{"aria-hidden":"true",class:"w-8 h-8 animate-spin fill-secondary dark:fill-secondary-light",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),l("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),l("span",{class:"sr-only"},"Loading...")],-1)]))):B("",!0),e.showSaveConfirmation?(T(),x("div",eht,[l("button",{class:"text-3xl hover:text-red-500 dark:hover:text-red-400 duration-150 active:scale-95",title:"Cancel",type:"button",onClick:t[13]||(t[13]=$(s=>e.showSaveConfirmation=!1,["stop"]))},t[74]||(t[74]=[l("i",{"data-feather":"x"},null,-1)])),l("button",{class:"text-3xl hover:text-green-500 dark:hover:text-green-400 duration-150 active:scale-95",title:"Confirm save changes",type:"button",onClick:t[14]||(t[14]=$(s=>e.save_configuration(),["stop"]))},t[75]||(t[75]=[l("i",{"data-feather":"check"},null,-1)]))])):B("",!0),e.isOpen?(T(),x("div",tht,[l("button",{onClick:t[15]||(t[15]=(...s)=>e.importDiscussions&&e.importDiscussions(...s)),class:"text-sm hover:text-secondary dark:hover:text-secondary-light"},"LOLLMS"),l("button",{onClick:t[16]||(t[16]=(...s)=>e.importChatGPT&&e.importChatGPT(...s)),class:"text-sm hover:text-secondary dark:hover:text-secondary-light"},"ChatGPT")])):B("",!0)])],544),[[ht,e.isMenuVisible]]),l("div",{onMouseenter:t[18]||(t[18]=(...s)=>e.showMenu&&e.showMenu(...s)),class:"menu-hover-area"},t[76]||(t[76]=[l("button",{class:"w-8 h-8",title:"Toggle menu"},[l("i",{"data-feather":"menu"})],-1)]),32)],32)),e.loading?B("",!0):(T(),x("div",{key:1,class:"toolbar-button",onMouseleave:t[25]||(t[25]=(...s)=>e.hideBindingsMenu&&e.hideBindingsMenu(...s))},[l("div",nht,[k(l("div",{onMouseenter:t[22]||(t[22]=(...s)=>e.showBindingsMenu&&e.showBindingsMenu(...s)),class:"absolute m-0 p-0 z-10 top-full left-0 transform w-80 bg-white dark:bg-gray-900 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2"},[l("div",sht,[k(l("input",{type:"text","onUpdate:modelValue":t[20]||(t[20]=s=>e.bindingSearchQuery=s),placeholder:"Search bindings...",class:"w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[ae,e.bindingSearchQuery]])]),l("div",rht,[(T(!0),x(Be,null,Ke(e.filteredBindings,(s,r)=>(T(),x("div",{key:r,class:"relative group/item flex flex-col items-center"},[l("div",iht,[l("button",{onClick:$(i=>e.setBinding(s),["prevent"]),title:s.name,class:"w-12 h-12 rounded-md overflow-hidden transition-transform duration-200 transform group-hover/item:scale-105 focus:outline-none"},[l("img",{src:s.icon?s.icon:bt($n),onError:t[21]||(t[21]=(...i)=>bt($n)&&bt($n)(...i)),alt:s.name,class:Le(["w-full h-full object-cover",{"border-2 border-secondary":s.name==e.binding_name}])},null,42,aht)],8,oht),l("span",{class:"mt-1 text-xs text-center w-full truncate",title:s.name},Y(s.name),9,lht)]),l("div",cht,[l("span",{class:"text-xs font-medium mb-2 text-center",onClick:$(i=>e.setBinding(s),["prevent"])},Y(s.name),9,dht),l("div",uht,[l("button",{onClick:$(i=>e.showModelConfig(s),["prevent"]),class:"p-1 bg-blue-500 rounded-full text-white hover:bg-blue-600 focus:outline-none",title:"Configure Binding"},t[77]||(t[77]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)]),8,pht)])])]))),128))])],544),[[ht,e.isBindingsMenuVisible]]),l("div",{onMouseenter:t[24]||(t[24]=(...s)=>e.showBindingsMenu&&e.showBindingsMenu(...s)),class:"bindings-hover-area"},[l("button",{onClick:t[23]||(t[23]=$(s=>e.showModelConfig(),["prevent"])),class:"w-6 h-6"},[l("img",{src:e.currentBindingIcon,class:"w-6 h-6 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary hover:scale-110 hover:-translate-y-1 duration-200",title:e.currentBinding?e.currentBinding.name:"unknown"},null,8,fht)])],32)])],32)),e.loading?B("",!0):(T(),x("div",{key:2,class:"toolbar-button",onMouseleave:t[31]||(t[31]=(...s)=>e.hideModelsMenu&&e.hideModelsMenu(...s))},[l("div",_ht,[k(l("div",{onMouseenter:t[28]||(t[28]=(...s)=>e.showModelsMenu&&e.showModelsMenu(...s)),class:"absolute m-0 p-0 z-10 top-full left-0 transform w-80 bg-white dark:bg-gray-900 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2"},[l("div",mht,[k(l("input",{type:"text","onUpdate:modelValue":t[26]||(t[26]=s=>e.modelSearchQuery=s),placeholder:"Search models...",class:"w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[ae,e.modelSearchQuery]])]),l("div",hht,[(T(!0),x(Be,null,Ke(e.filteredModels,(s,r)=>(T(),x("div",{key:r,class:"relative group/item flex flex-col items-center"},[l("div",ght,[l("button",{onClick:$(i=>e.setModel(s),["prevent"]),title:s.name,class:"w-12 h-12 rounded-md overflow-hidden transition-transform duration-200 transform group-hover/item:scale-105 focus:outline-none"},[l("img",{src:s.icon?s.icon:bt($n),onError:t[27]||(t[27]=(...i)=>e.personalityImgPlacehodler&&e.personalityImgPlacehodler(...i)),alt:s.name,class:Le(["w-full h-full object-cover",{"border-2 border-secondary":s.name==e.model_name}])},null,42,yht)],8,bht),l("span",{class:"mt-1 text-xs text-center w-full truncate",title:s.name},Y(s.name),9,Eht)]),l("div",vht,[l("span",{class:"text-xs font-medium mb-2 text-center",onClick:$(i=>e.setModel(s),["prevent"])},Y(s.name),9,Sht),l("div",Tht,[l("button",{onClick:$(i=>e.copyModelNameFrom(s.name),["prevent"]),class:"p-1 bg-blue-500 rounded-full text-white hover:bg-blue-600 focus:outline-none",title:"Copy Model Name"},t[78]||(t[78]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)]),8,xht)])])]))),128))])],544),[[ht,e.isModelsMenuVisible]]),l("div",{onMouseenter:t[30]||(t[30]=(...s)=>e.showModelsMenu&&e.showModelsMenu(...s)),class:"models-hover-area"},[l("button",{onClick:t[29]||(t[29]=$(s=>e.copyModelName(),["prevent"])),class:"w-6 h-6"},[l("img",{src:e.currentModelIcon,class:"w-6 h-6 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary hover:scale-110 hover:-translate-y-1 duration-400",title:e.currentModel?e.currentModel.name:"unknown"},null,8,Cht)])],32)])],32)),e.loading?B("",!0):(T(),x("div",{key:3,class:"toolbar-button",onMouseleave:t[36]||(t[36]=(...s)=>e.hidePersonalitiesMenu&&e.hidePersonalitiesMenu(...s))},[l("div",wht,[k(l("div",{onMouseenter:t[34]||(t[34]=(...s)=>e.showPersonalitiesMenu&&e.showPersonalitiesMenu(...s)),class:"absolute m-0 p-0 z-10 top-full left-0 transform w-80 bg-white dark:bg-gray-900 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2"},[l("div",Rht,[k(l("input",{type:"text","onUpdate:modelValue":t[32]||(t[32]=s=>e.personalitySearchQuery=s),placeholder:"Search personalities...",class:"w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[ae,e.personalitySearchQuery]])]),l("div",Aht,[(T(!0),x(Be,null,Ke(e.filteredPersonalities,(s,r)=>(T(),x("div",{key:r,class:"relative group/item flex flex-col items-center"},[l("div",Mht,[l("button",{onClick:$(i=>e.onPersonalitySelected(s),["prevent"]),title:s.name,class:"w-12 h-12 rounded-md overflow-hidden transition-transform duration-200 transform group-hover/item:scale-105 focus:outline-none"},[l("img",{src:bt(Lgt)+s.avatar,onError:t[33]||(t[33]=(...i)=>e.personalityImgPlacehodler&&e.personalityImgPlacehodler(...i)),alt:s.name,class:Le(["w-full h-full object-cover",{"border-2 border-secondary":e.$store.state.active_personality_id==e.$store.state.personalities.indexOf(s.full_path)}])},null,42,Oht)],8,Nht),l("span",{class:"mt-1 text-xs text-center w-full truncate",title:s.name},Y(s.name),9,Iht)]),l("div",kht,[l("span",{class:"text-xs font-medium mb-2 text-center",onClick:$(i=>e.onPersonalitySelected(s),["prevent"])},Y(s.name),9,Dht),l("div",Lht,[l("button",{onClick:$(i=>e.unmountPersonality(s),["prevent"]),class:"p-1 bg-red-500 rounded-full text-white hover:bg-red-600 focus:outline-none",title:"Unmount"},t[79]||(t[79]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]),8,Pht),l("button",{onClick:$(i=>e.remount_personality(s),["prevent"]),class:"p-1 bg-blue-500 rounded-full text-white hover:bg-blue-600 focus:outline-none",title:"Remount"},t[80]||(t[80]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)]),8,Fht),l("button",{onClick:$(i=>e.handleOnTalk(s),["prevent"]),class:"p-1 bg-green-500 rounded-full text-white hover:bg-green-600 focus:outline-none",title:"Talk"},t[81]||(t[81]=[l("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})],-1)]),8,Uht)])])]))),128))])],544),[[ht,e.isPersonalitiesMenuVisible]]),l("div",{onMouseenter:t[35]||(t[35]=(...s)=>e.showPersonalitiesMenu&&e.showPersonalitiesMenu(...s)),class:"personalities-hover-area"},[z(kN,{ref:"mountedPers",onShowPersList:e.onShowPersListFun,onReady:e.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])],32)])],32))])]),l("div",Bht,[l("form",{onSubmit:t[39]||(t[39]=$((...s)=>e.handleSearch&&e.handleSearch(...s),["prevent"])),class:"relative"},[l("div",Ght,[l("div",Vht,[k(l("input",{type:"search",id:"default-search",class:"block w-full h-8 px-8 text-sm border border-gray-300 rounded-md bg-bg-light focus:ring-1 focus:ring-secondary focus:border-secondary dark:bg-bg-dark dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-secondary dark:focus:border-secondary transition-all duration-200",placeholder:"Search discussions...",title:"Filter discussions by title","onUpdate:modelValue":t[37]||(t[37]=s=>e.filterTitle=s),onKeyup:t[38]||(t[38]=ws((...s)=>e.handleSearch&&e.handleSearch(...s),["enter"]))},null,544),[[ae,e.filterTitle]]),t[82]||(t[82]=l("div",{class:"absolute left-2 top-1/2 -translate-y-1/2"},[l("i",{"data-feather":"search",class:"w-4 h-4 text-gray-400"})],-1)),t[83]||(t[83]=l("button",{type:"submit",class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-600 hover:text-secondary rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-1 focus:ring-secondary transition-all duration-150 active:scale-98",title:"Search"},[l("i",{"data-feather":"arrow-right",class:"w-4 h-4"})],-1))])])],32)]),e.isCheckbox?(T(),x("div",zht,[l("div",Hht,[e.selectedDiscussions.length>0?(T(),x("p",qht,"Selected: "+Y(e.selectedDiscussions.length),1)):B("",!0),e.selectedDiscussions.length>0?(T(),x("div",Yht,[e.showConfirmation?B("",!0):(T(),x("button",{key:0,class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove selected",type:"button",onClick:t[40]||(t[40]=$(s=>e.showConfirmation=!0,["stop"]))},t[84]||(t[84]=[l("i",{"data-feather":"trash"},null,-1)]))),e.showConfirmation?(T(),x("div",$ht,[l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:t[41]||(t[41]=$((...s)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...s),["stop"]))},t[85]||(t[85]=[l("i",{"data-feather":"check"},null,-1)])),l("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:t[42]||(t[42]=$(s=>e.showConfirmation=!1,["stop"]))},t[86]||(t[86]=[l("i",{"data-feather":"x"},null,-1)]))])):B("",!0)])):B("",!0),l("div",Wht,[l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a json file",type:"button",onClick:t[43]||(t[43]=$((...s)=>e.exportDiscussionsAsJson&&e.exportDiscussionsAsJson(...s),["stop"]))},t[87]||(t[87]=[l("i",{"data-feather":"codepen"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a markdown file",type:"button",onClick:t[44]||(t[44]=$((...s)=>e.exportDiscussions&&e.exportDiscussions(...s),["stop"]))},t[88]||(t[88]=[l("i",{"data-feather":"folder"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a markdown file",type:"button",onClick:t[45]||(t[45]=$((...s)=>e.exportDiscussionsAsMarkdown&&e.exportDiscussionsAsMarkdown(...s),["stop"]))},t[89]||(t[89]=[l("i",{"data-feather":"bookmark"},null,-1)])),l("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:t[46]||(t[46]=$((...s)=>e.selectAllDiscussions&&e.selectAllDiscussions(...s),["stop"]))},t[90]||(t[90]=[l("i",{"data-feather":"list"},null,-1)]))])])])):B("",!0),l("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll overflow-x-hidden custom-scrollbar",onDragover:t[47]||(t[47]=$(s=>e.setDropZoneDiscussion(),["stop","prevent"]))},[l("div",Kht,[l("div",{class:Le(["mx-0 flex flex-col flex-grow w-full",e.isDragOverDiscussion?"pointer-events-none":""])},[l("div",{id:"dis-list",class:Le([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full pb-80"])},[e.list.length>0?(T(),at(Ir,{key:0,name:"list"},{default:Ie(()=>[(T(!0),x(Be,null,Ke(e.list,(s,r)=>(T(),at(Q0,{key:s.id,id:s.id,title:s.title,selected:e.currentDiscussion.id==s.id,loading:s.loading,isCheckbox:e.isCheckbox,checkBoxValue:s.checkBoxValue,onSelect:i=>e.selectDiscussion(s),onDelete:i=>e.deleteDiscussion(s.id),onOpenFolder:e.openFolder,onEditTitle:e.editTitle,onMakeTitle:e.makeTitle,onChecked:e.checkUncheckDiscussion},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","onSelect","onDelete","onOpenFolder","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):B("",!0),e.list.length<1?(T(),x("div",jht,t[91]||(t[91]=[l("p",{class:"px-3"},"No discussions are found",-1)]))):B("",!0),t[92]||(t[92]=l("div",{class:"sticky bottom-0 bg-gradient-to-t pointer-events-none from-bg-light-tone dark:from-bg-dark-tone flex flex-grow"},null,-1))],2)],2)])],32),l("div",Qht,[l("div",{class:"h-15 w-full py-4 cursor-pointer text-light-text-panel dark:text-dark-text-panel hover:text-secondary",onClick:t[48]||(t[48]=(...s)=>e.showDatabaseSelector&&e.showDatabaseSelector(...s))},[l("p",Xht,Y(e.formatted_database_name.replace("_"," ")),1)])])])):B("",!0)]),_:1}),e.isReady?(T(),x("div",Zht,[l("div",{id:"messages-list",class:Le(["w-full z-0 flex flex-col flex-grow overflow-y-auto scrollbar",e.isDragOverChat?"pointer-events-none":""])},[l("div",Jht,[e.discussionArr.length>0?(T(),at(Ir,{key:0,name:"list"},{default:Ie(()=>[(T(!0),x(Be,null,Ke(e.discussionArr,(s,r)=>(T(),at(mN,{key:s.id,message:s,id:"msg-"+s.id,ref_for:!0,ref:"msg-"+s.id,host:e.host,onCopy:e.copyToClipBoard,onDelete:e.deleteMessage,onRankUp:e.rankUpMessage,onRankDown:e.rankDownMessage,onUpdateMessage:e.updateMessage,onResendMessage:e.resendMessage,onContinueMessage:e.continueMessage,avatar:e.getAvatar(s.sender)},null,8,["message","id","host","onCopy","onDelete","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","avatar"]))),128)),e.discussionArr.length<2&&e.personality.prompts_list.length>0?(T(),x("div",egt,[t[97]||(t[97]=l("h2",{class:"text-2xl font-bold mb-6 text-gray-800 dark:text-gray-200"},"Prompt Examples",-1)),l("div",tgt,[l("div",ngt,[(T(!0),x(Be,null,Ke(e.personality.prompts_list,(s,r)=>(T(),x("div",{key:r,onClick:i=>e.handlePromptSelection(s),class:"flex-shrink-0 w-[300px] bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg p-6 cursor-pointer hover:shadow-xl transition-all duration-300 ease-in-out transform hover:scale-105 flex flex-col justify-between min-h-[220px] group"},[l("div",rgt,[l("h3",igt,Y(e.extractTitle(s)),1),l("div",{title:s,class:"text-base text-gray-700 dark:text-gray-300 overflow-hidden line-clamp-4"},Y(e.getPromptContent(s)),9,ogt)]),t[93]||(t[93]=l("div",{class:"mt-4 text-sm font-medium text-blue-600 dark:text-blue-400 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}," Click to select ",-1))],8,sgt))),128))])]),e.showPlaceholderModal?(T(),x("div",agt,[l("div",lgt,[t[96]||(t[96]=l("h3",{class:"text-lg font-semibold mb-4"},"Fill in the placeholders",-1)),l("div",cgt,[l("div",dgt,[t[94]||(t[94]=l("h4",{class:"text-sm font-medium mb-2 text-gray-600 dark:text-gray-400"},"Live Preview:",-1)),l("div",ugt,[l("span",pgt,Y(e.getPromptContent(e.previewPrompt)),1)])]),l("div",fgt,[l("div",_gt,[(T(!0),x(Be,null,Ke(e.parsedPlaceholders,(s,r)=>(T(),x("div",{key:s.fullText,class:"flex flex-col"},[l("label",{for:"placeholder-"+r,class:"text-sm font-medium mb-1"},Y(s.label),9,mgt),s.type==="text"?k((T(),x("input",{key:0,id:"placeholder-"+r,"onUpdate:modelValue":i=>e.placeholderValues[r]=i,type:"text",class:"border rounded-md p-2 dark:bg-gray-700 dark:border-gray-600",placeholder:s.label,onInput:t[49]||(t[49]=(...i)=>e.updatePreview&&e.updatePreview(...i))},null,40,hgt)),[[ae,e.placeholderValues[r]]]):B("",!0),s.type==="int"?k((T(),x("input",{key:1,id:"placeholder-"+r,"onUpdate:modelValue":i=>e.placeholderValues[r]=i,type:"number",step:"1",class:"border rounded-md p-2 dark:bg-gray-700 dark:border-gray-600",onInput:t[50]||(t[50]=(...i)=>e.updatePreview&&e.updatePreview(...i))},null,40,ggt)),[[ae,e.placeholderValues[r],void 0,{number:!0}]]):B("",!0),s.type==="float"?k((T(),x("input",{key:2,id:"placeholder-"+r,"onUpdate:modelValue":i=>e.placeholderValues[r]=i,type:"number",step:"0.01",class:"border rounded-md p-2 dark:bg-gray-700 dark:border-gray-600",onInput:t[51]||(t[51]=(...i)=>e.updatePreview&&e.updatePreview(...i))},null,40,bgt)),[[ae,e.placeholderValues[r],void 0,{number:!0}]]):B("",!0),s.type==="multiline"?k((T(),x("textarea",{key:3,id:"placeholder-"+r,"onUpdate:modelValue":i=>e.placeholderValues[r]=i,rows:"4",class:"border rounded-md p-2 dark:bg-gray-700 dark:border-gray-600",onInput:t[52]||(t[52]=(...i)=>e.updatePreview&&e.updatePreview(...i))},null,40,ygt)),[[ae,e.placeholderValues[r]]]):B("",!0),s.type==="code"?(T(),x("div",Egt,[l("div",vgt,Y(s.language||"Plain text"),1),k(l("textarea",{id:"placeholder-"+r,"onUpdate:modelValue":i=>e.placeholderValues[r]=i,rows:"8",class:"w-full p-2 font-mono bg-gray-100 dark:bg-gray-900 border-t",onInput:t[53]||(t[53]=(...i)=>e.updatePreview&&e.updatePreview(...i))},null,40,Sgt),[[ae,e.placeholderValues[r]]])])):B("",!0),s.type==="options"?k((T(),x("select",{key:5,id:"placeholder-"+r,"onUpdate:modelValue":i=>e.placeholderValues[r]=i,class:"border rounded-md p-2 dark:bg-gray-700 dark:border-gray-600",onChange:t[54]||(t[54]=(...i)=>e.updatePreview&&e.updatePreview(...i))},[t[95]||(t[95]=l("option",{value:"",disabled:""},"Select an option",-1)),(T(!0),x(Be,null,Ke(s.options,i=>(T(),x("option",{key:i,value:i},Y(i),9,xgt))),128))],40,Tgt)),[[Ot,e.placeholderValues[r]]]):B("",!0)]))),128))])])]),l("div",Cgt,[l("button",{onClick:t[55]||(t[55]=(...s)=>e.cancelPlaceholders&&e.cancelPlaceholders(...s)),class:"px-4 py-2 text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200"}," Cancel "),l("button",{onClick:t[56]||(t[56]=(...s)=>e.applyPlaceholders&&e.applyPlaceholders(...s)),class:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600"}," Apply ")])])])):B("",!0)])):B("",!0)]),_:1})):B("",!0),e.currentDiscussion.id?B("",!0):(T(),at(gN,{key:1})),t[98]||(t[98]=l("div",null,[l("br"),l("br"),l("br"),l("br"),l("br"),l("br"),l("br")],-1))]),t[99]||(t[99]=l("div",{class:"absolute w-full bottom-0 bg-transparent p-10 pt-16 bg-gradient-to-t from-bg-light dark:from-bg-dark from-5% via-bg-light dark:via-bg-dark via-10% to-transparent to-100%"},null,-1))],2),e.currentDiscussion.id?(T(),x("div",wgt,[z(hN,{ref:"chatBox",loading:e.isGenerating,discussionList:e.discussionArr,"on-show-toast-message":e.showToastMessage,"on-talk":e.talk,onPersonalitySelected:e.recoverFiles,onMessageSentEvent:e.sendMsg,onSendCMDEvent:e.sendCmd,onAddWebLink:e.add_webpage,onCreateEmptyUserMessage:e.createEmptyUserMessage,onCreateEmptyAIMessage:e.createEmptyAIMessage,onStopGenerating:e.stopGenerating,onLoaded:e.recoverFiles},null,8,["loading","discussionList","on-show-toast-message","on-talk","onPersonalitySelected","onMessageSentEvent","onSendCMDEvent","onAddWebLink","onCreateEmptyUserMessage","onCreateEmptyAIMessage","onStopGenerating","onLoaded"])])):B("",!0)])):B("",!0),z(Or,{name:"slide-left"},{default:Ie(()=>[e.showRightPanel?(T(),x("div",Rgt,[l("div",Agt,null,512)])):B("",!0)]),_:1}),z(j0,{reference:"database_selector",class:"z-20",show:e.database_selectorDialogVisible,choices:e.databases,"can-remove":!0,onChoiceRemoved:e.ondatabase_selectorDialogRemoved,onChoiceSelected:e.ondatabase_selectorDialogSelected,onCloseDialog:e.onclosedatabase_selectorDialog,onChoiceValidated:e.onvalidatedatabase_selectorChoice},null,8,["show","choices","onChoiceRemoved","onChoiceSelected","onCloseDialog","onChoiceValidated"]),k(l("div",Mgt,[z(mu,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),l("p",Ngt,Y(e.loading_infos)+" ...",1)],512),[[ht,e.progress_visibility]]),z(pN,{"prompt-text":"Enter the url to the page to use as discussion support",onOk:e.addWebpage,ref:"web_url_input_box"},null,8,["onOk"]),z(fN,{ref:"skills_lib"},null,512),z(Xu,{ref:"toast"},null,512),z(MN,{ref:"messageBox"},null,512),k(l("div",Ogt,[z(mu,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),l("p",Igt,Y(e.loading_infos)+" ...",1)],512),[[ht,e.progress_visibility]]),z(X0,{ref:"universalForm",class:"z-20"},null,512),z(NN,{ref:"yesNoDialog",class:"z-20"},null,512),z(ON,{ref:"personality_editor",config:e.currentPersonConfig,personality:e.selectedPersonality},null,8,["config","personality"]),l("div",kgt,[z(IN,{ref:"news"},null,512)])],64))}}),Ugt=rt(Fgt,[["__scopeId","data-v-94731cc1"]]);/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT - */const cy="159",Lgt=0,oC=1,Pgt=2,DN=1,Fgt=2,xr=3,Fr=0,Zn=1,Js=2,gi=0,ia=1,aC=2,lC=3,cC=4,Ugt=5,$i=100,Bgt=101,Ggt=102,dC=103,uC=104,Vgt=200,zgt=201,Hgt=202,qgt=203,_b=204,mb=205,Ygt=206,$gt=207,Wgt=208,Kgt=209,jgt=210,Qgt=211,Xgt=212,Zgt=213,Jgt=214,ebt=0,tbt=1,nbt=2,hu=3,sbt=4,rbt=5,ibt=6,obt=7,dy=0,abt=1,lbt=2,bi=0,cbt=1,dbt=2,ubt=3,pbt=4,fbt=5,pC="attached",_bt="detached",LN=300,ya=301,Ea=302,hb=303,gb=304,_p=306,va=1e3,hs=1001,gu=1002,gn=1003,bb=1004,kd=1005,Wn=1006,PN=1007,_o=1008,yi=1009,mbt=1010,hbt=1011,uy=1012,FN=1013,fi=1014,Ar=1015,Ql=1016,UN=1017,BN=1018,no=1020,gbt=1021,gs=1023,bbt=1024,ybt=1025,so=1026,Sa=1027,Ebt=1028,GN=1029,vbt=1030,VN=1031,zN=1033,Yh=33776,$h=33777,Wh=33778,Kh=33779,fC=35840,_C=35841,mC=35842,hC=35843,HN=36196,gC=37492,bC=37496,yC=37808,EC=37809,vC=37810,SC=37811,TC=37812,xC=37813,CC=37814,wC=37815,RC=37816,AC=37817,MC=37818,NC=37819,OC=37820,IC=37821,jh=36492,kC=36494,DC=36495,Sbt=36283,LC=36284,PC=36285,FC=36286,Xl=2300,Ta=2301,Qh=2302,UC=2400,BC=2401,GC=2402,Tbt=2500,xbt=0,qN=1,yb=2,YN=3e3,ro=3001,Cbt=3200,wbt=3201,py=0,Rbt=1,bs="",nn="srgb",Cn="srgb-linear",fy="display-p3",mp="display-p3-linear",bu="linear",jt="srgb",yu="rec709",Eu="p3",Ro=7680,VC=519,Abt=512,Mbt=513,Nbt=514,$N=515,Obt=516,Ibt=517,kbt=518,Dbt=519,Eb=35044,zC="300 es",vb=1035,Mr=2e3,vu=2001;class Ha{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const s=this._listeners[e.type];if(s!==void 0){e.target=this;const r=s.slice(0);for(let i=0,o=r.length;i>8&255]+An[n>>16&255]+An[n>>24&255]+"-"+An[e&255]+An[e>>8&255]+"-"+An[e>>16&15|64]+An[e>>24&255]+"-"+An[t&63|128]+An[t>>8&255]+"-"+An[t>>16&255]+An[t>>24&255]+An[s&255]+An[s>>8&255]+An[s>>16&255]+An[s>>24&255]).toLowerCase()}function On(n,e,t){return Math.max(e,Math.min(t,n))}function _y(n,e){return(n%e+e)%e}function Lbt(n,e,t,s,r){return s+(n-e)*(r-s)/(t-e)}function Pbt(n,e,t){return n!==e?(t-n)/(e-n):0}function Il(n,e,t){return(1-t)*n+t*e}function Fbt(n,e,t,s){return Il(n,e,1-Math.exp(-t*s))}function Ubt(n,e=1){return e-Math.abs(_y(n,e*2)-e)}function Bbt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Gbt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Vbt(n,e){return n+Math.floor(Math.random()*(e-n+1))}function zbt(n,e){return n+Math.random()*(e-n)}function Hbt(n){return n*(.5-Math.random())}function qbt(n){n!==void 0&&(HC=n);let e=HC+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Ybt(n){return n*Ol}function $bt(n){return n*xa}function Sb(n){return(n&n-1)===0&&n!==0}function Wbt(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Su(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Kbt(n,e,t,s,r){const i=Math.cos,o=Math.sin,a=i(t/2),c=o(t/2),d=i((e+s)/2),u=o((e+s)/2),_=i((e-s)/2),m=o((e-s)/2),h=i((s-e)/2),f=o((s-e)/2);switch(r){case"XYX":n.set(a*u,c*_,c*m,a*d);break;case"YZY":n.set(c*m,a*u,c*_,a*d);break;case"ZXZ":n.set(c*_,c*m,a*u,a*d);break;case"XZX":n.set(a*u,c*f,c*h,a*d);break;case"YXY":n.set(c*h,a*u,c*f,a*d);break;case"ZYZ":n.set(c*f,c*h,a*u,a*d);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function er(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Gt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const jbt={DEG2RAD:Ol,RAD2DEG:xa,generateUUID:Gs,clamp:On,euclideanModulo:_y,mapLinear:Lbt,inverseLerp:Pbt,lerp:Il,damp:Fbt,pingpong:Ubt,smoothstep:Bbt,smootherstep:Gbt,randInt:Vbt,randFloat:zbt,randFloatSpread:Hbt,seededRandom:qbt,degToRad:Ybt,radToDeg:$bt,isPowerOfTwo:Sb,ceilPowerOfTwo:Wbt,floorPowerOfTwo:Su,setQuaternionFromProperEuler:Kbt,normalize:Gt,denormalize:er};class Rt{constructor(e=0,t=0){Rt.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,s=this.y,r=e.elements;return this.x=r[0]*t+r[3]*s+r[6],this.y=r[1]*t+r[4]*s+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(On(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y;return t*t+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const s=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*s-o*r+e.x,this.y=i*r+o*s+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Tt{constructor(e,t,s,r,i,o,a,c,d){Tt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,s,r,i,o,a,c,d)}set(e,t,s,r,i,o,a,c,d){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=i,u[5]=c,u[6]=s,u[7]=o,u[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],this}extractBasis(e,t,s){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,r=t.elements,i=this.elements,o=s[0],a=s[3],c=s[6],d=s[1],u=s[4],_=s[7],m=s[2],h=s[5],f=s[8],y=r[0],b=r[3],g=r[6],E=r[1],v=r[4],S=r[7],R=r[2],w=r[5],A=r[8];return i[0]=o*y+a*E+c*R,i[3]=o*b+a*v+c*w,i[6]=o*g+a*S+c*A,i[1]=d*y+u*E+_*R,i[4]=d*b+u*v+_*w,i[7]=d*g+u*S+_*A,i[2]=m*y+h*E+f*R,i[5]=m*b+h*v+f*w,i[8]=m*g+h*S+f*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[1],r=e[2],i=e[3],o=e[4],a=e[5],c=e[6],d=e[7],u=e[8];return t*o*u-t*a*d-s*i*u+s*a*c+r*i*d-r*o*c}invert(){const e=this.elements,t=e[0],s=e[1],r=e[2],i=e[3],o=e[4],a=e[5],c=e[6],d=e[7],u=e[8],_=u*o-a*d,m=a*c-u*i,h=d*i-o*c,f=t*_+s*m+r*h;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/f;return e[0]=_*y,e[1]=(r*d-u*s)*y,e[2]=(a*s-r*o)*y,e[3]=m*y,e[4]=(u*t-r*c)*y,e[5]=(r*i-a*t)*y,e[6]=h*y,e[7]=(s*c-d*t)*y,e[8]=(o*t-s*i)*y,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,s,r,i,o,a){const c=Math.cos(i),d=Math.sin(i);return this.set(s*c,s*d,-s*(c*o+d*a)+o+e,-r*d,r*c,-r*(-d*o+c*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Xh.makeScale(e,t)),this}rotate(e){return this.premultiply(Xh.makeRotation(-e)),this}translate(e,t){return this.premultiply(Xh.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,s,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,s=e.elements;for(let r=0;r<9;r++)if(t[r]!==s[r])return!1;return!0}fromArray(e,t=0){for(let s=0;s<9;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Xh=new Tt;function WN(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function Zl(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Qbt(){const n=Zl("canvas");return n.style.display="block",n}const qC={};function kl(n){n in qC||(qC[n]=!0,console.warn(n))}const YC=new Tt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),$C=new Tt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Hc={[Cn]:{transfer:bu,primaries:yu,toReference:n=>n,fromReference:n=>n},[nn]:{transfer:jt,primaries:yu,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[mp]:{transfer:bu,primaries:Eu,toReference:n=>n.applyMatrix3($C),fromReference:n=>n.applyMatrix3(YC)},[fy]:{transfer:jt,primaries:Eu,toReference:n=>n.convertSRGBToLinear().applyMatrix3($C),fromReference:n=>n.applyMatrix3(YC).convertLinearToSRGB()}},Xbt=new Set([Cn,mp]),Lt={enabled:!0,_workingColorSpace:Cn,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!Xbt.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const s=Hc[e].toReference,r=Hc[t].fromReference;return r(s(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Hc[n].primaries},getTransfer:function(n){return n===bs?bu:Hc[n].transfer}};function oa(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Zh(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ao;class KN{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Ao===void 0&&(Ao=Zl("canvas")),Ao.width=e.width,Ao.height=e.height;const s=Ao.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),t=Ao}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Zl("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");s.drawImage(e,0,0,e.width,e.height);const r=s.getImageData(0,0,e.width,e.height),i=r.data;for(let o=0;o0&&(s.userData=this.userData),t||(e.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==LN)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case va:e.x=e.x-Math.floor(e.x);break;case hs:e.x=e.x<0?0:1;break;case gu:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case va:e.y=e.y-Math.floor(e.y);break;case hs:e.y=e.y<0?0:1;break;case gu:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return kl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===nn?ro:YN}set encoding(e){kl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===ro?nn:bs}}xn.DEFAULT_IMAGE=null;xn.DEFAULT_MAPPING=LN;xn.DEFAULT_ANISOTROPY=1;class Wt{constructor(e=0,t=0,s=0,r=1){Wt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=s,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,s,r){return this.x=e,this.y=t,this.z=s,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,s=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*s+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*s+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*s+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*s+o[11]*r+o[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,s,r,i;const c=e.elements,d=c[0],u=c[4],_=c[8],m=c[1],h=c[5],f=c[9],y=c[2],b=c[6],g=c[10];if(Math.abs(u-m)<.01&&Math.abs(_-y)<.01&&Math.abs(f-b)<.01){if(Math.abs(u+m)<.1&&Math.abs(_+y)<.1&&Math.abs(f+b)<.1&&Math.abs(d+h+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const v=(d+1)/2,S=(h+1)/2,R=(g+1)/2,w=(u+m)/4,A=(_+y)/4,I=(f+b)/4;return v>S&&v>R?v<.01?(s=0,r=.707106781,i=.707106781):(s=Math.sqrt(v),r=w/s,i=A/s):S>R?S<.01?(s=.707106781,r=0,i=.707106781):(r=Math.sqrt(S),s=w/r,i=I/r):R<.01?(s=.707106781,r=.707106781,i=0):(i=Math.sqrt(R),s=A/i,r=I/i),this.set(s,r,i,t),this}let E=Math.sqrt((b-f)*(b-f)+(_-y)*(_-y)+(m-u)*(m-u));return Math.abs(E)<.001&&(E=1),this.x=(b-f)/E,this.y=(_-y)/E,this.z=(m-u)/E,this.w=Math.acos((d+h+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this.w=e.w+(t.w-e.w)*s,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class e0t extends Ha{constructor(e=1,t=1,s={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Wt(0,0,e,t),this.scissorTest=!1,this.viewport=new Wt(0,0,e,t);const r={width:e,height:t,depth:1};s.encoding!==void 0&&(kl("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),s.colorSpace=s.encoding===ro?nn:bs),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Wn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},s),this.texture=new xn(r,s.mapping,s.wrapS,s.wrapT,s.magFilter,s.minFilter,s.format,s.type,s.anisotropy,s.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=s.generateMipmaps,this.texture.internalFormat=s.internalFormat,this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.depthTexture=s.depthTexture,this.samples=s.samples}setSize(e,t,s=1){(this.width!==e||this.height!==t||this.depth!==s)&&(this.width=e,this.height=t,this.depth=s,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=s,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new jN(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class mo extends e0t{constructor(e=1,t=1,s={}){super(e,t,s),this.isWebGLRenderTarget=!0}}class QN extends xn{constructor(e=null,t=1,s=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:s,depth:r},this.magFilter=gn,this.minFilter=gn,this.wrapR=hs,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class t0t extends xn{constructor(e=null,t=1,s=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:s,depth:r},this.magFilter=gn,this.minFilter=gn,this.wrapR=hs,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Ni{constructor(e=0,t=0,s=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=s,this._w=r}static slerpFlat(e,t,s,r,i,o,a){let c=s[r+0],d=s[r+1],u=s[r+2],_=s[r+3];const m=i[o+0],h=i[o+1],f=i[o+2],y=i[o+3];if(a===0){e[t+0]=c,e[t+1]=d,e[t+2]=u,e[t+3]=_;return}if(a===1){e[t+0]=m,e[t+1]=h,e[t+2]=f,e[t+3]=y;return}if(_!==y||c!==m||d!==h||u!==f){let b=1-a;const g=c*m+d*h+u*f+_*y,E=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){const R=Math.sqrt(v),w=Math.atan2(R,g*E);b=Math.sin(b*w)/R,a=Math.sin(a*w)/R}const S=a*E;if(c=c*b+m*S,d=d*b+h*S,u=u*b+f*S,_=_*b+y*S,b===1-a){const R=1/Math.sqrt(c*c+d*d+u*u+_*_);c*=R,d*=R,u*=R,_*=R}}e[t]=c,e[t+1]=d,e[t+2]=u,e[t+3]=_}static multiplyQuaternionsFlat(e,t,s,r,i,o){const a=s[r],c=s[r+1],d=s[r+2],u=s[r+3],_=i[o],m=i[o+1],h=i[o+2],f=i[o+3];return e[t]=a*f+u*_+c*h-d*m,e[t+1]=c*f+u*m+d*_-a*h,e[t+2]=d*f+u*h+a*m-c*_,e[t+3]=u*f-a*_-c*m-d*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,s,r){return this._x=e,this._y=t,this._z=s,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const s=e._x,r=e._y,i=e._z,o=e._order,a=Math.cos,c=Math.sin,d=a(s/2),u=a(r/2),_=a(i/2),m=c(s/2),h=c(r/2),f=c(i/2);switch(o){case"XYZ":this._x=m*u*_+d*h*f,this._y=d*h*_-m*u*f,this._z=d*u*f+m*h*_,this._w=d*u*_-m*h*f;break;case"YXZ":this._x=m*u*_+d*h*f,this._y=d*h*_-m*u*f,this._z=d*u*f-m*h*_,this._w=d*u*_+m*h*f;break;case"ZXY":this._x=m*u*_-d*h*f,this._y=d*h*_+m*u*f,this._z=d*u*f+m*h*_,this._w=d*u*_-m*h*f;break;case"ZYX":this._x=m*u*_-d*h*f,this._y=d*h*_+m*u*f,this._z=d*u*f-m*h*_,this._w=d*u*_+m*h*f;break;case"YZX":this._x=m*u*_+d*h*f,this._y=d*h*_+m*u*f,this._z=d*u*f-m*h*_,this._w=d*u*_-m*h*f;break;case"XZY":this._x=m*u*_-d*h*f,this._y=d*h*_-m*u*f,this._z=d*u*f+m*h*_,this._w=d*u*_+m*h*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const s=t/2,r=Math.sin(s);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,s=t[0],r=t[4],i=t[8],o=t[1],a=t[5],c=t[9],d=t[2],u=t[6],_=t[10],m=s+a+_;if(m>0){const h=.5/Math.sqrt(m+1);this._w=.25/h,this._x=(u-c)*h,this._y=(i-d)*h,this._z=(o-r)*h}else if(s>a&&s>_){const h=2*Math.sqrt(1+s-a-_);this._w=(u-c)/h,this._x=.25*h,this._y=(r+o)/h,this._z=(i+d)/h}else if(a>_){const h=2*Math.sqrt(1+a-s-_);this._w=(i-d)/h,this._x=(r+o)/h,this._y=.25*h,this._z=(c+u)/h}else{const h=2*Math.sqrt(1+_-s-a);this._w=(o-r)/h,this._x=(i+d)/h,this._y=(c+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let s=e.dot(t)+1;return sMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=s):(this._x=0,this._y=-e.z,this._z=e.y,this._w=s)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=s),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(On(this.dot(e),-1,1)))}rotateTowards(e,t){const s=this.angleTo(e);if(s===0)return this;const r=Math.min(1,t/s);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const s=e._x,r=e._y,i=e._z,o=e._w,a=t._x,c=t._y,d=t._z,u=t._w;return this._x=s*u+o*a+r*d-i*c,this._y=r*u+o*c+i*a-s*d,this._z=i*u+o*d+s*c-r*a,this._w=o*u-s*a-r*c-i*d,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const s=this._x,r=this._y,i=this._z,o=this._w;let a=o*e._w+s*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=s,this._y=r,this._z=i,this;const c=1-a*a;if(c<=Number.EPSILON){const h=1-t;return this._w=h*o+t*this._w,this._x=h*s+t*this._x,this._y=h*r+t*this._y,this._z=h*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const d=Math.sqrt(c),u=Math.atan2(d,a),_=Math.sin((1-t)*u)/d,m=Math.sin(t*u)/d;return this._w=o*_+this._w*m,this._x=s*_+this._x*m,this._y=r*_+this._y*m,this._z=i*_+this._z*m,this._onChangeCallback(),this}slerpQuaternions(e,t,s){return this.copy(e).slerp(t,s)}random(){const e=Math.random(),t=Math.sqrt(1-e),s=Math.sqrt(e),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(t*Math.cos(r),s*Math.sin(i),s*Math.cos(i),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ie{constructor(e=0,t=0,s=0){ie.prototype.isVector3=!0,this.x=e,this.y=t,this.z=s}set(e,t,s){return s===void 0&&(s=this.z),this.x=e,this.y=t,this.z=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(WC.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(WC.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,s=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*s+i[6]*r,this.y=i[1]*t+i[4]*s+i[7]*r,this.z=i[2]*t+i[5]*s+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,s=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*s+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*s+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*s+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*s+i[10]*r+i[14])*o,this}applyQuaternion(e){const t=this.x,s=this.y,r=this.z,i=e.x,o=e.y,a=e.z,c=e.w,d=2*(o*r-a*s),u=2*(a*t-i*r),_=2*(i*s-o*t);return this.x=t+c*d+o*_-a*u,this.y=s+c*u+a*d-i*_,this.z=r+c*_+i*u-o*d,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,s=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*s+i[8]*r,this.y=i[1]*t+i[5]*s+i[9]*r,this.z=i[2]*t+i[6]*s+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const s=e.x,r=e.y,i=e.z,o=t.x,a=t.y,c=t.z;return this.x=r*c-i*a,this.y=i*o-s*c,this.z=s*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const s=e.dot(this)/t;return this.copy(e).multiplyScalar(s)}projectOnPlane(e){return eg.copy(this).projectOnVector(e),this.sub(eg)}reflect(e){return this.sub(eg.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(On(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y,r=this.z-e.z;return t*t+s*s+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,s){const r=Math.sin(t)*e;return this.x=r*Math.sin(s),this.y=Math.cos(t)*e,this.z=r*Math.cos(s),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,s){return this.x=e*Math.sin(t),this.y=s,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),s=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=s,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,s=Math.sqrt(1-e**2);return this.x=s*Math.cos(t),this.y=s*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const eg=new ie,WC=new Ni;class Gr{constructor(e=new ie(1/0,1/0,1/0),t=new ie(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,s=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Is),Is.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,s;return e.normal.x>0?(t=e.normal.x*this.min.x,s=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,s=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,s+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,s+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,s+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,s+=e.normal.z*this.min.z),t<=-e.constant&&s>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ol),Yc.subVectors(this.max,ol),Mo.subVectors(e.a,ol),No.subVectors(e.b,ol),Oo.subVectors(e.c,ol),Kr.subVectors(No,Mo),jr.subVectors(Oo,No),Li.subVectors(Mo,Oo);let t=[0,-Kr.z,Kr.y,0,-jr.z,jr.y,0,-Li.z,Li.y,Kr.z,0,-Kr.x,jr.z,0,-jr.x,Li.z,0,-Li.x,-Kr.y,Kr.x,0,-jr.y,jr.x,0,-Li.y,Li.x,0];return!tg(t,Mo,No,Oo,Yc)||(t=[1,0,0,0,1,0,0,0,1],!tg(t,Mo,No,Oo,Yc))?!1:($c.crossVectors(Kr,jr),t=[$c.x,$c.y,$c.z],tg(t,Mo,No,Oo,Yc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Is).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Is).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(gr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const gr=[new ie,new ie,new ie,new ie,new ie,new ie,new ie,new ie],Is=new ie,qc=new Gr,Mo=new ie,No=new ie,Oo=new ie,Kr=new ie,jr=new ie,Li=new ie,ol=new ie,Yc=new ie,$c=new ie,Pi=new ie;function tg(n,e,t,s,r){for(let i=0,o=n.length-3;i<=o;i+=3){Pi.fromArray(n,i);const a=r.x*Math.abs(Pi.x)+r.y*Math.abs(Pi.y)+r.z*Math.abs(Pi.z),c=e.dot(Pi),d=t.dot(Pi),u=s.dot(Pi);if(Math.max(-Math.max(c,d,u),Math.min(c,d,u))>a)return!1}return!0}const n0t=new Gr,al=new ie,ng=new ie;class pr{constructor(e=new ie,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const s=this.center;t!==void 0?s.copy(t):n0t.setFromPoints(e).getCenter(s);let r=0;for(let i=0,o=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;al.subVectors(e,this.center);const t=al.lengthSq();if(t>this.radius*this.radius){const s=Math.sqrt(t),r=(s-this.radius)*.5;this.center.addScaledVector(al,r/s),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(ng.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(al.copy(e.center).add(ng)),this.expandByPoint(al.copy(e.center).sub(ng))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const br=new ie,sg=new ie,Wc=new ie,Qr=new ie,rg=new ie,Kc=new ie,ig=new ie;class hp{constructor(e=new ie,t=new ie(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,br)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const s=t.dot(this.direction);return s<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=br.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(br.copy(this.origin).addScaledVector(this.direction,t),br.distanceToSquared(e))}distanceSqToSegment(e,t,s,r){sg.copy(e).add(t).multiplyScalar(.5),Wc.copy(t).sub(e).normalize(),Qr.copy(this.origin).sub(sg);const i=e.distanceTo(t)*.5,o=-this.direction.dot(Wc),a=Qr.dot(this.direction),c=-Qr.dot(Wc),d=Qr.lengthSq(),u=Math.abs(1-o*o);let _,m,h,f;if(u>0)if(_=o*c-a,m=o*a-c,f=i*u,_>=0)if(m>=-f)if(m<=f){const y=1/u;_*=y,m*=y,h=_*(_+o*m+2*a)+m*(o*_+m+2*c)+d}else m=i,_=Math.max(0,-(o*m+a)),h=-_*_+m*(m+2*c)+d;else m=-i,_=Math.max(0,-(o*m+a)),h=-_*_+m*(m+2*c)+d;else m<=-f?(_=Math.max(0,-(-o*i+a)),m=_>0?-i:Math.min(Math.max(-i,-c),i),h=-_*_+m*(m+2*c)+d):m<=f?(_=0,m=Math.min(Math.max(-i,-c),i),h=m*(m+2*c)+d):(_=Math.max(0,-(o*i+a)),m=_>0?i:Math.min(Math.max(-i,-c),i),h=-_*_+m*(m+2*c)+d);else m=o>0?-i:i,_=Math.max(0,-(o*m+a)),h=-_*_+m*(m+2*c)+d;return s&&s.copy(this.origin).addScaledVector(this.direction,_),r&&r.copy(sg).addScaledVector(Wc,m),h}intersectSphere(e,t){br.subVectors(e.center,this.origin);const s=br.dot(this.direction),r=br.dot(br)-s*s,i=e.radius*e.radius;if(r>i)return null;const o=Math.sqrt(i-r),a=s-o,c=s+o;return c<0?null:a<0?this.at(c,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(e.normal)+e.constant)/t;return s>=0?s:null}intersectPlane(e,t){const s=this.distanceToPlane(e);return s===null?null:this.at(s,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let s,r,i,o,a,c;const d=1/this.direction.x,u=1/this.direction.y,_=1/this.direction.z,m=this.origin;return d>=0?(s=(e.min.x-m.x)*d,r=(e.max.x-m.x)*d):(s=(e.max.x-m.x)*d,r=(e.min.x-m.x)*d),u>=0?(i=(e.min.y-m.y)*u,o=(e.max.y-m.y)*u):(i=(e.max.y-m.y)*u,o=(e.min.y-m.y)*u),s>o||i>r||((i>s||isNaN(s))&&(s=i),(o=0?(a=(e.min.z-m.z)*_,c=(e.max.z-m.z)*_):(a=(e.max.z-m.z)*_,c=(e.min.z-m.z)*_),s>c||a>r)||((a>s||s!==s)&&(s=a),(c=0?s:r,t)}intersectsBox(e){return this.intersectBox(e,br)!==null}intersectTriangle(e,t,s,r,i){rg.subVectors(t,e),Kc.subVectors(s,e),ig.crossVectors(rg,Kc);let o=this.direction.dot(ig),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Qr.subVectors(this.origin,e);const c=a*this.direction.dot(Kc.crossVectors(Qr,Kc));if(c<0)return null;const d=a*this.direction.dot(rg.cross(Qr));if(d<0||c+d>o)return null;const u=-a*Qr.dot(ig);return u<0?null:this.at(u/o,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class xt{constructor(e,t,s,r,i,o,a,c,d,u,_,m,h,f,y,b){xt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,s,r,i,o,a,c,d,u,_,m,h,f,y,b)}set(e,t,s,r,i,o,a,c,d,u,_,m,h,f,y,b){const g=this.elements;return g[0]=e,g[4]=t,g[8]=s,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=c,g[2]=d,g[6]=u,g[10]=_,g[14]=m,g[3]=h,g[7]=f,g[11]=y,g[15]=b,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new xt().fromArray(this.elements)}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],t[9]=s[9],t[10]=s[10],t[11]=s[11],t[12]=s[12],t[13]=s[13],t[14]=s[14],t[15]=s[15],this}copyPosition(e){const t=this.elements,s=e.elements;return t[12]=s[12],t[13]=s[13],t[14]=s[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,s){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(e,t,s){return this.set(e.x,t.x,s.x,0,e.y,t.y,s.y,0,e.z,t.z,s.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,s=e.elements,r=1/Io.setFromMatrixColumn(e,0).length(),i=1/Io.setFromMatrixColumn(e,1).length(),o=1/Io.setFromMatrixColumn(e,2).length();return t[0]=s[0]*r,t[1]=s[1]*r,t[2]=s[2]*r,t[3]=0,t[4]=s[4]*i,t[5]=s[5]*i,t[6]=s[6]*i,t[7]=0,t[8]=s[8]*o,t[9]=s[9]*o,t[10]=s[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,s=e.x,r=e.y,i=e.z,o=Math.cos(s),a=Math.sin(s),c=Math.cos(r),d=Math.sin(r),u=Math.cos(i),_=Math.sin(i);if(e.order==="XYZ"){const m=o*u,h=o*_,f=a*u,y=a*_;t[0]=c*u,t[4]=-c*_,t[8]=d,t[1]=h+f*d,t[5]=m-y*d,t[9]=-a*c,t[2]=y-m*d,t[6]=f+h*d,t[10]=o*c}else if(e.order==="YXZ"){const m=c*u,h=c*_,f=d*u,y=d*_;t[0]=m+y*a,t[4]=f*a-h,t[8]=o*d,t[1]=o*_,t[5]=o*u,t[9]=-a,t[2]=h*a-f,t[6]=y+m*a,t[10]=o*c}else if(e.order==="ZXY"){const m=c*u,h=c*_,f=d*u,y=d*_;t[0]=m-y*a,t[4]=-o*_,t[8]=f+h*a,t[1]=h+f*a,t[5]=o*u,t[9]=y-m*a,t[2]=-o*d,t[6]=a,t[10]=o*c}else if(e.order==="ZYX"){const m=o*u,h=o*_,f=a*u,y=a*_;t[0]=c*u,t[4]=f*d-h,t[8]=m*d+y,t[1]=c*_,t[5]=y*d+m,t[9]=h*d-f,t[2]=-d,t[6]=a*c,t[10]=o*c}else if(e.order==="YZX"){const m=o*c,h=o*d,f=a*c,y=a*d;t[0]=c*u,t[4]=y-m*_,t[8]=f*_+h,t[1]=_,t[5]=o*u,t[9]=-a*u,t[2]=-d*u,t[6]=h*_+f,t[10]=m-y*_}else if(e.order==="XZY"){const m=o*c,h=o*d,f=a*c,y=a*d;t[0]=c*u,t[4]=-_,t[8]=d*u,t[1]=m*_+y,t[5]=o*u,t[9]=h*_-f,t[2]=f*_-h,t[6]=a*u,t[10]=y*_+m}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(s0t,e,r0t)}lookAt(e,t,s){const r=this.elements;return ts.subVectors(e,t),ts.lengthSq()===0&&(ts.z=1),ts.normalize(),Xr.crossVectors(s,ts),Xr.lengthSq()===0&&(Math.abs(s.z)===1?ts.x+=1e-4:ts.z+=1e-4,ts.normalize(),Xr.crossVectors(s,ts)),Xr.normalize(),jc.crossVectors(ts,Xr),r[0]=Xr.x,r[4]=jc.x,r[8]=ts.x,r[1]=Xr.y,r[5]=jc.y,r[9]=ts.y,r[2]=Xr.z,r[6]=jc.z,r[10]=ts.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,r=t.elements,i=this.elements,o=s[0],a=s[4],c=s[8],d=s[12],u=s[1],_=s[5],m=s[9],h=s[13],f=s[2],y=s[6],b=s[10],g=s[14],E=s[3],v=s[7],S=s[11],R=s[15],w=r[0],A=r[4],I=r[8],C=r[12],M=r[1],G=r[5],V=r[9],ee=r[13],O=r[2],H=r[6],q=r[10],L=r[14],W=r[3],se=r[7],oe=r[11],ye=r[15];return i[0]=o*w+a*M+c*O+d*W,i[4]=o*A+a*G+c*H+d*se,i[8]=o*I+a*V+c*q+d*oe,i[12]=o*C+a*ee+c*L+d*ye,i[1]=u*w+_*M+m*O+h*W,i[5]=u*A+_*G+m*H+h*se,i[9]=u*I+_*V+m*q+h*oe,i[13]=u*C+_*ee+m*L+h*ye,i[2]=f*w+y*M+b*O+g*W,i[6]=f*A+y*G+b*H+g*se,i[10]=f*I+y*V+b*q+g*oe,i[14]=f*C+y*ee+b*L+g*ye,i[3]=E*w+v*M+S*O+R*W,i[7]=E*A+v*G+S*H+R*se,i[11]=E*I+v*V+S*q+R*oe,i[15]=E*C+v*ee+S*L+R*ye,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[4],r=e[8],i=e[12],o=e[1],a=e[5],c=e[9],d=e[13],u=e[2],_=e[6],m=e[10],h=e[14],f=e[3],y=e[7],b=e[11],g=e[15];return f*(+i*c*_-r*d*_-i*a*m+s*d*m+r*a*h-s*c*h)+y*(+t*c*h-t*d*m+i*o*m-r*o*h+r*d*u-i*c*u)+b*(+t*d*_-t*a*h-i*o*_+s*o*h+i*a*u-s*d*u)+g*(-r*a*u-t*c*_+t*a*m+r*o*_-s*o*m+s*c*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,s){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=s),this}invert(){const e=this.elements,t=e[0],s=e[1],r=e[2],i=e[3],o=e[4],a=e[5],c=e[6],d=e[7],u=e[8],_=e[9],m=e[10],h=e[11],f=e[12],y=e[13],b=e[14],g=e[15],E=_*b*d-y*m*d+y*c*h-a*b*h-_*c*g+a*m*g,v=f*m*d-u*b*d-f*c*h+o*b*h+u*c*g-o*m*g,S=u*y*d-f*_*d+f*a*h-o*y*h-u*a*g+o*_*g,R=f*_*c-u*y*c-f*a*m+o*y*m+u*a*b-o*_*b,w=t*E+s*v+r*S+i*R;if(w===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/w;return e[0]=E*A,e[1]=(y*m*i-_*b*i-y*r*h+s*b*h+_*r*g-s*m*g)*A,e[2]=(a*b*i-y*c*i+y*r*d-s*b*d-a*r*g+s*c*g)*A,e[3]=(_*c*i-a*m*i-_*r*d+s*m*d+a*r*h-s*c*h)*A,e[4]=v*A,e[5]=(u*b*i-f*m*i+f*r*h-t*b*h-u*r*g+t*m*g)*A,e[6]=(f*c*i-o*b*i-f*r*d+t*b*d+o*r*g-t*c*g)*A,e[7]=(o*m*i-u*c*i+u*r*d-t*m*d-o*r*h+t*c*h)*A,e[8]=S*A,e[9]=(f*_*i-u*y*i-f*s*h+t*y*h+u*s*g-t*_*g)*A,e[10]=(o*y*i-f*a*i+f*s*d-t*y*d-o*s*g+t*a*g)*A,e[11]=(u*a*i-o*_*i-u*s*d+t*_*d+o*s*h-t*a*h)*A,e[12]=R*A,e[13]=(u*y*r-f*_*r+f*s*m-t*y*m-u*s*b+t*_*b)*A,e[14]=(f*a*r-o*y*r-f*s*c+t*y*c+o*s*b-t*a*b)*A,e[15]=(o*_*r-u*a*r+u*s*c-t*_*c-o*s*m+t*a*m)*A,this}scale(e){const t=this.elements,s=e.x,r=e.y,i=e.z;return t[0]*=s,t[4]*=r,t[8]*=i,t[1]*=s,t[5]*=r,t[9]*=i,t[2]*=s,t[6]*=r,t[10]*=i,t[3]*=s,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],s=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,s,r))}makeTranslation(e,t,s){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,s,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),s=Math.sin(e);return this.set(1,0,0,0,0,t,-s,0,0,s,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,0,s,0,0,1,0,0,-s,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,0,s,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const s=Math.cos(t),r=Math.sin(t),i=1-s,o=e.x,a=e.y,c=e.z,d=i*o,u=i*a;return this.set(d*o+s,d*a-r*c,d*c+r*a,0,d*a+r*c,u*a+s,u*c-r*o,0,d*c-r*a,u*c+r*o,i*c*c+s,0,0,0,0,1),this}makeScale(e,t,s){return this.set(e,0,0,0,0,t,0,0,0,0,s,0,0,0,0,1),this}makeShear(e,t,s,r,i,o){return this.set(1,s,i,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,s){const r=this.elements,i=t._x,o=t._y,a=t._z,c=t._w,d=i+i,u=o+o,_=a+a,m=i*d,h=i*u,f=i*_,y=o*u,b=o*_,g=a*_,E=c*d,v=c*u,S=c*_,R=s.x,w=s.y,A=s.z;return r[0]=(1-(y+g))*R,r[1]=(h+S)*R,r[2]=(f-v)*R,r[3]=0,r[4]=(h-S)*w,r[5]=(1-(m+g))*w,r[6]=(b+E)*w,r[7]=0,r[8]=(f+v)*A,r[9]=(b-E)*A,r[10]=(1-(m+y))*A,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,s){const r=this.elements;let i=Io.set(r[0],r[1],r[2]).length();const o=Io.set(r[4],r[5],r[6]).length(),a=Io.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],ks.copy(this);const d=1/i,u=1/o,_=1/a;return ks.elements[0]*=d,ks.elements[1]*=d,ks.elements[2]*=d,ks.elements[4]*=u,ks.elements[5]*=u,ks.elements[6]*=u,ks.elements[8]*=_,ks.elements[9]*=_,ks.elements[10]*=_,t.setFromRotationMatrix(ks),s.x=i,s.y=o,s.z=a,this}makePerspective(e,t,s,r,i,o,a=Mr){const c=this.elements,d=2*i/(t-e),u=2*i/(s-r),_=(t+e)/(t-e),m=(s+r)/(s-r);let h,f;if(a===Mr)h=-(o+i)/(o-i),f=-2*o*i/(o-i);else if(a===vu)h=-o/(o-i),f=-o*i/(o-i);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=d,c[4]=0,c[8]=_,c[12]=0,c[1]=0,c[5]=u,c[9]=m,c[13]=0,c[2]=0,c[6]=0,c[10]=h,c[14]=f,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,s,r,i,o,a=Mr){const c=this.elements,d=1/(t-e),u=1/(s-r),_=1/(o-i),m=(t+e)*d,h=(s+r)*u;let f,y;if(a===Mr)f=(o+i)*_,y=-2*_;else if(a===vu)f=i*_,y=-1*_;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=2*d,c[4]=0,c[8]=0,c[12]=-m,c[1]=0,c[5]=2*u,c[9]=0,c[13]=-h,c[2]=0,c[6]=0,c[10]=y,c[14]=-f,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,s=e.elements;for(let r=0;r<16;r++)if(t[r]!==s[r])return!1;return!0}fromArray(e,t=0){for(let s=0;s<16;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e[t+9]=s[9],e[t+10]=s[10],e[t+11]=s[11],e[t+12]=s[12],e[t+13]=s[13],e[t+14]=s[14],e[t+15]=s[15],e}}const Io=new ie,ks=new xt,s0t=new ie(0,0,0),r0t=new ie(1,1,1),Xr=new ie,jc=new ie,ts=new ie,KC=new xt,jC=new Ni;class gp{constructor(e=0,t=0,s=0,r=gp.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=s,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,s,r=this._order){return this._x=e,this._y=t,this._z=s,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,s=!0){const r=e.elements,i=r[0],o=r[4],a=r[8],c=r[1],d=r[5],u=r[9],_=r[2],m=r[6],h=r[10];switch(t){case"XYZ":this._y=Math.asin(On(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(m,d),this._z=0);break;case"YXZ":this._x=Math.asin(-On(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(c,d)):(this._y=Math.atan2(-_,i),this._z=0);break;case"ZXY":this._x=Math.asin(On(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-_,h),this._z=Math.atan2(-o,d)):(this._y=0,this._z=Math.atan2(c,i));break;case"ZYX":this._y=Math.asin(-On(_,-1,1)),Math.abs(_)<.9999999?(this._x=Math.atan2(m,h),this._z=Math.atan2(c,i)):(this._x=0,this._z=Math.atan2(-o,d));break;case"YZX":this._z=Math.asin(On(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,d),this._y=Math.atan2(-_,i)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-On(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(m,d),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,s===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,s){return KC.makeRotationFromQuaternion(e),this.setFromRotationMatrix(KC,t,s)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return jC.setFromEuler(this),this.setFromQuaternion(jC,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}gp.DEFAULT_ORDER="XYZ";class XN{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let s=0;s0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function i(a,c){return a[c.uuid]===void 0&&(a[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const c=a.shapes;if(Array.isArray(c))for(let d=0,u=c.length;d0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(s.geometries=a),c.length>0&&(s.materials=c),d.length>0&&(s.textures=d),u.length>0&&(s.images=u),_.length>0&&(s.shapes=_),m.length>0&&(s.skeletons=m),h.length>0&&(s.animations=h),f.length>0&&(s.nodes=f)}return s.object=r,s;function o(a){const c=[];for(const d in a){const u=a[d];delete u.metadata,c.push(u)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let s=0;s0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,s,r,i){Ds.subVectors(r,t),Er.subVectors(s,t),og.subVectors(e,t);const o=Ds.dot(Ds),a=Ds.dot(Er),c=Ds.dot(og),d=Er.dot(Er),u=Er.dot(og),_=o*d-a*a;if(_===0)return i.set(-2,-1,-1);const m=1/_,h=(d*c-a*u)*m,f=(o*u-a*c)*m;return i.set(1-h-f,f,h)}static containsPoint(e,t,s,r){return this.getBarycoord(e,t,s,r,vr),vr.x>=0&&vr.y>=0&&vr.x+vr.y<=1}static getUV(e,t,s,r,i,o,a,c){return Xc===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Xc=!0),this.getInterpolation(e,t,s,r,i,o,a,c)}static getInterpolation(e,t,s,r,i,o,a,c){return this.getBarycoord(e,t,s,r,vr),c.setScalar(0),c.addScaledVector(i,vr.x),c.addScaledVector(o,vr.y),c.addScaledVector(a,vr.z),c}static isFrontFacing(e,t,s,r){return Ds.subVectors(s,t),Er.subVectors(e,t),Ds.cross(Er).dot(r)<0}set(e,t,s){return this.a.copy(e),this.b.copy(t),this.c.copy(s),this}setFromPointsAndIndices(e,t,s,r){return this.a.copy(e[t]),this.b.copy(e[s]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,s,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,s),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ds.subVectors(this.c,this.b),Er.subVectors(this.a,this.b),Ds.cross(Er).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Fs.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Fs.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,s,r,i){return Xc===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Xc=!0),Fs.getInterpolation(e,this.a,this.b,this.c,t,s,r,i)}getInterpolation(e,t,s,r,i){return Fs.getInterpolation(e,this.a,this.b,this.c,t,s,r,i)}containsPoint(e){return Fs.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Fs.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const s=this.a,r=this.b,i=this.c;let o,a;Do.subVectors(r,s),Lo.subVectors(i,s),ag.subVectors(e,s);const c=Do.dot(ag),d=Lo.dot(ag);if(c<=0&&d<=0)return t.copy(s);lg.subVectors(e,r);const u=Do.dot(lg),_=Lo.dot(lg);if(u>=0&&_<=u)return t.copy(r);const m=c*_-u*d;if(m<=0&&c>=0&&u<=0)return o=c/(c-u),t.copy(s).addScaledVector(Do,o);cg.subVectors(e,i);const h=Do.dot(cg),f=Lo.dot(cg);if(f>=0&&h<=f)return t.copy(i);const y=h*d-c*f;if(y<=0&&d>=0&&f<=0)return a=d/(d-f),t.copy(s).addScaledVector(Lo,a);const b=u*f-h*_;if(b<=0&&_-u>=0&&h-f>=0)return ew.subVectors(i,r),a=(_-u)/(_-u+(h-f)),t.copy(r).addScaledVector(ew,a);const g=1/(b+y+m);return o=y*g,a=m*g,t.copy(s).addScaledVector(Do,o).addScaledVector(Lo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const ZN={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Zr={h:0,s:0,l:0},Zc={h:0,s:0,l:0};function dg(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class pt{constructor(e,t,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,s)}set(e,t,s){if(t===void 0&&s===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,s);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=nn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Lt.toWorkingColorSpace(this,t),this}setRGB(e,t,s,r=Lt.workingColorSpace){return this.r=e,this.g=t,this.b=s,Lt.toWorkingColorSpace(this,r),this}setHSL(e,t,s,r=Lt.workingColorSpace){if(e=_y(e,1),t=On(t,0,1),s=On(s,0,1),t===0)this.r=this.g=this.b=s;else{const i=s<=.5?s*(1+t):s+t-s*t,o=2*s-i;this.r=dg(o,i,e+1/3),this.g=dg(o,i,e),this.b=dg(o,i,e-1/3)}return Lt.toWorkingColorSpace(this,r),this}setStyle(e,t=nn){function s(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const i=r[1],o=i.length;if(o===3)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(i,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=nn){const s=ZN[e.toLowerCase()];return s!==void 0?this.setHex(s,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=oa(e.r),this.g=oa(e.g),this.b=oa(e.b),this}copyLinearToSRGB(e){return this.r=Zh(e.r),this.g=Zh(e.g),this.b=Zh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=nn){return Lt.fromWorkingColorSpace(Mn.copy(this),e),Math.round(On(Mn.r*255,0,255))*65536+Math.round(On(Mn.g*255,0,255))*256+Math.round(On(Mn.b*255,0,255))}getHexString(e=nn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Lt.workingColorSpace){Lt.fromWorkingColorSpace(Mn.copy(this),t);const s=Mn.r,r=Mn.g,i=Mn.b,o=Math.max(s,r,i),a=Math.min(s,r,i);let c,d;const u=(a+o)/2;if(a===o)c=0,d=0;else{const _=o-a;switch(d=u<=.5?_/(o+a):_/(2-o-a),o){case s:c=(r-i)/_+(r0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const s=e[t];if(s===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(s):r&&r.isVector3&&s&&s.isVector3?r.copy(s):this[t]=s}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const s={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(e).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(e).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(e).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(e).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(e).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==ia&&(s.blending=this.blending),this.side!==Fr&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==_b&&(s.blendSrc=this.blendSrc),this.blendDst!==mb&&(s.blendDst=this.blendDst),this.blendEquation!==$i&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==hu&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==VC&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ro&&(s.stencilFail=this.stencilFail),this.stencilZFail!==Ro&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==Ro&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function r(i){const o=[];for(const a in i){const c=i[a];delete c.metadata,o.push(c)}return o}if(t){const i=r(e.textures),o=r(e.images);i.length>0&&(s.textures=i),o.length>0&&(s.images=o)}return s}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let s=null;if(t!==null){const r=t.length;s=new Array(r);for(let i=0;i!==r;++i)s[i]=t[i].clone()}return this.clippingPlanes=s,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class _i extends Vs{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new pt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=dy,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const rn=new ie,Jc=new Rt;class zn{constructor(e,t,s=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=s,this.usage=Eb,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ar,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.BufferAttribute: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,s){e*=this.itemSize,s*=t.itemSize;for(let r=0,i=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const d in c)c[d]!==void 0&&(e[d]=c[d]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const s=this.attributes;for(const c in s){const d=s[c];e.data.attributes[c]=d.toJSON(e.data)}const r={};let i=!1;for(const c in this.morphAttributes){const d=this.morphAttributes[c],u=[];for(let _=0,m=d.length;_0&&(r[c]=u,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const s=e.index;s!==null&&this.setIndex(s.clone(t));const r=e.attributes;for(const d in r){const u=r[d];this.setAttribute(d,u.clone(t))}const i=e.morphAttributes;for(const d in i){const u=[],_=i[d];for(let m=0,h=_.length;m0){const r=t[s[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,o=r.length;i(e.far-e.near)**2))&&(tw.copy(i).invert(),Fi.copy(e.ray).applyMatrix4(tw),!(s.boundingBox!==null&&Fi.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(e,t,Fi)))}_computeIntersections(e,t,s){let r;const i=this.geometry,o=this.material,a=i.index,c=i.attributes.position,d=i.attributes.uv,u=i.attributes.uv1,_=i.attributes.normal,m=i.groups,h=i.drawRange;if(a!==null)if(Array.isArray(o))for(let f=0,y=m.length;ft.far?null:{distance:d,point:od.clone(),object:n}}function ad(n,e,t,s,r,i,o,a,c,d){n.getVertexPosition(a,Fo),n.getVertexPosition(c,Uo),n.getVertexPosition(d,Bo);const u=p0t(n,e,t,s,Fo,Uo,Bo,id);if(u){r&&(nd.fromBufferAttribute(r,a),sd.fromBufferAttribute(r,c),rd.fromBufferAttribute(r,d),u.uv=Fs.getInterpolation(id,Fo,Uo,Bo,nd,sd,rd,new Rt)),i&&(nd.fromBufferAttribute(i,a),sd.fromBufferAttribute(i,c),rd.fromBufferAttribute(i,d),u.uv1=Fs.getInterpolation(id,Fo,Uo,Bo,nd,sd,rd,new Rt),u.uv2=u.uv1),o&&(sw.fromBufferAttribute(o,a),rw.fromBufferAttribute(o,c),iw.fromBufferAttribute(o,d),u.normal=Fs.getInterpolation(id,Fo,Uo,Bo,sw,rw,iw,new ie),u.normal.dot(s.direction)>0&&u.normal.multiplyScalar(-1));const _={a,b:c,c:d,normal:new ie,materialIndex:0};Fs.getNormal(Fo,Uo,Bo,_.normal),u.face=_}return u}class Ei extends fr{constructor(e=1,t=1,s=1,r=1,i=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:s,widthSegments:r,heightSegments:i,depthSegments:o};const a=this;r=Math.floor(r),i=Math.floor(i),o=Math.floor(o);const c=[],d=[],u=[],_=[];let m=0,h=0;f("z","y","x",-1,-1,s,t,e,o,i,0),f("z","y","x",1,-1,s,t,-e,o,i,1),f("x","z","y",1,1,e,s,t,r,o,2),f("x","z","y",1,-1,e,s,-t,r,o,3),f("x","y","z",1,-1,e,t,s,r,i,4),f("x","y","z",-1,-1,e,t,-s,r,i,5),this.setIndex(c),this.setAttribute("position",new kr(d,3)),this.setAttribute("normal",new kr(u,3)),this.setAttribute("uv",new kr(_,2));function f(y,b,g,E,v,S,R,w,A,I,C){const M=S/A,G=R/I,V=S/2,ee=R/2,O=w/2,H=A+1,q=I+1;let L=0,W=0;const se=new ie;for(let oe=0;oe0?1:-1,u.push(se.x,se.y,se.z),_.push(xe/A),_.push(1-oe/I),L+=1}}for(let oe=0;oe>8&255]+An[n>>16&255]+An[n>>24&255]+"-"+An[e&255]+An[e>>8&255]+"-"+An[e>>16&15|64]+An[e>>24&255]+"-"+An[t&63|128]+An[t>>8&255]+"-"+An[t>>16&255]+An[t>>24&255]+An[s&255]+An[s>>8&255]+An[s>>16&255]+An[s>>24&255]).toLowerCase()}function On(n,e,t){return Math.max(e,Math.min(t,n))}function _y(n,e){return(n%e+e)%e}function Bbt(n,e,t,s,r){return s+(n-e)*(r-s)/(t-e)}function Gbt(n,e,t){return n!==e?(t-n)/(e-n):0}function Il(n,e,t){return(1-t)*n+t*e}function Vbt(n,e,t,s){return Il(n,e,1-Math.exp(-t*s))}function zbt(n,e=1){return e-Math.abs(_y(n,e*2)-e)}function Hbt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function qbt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Ybt(n,e){return n+Math.floor(Math.random()*(e-n+1))}function $bt(n,e){return n+Math.random()*(e-n)}function Wbt(n){return n*(.5-Math.random())}function Kbt(n){n!==void 0&&(HC=n);let e=HC+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function jbt(n){return n*Ol}function Qbt(n){return n*xa}function Sb(n){return(n&n-1)===0&&n!==0}function Xbt(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Su(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Zbt(n,e,t,s,r){const i=Math.cos,o=Math.sin,a=i(t/2),c=o(t/2),d=i((e+s)/2),u=o((e+s)/2),_=i((e-s)/2),m=o((e-s)/2),h=i((s-e)/2),f=o((s-e)/2);switch(r){case"XYX":n.set(a*u,c*_,c*m,a*d);break;case"YZY":n.set(c*m,a*u,c*_,a*d);break;case"ZXZ":n.set(c*_,c*m,a*u,a*d);break;case"XZX":n.set(a*u,c*f,c*h,a*d);break;case"YXY":n.set(c*h,a*u,c*f,a*d);break;case"ZYZ":n.set(c*f,c*h,a*u,a*d);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function er(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Gt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Jbt={DEG2RAD:Ol,RAD2DEG:xa,generateUUID:Gs,clamp:On,euclideanModulo:_y,mapLinear:Bbt,inverseLerp:Gbt,lerp:Il,damp:Vbt,pingpong:zbt,smoothstep:Hbt,smootherstep:qbt,randInt:Ybt,randFloat:$bt,randFloatSpread:Wbt,seededRandom:Kbt,degToRad:jbt,radToDeg:Qbt,isPowerOfTwo:Sb,ceilPowerOfTwo:Xbt,floorPowerOfTwo:Su,setQuaternionFromProperEuler:Zbt,normalize:Gt,denormalize:er};class Rt{constructor(e=0,t=0){Rt.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,s=this.y,r=e.elements;return this.x=r[0]*t+r[3]*s+r[6],this.y=r[1]*t+r[4]*s+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(On(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y;return t*t+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const s=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*s-o*r+e.x,this.y=i*r+o*s+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Tt{constructor(e,t,s,r,i,o,a,c,d){Tt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,s,r,i,o,a,c,d)}set(e,t,s,r,i,o,a,c,d){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=i,u[5]=c,u[6]=s,u[7]=o,u[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],this}extractBasis(e,t,s){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,r=t.elements,i=this.elements,o=s[0],a=s[3],c=s[6],d=s[1],u=s[4],_=s[7],m=s[2],h=s[5],f=s[8],y=r[0],b=r[3],g=r[6],E=r[1],v=r[4],S=r[7],R=r[2],w=r[5],A=r[8];return i[0]=o*y+a*E+c*R,i[3]=o*b+a*v+c*w,i[6]=o*g+a*S+c*A,i[1]=d*y+u*E+_*R,i[4]=d*b+u*v+_*w,i[7]=d*g+u*S+_*A,i[2]=m*y+h*E+f*R,i[5]=m*b+h*v+f*w,i[8]=m*g+h*S+f*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[1],r=e[2],i=e[3],o=e[4],a=e[5],c=e[6],d=e[7],u=e[8];return t*o*u-t*a*d-s*i*u+s*a*c+r*i*d-r*o*c}invert(){const e=this.elements,t=e[0],s=e[1],r=e[2],i=e[3],o=e[4],a=e[5],c=e[6],d=e[7],u=e[8],_=u*o-a*d,m=a*c-u*i,h=d*i-o*c,f=t*_+s*m+r*h;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/f;return e[0]=_*y,e[1]=(r*d-u*s)*y,e[2]=(a*s-r*o)*y,e[3]=m*y,e[4]=(u*t-r*c)*y,e[5]=(r*i-a*t)*y,e[6]=h*y,e[7]=(s*c-d*t)*y,e[8]=(o*t-s*i)*y,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,s,r,i,o,a){const c=Math.cos(i),d=Math.sin(i);return this.set(s*c,s*d,-s*(c*o+d*a)+o+e,-r*d,r*c,-r*(-d*o+c*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Xh.makeScale(e,t)),this}rotate(e){return this.premultiply(Xh.makeRotation(-e)),this}translate(e,t){return this.premultiply(Xh.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,s,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,s=e.elements;for(let r=0;r<9;r++)if(t[r]!==s[r])return!1;return!0}fromArray(e,t=0){for(let s=0;s<9;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Xh=new Tt;function WN(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function Zl(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function e0t(){const n=Zl("canvas");return n.style.display="block",n}const qC={};function kl(n){n in qC||(qC[n]=!0,console.warn(n))}const YC=new Tt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),$C=new Tt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Hc={[Cn]:{transfer:bu,primaries:yu,toReference:n=>n,fromReference:n=>n},[nn]:{transfer:jt,primaries:yu,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[mp]:{transfer:bu,primaries:Eu,toReference:n=>n.applyMatrix3($C),fromReference:n=>n.applyMatrix3(YC)},[fy]:{transfer:jt,primaries:Eu,toReference:n=>n.convertSRGBToLinear().applyMatrix3($C),fromReference:n=>n.applyMatrix3(YC).convertLinearToSRGB()}},t0t=new Set([Cn,mp]),Lt={enabled:!0,_workingColorSpace:Cn,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!t0t.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const s=Hc[e].toReference,r=Hc[t].fromReference;return r(s(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Hc[n].primaries},getTransfer:function(n){return n===bs?bu:Hc[n].transfer}};function oa(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Zh(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ao;class KN{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Ao===void 0&&(Ao=Zl("canvas")),Ao.width=e.width,Ao.height=e.height;const s=Ao.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),t=Ao}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Zl("canvas");t.width=e.width,t.height=e.height;const s=t.getContext("2d");s.drawImage(e,0,0,e.width,e.height);const r=s.getImageData(0,0,e.width,e.height),i=r.data;for(let o=0;o0&&(s.userData=this.userData),t||(e.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==LN)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case va:e.x=e.x-Math.floor(e.x);break;case hs:e.x=e.x<0?0:1;break;case gu:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case va:e.y=e.y-Math.floor(e.y);break;case hs:e.y=e.y<0?0:1;break;case gu:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return kl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===nn?ro:YN}set encoding(e){kl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===ro?nn:bs}}xn.DEFAULT_IMAGE=null;xn.DEFAULT_MAPPING=LN;xn.DEFAULT_ANISOTROPY=1;class Wt{constructor(e=0,t=0,s=0,r=1){Wt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=s,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,s,r){return this.x=e,this.y=t,this.z=s,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,s=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*s+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*s+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*s+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*s+o[11]*r+o[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,s,r,i;const c=e.elements,d=c[0],u=c[4],_=c[8],m=c[1],h=c[5],f=c[9],y=c[2],b=c[6],g=c[10];if(Math.abs(u-m)<.01&&Math.abs(_-y)<.01&&Math.abs(f-b)<.01){if(Math.abs(u+m)<.1&&Math.abs(_+y)<.1&&Math.abs(f+b)<.1&&Math.abs(d+h+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const v=(d+1)/2,S=(h+1)/2,R=(g+1)/2,w=(u+m)/4,A=(_+y)/4,I=(f+b)/4;return v>S&&v>R?v<.01?(s=0,r=.707106781,i=.707106781):(s=Math.sqrt(v),r=w/s,i=A/s):S>R?S<.01?(s=.707106781,r=0,i=.707106781):(r=Math.sqrt(S),s=w/r,i=I/r):R<.01?(s=.707106781,r=.707106781,i=0):(i=Math.sqrt(R),s=A/i,r=I/i),this.set(s,r,i,t),this}let E=Math.sqrt((b-f)*(b-f)+(_-y)*(_-y)+(m-u)*(m-u));return Math.abs(E)<.001&&(E=1),this.x=(b-f)/E,this.y=(_-y)/E,this.z=(m-u)/E,this.w=Math.acos((d+h+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this.w=e.w+(t.w-e.w)*s,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class r0t extends Ha{constructor(e=1,t=1,s={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Wt(0,0,e,t),this.scissorTest=!1,this.viewport=new Wt(0,0,e,t);const r={width:e,height:t,depth:1};s.encoding!==void 0&&(kl("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),s.colorSpace=s.encoding===ro?nn:bs),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Wn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},s),this.texture=new xn(r,s.mapping,s.wrapS,s.wrapT,s.magFilter,s.minFilter,s.format,s.type,s.anisotropy,s.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=s.generateMipmaps,this.texture.internalFormat=s.internalFormat,this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.depthTexture=s.depthTexture,this.samples=s.samples}setSize(e,t,s=1){(this.width!==e||this.height!==t||this.depth!==s)&&(this.width=e,this.height=t,this.depth=s,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=s,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new jN(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class mo extends r0t{constructor(e=1,t=1,s={}){super(e,t,s),this.isWebGLRenderTarget=!0}}class QN extends xn{constructor(e=null,t=1,s=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:s,depth:r},this.magFilter=gn,this.minFilter=gn,this.wrapR=hs,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class i0t extends xn{constructor(e=null,t=1,s=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:s,depth:r},this.magFilter=gn,this.minFilter=gn,this.wrapR=hs,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Ni{constructor(e=0,t=0,s=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=s,this._w=r}static slerpFlat(e,t,s,r,i,o,a){let c=s[r+0],d=s[r+1],u=s[r+2],_=s[r+3];const m=i[o+0],h=i[o+1],f=i[o+2],y=i[o+3];if(a===0){e[t+0]=c,e[t+1]=d,e[t+2]=u,e[t+3]=_;return}if(a===1){e[t+0]=m,e[t+1]=h,e[t+2]=f,e[t+3]=y;return}if(_!==y||c!==m||d!==h||u!==f){let b=1-a;const g=c*m+d*h+u*f+_*y,E=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){const R=Math.sqrt(v),w=Math.atan2(R,g*E);b=Math.sin(b*w)/R,a=Math.sin(a*w)/R}const S=a*E;if(c=c*b+m*S,d=d*b+h*S,u=u*b+f*S,_=_*b+y*S,b===1-a){const R=1/Math.sqrt(c*c+d*d+u*u+_*_);c*=R,d*=R,u*=R,_*=R}}e[t]=c,e[t+1]=d,e[t+2]=u,e[t+3]=_}static multiplyQuaternionsFlat(e,t,s,r,i,o){const a=s[r],c=s[r+1],d=s[r+2],u=s[r+3],_=i[o],m=i[o+1],h=i[o+2],f=i[o+3];return e[t]=a*f+u*_+c*h-d*m,e[t+1]=c*f+u*m+d*_-a*h,e[t+2]=d*f+u*h+a*m-c*_,e[t+3]=u*f-a*_-c*m-d*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,s,r){return this._x=e,this._y=t,this._z=s,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const s=e._x,r=e._y,i=e._z,o=e._order,a=Math.cos,c=Math.sin,d=a(s/2),u=a(r/2),_=a(i/2),m=c(s/2),h=c(r/2),f=c(i/2);switch(o){case"XYZ":this._x=m*u*_+d*h*f,this._y=d*h*_-m*u*f,this._z=d*u*f+m*h*_,this._w=d*u*_-m*h*f;break;case"YXZ":this._x=m*u*_+d*h*f,this._y=d*h*_-m*u*f,this._z=d*u*f-m*h*_,this._w=d*u*_+m*h*f;break;case"ZXY":this._x=m*u*_-d*h*f,this._y=d*h*_+m*u*f,this._z=d*u*f+m*h*_,this._w=d*u*_-m*h*f;break;case"ZYX":this._x=m*u*_-d*h*f,this._y=d*h*_+m*u*f,this._z=d*u*f-m*h*_,this._w=d*u*_+m*h*f;break;case"YZX":this._x=m*u*_+d*h*f,this._y=d*h*_+m*u*f,this._z=d*u*f-m*h*_,this._w=d*u*_-m*h*f;break;case"XZY":this._x=m*u*_-d*h*f,this._y=d*h*_-m*u*f,this._z=d*u*f+m*h*_,this._w=d*u*_+m*h*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const s=t/2,r=Math.sin(s);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,s=t[0],r=t[4],i=t[8],o=t[1],a=t[5],c=t[9],d=t[2],u=t[6],_=t[10],m=s+a+_;if(m>0){const h=.5/Math.sqrt(m+1);this._w=.25/h,this._x=(u-c)*h,this._y=(i-d)*h,this._z=(o-r)*h}else if(s>a&&s>_){const h=2*Math.sqrt(1+s-a-_);this._w=(u-c)/h,this._x=.25*h,this._y=(r+o)/h,this._z=(i+d)/h}else if(a>_){const h=2*Math.sqrt(1+a-s-_);this._w=(i-d)/h,this._x=(r+o)/h,this._y=.25*h,this._z=(c+u)/h}else{const h=2*Math.sqrt(1+_-s-a);this._w=(o-r)/h,this._x=(i+d)/h,this._y=(c+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let s=e.dot(t)+1;return sMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=s):(this._x=0,this._y=-e.z,this._z=e.y,this._w=s)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=s),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(On(this.dot(e),-1,1)))}rotateTowards(e,t){const s=this.angleTo(e);if(s===0)return this;const r=Math.min(1,t/s);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const s=e._x,r=e._y,i=e._z,o=e._w,a=t._x,c=t._y,d=t._z,u=t._w;return this._x=s*u+o*a+r*d-i*c,this._y=r*u+o*c+i*a-s*d,this._z=i*u+o*d+s*c-r*a,this._w=o*u-s*a-r*c-i*d,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const s=this._x,r=this._y,i=this._z,o=this._w;let a=o*e._w+s*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=s,this._y=r,this._z=i,this;const c=1-a*a;if(c<=Number.EPSILON){const h=1-t;return this._w=h*o+t*this._w,this._x=h*s+t*this._x,this._y=h*r+t*this._y,this._z=h*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const d=Math.sqrt(c),u=Math.atan2(d,a),_=Math.sin((1-t)*u)/d,m=Math.sin(t*u)/d;return this._w=o*_+this._w*m,this._x=s*_+this._x*m,this._y=r*_+this._y*m,this._z=i*_+this._z*m,this._onChangeCallback(),this}slerpQuaternions(e,t,s){return this.copy(e).slerp(t,s)}random(){const e=Math.random(),t=Math.sqrt(1-e),s=Math.sqrt(e),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(t*Math.cos(r),s*Math.sin(i),s*Math.cos(i),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ie{constructor(e=0,t=0,s=0){ie.prototype.isVector3=!0,this.x=e,this.y=t,this.z=s}set(e,t,s){return s===void 0&&(s=this.z),this.x=e,this.y=t,this.z=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(WC.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(WC.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,s=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*s+i[6]*r,this.y=i[1]*t+i[4]*s+i[7]*r,this.z=i[2]*t+i[5]*s+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,s=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*s+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*s+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*s+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*s+i[10]*r+i[14])*o,this}applyQuaternion(e){const t=this.x,s=this.y,r=this.z,i=e.x,o=e.y,a=e.z,c=e.w,d=2*(o*r-a*s),u=2*(a*t-i*r),_=2*(i*s-o*t);return this.x=t+c*d+o*_-a*u,this.y=s+c*u+a*d-i*_,this.z=r+c*_+i*u-o*d,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,s=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*s+i[8]*r,this.y=i[1]*t+i[5]*s+i[9]*r,this.z=i[2]*t+i[6]*s+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(t,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,s){return this.x=e.x+(t.x-e.x)*s,this.y=e.y+(t.y-e.y)*s,this.z=e.z+(t.z-e.z)*s,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const s=e.x,r=e.y,i=e.z,o=t.x,a=t.y,c=t.z;return this.x=r*c-i*a,this.y=i*o-s*c,this.z=s*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const s=e.dot(this)/t;return this.copy(e).multiplyScalar(s)}projectOnPlane(e){return eg.copy(this).projectOnVector(e),this.sub(eg)}reflect(e){return this.sub(eg.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const s=this.dot(e)/t;return Math.acos(On(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,s=this.y-e.y,r=this.z-e.z;return t*t+s*s+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,s){const r=Math.sin(t)*e;return this.x=r*Math.sin(s),this.y=Math.cos(t)*e,this.z=r*Math.cos(s),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,s){return this.x=e*Math.sin(t),this.y=s,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),s=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=s,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,s=Math.sqrt(1-e**2);return this.x=s*Math.cos(t),this.y=s*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const eg=new ie,WC=new Ni;class Gr{constructor(e=new ie(1/0,1/0,1/0),t=new ie(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,s=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Is),Is.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,s;return e.normal.x>0?(t=e.normal.x*this.min.x,s=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,s=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,s+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,s+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,s+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,s+=e.normal.z*this.min.z),t<=-e.constant&&s>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ol),Yc.subVectors(this.max,ol),Mo.subVectors(e.a,ol),No.subVectors(e.b,ol),Oo.subVectors(e.c,ol),Kr.subVectors(No,Mo),jr.subVectors(Oo,No),Li.subVectors(Mo,Oo);let t=[0,-Kr.z,Kr.y,0,-jr.z,jr.y,0,-Li.z,Li.y,Kr.z,0,-Kr.x,jr.z,0,-jr.x,Li.z,0,-Li.x,-Kr.y,Kr.x,0,-jr.y,jr.x,0,-Li.y,Li.x,0];return!tg(t,Mo,No,Oo,Yc)||(t=[1,0,0,0,1,0,0,0,1],!tg(t,Mo,No,Oo,Yc))?!1:($c.crossVectors(Kr,jr),t=[$c.x,$c.y,$c.z],tg(t,Mo,No,Oo,Yc))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Is).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Is).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(gr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const gr=[new ie,new ie,new ie,new ie,new ie,new ie,new ie,new ie],Is=new ie,qc=new Gr,Mo=new ie,No=new ie,Oo=new ie,Kr=new ie,jr=new ie,Li=new ie,ol=new ie,Yc=new ie,$c=new ie,Pi=new ie;function tg(n,e,t,s,r){for(let i=0,o=n.length-3;i<=o;i+=3){Pi.fromArray(n,i);const a=r.x*Math.abs(Pi.x)+r.y*Math.abs(Pi.y)+r.z*Math.abs(Pi.z),c=e.dot(Pi),d=t.dot(Pi),u=s.dot(Pi);if(Math.max(-Math.max(c,d,u),Math.min(c,d,u))>a)return!1}return!0}const o0t=new Gr,al=new ie,ng=new ie;class pr{constructor(e=new ie,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const s=this.center;t!==void 0?s.copy(t):o0t.setFromPoints(e).getCenter(s);let r=0;for(let i=0,o=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;al.subVectors(e,this.center);const t=al.lengthSq();if(t>this.radius*this.radius){const s=Math.sqrt(t),r=(s-this.radius)*.5;this.center.addScaledVector(al,r/s),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(ng.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(al.copy(e.center).add(ng)),this.expandByPoint(al.copy(e.center).sub(ng))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const br=new ie,sg=new ie,Wc=new ie,Qr=new ie,rg=new ie,Kc=new ie,ig=new ie;class hp{constructor(e=new ie,t=new ie(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,br)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const s=t.dot(this.direction);return s<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=br.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(br.copy(this.origin).addScaledVector(this.direction,t),br.distanceToSquared(e))}distanceSqToSegment(e,t,s,r){sg.copy(e).add(t).multiplyScalar(.5),Wc.copy(t).sub(e).normalize(),Qr.copy(this.origin).sub(sg);const i=e.distanceTo(t)*.5,o=-this.direction.dot(Wc),a=Qr.dot(this.direction),c=-Qr.dot(Wc),d=Qr.lengthSq(),u=Math.abs(1-o*o);let _,m,h,f;if(u>0)if(_=o*c-a,m=o*a-c,f=i*u,_>=0)if(m>=-f)if(m<=f){const y=1/u;_*=y,m*=y,h=_*(_+o*m+2*a)+m*(o*_+m+2*c)+d}else m=i,_=Math.max(0,-(o*m+a)),h=-_*_+m*(m+2*c)+d;else m=-i,_=Math.max(0,-(o*m+a)),h=-_*_+m*(m+2*c)+d;else m<=-f?(_=Math.max(0,-(-o*i+a)),m=_>0?-i:Math.min(Math.max(-i,-c),i),h=-_*_+m*(m+2*c)+d):m<=f?(_=0,m=Math.min(Math.max(-i,-c),i),h=m*(m+2*c)+d):(_=Math.max(0,-(o*i+a)),m=_>0?i:Math.min(Math.max(-i,-c),i),h=-_*_+m*(m+2*c)+d);else m=o>0?-i:i,_=Math.max(0,-(o*m+a)),h=-_*_+m*(m+2*c)+d;return s&&s.copy(this.origin).addScaledVector(this.direction,_),r&&r.copy(sg).addScaledVector(Wc,m),h}intersectSphere(e,t){br.subVectors(e.center,this.origin);const s=br.dot(this.direction),r=br.dot(br)-s*s,i=e.radius*e.radius;if(r>i)return null;const o=Math.sqrt(i-r),a=s-o,c=s+o;return c<0?null:a<0?this.at(c,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(e.normal)+e.constant)/t;return s>=0?s:null}intersectPlane(e,t){const s=this.distanceToPlane(e);return s===null?null:this.at(s,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let s,r,i,o,a,c;const d=1/this.direction.x,u=1/this.direction.y,_=1/this.direction.z,m=this.origin;return d>=0?(s=(e.min.x-m.x)*d,r=(e.max.x-m.x)*d):(s=(e.max.x-m.x)*d,r=(e.min.x-m.x)*d),u>=0?(i=(e.min.y-m.y)*u,o=(e.max.y-m.y)*u):(i=(e.max.y-m.y)*u,o=(e.min.y-m.y)*u),s>o||i>r||((i>s||isNaN(s))&&(s=i),(o=0?(a=(e.min.z-m.z)*_,c=(e.max.z-m.z)*_):(a=(e.max.z-m.z)*_,c=(e.min.z-m.z)*_),s>c||a>r)||((a>s||s!==s)&&(s=a),(c=0?s:r,t)}intersectsBox(e){return this.intersectBox(e,br)!==null}intersectTriangle(e,t,s,r,i){rg.subVectors(t,e),Kc.subVectors(s,e),ig.crossVectors(rg,Kc);let o=this.direction.dot(ig),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Qr.subVectors(this.origin,e);const c=a*this.direction.dot(Kc.crossVectors(Qr,Kc));if(c<0)return null;const d=a*this.direction.dot(rg.cross(Qr));if(d<0||c+d>o)return null;const u=-a*Qr.dot(ig);return u<0?null:this.at(u/o,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class xt{constructor(e,t,s,r,i,o,a,c,d,u,_,m,h,f,y,b){xt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,s,r,i,o,a,c,d,u,_,m,h,f,y,b)}set(e,t,s,r,i,o,a,c,d,u,_,m,h,f,y,b){const g=this.elements;return g[0]=e,g[4]=t,g[8]=s,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=c,g[2]=d,g[6]=u,g[10]=_,g[14]=m,g[3]=h,g[7]=f,g[11]=y,g[15]=b,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new xt().fromArray(this.elements)}copy(e){const t=this.elements,s=e.elements;return t[0]=s[0],t[1]=s[1],t[2]=s[2],t[3]=s[3],t[4]=s[4],t[5]=s[5],t[6]=s[6],t[7]=s[7],t[8]=s[8],t[9]=s[9],t[10]=s[10],t[11]=s[11],t[12]=s[12],t[13]=s[13],t[14]=s[14],t[15]=s[15],this}copyPosition(e){const t=this.elements,s=e.elements;return t[12]=s[12],t[13]=s[13],t[14]=s[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,s){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(e,t,s){return this.set(e.x,t.x,s.x,0,e.y,t.y,s.y,0,e.z,t.z,s.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,s=e.elements,r=1/Io.setFromMatrixColumn(e,0).length(),i=1/Io.setFromMatrixColumn(e,1).length(),o=1/Io.setFromMatrixColumn(e,2).length();return t[0]=s[0]*r,t[1]=s[1]*r,t[2]=s[2]*r,t[3]=0,t[4]=s[4]*i,t[5]=s[5]*i,t[6]=s[6]*i,t[7]=0,t[8]=s[8]*o,t[9]=s[9]*o,t[10]=s[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,s=e.x,r=e.y,i=e.z,o=Math.cos(s),a=Math.sin(s),c=Math.cos(r),d=Math.sin(r),u=Math.cos(i),_=Math.sin(i);if(e.order==="XYZ"){const m=o*u,h=o*_,f=a*u,y=a*_;t[0]=c*u,t[4]=-c*_,t[8]=d,t[1]=h+f*d,t[5]=m-y*d,t[9]=-a*c,t[2]=y-m*d,t[6]=f+h*d,t[10]=o*c}else if(e.order==="YXZ"){const m=c*u,h=c*_,f=d*u,y=d*_;t[0]=m+y*a,t[4]=f*a-h,t[8]=o*d,t[1]=o*_,t[5]=o*u,t[9]=-a,t[2]=h*a-f,t[6]=y+m*a,t[10]=o*c}else if(e.order==="ZXY"){const m=c*u,h=c*_,f=d*u,y=d*_;t[0]=m-y*a,t[4]=-o*_,t[8]=f+h*a,t[1]=h+f*a,t[5]=o*u,t[9]=y-m*a,t[2]=-o*d,t[6]=a,t[10]=o*c}else if(e.order==="ZYX"){const m=o*u,h=o*_,f=a*u,y=a*_;t[0]=c*u,t[4]=f*d-h,t[8]=m*d+y,t[1]=c*_,t[5]=y*d+m,t[9]=h*d-f,t[2]=-d,t[6]=a*c,t[10]=o*c}else if(e.order==="YZX"){const m=o*c,h=o*d,f=a*c,y=a*d;t[0]=c*u,t[4]=y-m*_,t[8]=f*_+h,t[1]=_,t[5]=o*u,t[9]=-a*u,t[2]=-d*u,t[6]=h*_+f,t[10]=m-y*_}else if(e.order==="XZY"){const m=o*c,h=o*d,f=a*c,y=a*d;t[0]=c*u,t[4]=-_,t[8]=d*u,t[1]=m*_+y,t[5]=o*u,t[9]=h*_-f,t[2]=f*_-h,t[6]=a*u,t[10]=y*_+m}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(a0t,e,l0t)}lookAt(e,t,s){const r=this.elements;return ts.subVectors(e,t),ts.lengthSq()===0&&(ts.z=1),ts.normalize(),Xr.crossVectors(s,ts),Xr.lengthSq()===0&&(Math.abs(s.z)===1?ts.x+=1e-4:ts.z+=1e-4,ts.normalize(),Xr.crossVectors(s,ts)),Xr.normalize(),jc.crossVectors(ts,Xr),r[0]=Xr.x,r[4]=jc.x,r[8]=ts.x,r[1]=Xr.y,r[5]=jc.y,r[9]=ts.y,r[2]=Xr.z,r[6]=jc.z,r[10]=ts.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const s=e.elements,r=t.elements,i=this.elements,o=s[0],a=s[4],c=s[8],d=s[12],u=s[1],_=s[5],m=s[9],h=s[13],f=s[2],y=s[6],b=s[10],g=s[14],E=s[3],v=s[7],S=s[11],R=s[15],w=r[0],A=r[4],I=r[8],C=r[12],M=r[1],G=r[5],V=r[9],ee=r[13],O=r[2],H=r[6],q=r[10],L=r[14],W=r[3],se=r[7],oe=r[11],ye=r[15];return i[0]=o*w+a*M+c*O+d*W,i[4]=o*A+a*G+c*H+d*se,i[8]=o*I+a*V+c*q+d*oe,i[12]=o*C+a*ee+c*L+d*ye,i[1]=u*w+_*M+m*O+h*W,i[5]=u*A+_*G+m*H+h*se,i[9]=u*I+_*V+m*q+h*oe,i[13]=u*C+_*ee+m*L+h*ye,i[2]=f*w+y*M+b*O+g*W,i[6]=f*A+y*G+b*H+g*se,i[10]=f*I+y*V+b*q+g*oe,i[14]=f*C+y*ee+b*L+g*ye,i[3]=E*w+v*M+S*O+R*W,i[7]=E*A+v*G+S*H+R*se,i[11]=E*I+v*V+S*q+R*oe,i[15]=E*C+v*ee+S*L+R*ye,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],s=e[4],r=e[8],i=e[12],o=e[1],a=e[5],c=e[9],d=e[13],u=e[2],_=e[6],m=e[10],h=e[14],f=e[3],y=e[7],b=e[11],g=e[15];return f*(+i*c*_-r*d*_-i*a*m+s*d*m+r*a*h-s*c*h)+y*(+t*c*h-t*d*m+i*o*m-r*o*h+r*d*u-i*c*u)+b*(+t*d*_-t*a*h-i*o*_+s*o*h+i*a*u-s*d*u)+g*(-r*a*u-t*c*_+t*a*m+r*o*_-s*o*m+s*c*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,s){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=s),this}invert(){const e=this.elements,t=e[0],s=e[1],r=e[2],i=e[3],o=e[4],a=e[5],c=e[6],d=e[7],u=e[8],_=e[9],m=e[10],h=e[11],f=e[12],y=e[13],b=e[14],g=e[15],E=_*b*d-y*m*d+y*c*h-a*b*h-_*c*g+a*m*g,v=f*m*d-u*b*d-f*c*h+o*b*h+u*c*g-o*m*g,S=u*y*d-f*_*d+f*a*h-o*y*h-u*a*g+o*_*g,R=f*_*c-u*y*c-f*a*m+o*y*m+u*a*b-o*_*b,w=t*E+s*v+r*S+i*R;if(w===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/w;return e[0]=E*A,e[1]=(y*m*i-_*b*i-y*r*h+s*b*h+_*r*g-s*m*g)*A,e[2]=(a*b*i-y*c*i+y*r*d-s*b*d-a*r*g+s*c*g)*A,e[3]=(_*c*i-a*m*i-_*r*d+s*m*d+a*r*h-s*c*h)*A,e[4]=v*A,e[5]=(u*b*i-f*m*i+f*r*h-t*b*h-u*r*g+t*m*g)*A,e[6]=(f*c*i-o*b*i-f*r*d+t*b*d+o*r*g-t*c*g)*A,e[7]=(o*m*i-u*c*i+u*r*d-t*m*d-o*r*h+t*c*h)*A,e[8]=S*A,e[9]=(f*_*i-u*y*i-f*s*h+t*y*h+u*s*g-t*_*g)*A,e[10]=(o*y*i-f*a*i+f*s*d-t*y*d-o*s*g+t*a*g)*A,e[11]=(u*a*i-o*_*i-u*s*d+t*_*d+o*s*h-t*a*h)*A,e[12]=R*A,e[13]=(u*y*r-f*_*r+f*s*m-t*y*m-u*s*b+t*_*b)*A,e[14]=(f*a*r-o*y*r-f*s*c+t*y*c+o*s*b-t*a*b)*A,e[15]=(o*_*r-u*a*r+u*s*c-t*_*c-o*s*m+t*a*m)*A,this}scale(e){const t=this.elements,s=e.x,r=e.y,i=e.z;return t[0]*=s,t[4]*=r,t[8]*=i,t[1]*=s,t[5]*=r,t[9]*=i,t[2]*=s,t[6]*=r,t[10]*=i,t[3]*=s,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],s=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,s,r))}makeTranslation(e,t,s){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,s,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),s=Math.sin(e);return this.set(1,0,0,0,0,t,-s,0,0,s,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,0,s,0,0,1,0,0,-s,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),s=Math.sin(e);return this.set(t,-s,0,0,s,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const s=Math.cos(t),r=Math.sin(t),i=1-s,o=e.x,a=e.y,c=e.z,d=i*o,u=i*a;return this.set(d*o+s,d*a-r*c,d*c+r*a,0,d*a+r*c,u*a+s,u*c-r*o,0,d*c-r*a,u*c+r*o,i*c*c+s,0,0,0,0,1),this}makeScale(e,t,s){return this.set(e,0,0,0,0,t,0,0,0,0,s,0,0,0,0,1),this}makeShear(e,t,s,r,i,o){return this.set(1,s,i,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,s){const r=this.elements,i=t._x,o=t._y,a=t._z,c=t._w,d=i+i,u=o+o,_=a+a,m=i*d,h=i*u,f=i*_,y=o*u,b=o*_,g=a*_,E=c*d,v=c*u,S=c*_,R=s.x,w=s.y,A=s.z;return r[0]=(1-(y+g))*R,r[1]=(h+S)*R,r[2]=(f-v)*R,r[3]=0,r[4]=(h-S)*w,r[5]=(1-(m+g))*w,r[6]=(b+E)*w,r[7]=0,r[8]=(f+v)*A,r[9]=(b-E)*A,r[10]=(1-(m+y))*A,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,s){const r=this.elements;let i=Io.set(r[0],r[1],r[2]).length();const o=Io.set(r[4],r[5],r[6]).length(),a=Io.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],ks.copy(this);const d=1/i,u=1/o,_=1/a;return ks.elements[0]*=d,ks.elements[1]*=d,ks.elements[2]*=d,ks.elements[4]*=u,ks.elements[5]*=u,ks.elements[6]*=u,ks.elements[8]*=_,ks.elements[9]*=_,ks.elements[10]*=_,t.setFromRotationMatrix(ks),s.x=i,s.y=o,s.z=a,this}makePerspective(e,t,s,r,i,o,a=Mr){const c=this.elements,d=2*i/(t-e),u=2*i/(s-r),_=(t+e)/(t-e),m=(s+r)/(s-r);let h,f;if(a===Mr)h=-(o+i)/(o-i),f=-2*o*i/(o-i);else if(a===vu)h=-o/(o-i),f=-o*i/(o-i);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=d,c[4]=0,c[8]=_,c[12]=0,c[1]=0,c[5]=u,c[9]=m,c[13]=0,c[2]=0,c[6]=0,c[10]=h,c[14]=f,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,s,r,i,o,a=Mr){const c=this.elements,d=1/(t-e),u=1/(s-r),_=1/(o-i),m=(t+e)*d,h=(s+r)*u;let f,y;if(a===Mr)f=(o+i)*_,y=-2*_;else if(a===vu)f=i*_,y=-1*_;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=2*d,c[4]=0,c[8]=0,c[12]=-m,c[1]=0,c[5]=2*u,c[9]=0,c[13]=-h,c[2]=0,c[6]=0,c[10]=y,c[14]=-f,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,s=e.elements;for(let r=0;r<16;r++)if(t[r]!==s[r])return!1;return!0}fromArray(e,t=0){for(let s=0;s<16;s++)this.elements[s]=e[s+t];return this}toArray(e=[],t=0){const s=this.elements;return e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e[t+9]=s[9],e[t+10]=s[10],e[t+11]=s[11],e[t+12]=s[12],e[t+13]=s[13],e[t+14]=s[14],e[t+15]=s[15],e}}const Io=new ie,ks=new xt,a0t=new ie(0,0,0),l0t=new ie(1,1,1),Xr=new ie,jc=new ie,ts=new ie,KC=new xt,jC=new Ni;class gp{constructor(e=0,t=0,s=0,r=gp.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=s,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,s,r=this._order){return this._x=e,this._y=t,this._z=s,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,s=!0){const r=e.elements,i=r[0],o=r[4],a=r[8],c=r[1],d=r[5],u=r[9],_=r[2],m=r[6],h=r[10];switch(t){case"XYZ":this._y=Math.asin(On(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(m,d),this._z=0);break;case"YXZ":this._x=Math.asin(-On(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(c,d)):(this._y=Math.atan2(-_,i),this._z=0);break;case"ZXY":this._x=Math.asin(On(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-_,h),this._z=Math.atan2(-o,d)):(this._y=0,this._z=Math.atan2(c,i));break;case"ZYX":this._y=Math.asin(-On(_,-1,1)),Math.abs(_)<.9999999?(this._x=Math.atan2(m,h),this._z=Math.atan2(c,i)):(this._x=0,this._z=Math.atan2(-o,d));break;case"YZX":this._z=Math.asin(On(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,d),this._y=Math.atan2(-_,i)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-On(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(m,d),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,s===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,s){return KC.makeRotationFromQuaternion(e),this.setFromRotationMatrix(KC,t,s)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return jC.setFromEuler(this),this.setFromQuaternion(jC,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}gp.DEFAULT_ORDER="XYZ";class XN{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let s=0;s0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function i(a,c){return a[c.uuid]===void 0&&(a[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const c=a.shapes;if(Array.isArray(c))for(let d=0,u=c.length;d0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(s.geometries=a),c.length>0&&(s.materials=c),d.length>0&&(s.textures=d),u.length>0&&(s.images=u),_.length>0&&(s.shapes=_),m.length>0&&(s.skeletons=m),h.length>0&&(s.animations=h),f.length>0&&(s.nodes=f)}return s.object=r,s;function o(a){const c=[];for(const d in a){const u=a[d];delete u.metadata,c.push(u)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let s=0;s0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,s,r,i){Ds.subVectors(r,t),Er.subVectors(s,t),og.subVectors(e,t);const o=Ds.dot(Ds),a=Ds.dot(Er),c=Ds.dot(og),d=Er.dot(Er),u=Er.dot(og),_=o*d-a*a;if(_===0)return i.set(-2,-1,-1);const m=1/_,h=(d*c-a*u)*m,f=(o*u-a*c)*m;return i.set(1-h-f,f,h)}static containsPoint(e,t,s,r){return this.getBarycoord(e,t,s,r,vr),vr.x>=0&&vr.y>=0&&vr.x+vr.y<=1}static getUV(e,t,s,r,i,o,a,c){return Xc===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Xc=!0),this.getInterpolation(e,t,s,r,i,o,a,c)}static getInterpolation(e,t,s,r,i,o,a,c){return this.getBarycoord(e,t,s,r,vr),c.setScalar(0),c.addScaledVector(i,vr.x),c.addScaledVector(o,vr.y),c.addScaledVector(a,vr.z),c}static isFrontFacing(e,t,s,r){return Ds.subVectors(s,t),Er.subVectors(e,t),Ds.cross(Er).dot(r)<0}set(e,t,s){return this.a.copy(e),this.b.copy(t),this.c.copy(s),this}setFromPointsAndIndices(e,t,s,r){return this.a.copy(e[t]),this.b.copy(e[s]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,s,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,s),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ds.subVectors(this.c,this.b),Er.subVectors(this.a,this.b),Ds.cross(Er).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Fs.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Fs.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,s,r,i){return Xc===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Xc=!0),Fs.getInterpolation(e,this.a,this.b,this.c,t,s,r,i)}getInterpolation(e,t,s,r,i){return Fs.getInterpolation(e,this.a,this.b,this.c,t,s,r,i)}containsPoint(e){return Fs.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Fs.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const s=this.a,r=this.b,i=this.c;let o,a;Do.subVectors(r,s),Lo.subVectors(i,s),ag.subVectors(e,s);const c=Do.dot(ag),d=Lo.dot(ag);if(c<=0&&d<=0)return t.copy(s);lg.subVectors(e,r);const u=Do.dot(lg),_=Lo.dot(lg);if(u>=0&&_<=u)return t.copy(r);const m=c*_-u*d;if(m<=0&&c>=0&&u<=0)return o=c/(c-u),t.copy(s).addScaledVector(Do,o);cg.subVectors(e,i);const h=Do.dot(cg),f=Lo.dot(cg);if(f>=0&&h<=f)return t.copy(i);const y=h*d-c*f;if(y<=0&&d>=0&&f<=0)return a=d/(d-f),t.copy(s).addScaledVector(Lo,a);const b=u*f-h*_;if(b<=0&&_-u>=0&&h-f>=0)return ew.subVectors(i,r),a=(_-u)/(_-u+(h-f)),t.copy(r).addScaledVector(ew,a);const g=1/(b+y+m);return o=y*g,a=m*g,t.copy(s).addScaledVector(Do,o).addScaledVector(Lo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const ZN={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Zr={h:0,s:0,l:0},Zc={h:0,s:0,l:0};function dg(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class pt{constructor(e,t,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,s)}set(e,t,s){if(t===void 0&&s===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,s);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=nn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Lt.toWorkingColorSpace(this,t),this}setRGB(e,t,s,r=Lt.workingColorSpace){return this.r=e,this.g=t,this.b=s,Lt.toWorkingColorSpace(this,r),this}setHSL(e,t,s,r=Lt.workingColorSpace){if(e=_y(e,1),t=On(t,0,1),s=On(s,0,1),t===0)this.r=this.g=this.b=s;else{const i=s<=.5?s*(1+t):s+t-s*t,o=2*s-i;this.r=dg(o,i,e+1/3),this.g=dg(o,i,e),this.b=dg(o,i,e-1/3)}return Lt.toWorkingColorSpace(this,r),this}setStyle(e,t=nn){function s(i){i!==void 0&&parseFloat(i)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const i=r[1],o=i.length;if(o===3)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(i,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=nn){const s=ZN[e.toLowerCase()];return s!==void 0?this.setHex(s,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=oa(e.r),this.g=oa(e.g),this.b=oa(e.b),this}copyLinearToSRGB(e){return this.r=Zh(e.r),this.g=Zh(e.g),this.b=Zh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=nn){return Lt.fromWorkingColorSpace(Mn.copy(this),e),Math.round(On(Mn.r*255,0,255))*65536+Math.round(On(Mn.g*255,0,255))*256+Math.round(On(Mn.b*255,0,255))}getHexString(e=nn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Lt.workingColorSpace){Lt.fromWorkingColorSpace(Mn.copy(this),t);const s=Mn.r,r=Mn.g,i=Mn.b,o=Math.max(s,r,i),a=Math.min(s,r,i);let c,d;const u=(a+o)/2;if(a===o)c=0,d=0;else{const _=o-a;switch(d=u<=.5?_/(o+a):_/(2-o-a),o){case s:c=(r-i)/_+(r0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const s=e[t];if(s===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(s):r&&r.isVector3&&s&&s.isVector3?r.copy(s):this[t]=s}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const s={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(e).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(e).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(e).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(e).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(e).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==ia&&(s.blending=this.blending),this.side!==Fr&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==_b&&(s.blendSrc=this.blendSrc),this.blendDst!==mb&&(s.blendDst=this.blendDst),this.blendEquation!==$i&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==hu&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==VC&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ro&&(s.stencilFail=this.stencilFail),this.stencilZFail!==Ro&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==Ro&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function r(i){const o=[];for(const a in i){const c=i[a];delete c.metadata,o.push(c)}return o}if(t){const i=r(e.textures),o=r(e.images);i.length>0&&(s.textures=i),o.length>0&&(s.images=o)}return s}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let s=null;if(t!==null){const r=t.length;s=new Array(r);for(let i=0;i!==r;++i)s[i]=t[i].clone()}return this.clippingPlanes=s,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class _i extends Vs{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new pt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=dy,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const rn=new ie,Jc=new Rt;class zn{constructor(e,t,s=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=s,this.usage=Eb,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ar,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.BufferAttribute: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,s){e*=this.itemSize,s*=t.itemSize;for(let r=0,i=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const d in c)c[d]!==void 0&&(e[d]=c[d]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const s=this.attributes;for(const c in s){const d=s[c];e.data.attributes[c]=d.toJSON(e.data)}const r={};let i=!1;for(const c in this.morphAttributes){const d=this.morphAttributes[c],u=[];for(let _=0,m=d.length;_0&&(r[c]=u,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const s=e.index;s!==null&&this.setIndex(s.clone(t));const r=e.attributes;for(const d in r){const u=r[d];this.setAttribute(d,u.clone(t))}const i=e.morphAttributes;for(const d in i){const u=[],_=i[d];for(let m=0,h=_.length;m0){const r=t[s[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,o=r.length;i(e.far-e.near)**2))&&(tw.copy(i).invert(),Fi.copy(e.ray).applyMatrix4(tw),!(s.boundingBox!==null&&Fi.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(e,t,Fi)))}_computeIntersections(e,t,s){let r;const i=this.geometry,o=this.material,a=i.index,c=i.attributes.position,d=i.attributes.uv,u=i.attributes.uv1,_=i.attributes.normal,m=i.groups,h=i.drawRange;if(a!==null)if(Array.isArray(o))for(let f=0,y=m.length;ft.far?null:{distance:d,point:od.clone(),object:n}}function ad(n,e,t,s,r,i,o,a,c,d){n.getVertexPosition(a,Fo),n.getVertexPosition(c,Uo),n.getVertexPosition(d,Bo);const u=h0t(n,e,t,s,Fo,Uo,Bo,id);if(u){r&&(nd.fromBufferAttribute(r,a),sd.fromBufferAttribute(r,c),rd.fromBufferAttribute(r,d),u.uv=Fs.getInterpolation(id,Fo,Uo,Bo,nd,sd,rd,new Rt)),i&&(nd.fromBufferAttribute(i,a),sd.fromBufferAttribute(i,c),rd.fromBufferAttribute(i,d),u.uv1=Fs.getInterpolation(id,Fo,Uo,Bo,nd,sd,rd,new Rt),u.uv2=u.uv1),o&&(sw.fromBufferAttribute(o,a),rw.fromBufferAttribute(o,c),iw.fromBufferAttribute(o,d),u.normal=Fs.getInterpolation(id,Fo,Uo,Bo,sw,rw,iw,new ie),u.normal.dot(s.direction)>0&&u.normal.multiplyScalar(-1));const _={a,b:c,c:d,normal:new ie,materialIndex:0};Fs.getNormal(Fo,Uo,Bo,_.normal),u.face=_}return u}class Ei extends fr{constructor(e=1,t=1,s=1,r=1,i=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:s,widthSegments:r,heightSegments:i,depthSegments:o};const a=this;r=Math.floor(r),i=Math.floor(i),o=Math.floor(o);const c=[],d=[],u=[],_=[];let m=0,h=0;f("z","y","x",-1,-1,s,t,e,o,i,0),f("z","y","x",1,-1,s,t,-e,o,i,1),f("x","z","y",1,1,e,s,t,r,o,2),f("x","z","y",1,-1,e,s,-t,r,o,3),f("x","y","z",1,-1,e,t,s,r,i,4),f("x","y","z",-1,-1,e,t,-s,r,i,5),this.setIndex(c),this.setAttribute("position",new kr(d,3)),this.setAttribute("normal",new kr(u,3)),this.setAttribute("uv",new kr(_,2));function f(y,b,g,E,v,S,R,w,A,I,C){const M=S/A,G=R/I,V=S/2,ee=R/2,O=w/2,H=A+1,q=I+1;let L=0,W=0;const se=new ie;for(let oe=0;oe0?1:-1,u.push(se.x,se.y,se.z),_.push(xe/A),_.push(1-oe/I),L+=1}}for(let oe=0;oe0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const s={};for(const r in this.extensions)this.extensions[r]===!0&&(s[r]=!0);return Object.keys(s).length>0&&(t.extensions=s),t}}class nO extends Jt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new xt,this.projectionMatrix=new xt,this.projectionMatrixInverse=new xt,this.coordinateSystem=Mr}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Gn extends nO{constructor(e=50,t=1,s=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=s,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=xa*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Ol*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return xa*2*Math.atan(Math.tan(Ol*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,s,r,i,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Ol*.5*this.fov)/this.zoom,s=2*t,r=this.aspect*s,i=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const c=o.fullWidth,d=o.fullHeight;i+=o.offsetX*r/c,t-=o.offsetY*s/d,r*=o.width/c,s*=o.height/d}const a=this.filmOffset;a!==0&&(i+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-s,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Go=-90,Vo=1;class g0t extends Jt{constructor(e,t,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Gn(Go,Vo,e,t);r.layers=this.layers,this.add(r);const i=new Gn(Go,Vo,e,t);i.layers=this.layers,this.add(i);const o=new Gn(Go,Vo,e,t);o.layers=this.layers,this.add(o);const a=new Gn(Go,Vo,e,t);a.layers=this.layers,this.add(a);const c=new Gn(Go,Vo,e,t);c.layers=this.layers,this.add(c);const d=new Gn(Go,Vo,e,t);d.layers=this.layers,this.add(d)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[s,r,i,o,a,c]=t;for(const d of t)this.remove(d);if(e===Mr)s.up.set(0,1,0),s.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===vu)s.up.set(0,-1,0),s.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const d of t)this.add(d),d.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,o,a,c,d,u]=this.children,_=e.getRenderTarget(),m=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;const y=s.texture.generateMipmaps;s.texture.generateMipmaps=!1,e.setRenderTarget(s,0,r),e.render(t,i),e.setRenderTarget(s,1,r),e.render(t,o),e.setRenderTarget(s,2,r),e.render(t,a),e.setRenderTarget(s,3,r),e.render(t,c),e.setRenderTarget(s,4,r),e.render(t,d),s.texture.generateMipmaps=y,e.setRenderTarget(s,5,r),e.render(t,u),e.setRenderTarget(_,m,h),e.xr.enabled=f,s.texture.needsPMREMUpdate=!0}}class sO extends xn{constructor(e,t,s,r,i,o,a,c,d,u){e=e!==void 0?e:[],t=t!==void 0?t:ya,super(e,t,s,r,i,o,a,c,d,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class b0t extends mo{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const s={width:e,height:e,depth:1},r=[s,s,s,s,s,s];t.encoding!==void 0&&(kl("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===ro?nn:bs),this.texture=new sO(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Wn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const s={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class ho extends Vs{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=y0t,this.fragmentShader=E0t,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ca(e.uniforms),this.uniformsGroups=g0t(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?t.uniforms[r]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[r]={type:"m4",value:o.toArray()}:t.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const s={};for(const r in this.extensions)this.extensions[r]===!0&&(s[r]=!0);return Object.keys(s).length>0&&(t.extensions=s),t}}class nO extends Jt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new xt,this.projectionMatrix=new xt,this.projectionMatrixInverse=new xt,this.coordinateSystem=Mr}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Gn extends nO{constructor(e=50,t=1,s=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=s,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=xa*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Ol*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return xa*2*Math.atan(Math.tan(Ol*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,s,r,i,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Ol*.5*this.fov)/this.zoom,s=2*t,r=this.aspect*s,i=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const c=o.fullWidth,d=o.fullHeight;i+=o.offsetX*r/c,t-=o.offsetY*s/d,r*=o.width/c,s*=o.height/d}const a=this.filmOffset;a!==0&&(i+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-s,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Go=-90,Vo=1;class v0t extends Jt{constructor(e,t,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Gn(Go,Vo,e,t);r.layers=this.layers,this.add(r);const i=new Gn(Go,Vo,e,t);i.layers=this.layers,this.add(i);const o=new Gn(Go,Vo,e,t);o.layers=this.layers,this.add(o);const a=new Gn(Go,Vo,e,t);a.layers=this.layers,this.add(a);const c=new Gn(Go,Vo,e,t);c.layers=this.layers,this.add(c);const d=new Gn(Go,Vo,e,t);d.layers=this.layers,this.add(d)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[s,r,i,o,a,c]=t;for(const d of t)this.remove(d);if(e===Mr)s.up.set(0,1,0),s.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===vu)s.up.set(0,-1,0),s.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const d of t)this.add(d),d.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,o,a,c,d,u]=this.children,_=e.getRenderTarget(),m=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;const y=s.texture.generateMipmaps;s.texture.generateMipmaps=!1,e.setRenderTarget(s,0,r),e.render(t,i),e.setRenderTarget(s,1,r),e.render(t,o),e.setRenderTarget(s,2,r),e.render(t,a),e.setRenderTarget(s,3,r),e.render(t,c),e.setRenderTarget(s,4,r),e.render(t,d),s.texture.generateMipmaps=y,e.setRenderTarget(s,5,r),e.render(t,u),e.setRenderTarget(_,m,h),e.xr.enabled=f,s.texture.needsPMREMUpdate=!0}}class sO extends xn{constructor(e,t,s,r,i,o,a,c,d,u){e=e!==void 0?e:[],t=t!==void 0?t:ya,super(e,t,s,r,i,o,a,c,d,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class S0t extends mo{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const s={width:e,height:e,depth:1},r=[s,s,s,s,s,s];t.encoding!==void 0&&(kl("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===ro?nn:bs),this.texture=new sO(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Wn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const s={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -368,9 +368,9 @@ ${c}`;navigator.clipboard.writeText(d)}else navigator.clipboard.writeText(e);thi gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},r=new Ei(5,5,5),i=new ho({name:"CubemapFromEquirect",uniforms:Ca(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:Zn,blending:gi});i.uniforms.tEquirect.value=t;const o=new Vn(r,i),a=t.minFilter;return t.minFilter===_o&&(t.minFilter=Wn),new g0t(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,s,r){const i=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,s,r);e.setRenderTarget(i)}}const fg=new ie,y0t=new ie,E0t=new Tt;class zi{constructor(e=new ie(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,s,r){return this.normal.set(e,t,s),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,s){const r=fg.subVectors(s,t).cross(y0t.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const s=e.delta(fg),r=this.normal.dot(s);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(s,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),s=this.distanceToPoint(e.end);return t<0&&s>0||s<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const s=t||E0t.getNormalMatrix(e),r=this.coplanarPoint(fg).applyMatrix4(e),i=this.normal.applyMatrix3(s).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ui=new pr,ld=new ie;class my{constructor(e=new zi,t=new zi,s=new zi,r=new zi,i=new zi,o=new zi){this.planes=[e,t,s,r,i,o]}set(e,t,s,r,i,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(s),a[3].copy(r),a[4].copy(i),a[5].copy(o),this}copy(e){const t=this.planes;for(let s=0;s<6;s++)t[s].copy(e.planes[s]);return this}setFromProjectionMatrix(e,t=Mr){const s=this.planes,r=e.elements,i=r[0],o=r[1],a=r[2],c=r[3],d=r[4],u=r[5],_=r[6],m=r[7],h=r[8],f=r[9],y=r[10],b=r[11],g=r[12],E=r[13],v=r[14],S=r[15];if(s[0].setComponents(c-i,m-d,b-h,S-g).normalize(),s[1].setComponents(c+i,m+d,b+h,S+g).normalize(),s[2].setComponents(c+o,m+u,b+f,S+E).normalize(),s[3].setComponents(c-o,m-u,b-f,S-E).normalize(),s[4].setComponents(c-a,m-_,b-y,S-v).normalize(),t===Mr)s[5].setComponents(c+a,m+_,b+y,S+v).normalize();else if(t===vu)s[5].setComponents(a,_,y,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ui.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ui.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ui)}intersectsSprite(e){return Ui.center.set(0,0,0),Ui.radius=.7071067811865476,Ui.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ui)}intersectsSphere(e){const t=this.planes,s=e.center,r=-e.radius;for(let i=0;i<6;i++)if(t[i].distanceToPoint(s)0?e.max.x:e.min.x,ld.y=r.normal.y>0?e.max.y:e.min.y,ld.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(ld)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let s=0;s<6;s++)if(t[s].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function rO(){let n=null,e=!1,t=null,s=null;function r(i,o){t(i,o),s=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(s=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(s),e=!1},setAnimationLoop:function(i){t=i},setContext:function(i){n=i}}}function v0t(n,e){const t=e.isWebGL2,s=new WeakMap;function r(d,u){const _=d.array,m=d.usage,h=_.byteLength,f=n.createBuffer();n.bindBuffer(u,f),n.bufferData(u,_,m),d.onUploadCallback();let y;if(_ instanceof Float32Array)y=n.FLOAT;else if(_ instanceof Uint16Array)if(d.isFloat16BufferAttribute)if(t)y=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else y=n.UNSIGNED_SHORT;else if(_ instanceof Int16Array)y=n.SHORT;else if(_ instanceof Uint32Array)y=n.UNSIGNED_INT;else if(_ instanceof Int32Array)y=n.INT;else if(_ instanceof Int8Array)y=n.BYTE;else if(_ instanceof Uint8Array)y=n.UNSIGNED_BYTE;else if(_ instanceof Uint8ClampedArray)y=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+_);return{buffer:f,type:y,bytesPerElement:_.BYTES_PER_ELEMENT,version:d.version,size:h}}function i(d,u,_){const m=u.array,h=u._updateRange,f=u.updateRanges;if(n.bindBuffer(_,d),h.count===-1&&f.length===0&&n.bufferSubData(_,0,m),f.length!==0){for(let y=0,b=f.length;y1?null:t.copy(e.start).addScaledVector(s,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),s=this.distanceToPoint(e.end);return t<0&&s>0||s<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const s=t||x0t.getNormalMatrix(e),r=this.coplanarPoint(fg).applyMatrix4(e),i=this.normal.applyMatrix3(s).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ui=new pr,ld=new ie;class my{constructor(e=new zi,t=new zi,s=new zi,r=new zi,i=new zi,o=new zi){this.planes=[e,t,s,r,i,o]}set(e,t,s,r,i,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(s),a[3].copy(r),a[4].copy(i),a[5].copy(o),this}copy(e){const t=this.planes;for(let s=0;s<6;s++)t[s].copy(e.planes[s]);return this}setFromProjectionMatrix(e,t=Mr){const s=this.planes,r=e.elements,i=r[0],o=r[1],a=r[2],c=r[3],d=r[4],u=r[5],_=r[6],m=r[7],h=r[8],f=r[9],y=r[10],b=r[11],g=r[12],E=r[13],v=r[14],S=r[15];if(s[0].setComponents(c-i,m-d,b-h,S-g).normalize(),s[1].setComponents(c+i,m+d,b+h,S+g).normalize(),s[2].setComponents(c+o,m+u,b+f,S+E).normalize(),s[3].setComponents(c-o,m-u,b-f,S-E).normalize(),s[4].setComponents(c-a,m-_,b-y,S-v).normalize(),t===Mr)s[5].setComponents(c+a,m+_,b+y,S+v).normalize();else if(t===vu)s[5].setComponents(a,_,y,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ui.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ui.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ui)}intersectsSprite(e){return Ui.center.set(0,0,0),Ui.radius=.7071067811865476,Ui.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ui)}intersectsSphere(e){const t=this.planes,s=e.center,r=-e.radius;for(let i=0;i<6;i++)if(t[i].distanceToPoint(s)0?e.max.x:e.min.x,ld.y=r.normal.y>0?e.max.y:e.min.y,ld.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(ld)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let s=0;s<6;s++)if(t[s].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function rO(){let n=null,e=!1,t=null,s=null;function r(i,o){t(i,o),s=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(s=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(s),e=!1},setAnimationLoop:function(i){t=i},setContext:function(i){n=i}}}function C0t(n,e){const t=e.isWebGL2,s=new WeakMap;function r(d,u){const _=d.array,m=d.usage,h=_.byteLength,f=n.createBuffer();n.bindBuffer(u,f),n.bufferData(u,_,m),d.onUploadCallback();let y;if(_ instanceof Float32Array)y=n.FLOAT;else if(_ instanceof Uint16Array)if(d.isFloat16BufferAttribute)if(t)y=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else y=n.UNSIGNED_SHORT;else if(_ instanceof Int16Array)y=n.SHORT;else if(_ instanceof Uint32Array)y=n.UNSIGNED_INT;else if(_ instanceof Int32Array)y=n.INT;else if(_ instanceof Int8Array)y=n.BYTE;else if(_ instanceof Uint8Array)y=n.UNSIGNED_BYTE;else if(_ instanceof Uint8ClampedArray)y=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+_);return{buffer:f,type:y,bytesPerElement:_.BYTES_PER_ELEMENT,version:d.version,size:h}}function i(d,u,_){const m=u.array,h=u._updateRange,f=u.updateRanges;if(n.bindBuffer(_,d),h.count===-1&&f.length===0&&n.bufferSubData(_,0,m),f.length!==0){for(let y=0,b=f.length;y 0 +#endif`,V0t=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { @@ -567,26 +567,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #pragma unroll_loop_end if ( clipped ) discard; #endif -#endif`,U0t=`#if NUM_CLIPPING_PLANES > 0 +#endif`,z0t=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,B0t=`#if NUM_CLIPPING_PLANES > 0 +#endif`,H0t=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,G0t=`#if NUM_CLIPPING_PLANES > 0 +#endif`,q0t=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,V0t=`#if defined( USE_COLOR_ALPHA ) +#endif`,Y0t=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,z0t=`#if defined( USE_COLOR_ALPHA ) +#endif`,$0t=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,H0t=`#if defined( USE_COLOR_ALPHA ) +#endif`,W0t=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,q0t=`#if defined( USE_COLOR_ALPHA ) +#endif`,K0t=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -596,7 +596,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; -#endif`,Y0t=`#define PI 3.141592653589793 +#endif`,j0t=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -674,7 +674,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,$0t=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,Q0t=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -772,7 +772,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,W0t=`vec3 transformedNormal = objectNormal; +#endif`,X0t=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -801,18 +801,18 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,K0t=`#ifdef USE_DISPLACEMENTMAP +#endif`,Z0t=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,j0t=`#ifdef USE_DISPLACEMENTMAP +#endif`,J0t=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,Q0t=`#ifdef USE_EMISSIVEMAP +#endif`,eyt=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,X0t=`#ifdef USE_EMISSIVEMAP +#endif`,tyt=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,Z0t="gl_FragColor = linearToOutputTexel( gl_FragColor );",J0t=` +#endif`,nyt="gl_FragColor = linearToOutputTexel( gl_FragColor );",syt=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), @@ -840,7 +840,7 @@ vec4 LinearToLinear( in vec4 value ) { } vec4 LinearTosRGB( in vec4 value ) { return sRGBTransferOETF( value ); -}`,eyt=`#ifdef USE_ENVMAP +}`,ryt=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -869,7 +869,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,tyt=`#ifdef USE_ENVMAP +#endif`,iyt=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE @@ -878,7 +878,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,nyt=`#ifdef USE_ENVMAP +#endif`,oyt=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -889,7 +889,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,syt=`#ifdef USE_ENVMAP +#endif`,ayt=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -900,7 +900,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,ryt=`#ifdef USE_ENVMAP +#endif`,lyt=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -917,18 +917,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,iyt=`#ifdef USE_FOG +#endif`,cyt=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,oyt=`#ifdef USE_FOG +#endif`,dyt=`#ifdef USE_FOG varying float vFogDepth; -#endif`,ayt=`#ifdef USE_FOG +#endif`,uyt=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,lyt=`#ifdef USE_FOG +#endif`,pyt=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -937,7 +937,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,cyt=`#ifdef USE_GRADIENTMAP +#endif`,fyt=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -949,16 +949,16 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,dyt=`#ifdef USE_LIGHTMAP +}`,_yt=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,uyt=`#ifdef USE_LIGHTMAP +#endif`,myt=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,pyt=`LambertMaterial material; +#endif`,hyt=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,fyt=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,gyt=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -972,7 +972,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,_yt=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,byt=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -1095,7 +1095,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,myt=`#ifdef USE_ENVMAP +#endif`,yyt=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -1128,8 +1128,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,hyt=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,gyt=`varying vec3 vViewPosition; +#endif`,Eyt=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,vyt=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -1141,11 +1141,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,byt=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Syt=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,yyt=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,Tyt=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -1162,7 +1162,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Eyt=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,xyt=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -1245,7 +1245,7 @@ material.roughness = min( material.roughness, 1.0 ); material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,vyt=`struct PhysicalMaterial { +#endif`,Cyt=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1545,7 +1545,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,Syt=` +}`,wyt=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1660,7 +1660,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,Tyt=`#if defined( RE_IndirectDiffuse ) +#endif`,Ryt=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1679,25 +1679,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,xyt=`#if defined( RE_IndirectDiffuse ) +#endif`,Ayt=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,Cyt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,Myt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,wyt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,Nyt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,Ryt=`#ifdef USE_LOGDEPTHBUF +#endif`,Oyt=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,Ayt=`#ifdef USE_LOGDEPTHBUF +#endif`,Iyt=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -1707,16 +1707,16 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,Myt=`#ifdef USE_MAP +#endif`,kyt=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,Nyt=`#ifdef USE_MAP +#endif`,Dyt=`#ifdef USE_MAP uniform sampler2D map; -#endif`,Oyt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,Lyt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1728,7 +1728,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,Iyt=`#if defined( USE_POINTS_UV ) +#endif`,Pyt=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1740,13 +1740,13 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,kyt=`float metalnessFactor = metalness; +#endif`,Fyt=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,Dyt=`#ifdef USE_METALNESSMAP +#endif`,Uyt=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,Lyt=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) +#endif`,Byt=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1755,7 +1755,7 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,Pyt=`#ifdef USE_MORPHNORMALS +#endif`,Gyt=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1767,7 +1767,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,Fyt=`#ifdef USE_MORPHTARGETS +#endif`,Vyt=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1787,7 +1787,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,Uyt=`#ifdef USE_MORPHTARGETS +#endif`,zyt=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1805,7 +1805,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,Byt=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,Hyt=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1846,7 +1846,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,Gyt=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,qyt=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1861,25 +1861,25 @@ vec3 nonPerturbedNormal = normal;`,Gyt=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,Vyt=`#ifndef FLAT_SHADED +#endif`,Yyt=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,zyt=`#ifndef FLAT_SHADED +#endif`,$yt=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,Hyt=`#ifndef FLAT_SHADED +#endif`,Wyt=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,qyt=`#ifdef USE_NORMALMAP +#endif`,Kyt=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1901,13 +1901,13 @@ vec3 nonPerturbedNormal = normal;`,Gyt=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,Yyt=`#ifdef USE_CLEARCOAT +#endif`,jyt=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,$yt=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,Qyt=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,Wyt=`#ifdef USE_CLEARCOATMAP +#endif`,Xyt=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1916,18 +1916,18 @@ vec3 nonPerturbedNormal = normal;`,Gyt=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,Kyt=`#ifdef USE_IRIDESCENCEMAP +#endif`,Zyt=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,jyt=`#ifdef OPAQUE +#endif`,Jyt=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Qyt=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,eEt=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1968,9 +1968,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,Xyt=`#ifdef PREMULTIPLIED_ALPHA +}`,tEt=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,Zyt=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,nEt=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1978,22 +1978,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,Jyt=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,sEt=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,eEt=`#ifdef DITHERING +#endif`,rEt=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,tEt=`float roughnessFactor = roughness; +#endif`,iEt=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,nEt=`#ifdef USE_ROUGHNESSMAP +#endif`,oEt=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,sEt=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,aEt=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -2170,7 +2170,7 @@ gl_Position = projectionMatrix * mvPosition;`,Jyt=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,rEt=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,lEt=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -2208,7 +2208,7 @@ gl_Position = projectionMatrix * mvPosition;`,Jyt=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,iEt=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,cEt=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -2240,7 +2240,7 @@ gl_Position = projectionMatrix * mvPosition;`,Jyt=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,oEt=`float getShadowMask() { +#endif`,dEt=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2272,12 +2272,12 @@ gl_Position = projectionMatrix * mvPosition;`,Jyt=`#ifdef DITHERING #endif #endif return shadow; -}`,aEt=`#ifdef USE_SKINNING +}`,uEt=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,lEt=`#ifdef USE_SKINNING +#endif`,pEt=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2292,7 +2292,7 @@ gl_Position = projectionMatrix * mvPosition;`,Jyt=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,cEt=`#ifdef USE_SKINNING +#endif`,fEt=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2300,7 +2300,7 @@ gl_Position = projectionMatrix * mvPosition;`,Jyt=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,dEt=`#ifdef USE_SKINNING +#endif`,_Et=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2311,17 +2311,17 @@ gl_Position = projectionMatrix * mvPosition;`,Jyt=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,uEt=`float specularStrength; +#endif`,mEt=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,pEt=`#ifdef USE_SPECULARMAP +#endif`,hEt=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,fEt=`#if defined( TONE_MAPPING ) +#endif`,gEt=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,_Et=`#ifndef saturate +#endif`,bEt=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2357,7 +2357,7 @@ vec3 ACESFilmicToneMapping( vec3 color ) { color = ACESOutputMat * color; return saturate( color ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,mEt=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,yEt=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2378,7 +2378,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,mEt=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,hEt=`#ifdef USE_TRANSMISSION +#endif`,EEt=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2484,7 +2484,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,mEt=`#ifdef USE_TRANSMIS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,gEt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,vEt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2554,7 +2554,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,mEt=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,bEt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,SEt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2648,7 +2648,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,mEt=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,yEt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,TEt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2719,7 +2719,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,mEt=`#ifdef USE_TRANSMIS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,EEt=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,xEt=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; @@ -2728,12 +2728,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,mEt=`#ifdef USE_TRANSMIS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const vEt=`varying vec2 vUv; +#endif`;const CEt=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,SEt=`uniform sampler2D t2D; +}`,wEt=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2745,14 +2745,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,TEt=`varying vec3 vWorldDirection; +}`,REt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,xEt=`#ifdef ENVMAP_TYPE_CUBE +}`,AEt=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2774,14 +2774,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,CEt=`varying vec3 vWorldDirection; +}`,MEt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,wEt=`uniform samplerCube tCube; +}`,NEt=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2791,7 +2791,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,REt=`#include +}`,OEt=`#include #include #include #include @@ -2817,7 +2817,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,AEt=`#if DEPTH_PACKING == 3200 +}`,IEt=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2847,7 +2847,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,MEt=`#define DISTANCE +}`,kEt=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2873,7 +2873,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,NEt=`#define DISTANCE +}`,DEt=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2897,13 +2897,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,OEt=`varying vec3 vWorldDirection; +}`,LEt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,IEt=`uniform sampler2D tEquirect; +}`,PEt=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2912,7 +2912,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,kEt=`uniform float scale; +}`,FEt=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2933,7 +2933,7 @@ void main() { #include #include #include -}`,DEt=`uniform vec3 diffuse; +}`,UEt=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2961,7 +2961,7 @@ void main() { #include #include #include -}`,LEt=`#include +}`,BEt=`#include #include #include #include @@ -2992,7 +2992,7 @@ void main() { #include #include #include -}`,PEt=`uniform vec3 diffuse; +}`,GEt=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -3040,7 +3040,7 @@ void main() { #include #include #include -}`,FEt=`#define LAMBERT +}`,VEt=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -3078,7 +3078,7 @@ void main() { #include #include #include -}`,UEt=`#define LAMBERT +}`,zEt=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3135,7 +3135,7 @@ void main() { #include #include #include -}`,BEt=`#define MATCAP +}`,HEt=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -3168,7 +3168,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,GEt=`#define MATCAP +}`,qEt=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3214,7 +3214,7 @@ void main() { #include #include #include -}`,VEt=`#define NORMAL +}`,YEt=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3246,7 +3246,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,zEt=`#define NORMAL +}`,$Et=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3267,7 +3267,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,HEt=`#define PHONG +}`,WEt=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3305,7 +3305,7 @@ void main() { #include #include #include -}`,qEt=`#define PHONG +}`,KEt=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3364,7 +3364,7 @@ void main() { #include #include #include -}`,YEt=`#define STANDARD +}`,jEt=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3406,7 +3406,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,$Et=`#define STANDARD +}`,QEt=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3528,7 +3528,7 @@ void main() { #include #include #include -}`,WEt=`#define TOON +}`,XEt=`#define TOON varying vec3 vViewPosition; #include #include @@ -3564,7 +3564,7 @@ void main() { #include #include #include -}`,KEt=`#define TOON +}`,ZEt=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3617,7 +3617,7 @@ void main() { #include #include #include -}`,jEt=`uniform float size; +}`,JEt=`uniform float size; uniform float scale; #include #include @@ -3647,7 +3647,7 @@ void main() { #include #include #include -}`,QEt=`uniform vec3 diffuse; +}`,evt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3672,7 +3672,7 @@ void main() { #include #include #include -}`,XEt=`#include +}`,tvt=`#include #include #include #include @@ -3694,7 +3694,7 @@ void main() { #include #include #include -}`,ZEt=`uniform vec3 color; +}`,nvt=`uniform vec3 color; uniform float opacity; #include #include @@ -3710,7 +3710,7 @@ void main() { #include #include #include -}`,JEt=`uniform float rotation; +}`,svt=`uniform float rotation; uniform vec2 center; #include #include @@ -3736,7 +3736,7 @@ void main() { #include #include #include -}`,evt=`uniform vec3 diffuse; +}`,rvt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3761,7 +3761,7 @@ void main() { #include #include #include -}`,vt={alphahash_fragment:S0t,alphahash_pars_fragment:T0t,alphamap_fragment:x0t,alphamap_pars_fragment:C0t,alphatest_fragment:w0t,alphatest_pars_fragment:R0t,aomap_fragment:A0t,aomap_pars_fragment:M0t,batching_pars_vertex:N0t,batching_vertex:O0t,begin_vertex:I0t,beginnormal_vertex:k0t,bsdfs:D0t,iridescence_fragment:L0t,bumpmap_pars_fragment:P0t,clipping_planes_fragment:F0t,clipping_planes_pars_fragment:U0t,clipping_planes_pars_vertex:B0t,clipping_planes_vertex:G0t,color_fragment:V0t,color_pars_fragment:z0t,color_pars_vertex:H0t,color_vertex:q0t,common:Y0t,cube_uv_reflection_fragment:$0t,defaultnormal_vertex:W0t,displacementmap_pars_vertex:K0t,displacementmap_vertex:j0t,emissivemap_fragment:Q0t,emissivemap_pars_fragment:X0t,colorspace_fragment:Z0t,colorspace_pars_fragment:J0t,envmap_fragment:eyt,envmap_common_pars_fragment:tyt,envmap_pars_fragment:nyt,envmap_pars_vertex:syt,envmap_physical_pars_fragment:myt,envmap_vertex:ryt,fog_vertex:iyt,fog_pars_vertex:oyt,fog_fragment:ayt,fog_pars_fragment:lyt,gradientmap_pars_fragment:cyt,lightmap_fragment:dyt,lightmap_pars_fragment:uyt,lights_lambert_fragment:pyt,lights_lambert_pars_fragment:fyt,lights_pars_begin:_yt,lights_toon_fragment:hyt,lights_toon_pars_fragment:gyt,lights_phong_fragment:byt,lights_phong_pars_fragment:yyt,lights_physical_fragment:Eyt,lights_physical_pars_fragment:vyt,lights_fragment_begin:Syt,lights_fragment_maps:Tyt,lights_fragment_end:xyt,logdepthbuf_fragment:Cyt,logdepthbuf_pars_fragment:wyt,logdepthbuf_pars_vertex:Ryt,logdepthbuf_vertex:Ayt,map_fragment:Myt,map_pars_fragment:Nyt,map_particle_fragment:Oyt,map_particle_pars_fragment:Iyt,metalnessmap_fragment:kyt,metalnessmap_pars_fragment:Dyt,morphcolor_vertex:Lyt,morphnormal_vertex:Pyt,morphtarget_pars_vertex:Fyt,morphtarget_vertex:Uyt,normal_fragment_begin:Byt,normal_fragment_maps:Gyt,normal_pars_fragment:Vyt,normal_pars_vertex:zyt,normal_vertex:Hyt,normalmap_pars_fragment:qyt,clearcoat_normal_fragment_begin:Yyt,clearcoat_normal_fragment_maps:$yt,clearcoat_pars_fragment:Wyt,iridescence_pars_fragment:Kyt,opaque_fragment:jyt,packing:Qyt,premultiplied_alpha_fragment:Xyt,project_vertex:Zyt,dithering_fragment:Jyt,dithering_pars_fragment:eEt,roughnessmap_fragment:tEt,roughnessmap_pars_fragment:nEt,shadowmap_pars_fragment:sEt,shadowmap_pars_vertex:rEt,shadowmap_vertex:iEt,shadowmask_pars_fragment:oEt,skinbase_vertex:aEt,skinning_pars_vertex:lEt,skinning_vertex:cEt,skinnormal_vertex:dEt,specularmap_fragment:uEt,specularmap_pars_fragment:pEt,tonemapping_fragment:fEt,tonemapping_pars_fragment:_Et,transmission_fragment:mEt,transmission_pars_fragment:hEt,uv_pars_fragment:gEt,uv_pars_vertex:bEt,uv_vertex:yEt,worldpos_vertex:EEt,background_vert:vEt,background_frag:SEt,backgroundCube_vert:TEt,backgroundCube_frag:xEt,cube_vert:CEt,cube_frag:wEt,depth_vert:REt,depth_frag:AEt,distanceRGBA_vert:MEt,distanceRGBA_frag:NEt,equirect_vert:OEt,equirect_frag:IEt,linedashed_vert:kEt,linedashed_frag:DEt,meshbasic_vert:LEt,meshbasic_frag:PEt,meshlambert_vert:FEt,meshlambert_frag:UEt,meshmatcap_vert:BEt,meshmatcap_frag:GEt,meshnormal_vert:VEt,meshnormal_frag:zEt,meshphong_vert:HEt,meshphong_frag:qEt,meshphysical_vert:YEt,meshphysical_frag:$Et,meshtoon_vert:WEt,meshtoon_frag:KEt,points_vert:jEt,points_frag:QEt,shadow_vert:XEt,shadow_frag:ZEt,sprite_vert:JEt,sprite_frag:evt},$e={common:{diffuse:{value:new pt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Tt},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Tt}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Tt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Tt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Tt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Tt},normalScale:{value:new Rt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Tt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Tt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Tt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Tt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new pt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new pt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0},uvTransform:{value:new Tt}},sprite:{diffuse:{value:new pt(16777215)},opacity:{value:1},center:{value:new Rt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Tt},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0}}},Zs={basic:{uniforms:Fn([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.fog]),vertexShader:vt.meshbasic_vert,fragmentShader:vt.meshbasic_frag},lambert:{uniforms:Fn([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,$e.lights,{emissive:{value:new pt(0)}}]),vertexShader:vt.meshlambert_vert,fragmentShader:vt.meshlambert_frag},phong:{uniforms:Fn([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,$e.lights,{emissive:{value:new pt(0)},specular:{value:new pt(1118481)},shininess:{value:30}}]),vertexShader:vt.meshphong_vert,fragmentShader:vt.meshphong_frag},standard:{uniforms:Fn([$e.common,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.roughnessmap,$e.metalnessmap,$e.fog,$e.lights,{emissive:{value:new pt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:vt.meshphysical_vert,fragmentShader:vt.meshphysical_frag},toon:{uniforms:Fn([$e.common,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.gradientmap,$e.fog,$e.lights,{emissive:{value:new pt(0)}}]),vertexShader:vt.meshtoon_vert,fragmentShader:vt.meshtoon_frag},matcap:{uniforms:Fn([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,{matcap:{value:null}}]),vertexShader:vt.meshmatcap_vert,fragmentShader:vt.meshmatcap_frag},points:{uniforms:Fn([$e.points,$e.fog]),vertexShader:vt.points_vert,fragmentShader:vt.points_frag},dashed:{uniforms:Fn([$e.common,$e.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:vt.linedashed_vert,fragmentShader:vt.linedashed_frag},depth:{uniforms:Fn([$e.common,$e.displacementmap]),vertexShader:vt.depth_vert,fragmentShader:vt.depth_frag},normal:{uniforms:Fn([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,{opacity:{value:1}}]),vertexShader:vt.meshnormal_vert,fragmentShader:vt.meshnormal_frag},sprite:{uniforms:Fn([$e.sprite,$e.fog]),vertexShader:vt.sprite_vert,fragmentShader:vt.sprite_frag},background:{uniforms:{uvTransform:{value:new Tt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:vt.background_vert,fragmentShader:vt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:vt.backgroundCube_vert,fragmentShader:vt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:vt.cube_vert,fragmentShader:vt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:vt.equirect_vert,fragmentShader:vt.equirect_frag},distanceRGBA:{uniforms:Fn([$e.common,$e.displacementmap,{referencePosition:{value:new ie},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:vt.distanceRGBA_vert,fragmentShader:vt.distanceRGBA_frag},shadow:{uniforms:Fn([$e.lights,$e.fog,{color:{value:new pt(0)},opacity:{value:1}}]),vertexShader:vt.shadow_vert,fragmentShader:vt.shadow_frag}};Zs.physical={uniforms:Fn([Zs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Tt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Tt},clearcoatNormalScale:{value:new Rt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Tt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Tt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Tt},sheen:{value:0},sheenColor:{value:new pt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Tt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Tt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Tt},transmissionSamplerSize:{value:new Rt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Tt},attenuationDistance:{value:0},attenuationColor:{value:new pt(0)},specularColor:{value:new pt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Tt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Tt},anisotropyVector:{value:new Rt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Tt}}]),vertexShader:vt.meshphysical_vert,fragmentShader:vt.meshphysical_frag};const cd={r:0,b:0,g:0};function tvt(n,e,t,s,r,i,o){const a=new pt(0);let c=i===!0?0:1,d,u,_=null,m=0,h=null;function f(b,g){let E=!1,v=g.isScene===!0?g.background:null;v&&v.isTexture&&(v=(g.backgroundBlurriness>0?t:e).get(v)),v===null?y(a,c):v&&v.isColor&&(y(v,1),E=!0);const S=n.xr.getEnvironmentBlendMode();S==="additive"?s.buffers.color.setClear(0,0,0,1,o):S==="alpha-blend"&&s.buffers.color.setClear(0,0,0,0,o),(n.autoClear||E)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),v&&(v.isCubeTexture||v.mapping===_p)?(u===void 0&&(u=new Vn(new Ei(1,1,1),new ho({name:"BackgroundCubeMaterial",uniforms:Ca(Zs.backgroundCube.uniforms),vertexShader:Zs.backgroundCube.vertexShader,fragmentShader:Zs.backgroundCube.fragmentShader,side:Zn,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(R,w,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),u.material.uniforms.envMap.value=v,u.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=Lt.getTransfer(v.colorSpace)!==jt,(_!==v||m!==v.version||h!==n.toneMapping)&&(u.material.needsUpdate=!0,_=v,m=v.version,h=n.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):v&&v.isTexture&&(d===void 0&&(d=new Vn(new hy(2,2),new ho({name:"BackgroundMaterial",uniforms:Ca(Zs.background.uniforms),vertexShader:Zs.background.vertexShader,fragmentShader:Zs.background.fragmentShader,side:Fr,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(d)),d.material.uniforms.t2D.value=v,d.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,d.material.toneMapped=Lt.getTransfer(v.colorSpace)!==jt,v.matrixAutoUpdate===!0&&v.updateMatrix(),d.material.uniforms.uvTransform.value.copy(v.matrix),(_!==v||m!==v.version||h!==n.toneMapping)&&(d.material.needsUpdate=!0,_=v,m=v.version,h=n.toneMapping),d.layers.enableAll(),b.unshift(d,d.geometry,d.material,0,0,null))}function y(b,g){b.getRGB(cd,tO(n)),s.buffers.color.setClear(cd.r,cd.g,cd.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(b,g=1){a.set(b),c=g,y(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(b){c=b,y(a,c)},render:f}}function nvt(n,e,t,s){const r=n.getParameter(n.MAX_VERTEX_ATTRIBS),i=s.isWebGL2?null:e.get("OES_vertex_array_object"),o=s.isWebGL2||i!==null,a={},c=b(null);let d=c,u=!1;function _(O,H,q,L,W){let se=!1;if(o){const oe=y(L,q,H);d!==oe&&(d=oe,h(d.object)),se=g(O,L,q,W),se&&E(O,L,q,W)}else{const oe=H.wireframe===!0;(d.geometry!==L.id||d.program!==q.id||d.wireframe!==oe)&&(d.geometry=L.id,d.program=q.id,d.wireframe=oe,se=!0)}W!==null&&t.update(W,n.ELEMENT_ARRAY_BUFFER),(se||u)&&(u=!1,I(O,H,q,L),W!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(W).buffer))}function m(){return s.isWebGL2?n.createVertexArray():i.createVertexArrayOES()}function h(O){return s.isWebGL2?n.bindVertexArray(O):i.bindVertexArrayOES(O)}function f(O){return s.isWebGL2?n.deleteVertexArray(O):i.deleteVertexArrayOES(O)}function y(O,H,q){const L=q.wireframe===!0;let W=a[O.id];W===void 0&&(W={},a[O.id]=W);let se=W[H.id];se===void 0&&(se={},W[H.id]=se);let oe=se[L];return oe===void 0&&(oe=b(m()),se[L]=oe),oe}function b(O){const H=[],q=[],L=[];for(let W=0;W=0){const ve=W[xe];let Oe=se[xe];if(Oe===void 0&&(xe==="instanceMatrix"&&O.instanceMatrix&&(Oe=O.instanceMatrix),xe==="instanceColor"&&O.instanceColor&&(Oe=O.instanceColor)),ve===void 0||ve.attribute!==Oe||Oe&&ve.data!==Oe.data)return!0;oe++}return d.attributesNum!==oe||d.index!==L}function E(O,H,q,L){const W={},se=H.attributes;let oe=0;const ye=q.getAttributes();for(const xe in ye)if(ye[xe].location>=0){let ve=se[xe];ve===void 0&&(xe==="instanceMatrix"&&O.instanceMatrix&&(ve=O.instanceMatrix),xe==="instanceColor"&&O.instanceColor&&(ve=O.instanceColor));const Oe={};Oe.attribute=ve,ve&&ve.data&&(Oe.data=ve.data),W[xe]=Oe,oe++}d.attributes=W,d.attributesNum=oe,d.index=L}function v(){const O=d.newAttributes;for(let H=0,q=O.length;H=0){let ce=W[ye];if(ce===void 0&&(ye==="instanceMatrix"&&O.instanceMatrix&&(ce=O.instanceMatrix),ye==="instanceColor"&&O.instanceColor&&(ce=O.instanceColor)),ce!==void 0){const ve=ce.normalized,Oe=ce.itemSize,De=t.get(ce);if(De===void 0)continue;const Q=De.buffer,fe=De.type,_e=De.bytesPerElement,Ae=s.isWebGL2===!0&&(fe===n.INT||fe===n.UNSIGNED_INT||ce.gpuType===FN);if(ce.isInterleavedBufferAttribute){const Ue=ce.data,te=Ue.stride,U=ce.offset;if(Ue.isInstancedInterleavedBuffer){for(let P=0;P0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const c=i(a);c!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",c,"instead."),a=c);const d=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,_=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=n.getParameter(n.MAX_TEXTURE_SIZE),f=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),y=n.getParameter(n.MAX_VERTEX_ATTRIBS),b=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),E=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),v=m>0,S=o||e.has("OES_texture_float"),R=v&&S,w=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:d,getMaxAnisotropy:r,getMaxPrecision:i,precision:a,logarithmicDepthBuffer:u,maxTextures:_,maxVertexTextures:m,maxTextureSize:h,maxCubemapSize:f,maxAttributes:y,maxVertexUniforms:b,maxVaryings:g,maxFragmentUniforms:E,vertexTextures:v,floatFragmentTextures:S,floatVertexTextures:R,maxSamples:w}}function ivt(n){const e=this;let t=null,s=0,r=!1,i=!1;const o=new zi,a=new Tt,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(_,m){const h=_.length!==0||m||s!==0||r;return r=m,s=_.length,h},this.beginShadows=function(){i=!0,u(null)},this.endShadows=function(){i=!1},this.setGlobalState=function(_,m){t=u(_,m,0)},this.setState=function(_,m,h){const f=_.clippingPlanes,y=_.clipIntersection,b=_.clipShadows,g=n.get(_);if(!r||f===null||f.length===0||i&&!b)i?u(null):d();else{const E=i?0:s,v=E*4;let S=g.clippingState||null;c.value=S,S=u(f,m,v,h);for(let R=0;R!==v;++R)S[R]=t[R];g.clippingState=S,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=E}};function d(){c.value!==t&&(c.value=t,c.needsUpdate=s>0),e.numPlanes=s,e.numIntersection=0}function u(_,m,h,f){const y=_!==null?_.length:0;let b=null;if(y!==0){if(b=c.value,f!==!0||b===null){const g=h+y*4,E=m.matrixWorldInverse;a.getNormalMatrix(E),(b===null||b.length0){const d=new b0t(c.height/2);return d.fromEquirectangularTexture(n,o),e.set(o,d),o.addEventListener("dispose",r),t(d.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const c=e.get(a);c!==void 0&&(e.delete(a),c.dispose())}function i(){e=new WeakMap}return{get:s,dispose:i}}class gy extends nO{constructor(e=-1,t=1,s=1,r=-1,i=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=s,this.bottom=r,this.near=i,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,s,r,i,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=s-e,o=s+e,a=r+t,c=r-t;if(this.view!==null&&this.view.enabled){const d=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=d*this.view.offsetX,o=i+d*this.view.width,a-=u*this.view.offsetY,c=a-u*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,c,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const jo=4,ow=[.125,.215,.35,.446,.526,.582],Wi=20,_g=new gy,aw=new pt;let mg=null,hg=0,gg=0;const Hi=(1+Math.sqrt(5))/2,zo=1/Hi,lw=[new ie(1,1,1),new ie(-1,1,1),new ie(1,1,-1),new ie(-1,1,-1),new ie(0,Hi,zo),new ie(0,Hi,-zo),new ie(zo,0,Hi),new ie(-zo,0,Hi),new ie(Hi,zo,0),new ie(-Hi,zo,0)];class cw{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,s=.1,r=100){mg=this._renderer.getRenderTarget(),hg=this._renderer.getActiveCubeFace(),gg=this._renderer.getActiveMipmapLevel(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,s,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=pw(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=uw(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?v:0,v,v),u.setRenderTarget(r),y&&u.render(f,a),u.render(e,a)}f.geometry.dispose(),f.material.dispose(),u.toneMapping=m,u.autoClear=_,e.background=b}_textureToCubeUV(e,t){const s=this._renderer,r=e.mapping===ya||e.mapping===Ea;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=pw()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=uw());const i=r?this._cubemapMaterial:this._equirectMaterial,o=new Vn(this._lodPlanes[0],i),a=i.uniforms;a.envMap.value=e;const c=this._cubeSize;dd(t,0,0,3*c,2*c),s.setRenderTarget(t),s.render(o,_g)}_applyPMREM(e){const t=this._renderer,s=t.autoClear;t.autoClear=!1;for(let r=1;rWi&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${Wi}`);const g=[];let E=0;for(let A=0;Av-jo?r-v+jo:0),w=4*(this._cubeSize-S);dd(t,R,w,3*S,2*S),c.setRenderTarget(t),c.render(_,_g)}}function avt(n){const e=[],t=[],s=[];let r=n;const i=n-jo+1+ow.length;for(let o=0;on-jo?c=ow[o-n+jo-1]:o===0&&(c=0),s.push(c);const d=1/(a-2),u=-d,_=1+d,m=[u,u,_,u,_,_,u,u,_,_,u,_],h=6,f=6,y=3,b=2,g=1,E=new Float32Array(y*f*h),v=new Float32Array(b*f*h),S=new Float32Array(g*f*h);for(let w=0;w2?0:-1,C=[A,I,0,A+2/3,I,0,A+2/3,I+1,0,A,I,0,A+2/3,I+1,0,A,I+1,0];E.set(C,y*f*w),v.set(m,b*f*w);const M=[w,w,w,w,w,w];S.set(M,g*f*w)}const R=new fr;R.setAttribute("position",new zn(E,y)),R.setAttribute("uv",new zn(v,b)),R.setAttribute("faceIndex",new zn(S,g)),e.push(R),r>jo&&r--}return{lodPlanes:e,sizeLods:t,sigmas:s}}function dw(n,e,t){const s=new mo(n,e,t);return s.texture.mapping=_p,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function dd(n,e,t,s,r){n.viewport.set(e,t,s,r),n.scissor.set(e,t,s,r)}function lvt(n,e,t){const s=new Float32Array(Wi),r=new ie(0,1,0);return new ho({name:"SphericalGaussianBlur",defines:{n:Wi,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:by(),fragmentShader:` +}`,vt={alphahash_fragment:w0t,alphahash_pars_fragment:R0t,alphamap_fragment:A0t,alphamap_pars_fragment:M0t,alphatest_fragment:N0t,alphatest_pars_fragment:O0t,aomap_fragment:I0t,aomap_pars_fragment:k0t,batching_pars_vertex:D0t,batching_vertex:L0t,begin_vertex:P0t,beginnormal_vertex:F0t,bsdfs:U0t,iridescence_fragment:B0t,bumpmap_pars_fragment:G0t,clipping_planes_fragment:V0t,clipping_planes_pars_fragment:z0t,clipping_planes_pars_vertex:H0t,clipping_planes_vertex:q0t,color_fragment:Y0t,color_pars_fragment:$0t,color_pars_vertex:W0t,color_vertex:K0t,common:j0t,cube_uv_reflection_fragment:Q0t,defaultnormal_vertex:X0t,displacementmap_pars_vertex:Z0t,displacementmap_vertex:J0t,emissivemap_fragment:eyt,emissivemap_pars_fragment:tyt,colorspace_fragment:nyt,colorspace_pars_fragment:syt,envmap_fragment:ryt,envmap_common_pars_fragment:iyt,envmap_pars_fragment:oyt,envmap_pars_vertex:ayt,envmap_physical_pars_fragment:yyt,envmap_vertex:lyt,fog_vertex:cyt,fog_pars_vertex:dyt,fog_fragment:uyt,fog_pars_fragment:pyt,gradientmap_pars_fragment:fyt,lightmap_fragment:_yt,lightmap_pars_fragment:myt,lights_lambert_fragment:hyt,lights_lambert_pars_fragment:gyt,lights_pars_begin:byt,lights_toon_fragment:Eyt,lights_toon_pars_fragment:vyt,lights_phong_fragment:Syt,lights_phong_pars_fragment:Tyt,lights_physical_fragment:xyt,lights_physical_pars_fragment:Cyt,lights_fragment_begin:wyt,lights_fragment_maps:Ryt,lights_fragment_end:Ayt,logdepthbuf_fragment:Myt,logdepthbuf_pars_fragment:Nyt,logdepthbuf_pars_vertex:Oyt,logdepthbuf_vertex:Iyt,map_fragment:kyt,map_pars_fragment:Dyt,map_particle_fragment:Lyt,map_particle_pars_fragment:Pyt,metalnessmap_fragment:Fyt,metalnessmap_pars_fragment:Uyt,morphcolor_vertex:Byt,morphnormal_vertex:Gyt,morphtarget_pars_vertex:Vyt,morphtarget_vertex:zyt,normal_fragment_begin:Hyt,normal_fragment_maps:qyt,normal_pars_fragment:Yyt,normal_pars_vertex:$yt,normal_vertex:Wyt,normalmap_pars_fragment:Kyt,clearcoat_normal_fragment_begin:jyt,clearcoat_normal_fragment_maps:Qyt,clearcoat_pars_fragment:Xyt,iridescence_pars_fragment:Zyt,opaque_fragment:Jyt,packing:eEt,premultiplied_alpha_fragment:tEt,project_vertex:nEt,dithering_fragment:sEt,dithering_pars_fragment:rEt,roughnessmap_fragment:iEt,roughnessmap_pars_fragment:oEt,shadowmap_pars_fragment:aEt,shadowmap_pars_vertex:lEt,shadowmap_vertex:cEt,shadowmask_pars_fragment:dEt,skinbase_vertex:uEt,skinning_pars_vertex:pEt,skinning_vertex:fEt,skinnormal_vertex:_Et,specularmap_fragment:mEt,specularmap_pars_fragment:hEt,tonemapping_fragment:gEt,tonemapping_pars_fragment:bEt,transmission_fragment:yEt,transmission_pars_fragment:EEt,uv_pars_fragment:vEt,uv_pars_vertex:SEt,uv_vertex:TEt,worldpos_vertex:xEt,background_vert:CEt,background_frag:wEt,backgroundCube_vert:REt,backgroundCube_frag:AEt,cube_vert:MEt,cube_frag:NEt,depth_vert:OEt,depth_frag:IEt,distanceRGBA_vert:kEt,distanceRGBA_frag:DEt,equirect_vert:LEt,equirect_frag:PEt,linedashed_vert:FEt,linedashed_frag:UEt,meshbasic_vert:BEt,meshbasic_frag:GEt,meshlambert_vert:VEt,meshlambert_frag:zEt,meshmatcap_vert:HEt,meshmatcap_frag:qEt,meshnormal_vert:YEt,meshnormal_frag:$Et,meshphong_vert:WEt,meshphong_frag:KEt,meshphysical_vert:jEt,meshphysical_frag:QEt,meshtoon_vert:XEt,meshtoon_frag:ZEt,points_vert:JEt,points_frag:evt,shadow_vert:tvt,shadow_frag:nvt,sprite_vert:svt,sprite_frag:rvt},$e={common:{diffuse:{value:new pt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Tt},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Tt}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Tt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Tt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Tt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Tt},normalScale:{value:new Rt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Tt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Tt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Tt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Tt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new pt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new pt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0},uvTransform:{value:new Tt}},sprite:{diffuse:{value:new pt(16777215)},opacity:{value:1},center:{value:new Rt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Tt},alphaMap:{value:null},alphaMapTransform:{value:new Tt},alphaTest:{value:0}}},Zs={basic:{uniforms:Fn([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.fog]),vertexShader:vt.meshbasic_vert,fragmentShader:vt.meshbasic_frag},lambert:{uniforms:Fn([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,$e.lights,{emissive:{value:new pt(0)}}]),vertexShader:vt.meshlambert_vert,fragmentShader:vt.meshlambert_frag},phong:{uniforms:Fn([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,$e.lights,{emissive:{value:new pt(0)},specular:{value:new pt(1118481)},shininess:{value:30}}]),vertexShader:vt.meshphong_vert,fragmentShader:vt.meshphong_frag},standard:{uniforms:Fn([$e.common,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.roughnessmap,$e.metalnessmap,$e.fog,$e.lights,{emissive:{value:new pt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:vt.meshphysical_vert,fragmentShader:vt.meshphysical_frag},toon:{uniforms:Fn([$e.common,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.gradientmap,$e.fog,$e.lights,{emissive:{value:new pt(0)}}]),vertexShader:vt.meshtoon_vert,fragmentShader:vt.meshtoon_frag},matcap:{uniforms:Fn([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,{matcap:{value:null}}]),vertexShader:vt.meshmatcap_vert,fragmentShader:vt.meshmatcap_frag},points:{uniforms:Fn([$e.points,$e.fog]),vertexShader:vt.points_vert,fragmentShader:vt.points_frag},dashed:{uniforms:Fn([$e.common,$e.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:vt.linedashed_vert,fragmentShader:vt.linedashed_frag},depth:{uniforms:Fn([$e.common,$e.displacementmap]),vertexShader:vt.depth_vert,fragmentShader:vt.depth_frag},normal:{uniforms:Fn([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,{opacity:{value:1}}]),vertexShader:vt.meshnormal_vert,fragmentShader:vt.meshnormal_frag},sprite:{uniforms:Fn([$e.sprite,$e.fog]),vertexShader:vt.sprite_vert,fragmentShader:vt.sprite_frag},background:{uniforms:{uvTransform:{value:new Tt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:vt.background_vert,fragmentShader:vt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:vt.backgroundCube_vert,fragmentShader:vt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:vt.cube_vert,fragmentShader:vt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:vt.equirect_vert,fragmentShader:vt.equirect_frag},distanceRGBA:{uniforms:Fn([$e.common,$e.displacementmap,{referencePosition:{value:new ie},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:vt.distanceRGBA_vert,fragmentShader:vt.distanceRGBA_frag},shadow:{uniforms:Fn([$e.lights,$e.fog,{color:{value:new pt(0)},opacity:{value:1}}]),vertexShader:vt.shadow_vert,fragmentShader:vt.shadow_frag}};Zs.physical={uniforms:Fn([Zs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Tt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Tt},clearcoatNormalScale:{value:new Rt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Tt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Tt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Tt},sheen:{value:0},sheenColor:{value:new pt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Tt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Tt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Tt},transmissionSamplerSize:{value:new Rt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Tt},attenuationDistance:{value:0},attenuationColor:{value:new pt(0)},specularColor:{value:new pt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Tt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Tt},anisotropyVector:{value:new Rt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Tt}}]),vertexShader:vt.meshphysical_vert,fragmentShader:vt.meshphysical_frag};const cd={r:0,b:0,g:0};function ivt(n,e,t,s,r,i,o){const a=new pt(0);let c=i===!0?0:1,d,u,_=null,m=0,h=null;function f(b,g){let E=!1,v=g.isScene===!0?g.background:null;v&&v.isTexture&&(v=(g.backgroundBlurriness>0?t:e).get(v)),v===null?y(a,c):v&&v.isColor&&(y(v,1),E=!0);const S=n.xr.getEnvironmentBlendMode();S==="additive"?s.buffers.color.setClear(0,0,0,1,o):S==="alpha-blend"&&s.buffers.color.setClear(0,0,0,0,o),(n.autoClear||E)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),v&&(v.isCubeTexture||v.mapping===_p)?(u===void 0&&(u=new Vn(new Ei(1,1,1),new ho({name:"BackgroundCubeMaterial",uniforms:Ca(Zs.backgroundCube.uniforms),vertexShader:Zs.backgroundCube.vertexShader,fragmentShader:Zs.backgroundCube.fragmentShader,side:Zn,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(R,w,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),u.material.uniforms.envMap.value=v,u.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=Lt.getTransfer(v.colorSpace)!==jt,(_!==v||m!==v.version||h!==n.toneMapping)&&(u.material.needsUpdate=!0,_=v,m=v.version,h=n.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):v&&v.isTexture&&(d===void 0&&(d=new Vn(new hy(2,2),new ho({name:"BackgroundMaterial",uniforms:Ca(Zs.background.uniforms),vertexShader:Zs.background.vertexShader,fragmentShader:Zs.background.fragmentShader,side:Fr,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(d)),d.material.uniforms.t2D.value=v,d.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,d.material.toneMapped=Lt.getTransfer(v.colorSpace)!==jt,v.matrixAutoUpdate===!0&&v.updateMatrix(),d.material.uniforms.uvTransform.value.copy(v.matrix),(_!==v||m!==v.version||h!==n.toneMapping)&&(d.material.needsUpdate=!0,_=v,m=v.version,h=n.toneMapping),d.layers.enableAll(),b.unshift(d,d.geometry,d.material,0,0,null))}function y(b,g){b.getRGB(cd,tO(n)),s.buffers.color.setClear(cd.r,cd.g,cd.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(b,g=1){a.set(b),c=g,y(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(b){c=b,y(a,c)},render:f}}function ovt(n,e,t,s){const r=n.getParameter(n.MAX_VERTEX_ATTRIBS),i=s.isWebGL2?null:e.get("OES_vertex_array_object"),o=s.isWebGL2||i!==null,a={},c=b(null);let d=c,u=!1;function _(O,H,q,L,W){let se=!1;if(o){const oe=y(L,q,H);d!==oe&&(d=oe,h(d.object)),se=g(O,L,q,W),se&&E(O,L,q,W)}else{const oe=H.wireframe===!0;(d.geometry!==L.id||d.program!==q.id||d.wireframe!==oe)&&(d.geometry=L.id,d.program=q.id,d.wireframe=oe,se=!0)}W!==null&&t.update(W,n.ELEMENT_ARRAY_BUFFER),(se||u)&&(u=!1,I(O,H,q,L),W!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(W).buffer))}function m(){return s.isWebGL2?n.createVertexArray():i.createVertexArrayOES()}function h(O){return s.isWebGL2?n.bindVertexArray(O):i.bindVertexArrayOES(O)}function f(O){return s.isWebGL2?n.deleteVertexArray(O):i.deleteVertexArrayOES(O)}function y(O,H,q){const L=q.wireframe===!0;let W=a[O.id];W===void 0&&(W={},a[O.id]=W);let se=W[H.id];se===void 0&&(se={},W[H.id]=se);let oe=se[L];return oe===void 0&&(oe=b(m()),se[L]=oe),oe}function b(O){const H=[],q=[],L=[];for(let W=0;W=0){const ve=W[xe];let Oe=se[xe];if(Oe===void 0&&(xe==="instanceMatrix"&&O.instanceMatrix&&(Oe=O.instanceMatrix),xe==="instanceColor"&&O.instanceColor&&(Oe=O.instanceColor)),ve===void 0||ve.attribute!==Oe||Oe&&ve.data!==Oe.data)return!0;oe++}return d.attributesNum!==oe||d.index!==L}function E(O,H,q,L){const W={},se=H.attributes;let oe=0;const ye=q.getAttributes();for(const xe in ye)if(ye[xe].location>=0){let ve=se[xe];ve===void 0&&(xe==="instanceMatrix"&&O.instanceMatrix&&(ve=O.instanceMatrix),xe==="instanceColor"&&O.instanceColor&&(ve=O.instanceColor));const Oe={};Oe.attribute=ve,ve&&ve.data&&(Oe.data=ve.data),W[xe]=Oe,oe++}d.attributes=W,d.attributesNum=oe,d.index=L}function v(){const O=d.newAttributes;for(let H=0,q=O.length;H=0){let ce=W[ye];if(ce===void 0&&(ye==="instanceMatrix"&&O.instanceMatrix&&(ce=O.instanceMatrix),ye==="instanceColor"&&O.instanceColor&&(ce=O.instanceColor)),ce!==void 0){const ve=ce.normalized,Oe=ce.itemSize,De=t.get(ce);if(De===void 0)continue;const Q=De.buffer,fe=De.type,_e=De.bytesPerElement,Ae=s.isWebGL2===!0&&(fe===n.INT||fe===n.UNSIGNED_INT||ce.gpuType===FN);if(ce.isInterleavedBufferAttribute){const Ue=ce.data,te=Ue.stride,U=ce.offset;if(Ue.isInstancedInterleavedBuffer){for(let P=0;P0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const c=i(a);c!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",c,"instead."),a=c);const d=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,_=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=n.getParameter(n.MAX_TEXTURE_SIZE),f=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),y=n.getParameter(n.MAX_VERTEX_ATTRIBS),b=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),E=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),v=m>0,S=o||e.has("OES_texture_float"),R=v&&S,w=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:d,getMaxAnisotropy:r,getMaxPrecision:i,precision:a,logarithmicDepthBuffer:u,maxTextures:_,maxVertexTextures:m,maxTextureSize:h,maxCubemapSize:f,maxAttributes:y,maxVertexUniforms:b,maxVaryings:g,maxFragmentUniforms:E,vertexTextures:v,floatFragmentTextures:S,floatVertexTextures:R,maxSamples:w}}function cvt(n){const e=this;let t=null,s=0,r=!1,i=!1;const o=new zi,a=new Tt,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(_,m){const h=_.length!==0||m||s!==0||r;return r=m,s=_.length,h},this.beginShadows=function(){i=!0,u(null)},this.endShadows=function(){i=!1},this.setGlobalState=function(_,m){t=u(_,m,0)},this.setState=function(_,m,h){const f=_.clippingPlanes,y=_.clipIntersection,b=_.clipShadows,g=n.get(_);if(!r||f===null||f.length===0||i&&!b)i?u(null):d();else{const E=i?0:s,v=E*4;let S=g.clippingState||null;c.value=S,S=u(f,m,v,h);for(let R=0;R!==v;++R)S[R]=t[R];g.clippingState=S,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=E}};function d(){c.value!==t&&(c.value=t,c.needsUpdate=s>0),e.numPlanes=s,e.numIntersection=0}function u(_,m,h,f){const y=_!==null?_.length:0;let b=null;if(y!==0){if(b=c.value,f!==!0||b===null){const g=h+y*4,E=m.matrixWorldInverse;a.getNormalMatrix(E),(b===null||b.length0){const d=new S0t(c.height/2);return d.fromEquirectangularTexture(n,o),e.set(o,d),o.addEventListener("dispose",r),t(d.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const c=e.get(a);c!==void 0&&(e.delete(a),c.dispose())}function i(){e=new WeakMap}return{get:s,dispose:i}}class gy extends nO{constructor(e=-1,t=1,s=1,r=-1,i=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=s,this.bottom=r,this.near=i,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,s,r,i,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=s,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=s-e,o=s+e,a=r+t,c=r-t;if(this.view!==null&&this.view.enabled){const d=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=d*this.view.offsetX,o=i+d*this.view.width,a-=u*this.view.offsetY,c=a-u*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,c,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const jo=4,ow=[.125,.215,.35,.446,.526,.582],Wi=20,_g=new gy,aw=new pt;let mg=null,hg=0,gg=0;const Hi=(1+Math.sqrt(5))/2,zo=1/Hi,lw=[new ie(1,1,1),new ie(-1,1,1),new ie(1,1,-1),new ie(-1,1,-1),new ie(0,Hi,zo),new ie(0,Hi,-zo),new ie(zo,0,Hi),new ie(-zo,0,Hi),new ie(Hi,zo,0),new ie(-Hi,zo,0)];class cw{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,s=.1,r=100){mg=this._renderer.getRenderTarget(),hg=this._renderer.getActiveCubeFace(),gg=this._renderer.getActiveMipmapLevel(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,s,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=pw(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=uw(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?v:0,v,v),u.setRenderTarget(r),y&&u.render(f,a),u.render(e,a)}f.geometry.dispose(),f.material.dispose(),u.toneMapping=m,u.autoClear=_,e.background=b}_textureToCubeUV(e,t){const s=this._renderer,r=e.mapping===ya||e.mapping===Ea;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=pw()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=uw());const i=r?this._cubemapMaterial:this._equirectMaterial,o=new Vn(this._lodPlanes[0],i),a=i.uniforms;a.envMap.value=e;const c=this._cubeSize;dd(t,0,0,3*c,2*c),s.setRenderTarget(t),s.render(o,_g)}_applyPMREM(e){const t=this._renderer,s=t.autoClear;t.autoClear=!1;for(let r=1;rWi&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${Wi}`);const g=[];let E=0;for(let A=0;Av-jo?r-v+jo:0),w=4*(this._cubeSize-S);dd(t,R,w,3*S,2*S),c.setRenderTarget(t),c.render(_,_g)}}function uvt(n){const e=[],t=[],s=[];let r=n;const i=n-jo+1+ow.length;for(let o=0;on-jo?c=ow[o-n+jo-1]:o===0&&(c=0),s.push(c);const d=1/(a-2),u=-d,_=1+d,m=[u,u,_,u,_,_,u,u,_,_,u,_],h=6,f=6,y=3,b=2,g=1,E=new Float32Array(y*f*h),v=new Float32Array(b*f*h),S=new Float32Array(g*f*h);for(let w=0;w2?0:-1,C=[A,I,0,A+2/3,I,0,A+2/3,I+1,0,A,I,0,A+2/3,I+1,0,A,I+1,0];E.set(C,y*f*w),v.set(m,b*f*w);const M=[w,w,w,w,w,w];S.set(M,g*f*w)}const R=new fr;R.setAttribute("position",new zn(E,y)),R.setAttribute("uv",new zn(v,b)),R.setAttribute("faceIndex",new zn(S,g)),e.push(R),r>jo&&r--}return{lodPlanes:e,sizeLods:t,sigmas:s}}function dw(n,e,t){const s=new mo(n,e,t);return s.texture.mapping=_p,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function dd(n,e,t,s,r){n.viewport.set(e,t,s,r),n.scissor.set(e,t,s,r)}function pvt(n,e,t){const s=new Float32Array(Wi),r=new ie(0,1,0);return new ho({name:"SphericalGaussianBlur",defines:{n:Wi,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:by(),fragmentShader:` precision mediump float; precision mediump int; @@ -3911,26 +3911,26 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function cvt(n){let e=new WeakMap,t=null;function s(a){if(a&&a.isTexture){const c=a.mapping,d=c===hb||c===gb,u=c===ya||c===Ea;if(d||u)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let _=e.get(a);return t===null&&(t=new cw(n)),_=d?t.fromEquirectangular(a,_):t.fromCubemap(a,_),e.set(a,_),_.texture}else{if(e.has(a))return e.get(a).texture;{const _=a.image;if(d&&_&&_.height>0||u&&_&&r(_)){t===null&&(t=new cw(n));const m=d?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,m),a.addEventListener("dispose",i),m.texture}else return null}}}return a}function r(a){let c=0;const d=6;for(let u=0;ue.maxTextureSize&&(G=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const V=new Float32Array(M*G*4*y),ee=new QN(V,M,G,y);ee.type=Ar,ee.needsUpdate=!0;const O=C*4;for(let q=0;q0)return n;const r=e*t;let i=fw[r];if(i===void 0&&(i=new Float32Array(r),fw[r]=i),e!==0){s.toArray(i,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(i,a)}return i}function fn(n,e){if(n.length!==e.length)return!1;for(let t=0,s=n.length;t0||u&&_&&r(_)){t===null&&(t=new cw(n));const m=d?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,m),a.addEventListener("dispose",i),m.texture}else return null}}}return a}function r(a){let c=0;const d=6;for(let u=0;ue.maxTextureSize&&(G=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const V=new Float32Array(M*G*4*y),ee=new QN(V,M,G,y);ee.type=Ar,ee.needsUpdate=!0;const O=C*4;for(let q=0;q0)return n;const r=e*t;let i=fw[r];if(i===void 0&&(i=new Float32Array(r),fw[r]=i),e!==0){s.toArray(i,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(i,a)}return i}function fn(n,e){if(n.length!==e.length)return!1;for(let t=0,s=n.length;t":" "} ${a}: ${t[o]}`)}return s.join(` -`)}function uSt(n){const e=Lt.getPrimaries(Lt.workingColorSpace),t=Lt.getPrimaries(n);let s;switch(e===t?s="":e===Eu&&t===yu?s="LinearDisplayP3ToLinearSRGB":e===yu&&t===Eu&&(s="LinearSRGBToLinearDisplayP3"),n){case Cn:case mp:return[s,"LinearTransferOETF"];case nn:case fy:return[s,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[s,"LinearTransferOETF"]}}function Ew(n,e,t){const s=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(s&&r==="")return"";const i=/ERROR: 0:(\d+)/.exec(r);if(i){const o=parseInt(i[1]);return t.toUpperCase()+` +`)}function mSt(n){const e=Lt.getPrimaries(Lt.workingColorSpace),t=Lt.getPrimaries(n);let s;switch(e===t?s="":e===Eu&&t===yu?s="LinearDisplayP3ToLinearSRGB":e===yu&&t===Eu&&(s="LinearSRGBToLinearDisplayP3"),n){case Cn:case mp:return[s,"LinearTransferOETF"];case nn:case fy:return[s,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[s,"LinearTransferOETF"]}}function Ew(n,e,t){const s=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(s&&r==="")return"";const i=/ERROR: 0:(\d+)/.exec(r);if(i){const o=parseInt(i[1]);return t.toUpperCase()+` `+r+` -`+dSt(n.getShaderSource(e),o)}else return r}function pSt(n,e){const t=uSt(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function fSt(n,e){let t;switch(e){case cbt:t="Linear";break;case dbt:t="Reinhard";break;case ubt:t="OptimizedCineon";break;case pbt:t="ACESFilmic";break;case fbt:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function _St(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(gl).join(` -`)}function mSt(n){const e=[];for(const t in n){const s=n[t];s!==!1&&e.push("#define "+t+" "+s)}return e.join(` -`)}function hSt(n,e){const t={},s=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function Tb(n){return n.replace(gSt,ySt)}const bSt=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function ySt(n,e){let t=vt[e];if(t===void 0){const s=bSt.get(e);if(s!==void 0)t=vt[s],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,s);else throw new Error("Can not resolve #include <"+e+">")}return Tb(t)}const ESt=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Tw(n){return n.replace(ESt,vSt)}function vSt(n,e,t,s){let r="";for(let i=parseInt(e);i/gm;function Tb(n){return n.replace(vSt,TSt)}const SSt=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function TSt(n,e){let t=vt[e];if(t===void 0){const s=SSt.get(e);if(s!==void 0)t=vt[s],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,s);else throw new Error("Can not resolve #include <"+e+">")}return Tb(t)}const xSt=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Tw(n){return n.replace(xSt,CSt)}function CSt(n,e,t,s){let r="";for(let i=parseInt(e);i0&&(b+=` `),g=[h,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f].filter(gl).join(` `),g.length>0&&(g+=` `)):(b=[xw(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f,t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(gl).join(` -`),g=[h,xw(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+d:"",t.envMap?"#define "+u:"",t.envMap?"#define "+_:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==bi?"#define TONE_MAPPING":"",t.toneMapping!==bi?vt.tonemapping_pars_fragment:"",t.toneMapping!==bi?fSt("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",vt.colorspace_pars_fragment,pSt("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`),g=[h,xw(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,f,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+d:"",t.envMap?"#define "+u:"",t.envMap?"#define "+_:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==bi?"#define TONE_MAPPING":"",t.toneMapping!==bi?vt.tonemapping_pars_fragment:"",t.toneMapping!==bi?gSt("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",vt.colorspace_pars_fragment,hSt("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(gl).join(` `)),o=Tb(o),o=vw(o,t),o=Sw(o,t),a=Tb(a),a=vw(a,t),a=Sw(a,t),o=Tw(o),a=Tw(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(E=`#version 300 es `,b=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` @@ -3941,9 +3941,9 @@ precision `+n.precision+" int;";return n.precision==="highp"?e+=` Program Info Log: `+V+` `+L+` -`+W)}else V!==""?console.warn("THREE.WebGLProgram: Program Info Log:",V):(ee===""||O==="")&&(q=!1);q&&(G.diagnostics={runnable:H,programLog:V,vertexShader:{log:ee,prefix:b},fragmentShader:{log:O,prefix:g}})}r.deleteShader(R),r.deleteShader(w),I=new Dd(r,y),C=hSt(r,y)}let I;this.getUniforms=function(){return I===void 0&&A(this),I};let C;this.getAttributes=function(){return C===void 0&&A(this),C};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(y,lSt)),M},this.destroy=function(){s.releaseStatesOfProgram(this),r.deleteProgram(y),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=cSt++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=R,this.fragmentShader=w,this}let ASt=0;class MSt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,s=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(s),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(i)===!1&&(o.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const s of t)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let s=t.get(e);return s===void 0&&(s=new Set,t.set(e,s)),s}_getShaderStage(e){const t=this.shaderCache;let s=t.get(e);return s===void 0&&(s=new NSt(e),t.set(e,s)),s}}class NSt{constructor(e){this.id=ASt++,this.code=e,this.usedTimes=0}}function OSt(n,e,t,s,r,i,o){const a=new XN,c=new MSt,d=[],u=r.isWebGL2,_=r.logarithmicDepthBuffer,m=r.vertexTextures;let h=r.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function y(C){return C===0?"uv":`uv${C}`}function b(C,M,G,V,ee){const O=V.fog,H=ee.geometry,q=C.isMeshStandardMaterial?V.environment:null,L=(C.isMeshStandardMaterial?t:e).get(C.envMap||q),W=L&&L.mapping===_p?L.image.height:null,se=f[C.type];C.precision!==null&&(h=r.getMaxPrecision(C.precision),h!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",h,"instead."));const oe=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,ye=oe!==void 0?oe.length:0;let xe=0;H.morphAttributes.position!==void 0&&(xe=1),H.morphAttributes.normal!==void 0&&(xe=2),H.morphAttributes.color!==void 0&&(xe=3);let ce,ve,Oe,De;if(se){const wn=Zs[se];ce=wn.vertexShader,ve=wn.fragmentShader}else ce=C.vertexShader,ve=C.fragmentShader,c.update(C),Oe=c.getVertexShaderID(C),De=c.getFragmentShaderID(C);const Q=n.getRenderTarget(),fe=ee.isInstancedMesh===!0,_e=ee.isBatchedMesh===!0,Ae=!!C.map,Ue=!!C.matcap,te=!!L,U=!!C.aoMap,P=!!C.lightMap,Z=!!C.bumpMap,de=!!C.normalMap,pe=!!C.displacementMap,he=!!C.emissiveMap,le=!!C.metalnessMap,Me=!!C.roughnessMap,Re=C.anisotropy>0,ge=C.clearcoat>0,D=C.iridescence>0,N=C.sheen>0,K=C.transmission>0,me=Re&&!!C.anisotropyMap,j=ge&&!!C.clearcoatMap,re=ge&&!!C.clearcoatNormalMap,Ce=ge&&!!C.clearcoatRoughnessMap,we=D&&!!C.iridescenceMap,ke=D&&!!C.iridescenceThicknessMap,We=N&&!!C.sheenColorMap,lt=N&&!!C.sheenRoughnessMap,Pe=!!C.specularMap,Mt=!!C.specularColorMap,et=!!C.specularIntensityMap,tt=K&&!!C.transmissionMap,ze=K&&!!C.thicknessMap,je=!!C.gradientMap,_t=!!C.alphaMap,J=C.alphaTest>0,Qe=!!C.alphaHash,Ge=!!C.extensions,Ne=!!H.attributes.uv1,qe=!!H.attributes.uv2,dt=!!H.attributes.uv3;let Nt=bi;return C.toneMapped&&(Q===null||Q.isXRRenderTarget===!0)&&(Nt=n.toneMapping),{isWebGL2:u,shaderID:se,shaderType:C.type,shaderName:C.name,vertexShader:ce,fragmentShader:ve,defines:C.defines,customVertexShaderID:Oe,customFragmentShaderID:De,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:h,batching:_e,instancing:fe,instancingColor:fe&&ee.instanceColor!==null,supportsVertexTextures:m,outputColorSpace:Q===null?n.outputColorSpace:Q.isXRRenderTarget===!0?Q.texture.colorSpace:Cn,map:Ae,matcap:Ue,envMap:te,envMapMode:te&&L.mapping,envMapCubeUVHeight:W,aoMap:U,lightMap:P,bumpMap:Z,normalMap:de,displacementMap:m&&pe,emissiveMap:he,normalMapObjectSpace:de&&C.normalMapType===Rbt,normalMapTangentSpace:de&&C.normalMapType===py,metalnessMap:le,roughnessMap:Me,anisotropy:Re,anisotropyMap:me,clearcoat:ge,clearcoatMap:j,clearcoatNormalMap:re,clearcoatRoughnessMap:Ce,iridescence:D,iridescenceMap:we,iridescenceThicknessMap:ke,sheen:N,sheenColorMap:We,sheenRoughnessMap:lt,specularMap:Pe,specularColorMap:Mt,specularIntensityMap:et,transmission:K,transmissionMap:tt,thicknessMap:ze,gradientMap:je,opaque:C.transparent===!1&&C.blending===ia,alphaMap:_t,alphaTest:J,alphaHash:Qe,combine:C.combine,mapUv:Ae&&y(C.map.channel),aoMapUv:U&&y(C.aoMap.channel),lightMapUv:P&&y(C.lightMap.channel),bumpMapUv:Z&&y(C.bumpMap.channel),normalMapUv:de&&y(C.normalMap.channel),displacementMapUv:pe&&y(C.displacementMap.channel),emissiveMapUv:he&&y(C.emissiveMap.channel),metalnessMapUv:le&&y(C.metalnessMap.channel),roughnessMapUv:Me&&y(C.roughnessMap.channel),anisotropyMapUv:me&&y(C.anisotropyMap.channel),clearcoatMapUv:j&&y(C.clearcoatMap.channel),clearcoatNormalMapUv:re&&y(C.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ce&&y(C.clearcoatRoughnessMap.channel),iridescenceMapUv:we&&y(C.iridescenceMap.channel),iridescenceThicknessMapUv:ke&&y(C.iridescenceThicknessMap.channel),sheenColorMapUv:We&&y(C.sheenColorMap.channel),sheenRoughnessMapUv:lt&&y(C.sheenRoughnessMap.channel),specularMapUv:Pe&&y(C.specularMap.channel),specularColorMapUv:Mt&&y(C.specularColorMap.channel),specularIntensityMapUv:et&&y(C.specularIntensityMap.channel),transmissionMapUv:tt&&y(C.transmissionMap.channel),thicknessMapUv:ze&&y(C.thicknessMap.channel),alphaMapUv:_t&&y(C.alphaMap.channel),vertexTangents:!!H.attributes.tangent&&(de||Re),vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,vertexUv1s:Ne,vertexUv2s:qe,vertexUv3s:dt,pointsUvs:ee.isPoints===!0&&!!H.attributes.uv&&(Ae||_t),fog:!!O,useFog:C.fog===!0,fogExp2:O&&O.isFogExp2,flatShading:C.flatShading===!0,sizeAttenuation:C.sizeAttenuation===!0,logarithmicDepthBuffer:_,skinning:ee.isSkinnedMesh===!0,morphTargets:H.morphAttributes.position!==void 0,morphNormals:H.morphAttributes.normal!==void 0,morphColors:H.morphAttributes.color!==void 0,morphTargetsCount:ye,morphTextureStride:xe,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:C.dithering,shadowMapEnabled:n.shadowMap.enabled&&G.length>0,shadowMapType:n.shadowMap.type,toneMapping:Nt,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Ae&&C.map.isVideoTexture===!0&&Lt.getTransfer(C.map.colorSpace)===jt,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===Js,flipSided:C.side===Zn,useDepthPacking:C.depthPacking>=0,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionDerivatives:Ge&&C.extensions.derivatives===!0,extensionFragDepth:Ge&&C.extensions.fragDepth===!0,extensionDrawBuffers:Ge&&C.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ge&&C.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:u||s.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||s.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||s.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:s.has("KHR_parallel_shader_compile"),customProgramCacheKey:C.customProgramCacheKey()}}function g(C){const M=[];if(C.shaderID?M.push(C.shaderID):(M.push(C.customVertexShaderID),M.push(C.customFragmentShaderID)),C.defines!==void 0)for(const G in C.defines)M.push(G),M.push(C.defines[G]);return C.isRawShaderMaterial===!1&&(E(M,C),v(M,C),M.push(n.outputColorSpace)),M.push(C.customProgramCacheKey),M.join()}function E(C,M){C.push(M.precision),C.push(M.outputColorSpace),C.push(M.envMapMode),C.push(M.envMapCubeUVHeight),C.push(M.mapUv),C.push(M.alphaMapUv),C.push(M.lightMapUv),C.push(M.aoMapUv),C.push(M.bumpMapUv),C.push(M.normalMapUv),C.push(M.displacementMapUv),C.push(M.emissiveMapUv),C.push(M.metalnessMapUv),C.push(M.roughnessMapUv),C.push(M.anisotropyMapUv),C.push(M.clearcoatMapUv),C.push(M.clearcoatNormalMapUv),C.push(M.clearcoatRoughnessMapUv),C.push(M.iridescenceMapUv),C.push(M.iridescenceThicknessMapUv),C.push(M.sheenColorMapUv),C.push(M.sheenRoughnessMapUv),C.push(M.specularMapUv),C.push(M.specularColorMapUv),C.push(M.specularIntensityMapUv),C.push(M.transmissionMapUv),C.push(M.thicknessMapUv),C.push(M.combine),C.push(M.fogExp2),C.push(M.sizeAttenuation),C.push(M.morphTargetsCount),C.push(M.morphAttributeCount),C.push(M.numDirLights),C.push(M.numPointLights),C.push(M.numSpotLights),C.push(M.numSpotLightMaps),C.push(M.numHemiLights),C.push(M.numRectAreaLights),C.push(M.numDirLightShadows),C.push(M.numPointLightShadows),C.push(M.numSpotLightShadows),C.push(M.numSpotLightShadowsWithMaps),C.push(M.numLightProbes),C.push(M.shadowMapType),C.push(M.toneMapping),C.push(M.numClippingPlanes),C.push(M.numClipIntersection),C.push(M.depthPacking)}function v(C,M){a.disableAll(),M.isWebGL2&&a.enable(0),M.supportsVertexTextures&&a.enable(1),M.instancing&&a.enable(2),M.instancingColor&&a.enable(3),M.matcap&&a.enable(4),M.envMap&&a.enable(5),M.normalMapObjectSpace&&a.enable(6),M.normalMapTangentSpace&&a.enable(7),M.clearcoat&&a.enable(8),M.iridescence&&a.enable(9),M.alphaTest&&a.enable(10),M.vertexColors&&a.enable(11),M.vertexAlphas&&a.enable(12),M.vertexUv1s&&a.enable(13),M.vertexUv2s&&a.enable(14),M.vertexUv3s&&a.enable(15),M.vertexTangents&&a.enable(16),M.anisotropy&&a.enable(17),M.alphaHash&&a.enable(18),M.batching&&a.enable(19),C.push(a.mask),a.disableAll(),M.fog&&a.enable(0),M.useFog&&a.enable(1),M.flatShading&&a.enable(2),M.logarithmicDepthBuffer&&a.enable(3),M.skinning&&a.enable(4),M.morphTargets&&a.enable(5),M.morphNormals&&a.enable(6),M.morphColors&&a.enable(7),M.premultipliedAlpha&&a.enable(8),M.shadowMapEnabled&&a.enable(9),M.useLegacyLights&&a.enable(10),M.doubleSided&&a.enable(11),M.flipSided&&a.enable(12),M.useDepthPacking&&a.enable(13),M.dithering&&a.enable(14),M.transmission&&a.enable(15),M.sheen&&a.enable(16),M.opaque&&a.enable(17),M.pointsUvs&&a.enable(18),M.decodeVideoTexture&&a.enable(19),C.push(a.mask)}function S(C){const M=f[C.type];let G;if(M){const V=Zs[M];G=_0t.clone(V.uniforms)}else G=C.uniforms;return G}function R(C,M){let G;for(let V=0,ee=d.length;V0?s.push(g):h.transparent===!0?r.push(g):t.push(g)}function c(_,m,h,f,y,b){const g=o(_,m,h,f,y,b);h.transmission>0?s.unshift(g):h.transparent===!0?r.unshift(g):t.unshift(g)}function d(_,m){t.length>1&&t.sort(_||kSt),s.length>1&&s.sort(m||Cw),r.length>1&&r.sort(m||Cw)}function u(){for(let _=e,m=n.length;_=i.length?(o=new ww,i.push(o)):o=i[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function LSt(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new ie,color:new pt};break;case"SpotLight":t={position:new ie,direction:new ie,color:new pt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new ie,color:new pt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new ie,skyColor:new pt,groundColor:new pt};break;case"RectAreaLight":t={color:new pt,position:new ie,halfWidth:new ie,halfHeight:new ie};break}return n[e.id]=t,t}}}function PSt(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let FSt=0;function USt(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function BSt(n,e){const t=new LSt,s=PSt(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)r.probe.push(new ie);const i=new ie,o=new xt,a=new xt;function c(u,_){let m=0,h=0,f=0;for(let V=0;V<9;V++)r.probe[V].set(0,0,0);let y=0,b=0,g=0,E=0,v=0,S=0,R=0,w=0,A=0,I=0,C=0;u.sort(USt);const M=_===!0?Math.PI:1;for(let V=0,ee=u.length;V0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=$e.LTC_FLOAT_1,r.rectAreaLTC2=$e.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=$e.LTC_HALF_1,r.rectAreaLTC2=$e.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=m,r.ambient[1]=h,r.ambient[2]=f;const G=r.hash;(G.directionalLength!==y||G.pointLength!==b||G.spotLength!==g||G.rectAreaLength!==E||G.hemiLength!==v||G.numDirectionalShadows!==S||G.numPointShadows!==R||G.numSpotShadows!==w||G.numSpotMaps!==A||G.numLightProbes!==C)&&(r.directional.length=y,r.spot.length=g,r.rectArea.length=E,r.point.length=b,r.hemi.length=v,r.directionalShadow.length=S,r.directionalShadowMap.length=S,r.pointShadow.length=R,r.pointShadowMap.length=R,r.spotShadow.length=w,r.spotShadowMap.length=w,r.directionalShadowMatrix.length=S,r.pointShadowMatrix.length=R,r.spotLightMatrix.length=w+A-I,r.spotLightMap.length=A,r.numSpotLightShadowsWithMaps=I,r.numLightProbes=C,G.directionalLength=y,G.pointLength=b,G.spotLength=g,G.rectAreaLength=E,G.hemiLength=v,G.numDirectionalShadows=S,G.numPointShadows=R,G.numSpotShadows=w,G.numSpotMaps=A,G.numLightProbes=C,r.version=FSt++)}function d(u,_){let m=0,h=0,f=0,y=0,b=0;const g=_.matrixWorldInverse;for(let E=0,v=u.length;E=a.length?(c=new Rw(n,e),a.push(c)):c=a[o],c}function r(){t=new WeakMap}return{get:s,dispose:r}}class VSt extends Vs{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Cbt,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class zSt extends Vs{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const HSt=`void main() { +`+W)}else V!==""?console.warn("THREE.WebGLProgram: Program Info Log:",V):(ee===""||O==="")&&(q=!1);q&&(G.diagnostics={runnable:H,programLog:V,vertexShader:{log:ee,prefix:b},fragmentShader:{log:O,prefix:g}})}r.deleteShader(R),r.deleteShader(w),I=new Dd(r,y),C=ESt(r,y)}let I;this.getUniforms=function(){return I===void 0&&A(this),I};let C;this.getAttributes=function(){return C===void 0&&A(this),C};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(y,pSt)),M},this.destroy=function(){s.releaseStatesOfProgram(this),r.deleteProgram(y),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=fSt++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=R,this.fragmentShader=w,this}let ISt=0;class kSt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,s=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(s),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(i)===!1&&(o.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const s of t)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let s=t.get(e);return s===void 0&&(s=new Set,t.set(e,s)),s}_getShaderStage(e){const t=this.shaderCache;let s=t.get(e);return s===void 0&&(s=new DSt(e),t.set(e,s)),s}}class DSt{constructor(e){this.id=ISt++,this.code=e,this.usedTimes=0}}function LSt(n,e,t,s,r,i,o){const a=new XN,c=new kSt,d=[],u=r.isWebGL2,_=r.logarithmicDepthBuffer,m=r.vertexTextures;let h=r.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function y(C){return C===0?"uv":`uv${C}`}function b(C,M,G,V,ee){const O=V.fog,H=ee.geometry,q=C.isMeshStandardMaterial?V.environment:null,L=(C.isMeshStandardMaterial?t:e).get(C.envMap||q),W=L&&L.mapping===_p?L.image.height:null,se=f[C.type];C.precision!==null&&(h=r.getMaxPrecision(C.precision),h!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",h,"instead."));const oe=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,ye=oe!==void 0?oe.length:0;let xe=0;H.morphAttributes.position!==void 0&&(xe=1),H.morphAttributes.normal!==void 0&&(xe=2),H.morphAttributes.color!==void 0&&(xe=3);let ce,ve,Oe,De;if(se){const wn=Zs[se];ce=wn.vertexShader,ve=wn.fragmentShader}else ce=C.vertexShader,ve=C.fragmentShader,c.update(C),Oe=c.getVertexShaderID(C),De=c.getFragmentShaderID(C);const Q=n.getRenderTarget(),fe=ee.isInstancedMesh===!0,_e=ee.isBatchedMesh===!0,Ae=!!C.map,Ue=!!C.matcap,te=!!L,U=!!C.aoMap,P=!!C.lightMap,Z=!!C.bumpMap,de=!!C.normalMap,pe=!!C.displacementMap,he=!!C.emissiveMap,le=!!C.metalnessMap,Me=!!C.roughnessMap,Re=C.anisotropy>0,ge=C.clearcoat>0,D=C.iridescence>0,N=C.sheen>0,K=C.transmission>0,me=Re&&!!C.anisotropyMap,j=ge&&!!C.clearcoatMap,re=ge&&!!C.clearcoatNormalMap,Ce=ge&&!!C.clearcoatRoughnessMap,we=D&&!!C.iridescenceMap,ke=D&&!!C.iridescenceThicknessMap,We=N&&!!C.sheenColorMap,lt=N&&!!C.sheenRoughnessMap,Pe=!!C.specularMap,Mt=!!C.specularColorMap,et=!!C.specularIntensityMap,tt=K&&!!C.transmissionMap,ze=K&&!!C.thicknessMap,je=!!C.gradientMap,_t=!!C.alphaMap,J=C.alphaTest>0,Qe=!!C.alphaHash,Ge=!!C.extensions,Ne=!!H.attributes.uv1,qe=!!H.attributes.uv2,dt=!!H.attributes.uv3;let Nt=bi;return C.toneMapped&&(Q===null||Q.isXRRenderTarget===!0)&&(Nt=n.toneMapping),{isWebGL2:u,shaderID:se,shaderType:C.type,shaderName:C.name,vertexShader:ce,fragmentShader:ve,defines:C.defines,customVertexShaderID:Oe,customFragmentShaderID:De,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:h,batching:_e,instancing:fe,instancingColor:fe&&ee.instanceColor!==null,supportsVertexTextures:m,outputColorSpace:Q===null?n.outputColorSpace:Q.isXRRenderTarget===!0?Q.texture.colorSpace:Cn,map:Ae,matcap:Ue,envMap:te,envMapMode:te&&L.mapping,envMapCubeUVHeight:W,aoMap:U,lightMap:P,bumpMap:Z,normalMap:de,displacementMap:m&&pe,emissiveMap:he,normalMapObjectSpace:de&&C.normalMapType===Obt,normalMapTangentSpace:de&&C.normalMapType===py,metalnessMap:le,roughnessMap:Me,anisotropy:Re,anisotropyMap:me,clearcoat:ge,clearcoatMap:j,clearcoatNormalMap:re,clearcoatRoughnessMap:Ce,iridescence:D,iridescenceMap:we,iridescenceThicknessMap:ke,sheen:N,sheenColorMap:We,sheenRoughnessMap:lt,specularMap:Pe,specularColorMap:Mt,specularIntensityMap:et,transmission:K,transmissionMap:tt,thicknessMap:ze,gradientMap:je,opaque:C.transparent===!1&&C.blending===ia,alphaMap:_t,alphaTest:J,alphaHash:Qe,combine:C.combine,mapUv:Ae&&y(C.map.channel),aoMapUv:U&&y(C.aoMap.channel),lightMapUv:P&&y(C.lightMap.channel),bumpMapUv:Z&&y(C.bumpMap.channel),normalMapUv:de&&y(C.normalMap.channel),displacementMapUv:pe&&y(C.displacementMap.channel),emissiveMapUv:he&&y(C.emissiveMap.channel),metalnessMapUv:le&&y(C.metalnessMap.channel),roughnessMapUv:Me&&y(C.roughnessMap.channel),anisotropyMapUv:me&&y(C.anisotropyMap.channel),clearcoatMapUv:j&&y(C.clearcoatMap.channel),clearcoatNormalMapUv:re&&y(C.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ce&&y(C.clearcoatRoughnessMap.channel),iridescenceMapUv:we&&y(C.iridescenceMap.channel),iridescenceThicknessMapUv:ke&&y(C.iridescenceThicknessMap.channel),sheenColorMapUv:We&&y(C.sheenColorMap.channel),sheenRoughnessMapUv:lt&&y(C.sheenRoughnessMap.channel),specularMapUv:Pe&&y(C.specularMap.channel),specularColorMapUv:Mt&&y(C.specularColorMap.channel),specularIntensityMapUv:et&&y(C.specularIntensityMap.channel),transmissionMapUv:tt&&y(C.transmissionMap.channel),thicknessMapUv:ze&&y(C.thicknessMap.channel),alphaMapUv:_t&&y(C.alphaMap.channel),vertexTangents:!!H.attributes.tangent&&(de||Re),vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,vertexUv1s:Ne,vertexUv2s:qe,vertexUv3s:dt,pointsUvs:ee.isPoints===!0&&!!H.attributes.uv&&(Ae||_t),fog:!!O,useFog:C.fog===!0,fogExp2:O&&O.isFogExp2,flatShading:C.flatShading===!0,sizeAttenuation:C.sizeAttenuation===!0,logarithmicDepthBuffer:_,skinning:ee.isSkinnedMesh===!0,morphTargets:H.morphAttributes.position!==void 0,morphNormals:H.morphAttributes.normal!==void 0,morphColors:H.morphAttributes.color!==void 0,morphTargetsCount:ye,morphTextureStride:xe,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:C.dithering,shadowMapEnabled:n.shadowMap.enabled&&G.length>0,shadowMapType:n.shadowMap.type,toneMapping:Nt,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Ae&&C.map.isVideoTexture===!0&&Lt.getTransfer(C.map.colorSpace)===jt,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===Js,flipSided:C.side===Zn,useDepthPacking:C.depthPacking>=0,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionDerivatives:Ge&&C.extensions.derivatives===!0,extensionFragDepth:Ge&&C.extensions.fragDepth===!0,extensionDrawBuffers:Ge&&C.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ge&&C.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:u||s.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||s.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||s.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:s.has("KHR_parallel_shader_compile"),customProgramCacheKey:C.customProgramCacheKey()}}function g(C){const M=[];if(C.shaderID?M.push(C.shaderID):(M.push(C.customVertexShaderID),M.push(C.customFragmentShaderID)),C.defines!==void 0)for(const G in C.defines)M.push(G),M.push(C.defines[G]);return C.isRawShaderMaterial===!1&&(E(M,C),v(M,C),M.push(n.outputColorSpace)),M.push(C.customProgramCacheKey),M.join()}function E(C,M){C.push(M.precision),C.push(M.outputColorSpace),C.push(M.envMapMode),C.push(M.envMapCubeUVHeight),C.push(M.mapUv),C.push(M.alphaMapUv),C.push(M.lightMapUv),C.push(M.aoMapUv),C.push(M.bumpMapUv),C.push(M.normalMapUv),C.push(M.displacementMapUv),C.push(M.emissiveMapUv),C.push(M.metalnessMapUv),C.push(M.roughnessMapUv),C.push(M.anisotropyMapUv),C.push(M.clearcoatMapUv),C.push(M.clearcoatNormalMapUv),C.push(M.clearcoatRoughnessMapUv),C.push(M.iridescenceMapUv),C.push(M.iridescenceThicknessMapUv),C.push(M.sheenColorMapUv),C.push(M.sheenRoughnessMapUv),C.push(M.specularMapUv),C.push(M.specularColorMapUv),C.push(M.specularIntensityMapUv),C.push(M.transmissionMapUv),C.push(M.thicknessMapUv),C.push(M.combine),C.push(M.fogExp2),C.push(M.sizeAttenuation),C.push(M.morphTargetsCount),C.push(M.morphAttributeCount),C.push(M.numDirLights),C.push(M.numPointLights),C.push(M.numSpotLights),C.push(M.numSpotLightMaps),C.push(M.numHemiLights),C.push(M.numRectAreaLights),C.push(M.numDirLightShadows),C.push(M.numPointLightShadows),C.push(M.numSpotLightShadows),C.push(M.numSpotLightShadowsWithMaps),C.push(M.numLightProbes),C.push(M.shadowMapType),C.push(M.toneMapping),C.push(M.numClippingPlanes),C.push(M.numClipIntersection),C.push(M.depthPacking)}function v(C,M){a.disableAll(),M.isWebGL2&&a.enable(0),M.supportsVertexTextures&&a.enable(1),M.instancing&&a.enable(2),M.instancingColor&&a.enable(3),M.matcap&&a.enable(4),M.envMap&&a.enable(5),M.normalMapObjectSpace&&a.enable(6),M.normalMapTangentSpace&&a.enable(7),M.clearcoat&&a.enable(8),M.iridescence&&a.enable(9),M.alphaTest&&a.enable(10),M.vertexColors&&a.enable(11),M.vertexAlphas&&a.enable(12),M.vertexUv1s&&a.enable(13),M.vertexUv2s&&a.enable(14),M.vertexUv3s&&a.enable(15),M.vertexTangents&&a.enable(16),M.anisotropy&&a.enable(17),M.alphaHash&&a.enable(18),M.batching&&a.enable(19),C.push(a.mask),a.disableAll(),M.fog&&a.enable(0),M.useFog&&a.enable(1),M.flatShading&&a.enable(2),M.logarithmicDepthBuffer&&a.enable(3),M.skinning&&a.enable(4),M.morphTargets&&a.enable(5),M.morphNormals&&a.enable(6),M.morphColors&&a.enable(7),M.premultipliedAlpha&&a.enable(8),M.shadowMapEnabled&&a.enable(9),M.useLegacyLights&&a.enable(10),M.doubleSided&&a.enable(11),M.flipSided&&a.enable(12),M.useDepthPacking&&a.enable(13),M.dithering&&a.enable(14),M.transmission&&a.enable(15),M.sheen&&a.enable(16),M.opaque&&a.enable(17),M.pointsUvs&&a.enable(18),M.decodeVideoTexture&&a.enable(19),C.push(a.mask)}function S(C){const M=f[C.type];let G;if(M){const V=Zs[M];G=b0t.clone(V.uniforms)}else G=C.uniforms;return G}function R(C,M){let G;for(let V=0,ee=d.length;V0?s.push(g):h.transparent===!0?r.push(g):t.push(g)}function c(_,m,h,f,y,b){const g=o(_,m,h,f,y,b);h.transmission>0?s.unshift(g):h.transparent===!0?r.unshift(g):t.unshift(g)}function d(_,m){t.length>1&&t.sort(_||FSt),s.length>1&&s.sort(m||Cw),r.length>1&&r.sort(m||Cw)}function u(){for(let _=e,m=n.length;_=i.length?(o=new ww,i.push(o)):o=i[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function BSt(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new ie,color:new pt};break;case"SpotLight":t={position:new ie,direction:new ie,color:new pt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new ie,color:new pt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new ie,skyColor:new pt,groundColor:new pt};break;case"RectAreaLight":t={color:new pt,position:new ie,halfWidth:new ie,halfHeight:new ie};break}return n[e.id]=t,t}}}function GSt(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let VSt=0;function zSt(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function HSt(n,e){const t=new BSt,s=GSt(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)r.probe.push(new ie);const i=new ie,o=new xt,a=new xt;function c(u,_){let m=0,h=0,f=0;for(let V=0;V<9;V++)r.probe[V].set(0,0,0);let y=0,b=0,g=0,E=0,v=0,S=0,R=0,w=0,A=0,I=0,C=0;u.sort(zSt);const M=_===!0?Math.PI:1;for(let V=0,ee=u.length;V0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=$e.LTC_FLOAT_1,r.rectAreaLTC2=$e.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=$e.LTC_HALF_1,r.rectAreaLTC2=$e.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=m,r.ambient[1]=h,r.ambient[2]=f;const G=r.hash;(G.directionalLength!==y||G.pointLength!==b||G.spotLength!==g||G.rectAreaLength!==E||G.hemiLength!==v||G.numDirectionalShadows!==S||G.numPointShadows!==R||G.numSpotShadows!==w||G.numSpotMaps!==A||G.numLightProbes!==C)&&(r.directional.length=y,r.spot.length=g,r.rectArea.length=E,r.point.length=b,r.hemi.length=v,r.directionalShadow.length=S,r.directionalShadowMap.length=S,r.pointShadow.length=R,r.pointShadowMap.length=R,r.spotShadow.length=w,r.spotShadowMap.length=w,r.directionalShadowMatrix.length=S,r.pointShadowMatrix.length=R,r.spotLightMatrix.length=w+A-I,r.spotLightMap.length=A,r.numSpotLightShadowsWithMaps=I,r.numLightProbes=C,G.directionalLength=y,G.pointLength=b,G.spotLength=g,G.rectAreaLength=E,G.hemiLength=v,G.numDirectionalShadows=S,G.numPointShadows=R,G.numSpotShadows=w,G.numSpotMaps=A,G.numLightProbes=C,r.version=VSt++)}function d(u,_){let m=0,h=0,f=0,y=0,b=0;const g=_.matrixWorldInverse;for(let E=0,v=u.length;E=a.length?(c=new Rw(n,e),a.push(c)):c=a[o],c}function r(){t=new WeakMap}return{get:s,dispose:r}}class YSt extends Vs{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Mbt,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class $St extends Vs{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const WSt=`void main() { gl_Position = vec4( position, 1.0 ); -}`,qSt=`uniform sampler2D shadow_pass; +}`,KSt=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3969,12 +3969,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function YSt(n,e,t){let s=new my;const r=new Rt,i=new Rt,o=new Wt,a=new VSt({depthPacking:wbt}),c=new zSt,d={},u=t.maxTextureSize,_={[Fr]:Zn,[Zn]:Fr,[Js]:Js},m=new ho({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Rt},radius:{value:4}},vertexShader:HSt,fragmentShader:qSt}),h=m.clone();h.defines.HORIZONTAL_PASS=1;const f=new fr;f.setAttribute("position",new zn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new Vn(f,m),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=DN;let g=this.type;this.render=function(R,w,A){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||R.length===0)return;const I=n.getRenderTarget(),C=n.getActiveCubeFace(),M=n.getActiveMipmapLevel(),G=n.state;G.setBlending(gi),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const V=g!==xr&&this.type===xr,ee=g===xr&&this.type!==xr;for(let O=0,H=R.length;Ou||r.y>u)&&(r.x>u&&(i.x=Math.floor(u/W.x),r.x=i.x*W.x,L.mapSize.x=i.x),r.y>u&&(i.y=Math.floor(u/W.y),r.y=i.y*W.y,L.mapSize.y=i.y)),L.map===null||V===!0||ee===!0){const oe=this.type!==xr?{minFilter:gn,magFilter:gn}:{};L.map!==null&&L.map.dispose(),L.map=new mo(r.x,r.y,oe),L.map.texture.name=q.name+".shadowMap",L.camera.updateProjectionMatrix()}n.setRenderTarget(L.map),n.clear();const se=L.getViewportCount();for(let oe=0;oe0||w.map&&w.alphaTest>0){const G=C.uuid,V=w.uuid;let ee=d[G];ee===void 0&&(ee={},d[G]=ee);let O=ee[V];O===void 0&&(O=C.clone(),ee[V]=O),C=O}if(C.visible=w.visible,C.wireframe=w.wireframe,I===xr?C.side=w.shadowSide!==null?w.shadowSide:w.side:C.side=w.shadowSide!==null?w.shadowSide:_[w.side],C.alphaMap=w.alphaMap,C.alphaTest=w.alphaTest,C.map=w.map,C.clipShadows=w.clipShadows,C.clippingPlanes=w.clippingPlanes,C.clipIntersection=w.clipIntersection,C.displacementMap=w.displacementMap,C.displacementScale=w.displacementScale,C.displacementBias=w.displacementBias,C.wireframeLinewidth=w.wireframeLinewidth,C.linewidth=w.linewidth,A.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const G=n.properties.get(C);G.light=A}return C}function S(R,w,A,I,C){if(R.visible===!1)return;if(R.layers.test(w.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&C===xr)&&(!R.frustumCulled||s.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,R.matrixWorld);const V=e.update(R),ee=R.material;if(Array.isArray(ee)){const O=V.groups;for(let H=0,q=O.length;H=1):oe.indexOf("OpenGL ES")!==-1&&(se=parseFloat(/^OpenGL ES (\d)/.exec(oe)[1]),W=se>=2);let ye=null,xe={};const ce=n.getParameter(n.SCISSOR_BOX),ve=n.getParameter(n.VIEWPORT),Oe=new Wt().fromArray(ce),De=new Wt().fromArray(ve);function Q(J,Qe,Ge,Ne){const qe=new Uint8Array(4),dt=n.createTexture();n.bindTexture(J,dt),n.texParameteri(J,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(J,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Nt=0;Nt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let y;const b=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function E(D,N){return g?new OffscreenCanvas(D,N):Zl("canvas")}function v(D,N,K,me){let j=1;if((D.width>me||D.height>me)&&(j=me/Math.max(D.width,D.height)),j<1||N===!0)if(typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&D instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&D instanceof ImageBitmap){const re=N?Su:Math.floor,Ce=re(j*D.width),we=re(j*D.height);y===void 0&&(y=E(Ce,we));const ke=K?E(Ce,we):y;return ke.width=Ce,ke.height=we,ke.getContext("2d").drawImage(D,0,0,Ce,we),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+D.width+"x"+D.height+") to ("+Ce+"x"+we+")."),ke}else return"data"in D&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+D.width+"x"+D.height+")."),D;return D}function S(D){return Sb(D.width)&&Sb(D.height)}function R(D){return a?!1:D.wrapS!==hs||D.wrapT!==hs||D.minFilter!==gn&&D.minFilter!==Wn}function w(D,N){return D.generateMipmaps&&N&&D.minFilter!==gn&&D.minFilter!==Wn}function A(D){n.generateMipmap(D)}function I(D,N,K,me,j=!1){if(a===!1)return N;if(D!==null){if(n[D]!==void 0)return n[D];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+D+"'")}let re=N;if(N===n.RED&&(K===n.FLOAT&&(re=n.R32F),K===n.HALF_FLOAT&&(re=n.R16F),K===n.UNSIGNED_BYTE&&(re=n.R8)),N===n.RED_INTEGER&&(K===n.UNSIGNED_BYTE&&(re=n.R8UI),K===n.UNSIGNED_SHORT&&(re=n.R16UI),K===n.UNSIGNED_INT&&(re=n.R32UI),K===n.BYTE&&(re=n.R8I),K===n.SHORT&&(re=n.R16I),K===n.INT&&(re=n.R32I)),N===n.RG&&(K===n.FLOAT&&(re=n.RG32F),K===n.HALF_FLOAT&&(re=n.RG16F),K===n.UNSIGNED_BYTE&&(re=n.RG8)),N===n.RGBA){const Ce=j?bu:Lt.getTransfer(me);K===n.FLOAT&&(re=n.RGBA32F),K===n.HALF_FLOAT&&(re=n.RGBA16F),K===n.UNSIGNED_BYTE&&(re=Ce===jt?n.SRGB8_ALPHA8:n.RGBA8),K===n.UNSIGNED_SHORT_4_4_4_4&&(re=n.RGBA4),K===n.UNSIGNED_SHORT_5_5_5_1&&(re=n.RGB5_A1)}return(re===n.R16F||re===n.R32F||re===n.RG16F||re===n.RG32F||re===n.RGBA16F||re===n.RGBA32F)&&e.get("EXT_color_buffer_float"),re}function C(D,N,K){return w(D,K)===!0||D.isFramebufferTexture&&D.minFilter!==gn&&D.minFilter!==Wn?Math.log2(Math.max(N.width,N.height))+1:D.mipmaps!==void 0&&D.mipmaps.length>0?D.mipmaps.length:D.isCompressedTexture&&Array.isArray(D.image)?N.mipmaps.length:1}function M(D){return D===gn||D===bb||D===kd?n.NEAREST:n.LINEAR}function G(D){const N=D.target;N.removeEventListener("dispose",G),ee(N),N.isVideoTexture&&f.delete(N)}function V(D){const N=D.target;N.removeEventListener("dispose",V),H(N)}function ee(D){const N=s.get(D);if(N.__webglInit===void 0)return;const K=D.source,me=b.get(K);if(me){const j=me[N.__cacheKey];j.usedTimes--,j.usedTimes===0&&O(D),Object.keys(me).length===0&&b.delete(K)}s.remove(D)}function O(D){const N=s.get(D);n.deleteTexture(N.__webglTexture);const K=D.source,me=b.get(K);delete me[N.__cacheKey],o.memory.textures--}function H(D){const N=D.texture,K=s.get(D),me=s.get(N);if(me.__webglTexture!==void 0&&(n.deleteTexture(me.__webglTexture),o.memory.textures--),D.depthTexture&&D.depthTexture.dispose(),D.isWebGLCubeRenderTarget)for(let j=0;j<6;j++){if(Array.isArray(K.__webglFramebuffer[j]))for(let re=0;re=c&&console.warn("THREE.WebGLTextures: Trying to use "+D+" texture units while this GPU supports only "+c),q+=1,D}function se(D){const N=[];return N.push(D.wrapS),N.push(D.wrapT),N.push(D.wrapR||0),N.push(D.magFilter),N.push(D.minFilter),N.push(D.anisotropy),N.push(D.internalFormat),N.push(D.format),N.push(D.type),N.push(D.generateMipmaps),N.push(D.premultiplyAlpha),N.push(D.flipY),N.push(D.unpackAlignment),N.push(D.colorSpace),N.join()}function oe(D,N){const K=s.get(D);if(D.isVideoTexture&&Re(D),D.isRenderTargetTexture===!1&&D.version>0&&K.__version!==D.version){const me=D.image;if(me===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(me.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{_e(K,D,N);return}}t.bindTexture(n.TEXTURE_2D,K.__webglTexture,n.TEXTURE0+N)}function ye(D,N){const K=s.get(D);if(D.version>0&&K.__version!==D.version){_e(K,D,N);return}t.bindTexture(n.TEXTURE_2D_ARRAY,K.__webglTexture,n.TEXTURE0+N)}function xe(D,N){const K=s.get(D);if(D.version>0&&K.__version!==D.version){_e(K,D,N);return}t.bindTexture(n.TEXTURE_3D,K.__webglTexture,n.TEXTURE0+N)}function ce(D,N){const K=s.get(D);if(D.version>0&&K.__version!==D.version){Ae(K,D,N);return}t.bindTexture(n.TEXTURE_CUBE_MAP,K.__webglTexture,n.TEXTURE0+N)}const ve={[va]:n.REPEAT,[hs]:n.CLAMP_TO_EDGE,[gu]:n.MIRRORED_REPEAT},Oe={[gn]:n.NEAREST,[bb]:n.NEAREST_MIPMAP_NEAREST,[kd]:n.NEAREST_MIPMAP_LINEAR,[Wn]:n.LINEAR,[PN]:n.LINEAR_MIPMAP_NEAREST,[_o]:n.LINEAR_MIPMAP_LINEAR},De={[Abt]:n.NEVER,[Dbt]:n.ALWAYS,[Mbt]:n.LESS,[$N]:n.LEQUAL,[Nbt]:n.EQUAL,[kbt]:n.GEQUAL,[Obt]:n.GREATER,[Ibt]:n.NOTEQUAL};function Q(D,N,K){if(K?(n.texParameteri(D,n.TEXTURE_WRAP_S,ve[N.wrapS]),n.texParameteri(D,n.TEXTURE_WRAP_T,ve[N.wrapT]),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,ve[N.wrapR]),n.texParameteri(D,n.TEXTURE_MAG_FILTER,Oe[N.magFilter]),n.texParameteri(D,n.TEXTURE_MIN_FILTER,Oe[N.minFilter])):(n.texParameteri(D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(N.wrapS!==hs||N.wrapT!==hs)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(D,n.TEXTURE_MAG_FILTER,M(N.magFilter)),n.texParameteri(D,n.TEXTURE_MIN_FILTER,M(N.minFilter)),N.minFilter!==gn&&N.minFilter!==Wn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),N.compareFunction&&(n.texParameteri(D,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(D,n.TEXTURE_COMPARE_FUNC,De[N.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const me=e.get("EXT_texture_filter_anisotropic");if(N.magFilter===gn||N.minFilter!==kd&&N.minFilter!==_o||N.type===Ar&&e.has("OES_texture_float_linear")===!1||a===!1&&N.type===Ql&&e.has("OES_texture_half_float_linear")===!1)return;(N.anisotropy>1||s.get(N).__currentAnisotropy)&&(n.texParameterf(D,me.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,r.getMaxAnisotropy())),s.get(N).__currentAnisotropy=N.anisotropy)}}function fe(D,N){let K=!1;D.__webglInit===void 0&&(D.__webglInit=!0,N.addEventListener("dispose",G));const me=N.source;let j=b.get(me);j===void 0&&(j={},b.set(me,j));const re=se(N);if(re!==D.__cacheKey){j[re]===void 0&&(j[re]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,K=!0),j[re].usedTimes++;const Ce=j[D.__cacheKey];Ce!==void 0&&(j[D.__cacheKey].usedTimes--,Ce.usedTimes===0&&O(N)),D.__cacheKey=re,D.__webglTexture=j[re].texture}return K}function _e(D,N,K){let me=n.TEXTURE_2D;(N.isDataArrayTexture||N.isCompressedArrayTexture)&&(me=n.TEXTURE_2D_ARRAY),N.isData3DTexture&&(me=n.TEXTURE_3D);const j=fe(D,N),re=N.source;t.bindTexture(me,D.__webglTexture,n.TEXTURE0+K);const Ce=s.get(re);if(re.version!==Ce.__version||j===!0){t.activeTexture(n.TEXTURE0+K);const we=Lt.getPrimaries(Lt.workingColorSpace),ke=N.colorSpace===bs?null:Lt.getPrimaries(N.colorSpace),We=N.colorSpace===bs||we===ke?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,N.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,N.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,N.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,We);const lt=R(N)&&S(N.image)===!1;let Pe=v(N.image,lt,!1,u);Pe=ge(N,Pe);const Mt=S(Pe)||a,et=i.convert(N.format,N.colorSpace);let tt=i.convert(N.type),ze=I(N.internalFormat,et,tt,N.colorSpace,N.isVideoTexture);Q(me,N,Mt);let je;const _t=N.mipmaps,J=a&&N.isVideoTexture!==!0&&ze!==HN,Qe=Ce.__version===void 0||j===!0,Ge=C(N,Pe,Mt);if(N.isDepthTexture)ze=n.DEPTH_COMPONENT,a?N.type===Ar?ze=n.DEPTH_COMPONENT32F:N.type===fi?ze=n.DEPTH_COMPONENT24:N.type===no?ze=n.DEPTH24_STENCIL8:ze=n.DEPTH_COMPONENT16:N.type===Ar&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),N.format===so&&ze===n.DEPTH_COMPONENT&&N.type!==uy&&N.type!==fi&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),N.type=fi,tt=i.convert(N.type)),N.format===Sa&&ze===n.DEPTH_COMPONENT&&(ze=n.DEPTH_STENCIL,N.type!==no&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),N.type=no,tt=i.convert(N.type))),Qe&&(J?t.texStorage2D(n.TEXTURE_2D,1,ze,Pe.width,Pe.height):t.texImage2D(n.TEXTURE_2D,0,ze,Pe.width,Pe.height,0,et,tt,null));else if(N.isDataTexture)if(_t.length>0&&Mt){J&&Qe&&t.texStorage2D(n.TEXTURE_2D,Ge,ze,_t[0].width,_t[0].height);for(let Ne=0,qe=_t.length;Ne>=1,qe>>=1}}else if(_t.length>0&&Mt){J&&Qe&&t.texStorage2D(n.TEXTURE_2D,Ge,ze,_t[0].width,_t[0].height);for(let Ne=0,qe=_t.length;Ne0&&Qe++,t.texStorage2D(n.TEXTURE_CUBE_MAP,Qe,je,Pe[0].width,Pe[0].height));for(let Ne=0;Ne<6;Ne++)if(lt){_t?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,0,0,Pe[Ne].width,Pe[Ne].height,tt,ze,Pe[Ne].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,je,Pe[Ne].width,Pe[Ne].height,0,tt,ze,Pe[Ne].data);for(let qe=0;qe>re),Pe=Math.max(1,N.height>>re);j===n.TEXTURE_3D||j===n.TEXTURE_2D_ARRAY?t.texImage3D(j,re,ke,lt,Pe,N.depth,0,Ce,we,null):t.texImage2D(j,re,ke,lt,Pe,0,Ce,we,null)}t.bindFramebuffer(n.FRAMEBUFFER,D),Me(N)?m.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,me,j,s.get(K).__webglTexture,0,le(N)):(j===n.TEXTURE_2D||j>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&j<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,me,j,s.get(K).__webglTexture,re),t.bindFramebuffer(n.FRAMEBUFFER,null)}function te(D,N,K){if(n.bindRenderbuffer(n.RENDERBUFFER,D),N.depthBuffer&&!N.stencilBuffer){let me=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(K||Me(N)){const j=N.depthTexture;j&&j.isDepthTexture&&(j.type===Ar?me=n.DEPTH_COMPONENT32F:j.type===fi&&(me=n.DEPTH_COMPONENT24));const re=le(N);Me(N)?m.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,re,me,N.width,N.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,re,me,N.width,N.height)}else n.renderbufferStorage(n.RENDERBUFFER,me,N.width,N.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,D)}else if(N.depthBuffer&&N.stencilBuffer){const me=le(N);K&&Me(N)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,me,n.DEPTH24_STENCIL8,N.width,N.height):Me(N)?m.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,me,n.DEPTH24_STENCIL8,N.width,N.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,N.width,N.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,D)}else{const me=N.isWebGLMultipleRenderTargets===!0?N.texture:[N.texture];for(let j=0;j0){K.__webglFramebuffer[we]=[];for(let ke=0;ke0){K.__webglFramebuffer=[];for(let we=0;we0&&Me(D)===!1){const we=re?N:[N];K.__webglMultisampledFramebuffer=n.createFramebuffer(),K.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,K.__webglMultisampledFramebuffer);for(let ke=0;ke0)for(let ke=0;ke0)for(let ke=0;ke0&&Me(D)===!1){const N=D.isWebGLMultipleRenderTargets?D.texture:[D.texture],K=D.width,me=D.height;let j=n.COLOR_BUFFER_BIT;const re=[],Ce=D.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,we=s.get(D),ke=D.isWebGLMultipleRenderTargets===!0;if(ke)for(let We=0;We0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&N.__useRenderToTexture!==!1}function Re(D){const N=o.render.frame;f.get(D)!==N&&(f.set(D,N),D.update())}function ge(D,N){const K=D.colorSpace,me=D.format,j=D.type;return D.isCompressedTexture===!0||D.isVideoTexture===!0||D.format===vb||K!==Cn&&K!==bs&&(Lt.getTransfer(K)===jt?a===!1?e.has("EXT_sRGB")===!0&&me===gs?(D.format=vb,D.minFilter=Wn,D.generateMipmaps=!1):N=KN.sRGBToLinear(N):(me!==gs||j!==yi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",K)),N}this.allocateTextureUnit=W,this.resetTextureUnits=L,this.setTexture2D=oe,this.setTexture2DArray=ye,this.setTexture3D=xe,this.setTextureCube=ce,this.rebindTextures=Z,this.setupRenderTarget=de,this.updateRenderTargetMipmap=pe,this.updateMultisampleRenderTarget=he,this.setupDepthRenderbuffer=P,this.setupFrameBufferTexture=Ue,this.useMultisampledRTT=Me}function KSt(n,e,t){const s=t.isWebGL2;function r(i,o=bs){let a;const c=Lt.getTransfer(o);if(i===yi)return n.UNSIGNED_BYTE;if(i===UN)return n.UNSIGNED_SHORT_4_4_4_4;if(i===BN)return n.UNSIGNED_SHORT_5_5_5_1;if(i===mbt)return n.BYTE;if(i===hbt)return n.SHORT;if(i===uy)return n.UNSIGNED_SHORT;if(i===FN)return n.INT;if(i===fi)return n.UNSIGNED_INT;if(i===Ar)return n.FLOAT;if(i===Ql)return s?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(i===gbt)return n.ALPHA;if(i===gs)return n.RGBA;if(i===bbt)return n.LUMINANCE;if(i===ybt)return n.LUMINANCE_ALPHA;if(i===so)return n.DEPTH_COMPONENT;if(i===Sa)return n.DEPTH_STENCIL;if(i===vb)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(i===Ebt)return n.RED;if(i===GN)return n.RED_INTEGER;if(i===vbt)return n.RG;if(i===VN)return n.RG_INTEGER;if(i===zN)return n.RGBA_INTEGER;if(i===Yh||i===$h||i===Wh||i===Kh)if(c===jt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(i===Yh)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===$h)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Wh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Kh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(i===Yh)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===$h)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Wh)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Kh)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===fC||i===_C||i===mC||i===hC)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(i===fC)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===_C)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===mC)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===hC)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===HN)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(i===gC||i===bC)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(i===gC)return c===jt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(i===bC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===yC||i===EC||i===vC||i===SC||i===TC||i===xC||i===CC||i===wC||i===RC||i===AC||i===MC||i===NC||i===OC||i===IC)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(i===yC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===EC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===vC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===SC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===TC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===xC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===CC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===wC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===RC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===AC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===MC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===NC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===OC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===IC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===jh||i===kC||i===DC)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(i===jh)return c===jt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===kC)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===DC)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===Sbt||i===LC||i===PC||i===FC)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(i===jh)return a.COMPRESSED_RED_RGTC1_EXT;if(i===LC)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===PC)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===FC)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===no?s?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[i]!==void 0?n[i]:null}return{convert:r}}class jSt extends Gn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Qi extends Jt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const QSt={type:"move"};class yg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Qi,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Qi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ie,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ie),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Qi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ie,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ie),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const s of e.hand.values())this._getHandJoint(t,s)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,s){let r=null,i=null,o=null;const a=this._targetRay,c=this._grip,d=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(d&&e.hand){o=!0;for(const y of e.hand.values()){const b=t.getJointPose(y,s),g=this._getHandJoint(d,y);b!==null&&(g.matrix.fromArray(b.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=b.radius),g.visible=b!==null}const u=d.joints["index-finger-tip"],_=d.joints["thumb-tip"],m=u.position.distanceTo(_.position),h=.02,f=.005;d.inputState.pinching&&m>h+f?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!d.inputState.pinching&&m<=h-f&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,s),i!==null&&(c.matrix.fromArray(i.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,i.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(i.linearVelocity)):c.hasLinearVelocity=!1,i.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(i.angularVelocity)):c.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,s),r===null&&i!==null&&(r=i),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(QSt)))}return a!==null&&(a.visible=r!==null),c!==null&&(c.visible=i!==null),d!==null&&(d.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const s=new Qi;s.matrixAutoUpdate=!1,s.visible=!1,e.joints[t.jointName]=s,e.add(s)}return e.joints[t.jointName]}}class XSt extends Ha{constructor(e,t){super();const s=this;let r=null,i=1,o=null,a="local-floor",c=1,d=null,u=null,_=null,m=null,h=null,f=null;const y=t.getContextAttributes();let b=null,g=null;const E=[],v=[],S=new Rt;let R=null;const w=new Gn;w.layers.enable(1),w.viewport=new Wt;const A=new Gn;A.layers.enable(2),A.viewport=new Wt;const I=[w,A],C=new jSt;C.layers.enable(1),C.layers.enable(2);let M=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ce){let ve=E[ce];return ve===void 0&&(ve=new yg,E[ce]=ve),ve.getTargetRaySpace()},this.getControllerGrip=function(ce){let ve=E[ce];return ve===void 0&&(ve=new yg,E[ce]=ve),ve.getGripSpace()},this.getHand=function(ce){let ve=E[ce];return ve===void 0&&(ve=new yg,E[ce]=ve),ve.getHandSpace()};function V(ce){const ve=v.indexOf(ce.inputSource);if(ve===-1)return;const Oe=E[ve];Oe!==void 0&&(Oe.update(ce.inputSource,ce.frame,d||o),Oe.dispatchEvent({type:ce.type,data:ce.inputSource}))}function ee(){r.removeEventListener("select",V),r.removeEventListener("selectstart",V),r.removeEventListener("selectend",V),r.removeEventListener("squeeze",V),r.removeEventListener("squeezestart",V),r.removeEventListener("squeezeend",V),r.removeEventListener("end",ee),r.removeEventListener("inputsourceschange",O);for(let ce=0;ce=0&&(v[De]=null,E[De].disconnect(Oe))}for(let ve=0;ve=v.length){v.push(Oe),De=fe;break}else if(v[fe]===null){v[fe]=Oe,De=fe;break}if(De===-1)break}const Q=E[De];Q&&Q.connect(Oe)}}const H=new ie,q=new ie;function L(ce,ve,Oe){H.setFromMatrixPosition(ve.matrixWorld),q.setFromMatrixPosition(Oe.matrixWorld);const De=H.distanceTo(q),Q=ve.projectionMatrix.elements,fe=Oe.projectionMatrix.elements,_e=Q[14]/(Q[10]-1),Ae=Q[14]/(Q[10]+1),Ue=(Q[9]+1)/Q[5],te=(Q[9]-1)/Q[5],U=(Q[8]-1)/Q[0],P=(fe[8]+1)/fe[0],Z=_e*U,de=_e*P,pe=De/(-U+P),he=pe*-U;ve.matrixWorld.decompose(ce.position,ce.quaternion,ce.scale),ce.translateX(he),ce.translateZ(pe),ce.matrixWorld.compose(ce.position,ce.quaternion,ce.scale),ce.matrixWorldInverse.copy(ce.matrixWorld).invert();const le=_e+pe,Me=Ae+pe,Re=Z-he,ge=de+(De-he),D=Ue*Ae/Me*le,N=te*Ae/Me*le;ce.projectionMatrix.makePerspective(Re,ge,D,N,le,Me),ce.projectionMatrixInverse.copy(ce.projectionMatrix).invert()}function W(ce,ve){ve===null?ce.matrixWorld.copy(ce.matrix):ce.matrixWorld.multiplyMatrices(ve.matrixWorld,ce.matrix),ce.matrixWorldInverse.copy(ce.matrixWorld).invert()}this.updateCamera=function(ce){if(r===null)return;C.near=A.near=w.near=ce.near,C.far=A.far=w.far=ce.far,(M!==C.near||G!==C.far)&&(r.updateRenderState({depthNear:C.near,depthFar:C.far}),M=C.near,G=C.far);const ve=ce.parent,Oe=C.cameras;W(C,ve);for(let De=0;De0&&(b.alphaTest.value=g.alphaTest);const E=e.get(g).envMap;if(E&&(b.envMap.value=E,b.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,b.reflectivity.value=g.reflectivity,b.ior.value=g.ior,b.refractionRatio.value=g.refractionRatio),g.lightMap){b.lightMap.value=g.lightMap;const v=n._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=g.lightMapIntensity*v,t(g.lightMap,b.lightMapTransform)}g.aoMap&&(b.aoMap.value=g.aoMap,b.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,b.aoMapTransform))}function o(b,g){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,g.map&&(b.map.value=g.map,t(g.map,b.mapTransform))}function a(b,g){b.dashSize.value=g.dashSize,b.totalSize.value=g.dashSize+g.gapSize,b.scale.value=g.scale}function c(b,g,E,v){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,b.size.value=g.size*E,b.scale.value=v*.5,g.map&&(b.map.value=g.map,t(g.map,b.uvTransform)),g.alphaMap&&(b.alphaMap.value=g.alphaMap,t(g.alphaMap,b.alphaMapTransform)),g.alphaTest>0&&(b.alphaTest.value=g.alphaTest)}function d(b,g){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,b.rotation.value=g.rotation,g.map&&(b.map.value=g.map,t(g.map,b.mapTransform)),g.alphaMap&&(b.alphaMap.value=g.alphaMap,t(g.alphaMap,b.alphaMapTransform)),g.alphaTest>0&&(b.alphaTest.value=g.alphaTest)}function u(b,g){b.specular.value.copy(g.specular),b.shininess.value=Math.max(g.shininess,1e-4)}function _(b,g){g.gradientMap&&(b.gradientMap.value=g.gradientMap)}function m(b,g){b.metalness.value=g.metalness,g.metalnessMap&&(b.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,b.metalnessMapTransform)),b.roughness.value=g.roughness,g.roughnessMap&&(b.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,b.roughnessMapTransform)),e.get(g).envMap&&(b.envMapIntensity.value=g.envMapIntensity)}function h(b,g,E){b.ior.value=g.ior,g.sheen>0&&(b.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),b.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(b.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,b.sheenColorMapTransform)),g.sheenRoughnessMap&&(b.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,b.sheenRoughnessMapTransform))),g.clearcoat>0&&(b.clearcoat.value=g.clearcoat,b.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(b.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,b.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(b.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Zn&&b.clearcoatNormalScale.value.negate())),g.iridescence>0&&(b.iridescence.value=g.iridescence,b.iridescenceIOR.value=g.iridescenceIOR,b.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],b.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(b.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,b.iridescenceMapTransform)),g.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,b.iridescenceThicknessMapTransform))),g.transmission>0&&(b.transmission.value=g.transmission,b.transmissionSamplerMap.value=E.texture,b.transmissionSamplerSize.value.set(E.width,E.height),g.transmissionMap&&(b.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,b.transmissionMapTransform)),b.thickness.value=g.thickness,g.thicknessMap&&(b.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,b.thicknessMapTransform)),b.attenuationDistance.value=g.attenuationDistance,b.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(b.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(b.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=g.specularIntensity,b.specularColor.value.copy(g.specularColor),g.specularColorMap&&(b.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,b.specularColorMapTransform)),g.specularIntensityMap&&(b.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,b.specularIntensityMapTransform))}function f(b,g){g.matcap&&(b.matcap.value=g.matcap)}function y(b,g){const E=e.get(g).light;b.referencePosition.value.setFromMatrixPosition(E.matrixWorld),b.nearDistance.value=E.shadow.camera.near,b.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:r}}function JSt(n,e,t,s){let r={},i={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function c(E,v){const S=v.program;s.uniformBlockBinding(E,S)}function d(E,v){let S=r[E.id];S===void 0&&(f(E),S=u(E),r[E.id]=S,E.addEventListener("dispose",b));const R=v.program;s.updateUBOMapping(E,R);const w=e.render.frame;i[E.id]!==w&&(m(E),i[E.id]=w)}function u(E){const v=_();E.__bindingPointIndex=v;const S=n.createBuffer(),R=E.__size,w=E.usage;return n.bindBuffer(n.UNIFORM_BUFFER,S),n.bufferData(n.UNIFORM_BUFFER,R,w),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,v,S),S}function _(){for(let E=0;E0){w=S%R;const V=R-w;w!==0&&V-M.boundary<0&&(S+=R-w,C.__offset=S)}S+=M.storage}return w=S%R,w>0&&(S+=R-w),E.__size=S,E.__cache={},this}function y(E){const v={boundary:0,storage:0};return typeof E=="number"?(v.boundary=4,v.storage=4):E.isVector2?(v.boundary=8,v.storage=8):E.isVector3||E.isColor?(v.boundary=16,v.storage=12):E.isVector4?(v.boundary=16,v.storage=16):E.isMatrix3?(v.boundary=48,v.storage=48):E.isMatrix4?(v.boundary=64,v.storage=64):E.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",E),v}function b(E){const v=E.target;v.removeEventListener("dispose",b);const S=o.indexOf(v.__bindingPointIndex);o.splice(S,1),n.deleteBuffer(r[v.id]),delete r[v.id],delete i[v.id]}function g(){for(const E in r)n.deleteBuffer(r[E]);o=[],r={},i={}}return{bind:c,update:d,dispose:g}}class uO{constructor(e={}){const{canvas:t=Qbt(),context:s=null,depth:r=!0,stencil:i=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:d=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:_=!1}=e;this.isWebGLRenderer=!0;let m;s!==null?m=s.getContextAttributes().alpha:m=o;const h=new Uint32Array(4),f=new Int32Array(4);let y=null,b=null;const g=[],E=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=nn,this._useLegacyLights=!1,this.toneMapping=bi,this.toneMappingExposure=1;const v=this;let S=!1,R=0,w=0,A=null,I=-1,C=null;const M=new Wt,G=new Wt;let V=null;const ee=new pt(0);let O=0,H=t.width,q=t.height,L=1,W=null,se=null;const oe=new Wt(0,0,H,q),ye=new Wt(0,0,H,q);let xe=!1;const ce=new my;let ve=!1,Oe=!1,De=null;const Q=new xt,fe=new Rt,_e=new ie,Ae={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ue(){return A===null?L:1}let te=s;function U(F,ue){for(let Ee=0;Ee{function Xe(){if(Se.forEach(function(st){he.get(st).currentProgram.isReady()&&Se.delete(st)}),Se.size===0){be(F);return}setTimeout(Xe,10)}P.get("KHR_parallel_shader_compile")!==null?Xe():setTimeout(Xe,10)})};let Nt=null;function dn(F){Nt&&Nt(F)}function wn(){Rn.stop()}function qt(){Rn.start()}const Rn=new rO;Rn.setAnimationLoop(dn),typeof self<"u"&&Rn.setContext(self),this.setAnimationLoop=function(F){Nt=F,je.setAnimationLoop(F),F===null?Rn.stop():Rn.start()},je.addEventListener("sessionstart",wn),je.addEventListener("sessionend",qt),this.render=function(F,ue){if(ue!==void 0&&ue.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),ue.parent===null&&ue.matrixWorldAutoUpdate===!0&&ue.updateMatrixWorld(),je.enabled===!0&&je.isPresenting===!0&&(je.cameraAutoUpdate===!0&&je.updateCamera(ue),ue=je.getCamera()),F.isScene===!0&&F.onBeforeRender(v,F,ue,A),b=re.get(F,E.length),b.init(),E.push(b),Q.multiplyMatrices(ue.projectionMatrix,ue.matrixWorldInverse),ce.setFromProjectionMatrix(Q),Oe=this.localClippingEnabled,ve=Ce.init(this.clippingPlanes,Oe),y=j.get(F,g.length),y.init(),g.push(y),Os(F,ue,0,v.sortObjects),y.finish(),v.sortObjects===!0&&y.sort(W,se),this.info.render.frame++,ve===!0&&Ce.beginShadows();const Ee=b.state.shadowsArray;if(we.render(Ee,F,ue),ve===!0&&Ce.endShadows(),this.info.autoReset===!0&&this.info.reset(),ke.render(y,F),b.setupLights(v._useLegacyLights),ue.isArrayCamera){const Se=ue.cameras;for(let be=0,Xe=Se.length;be0?b=E[E.length-1]:b=null,g.pop(),g.length>0?y=g[g.length-1]:y=null};function Os(F,ue,Ee,Se){if(F.visible===!1)return;if(F.layers.test(ue.layers)){if(F.isGroup)Ee=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(ue);else if(F.isLight)b.pushLight(F),F.castShadow&&b.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||ce.intersectsSprite(F)){Se&&_e.setFromMatrixPosition(F.matrixWorld).applyMatrix4(Q);const st=N.update(F),ct=F.material;ct.visible&&y.push(F,st,ct,Ee,_e.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||ce.intersectsObject(F))){const st=N.update(F),ct=F.material;if(Se&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),_e.copy(F.boundingSphere.center)):(st.boundingSphere===null&&st.computeBoundingSphere(),_e.copy(st.boundingSphere.center)),_e.applyMatrix4(F.matrixWorld).applyMatrix4(Q)),Array.isArray(ct)){const ut=st.groups;for(let Et=0,mt=ut.length;Et0&&ky(be,Xe,ue,Ee),Se&&de.viewport(M.copy(Se)),be.length>0&&ja(be,ue,Ee),Xe.length>0&&ja(Xe,ue,Ee),st.length>0&&ja(st,ue,Ee),de.buffers.depth.setTest(!0),de.buffers.depth.setMask(!0),de.buffers.color.setMask(!0),de.setPolygonOffset(!1)}function ky(F,ue,Ee,Se){if((Ee.isScene===!0?Ee.overrideMaterial:null)!==null)return;const Xe=Z.isWebGL2;De===null&&(De=new mo(1,1,{generateMipmaps:!0,type:P.has("EXT_color_buffer_half_float")?Ql:yi,minFilter:_o,samples:Xe?4:0})),v.getDrawingBufferSize(fe),Xe?De.setSize(fe.x,fe.y):De.setSize(Su(fe.x),Su(fe.y));const st=v.getRenderTarget();v.setRenderTarget(De),v.getClearColor(ee),O=v.getClearAlpha(),O<1&&v.setClearColor(16777215,.5),v.clear();const ct=v.toneMapping;v.toneMapping=bi,ja(F,Ee,Se),le.updateMultisampleRenderTarget(De),le.updateRenderTargetMipmap(De);let ut=!1;for(let Et=0,mt=ue.length;Et0),gt=!!Ee.morphAttributes.position,tn=!!Ee.morphAttributes.normal,qn=!!Ee.morphAttributes.color;let un=bi;Se.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(un=v.toneMapping);const Ws=Ee.morphAttributes.position||Ee.morphAttributes.normal||Ee.morphAttributes.color,Qt=Ws!==void 0?Ws.length:0,St=he.get(Se),hc=b.state.lights;if(ve===!0&&(Oe===!0||F!==C)){const es=F===C&&Se.id===I;Ce.setState(Se,F,es)}let Zt=!1;Se.version===St.__version?(St.needsLights&&St.lightsStateVersion!==hc.state.version||St.outputColorSpace!==ct||be.isBatchedMesh&&St.batching===!1||!be.isBatchedMesh&&St.batching===!0||be.isInstancedMesh&&St.instancing===!1||!be.isInstancedMesh&&St.instancing===!0||be.isSkinnedMesh&&St.skinning===!1||!be.isSkinnedMesh&&St.skinning===!0||be.isInstancedMesh&&St.instancingColor===!0&&be.instanceColor===null||be.isInstancedMesh&&St.instancingColor===!1&&be.instanceColor!==null||St.envMap!==ut||Se.fog===!0&&St.fog!==Xe||St.numClippingPlanes!==void 0&&(St.numClippingPlanes!==Ce.numPlanes||St.numIntersection!==Ce.numIntersection)||St.vertexAlphas!==Et||St.vertexTangents!==mt||St.morphTargets!==gt||St.morphNormals!==tn||St.morphColors!==qn||St.toneMapping!==un||Z.isWebGL2===!0&&St.morphTargetsCount!==Qt)&&(Zt=!0):(Zt=!0,St.__version=Se.version);let zr=St.currentProgram;Zt===!0&&(zr=Qa(Se,ue,be));let wp=!1,vo=!1,gc=!1;const yn=zr.getUniforms(),Hr=St.uniforms;if(de.useProgram(zr.program)&&(wp=!0,vo=!0,gc=!0),Se.id!==I&&(I=Se.id,vo=!0),wp||C!==F){yn.setValue(te,"projectionMatrix",F.projectionMatrix),yn.setValue(te,"viewMatrix",F.matrixWorldInverse);const es=yn.map.cameraPosition;es!==void 0&&es.setValue(te,_e.setFromMatrixPosition(F.matrixWorld)),Z.logarithmicDepthBuffer&&yn.setValue(te,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(Se.isMeshPhongMaterial||Se.isMeshToonMaterial||Se.isMeshLambertMaterial||Se.isMeshBasicMaterial||Se.isMeshStandardMaterial||Se.isShaderMaterial)&&yn.setValue(te,"isOrthographic",F.isOrthographicCamera===!0),C!==F&&(C=F,vo=!0,gc=!0)}if(be.isSkinnedMesh){yn.setOptional(te,be,"bindMatrix"),yn.setOptional(te,be,"bindMatrixInverse");const es=be.skeleton;es&&(Z.floatVertexTextures?(es.boneTexture===null&&es.computeBoneTexture(),yn.setValue(te,"boneTexture",es.boneTexture,le)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}be.isBatchedMesh&&(yn.setOptional(te,be,"batchingTexture"),yn.setValue(te,"batchingTexture",be._matricesTexture,le));const bc=Ee.morphAttributes;if((bc.position!==void 0||bc.normal!==void 0||bc.color!==void 0&&Z.isWebGL2===!0)&&We.update(be,Ee,zr),(vo||St.receiveShadow!==be.receiveShadow)&&(St.receiveShadow=be.receiveShadow,yn.setValue(te,"receiveShadow",be.receiveShadow)),Se.isMeshGouraudMaterial&&Se.envMap!==null&&(Hr.envMap.value=ut,Hr.flipEnvMap.value=ut.isCubeTexture&&ut.isRenderTargetTexture===!1?-1:1),vo&&(yn.setValue(te,"toneMappingExposure",v.toneMappingExposure),St.needsLights&&Ly(Hr,gc),Xe&&Se.fog===!0&&me.refreshFogUniforms(Hr,Xe),me.refreshMaterialUniforms(Hr,Se,L,q,De),Dd.upload(te,xp(St),Hr,le)),Se.isShaderMaterial&&Se.uniformsNeedUpdate===!0&&(Dd.upload(te,xp(St),Hr,le),Se.uniformsNeedUpdate=!1),Se.isSpriteMaterial&&yn.setValue(te,"center",be.center),yn.setValue(te,"modelViewMatrix",be.modelViewMatrix),yn.setValue(te,"normalMatrix",be.normalMatrix),yn.setValue(te,"modelMatrix",be.matrixWorld),Se.isShaderMaterial||Se.isRawShaderMaterial){const es=Se.uniformsGroups;for(let yc=0,Fy=es.length;yc0&&le.useMultisampledRTT(F)===!1?be=he.get(F).__webglMultisampledFramebuffer:Array.isArray(mt)?be=mt[Ee]:be=mt,M.copy(F.viewport),G.copy(F.scissor),V=F.scissorTest}else M.copy(oe).multiplyScalar(L).floor(),G.copy(ye).multiplyScalar(L).floor(),V=xe;if(de.bindFramebuffer(te.FRAMEBUFFER,be)&&Z.drawBuffers&&Se&&de.drawBuffers(F,be),de.viewport(M),de.scissor(G),de.setScissorTest(V),Xe){const ut=he.get(F.texture);te.framebufferTexture2D(te.FRAMEBUFFER,te.COLOR_ATTACHMENT0,te.TEXTURE_CUBE_MAP_POSITIVE_X+ue,ut.__webglTexture,Ee)}else if(st){const ut=he.get(F.texture),Et=ue||0;te.framebufferTextureLayer(te.FRAMEBUFFER,te.COLOR_ATTACHMENT0,ut.__webglTexture,Ee||0,Et)}I=-1},this.readRenderTargetPixels=function(F,ue,Ee,Se,be,Xe,st){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ct=he.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&st!==void 0&&(ct=ct[st]),ct){de.bindFramebuffer(te.FRAMEBUFFER,ct);try{const ut=F.texture,Et=ut.format,mt=ut.type;if(Et!==gs&&Mt.convert(Et)!==te.getParameter(te.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const gt=mt===Ql&&(P.has("EXT_color_buffer_half_float")||Z.isWebGL2&&P.has("EXT_color_buffer_float"));if(mt!==yi&&Mt.convert(mt)!==te.getParameter(te.IMPLEMENTATION_COLOR_READ_TYPE)&&!(mt===Ar&&(Z.isWebGL2||P.has("OES_texture_float")||P.has("WEBGL_color_buffer_float")))&&!gt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ue>=0&&ue<=F.width-Se&&Ee>=0&&Ee<=F.height-be&&te.readPixels(ue,Ee,Se,be,Mt.convert(Et),Mt.convert(mt),Xe)}finally{const ut=A!==null?he.get(A).__webglFramebuffer:null;de.bindFramebuffer(te.FRAMEBUFFER,ut)}}},this.copyFramebufferToTexture=function(F,ue,Ee=0){const Se=Math.pow(2,-Ee),be=Math.floor(ue.image.width*Se),Xe=Math.floor(ue.image.height*Se);le.setTexture2D(ue,0),te.copyTexSubImage2D(te.TEXTURE_2D,Ee,0,0,F.x,F.y,be,Xe),de.unbindTexture()},this.copyTextureToTexture=function(F,ue,Ee,Se=0){const be=ue.image.width,Xe=ue.image.height,st=Mt.convert(Ee.format),ct=Mt.convert(Ee.type);le.setTexture2D(Ee,0),te.pixelStorei(te.UNPACK_FLIP_Y_WEBGL,Ee.flipY),te.pixelStorei(te.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ee.premultiplyAlpha),te.pixelStorei(te.UNPACK_ALIGNMENT,Ee.unpackAlignment),ue.isDataTexture?te.texSubImage2D(te.TEXTURE_2D,Se,F.x,F.y,be,Xe,st,ct,ue.image.data):ue.isCompressedTexture?te.compressedTexSubImage2D(te.TEXTURE_2D,Se,F.x,F.y,ue.mipmaps[0].width,ue.mipmaps[0].height,st,ue.mipmaps[0].data):te.texSubImage2D(te.TEXTURE_2D,Se,F.x,F.y,st,ct,ue.image),Se===0&&Ee.generateMipmaps&&te.generateMipmap(te.TEXTURE_2D),de.unbindTexture()},this.copyTextureToTexture3D=function(F,ue,Ee,Se,be=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Xe=F.max.x-F.min.x+1,st=F.max.y-F.min.y+1,ct=F.max.z-F.min.z+1,ut=Mt.convert(Se.format),Et=Mt.convert(Se.type);let mt;if(Se.isData3DTexture)le.setTexture3D(Se,0),mt=te.TEXTURE_3D;else if(Se.isDataArrayTexture)le.setTexture2DArray(Se,0),mt=te.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}te.pixelStorei(te.UNPACK_FLIP_Y_WEBGL,Se.flipY),te.pixelStorei(te.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Se.premultiplyAlpha),te.pixelStorei(te.UNPACK_ALIGNMENT,Se.unpackAlignment);const gt=te.getParameter(te.UNPACK_ROW_LENGTH),tn=te.getParameter(te.UNPACK_IMAGE_HEIGHT),qn=te.getParameter(te.UNPACK_SKIP_PIXELS),un=te.getParameter(te.UNPACK_SKIP_ROWS),Ws=te.getParameter(te.UNPACK_SKIP_IMAGES),Qt=Ee.isCompressedTexture?Ee.mipmaps[0]:Ee.image;te.pixelStorei(te.UNPACK_ROW_LENGTH,Qt.width),te.pixelStorei(te.UNPACK_IMAGE_HEIGHT,Qt.height),te.pixelStorei(te.UNPACK_SKIP_PIXELS,F.min.x),te.pixelStorei(te.UNPACK_SKIP_ROWS,F.min.y),te.pixelStorei(te.UNPACK_SKIP_IMAGES,F.min.z),Ee.isDataTexture||Ee.isData3DTexture?te.texSubImage3D(mt,be,ue.x,ue.y,ue.z,Xe,st,ct,ut,Et,Qt.data):Ee.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),te.compressedTexSubImage3D(mt,be,ue.x,ue.y,ue.z,Xe,st,ct,ut,Qt.data)):te.texSubImage3D(mt,be,ue.x,ue.y,ue.z,Xe,st,ct,ut,Et,Qt),te.pixelStorei(te.UNPACK_ROW_LENGTH,gt),te.pixelStorei(te.UNPACK_IMAGE_HEIGHT,tn),te.pixelStorei(te.UNPACK_SKIP_PIXELS,qn),te.pixelStorei(te.UNPACK_SKIP_ROWS,un),te.pixelStorei(te.UNPACK_SKIP_IMAGES,Ws),be===0&&Se.generateMipmaps&&te.generateMipmap(mt),de.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?le.setTextureCube(F,0):F.isData3DTexture?le.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?le.setTexture2DArray(F,0):le.setTexture2D(F,0),de.unbindTexture()},this.resetState=function(){R=0,w=0,A=null,de.reset(),et.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Mr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===fy?"display-p3":"srgb",t.unpackColorSpace=Lt.workingColorSpace===mp?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===nn?ro:YN}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===ro?nn:Cn}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class e1t extends uO{}e1t.prototype.isWebGL1Renderer=!0;class t1t extends Jt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class n1t{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Eb,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Gs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,s){e*=this.stride,s*=t.stride;for(let r=0,i=this.stride;rc)continue;m.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(m);Ie.far||t.push({distance:I,point:_.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),E=Math.min(b.count,o.start+o.count);for(let v=g,S=E-1;vc)continue;m.applyMatrix4(this.matrixWorld);const w=e.ray.origin.distanceTo(m);we.far||t.push({distance:w,point:_.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const r=t[s[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,o=r.length;i0){const r=t[s[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,o=r.length;ir.far)return;i.push({distance:d,distanceToRay:Math.sqrt(a),point:c,index:e,face:null,object:o})}}class Sy extends Vs{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new pt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=py,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Vr extends Sy{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Rt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return On(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new pt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new pt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new pt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Hw extends Vs{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new pt(16777215),this.specular=new pt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=py,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=dy,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}function hd(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function p1t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function f1t(n){function e(r,i){return n[r]-n[i]}const t=n.length,s=new Array(t);for(let r=0;r!==t;++r)s[r]=r;return s.sort(e),s}function qw(n,e,t){const s=n.length,r=new n.constructor(s);for(let i=0,o=0;o!==s;++i){const a=t[i]*e;for(let c=0;c!==e;++c)r[o++]=n[a+c]}return r}function mO(n,e,t,s){let r=1,i=n[0];for(;i!==void 0&&i[s]===void 0;)i=n[r++];if(i===void 0)return;let o=i[s];if(o!==void 0)if(Array.isArray(o))do o=i[s],o!==void 0&&(e.push(i.time),t.push.apply(t,o)),i=n[r++];while(i!==void 0);else if(o.toArray!==void 0)do o=i[s],o!==void 0&&(e.push(i.time),o.toArray(t,t.length)),i=n[r++];while(i!==void 0);else do o=i[s],o!==void 0&&(e.push(i.time),t.push(o)),i=n[r++];while(i!==void 0)}class fc{constructor(e,t,s,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(s),this.sampleValues=t,this.valueSize=s,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let s=this._cachedIndex,r=t[s],i=t[s-1];e:{t:{let o;n:{s:if(!(e=i)){const a=t[1];e=i)break t}o=s,s=0;break n}break e}for(;s>>1;et;)--o;if(++o,i!==0||o!==r){i>=o&&(o=Math.max(o,1),i=o-1);const a=this.getValueSize();this.times=s.slice(i,o),this.values=this.values.slice(i*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const s=this.times,r=this.values,i=s.length;i===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==i;a++){const c=s[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),e=!1;break}o=c}if(r!==void 0&&p1t(r))for(let a=0,c=r.length;a!==c;++a){const d=r[a];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,d),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),s=this.getValueSize(),r=this.getInterpolation()===Qh,i=e.length-1;let o=1;for(let a=1;a0){e[o]=e[i];for(let a=i*s,c=o*s,d=0;d!==s;++d)t[c+d]=t[a+d];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*s)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),s=this.constructor,r=new s(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}_r.prototype.TimeBufferType=Float32Array;_r.prototype.ValueBufferType=Float32Array;_r.prototype.DefaultInterpolation=Ta;class Ya extends _r{}Ya.prototype.ValueTypeName="bool";Ya.prototype.ValueBufferType=Array;Ya.prototype.DefaultInterpolation=Xl;Ya.prototype.InterpolantFactoryMethodLinear=void 0;Ya.prototype.InterpolantFactoryMethodSmooth=void 0;class hO extends _r{}hO.prototype.ValueTypeName="color";class wa extends _r{}wa.prototype.ValueTypeName="number";class g1t extends fc{constructor(e,t,s,r){super(e,t,s,r)}interpolate_(e,t,s,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(s-t)/(r-t);let d=e*a;for(let u=d+a;d!==u;d+=4)Ni.slerpFlat(i,0,o,d-a,o,d,c);return i}}class go extends _r{InterpolantFactoryMethodLinear(e){return new g1t(this.times,this.values,this.getValueSize(),e)}}go.prototype.ValueTypeName="quaternion";go.prototype.DefaultInterpolation=Ta;go.prototype.InterpolantFactoryMethodSmooth=void 0;class $a extends _r{}$a.prototype.ValueTypeName="string";$a.prototype.ValueBufferType=Array;$a.prototype.DefaultInterpolation=Xl;$a.prototype.InterpolantFactoryMethodLinear=void 0;$a.prototype.InterpolantFactoryMethodSmooth=void 0;class Ra extends _r{}Ra.prototype.ValueTypeName="vector";class b1t{constructor(e,t=-1,s,r=Tbt){this.name=e,this.tracks=s,this.duration=t,this.blendMode=r,this.uuid=Gs(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],s=e.tracks,r=1/(e.fps||1);for(let o=0,a=s.length;o!==a;++o)t.push(E1t(s[o]).scale(r));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],s=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let i=0,o=s.length;i!==o;++i)t.push(_r.toJSON(s[i]));return r}static CreateFromMorphTargetSequence(e,t,s,r){const i=t.length,o=[];for(let a=0;a1){const _=u[1];let m=r[_];m||(r[_]=m=[]),m.push(d)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,s));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const s=function(_,m,h,f,y){if(h.length!==0){const b=[],g=[];mO(h,b,g,f),b.length!==0&&y.push(new _(m,b,g))}},r=[],i=e.name||"default",o=e.fps||30,a=e.blendMode;let c=e.length||-1;const d=e.hierarchy||[];for(let _=0;_{t&&t(i),this.manager.itemEnd(e)},0),i;if(Sr[e]!==void 0){Sr[e].push({onLoad:t,onProgress:s,onError:r});return}Sr[e]=[],Sr[e].push({onLoad:t,onProgress:s,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,c=this.responseType;fetch(o).then(d=>{if(d.status===200||d.status===0){if(d.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||d.body===void 0||d.body.getReader===void 0)return d;const u=Sr[e],_=d.body.getReader(),m=d.headers.get("Content-Length")||d.headers.get("X-File-Size"),h=m?parseInt(m):0,f=h!==0;let y=0;const b=new ReadableStream({start(g){E();function E(){_.read().then(({done:v,value:S})=>{if(v)g.close();else{y+=S.byteLength;const R=new ProgressEvent("progress",{lengthComputable:f,loaded:y,total:h});for(let w=0,A=u.length;w{switch(c){case"arraybuffer":return d.arrayBuffer();case"blob":return d.blob();case"document":return d.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return d.json();default:if(a===void 0)return d.text();{const _=/charset="?([^;"\s]*)"?/i.exec(a),m=_&&_[1]?_[1].toLowerCase():void 0,h=new TextDecoder(m);return d.arrayBuffer().then(f=>h.decode(f))}}}).then(d=>{Aa.add(e,d);const u=Sr[e];delete Sr[e];for(let _=0,m=u.length;_{const u=Sr[e];if(u===void 0)throw this.manager.itemError(e),d;delete Sr[e];for(let _=0,m=u.length;_{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class x1t extends Wa{constructor(e){super(e)}load(e,t,s,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=Aa.get(e);if(o!==void 0)return i.manager.itemStart(e),setTimeout(function(){t&&t(o),i.manager.itemEnd(e)},0),o;const a=Zl("img");function c(){u(),Aa.add(e,this),t&&t(this),i.manager.itemEnd(e)}function d(_){u(),r&&r(_),i.manager.itemError(e),i.manager.itemEnd(e)}function u(){a.removeEventListener("load",c,!1),a.removeEventListener("error",d,!1)}return a.addEventListener("load",c,!1),a.addEventListener("error",d,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(e),a.src=e,a}}class bO extends Wa{constructor(e){super(e)}load(e,t,s,r){const i=new xn,o=new x1t(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){i.image=a,i.needsUpdate=!0,t!==void 0&&t(i)},s,r),i}}class yp extends Jt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new pt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const Tg=new xt,Yw=new ie,$w=new ie;class Ty{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Rt(512,512),this.map=null,this.mapPass=null,this.matrix=new xt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new my,this._frameExtents=new Rt(1,1),this._viewportCount=1,this._viewports=[new Wt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,s=this.matrix;Yw.setFromMatrixPosition(e.matrixWorld),t.position.copy(Yw),$w.setFromMatrixPosition(e.target.matrixWorld),t.lookAt($w),t.updateMatrixWorld(),Tg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Tg),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(Tg)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class C1t extends Ty{constructor(){super(new Gn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,s=xa*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;(s!==t.fov||r!==t.aspect||i!==t.far)&&(t.fov=s,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class w1t extends yp{constructor(e,t,s=0,r=Math.PI/3,i=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Jt.DEFAULT_UP),this.updateMatrix(),this.target=new Jt,this.distance=s,this.angle=r,this.penumbra=i,this.decay=o,this.map=null,this.shadow=new C1t}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Ww=new xt,pl=new ie,xg=new ie;class R1t extends Ty{constructor(){super(new Gn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Rt(4,2),this._viewportCount=6,this._viewports=[new Wt(2,1,1,1),new Wt(0,1,1,1),new Wt(3,1,1,1),new Wt(1,1,1,1),new Wt(3,0,1,1),new Wt(1,0,1,1)],this._cubeDirections=[new ie(1,0,0),new ie(-1,0,0),new ie(0,0,1),new ie(0,0,-1),new ie(0,1,0),new ie(0,-1,0)],this._cubeUps=[new ie(0,1,0),new ie(0,1,0),new ie(0,1,0),new ie(0,1,0),new ie(0,0,1),new ie(0,0,-1)]}updateMatrices(e,t=0){const s=this.camera,r=this.matrix,i=e.distance||s.far;i!==s.far&&(s.far=i,s.updateProjectionMatrix()),pl.setFromMatrixPosition(e.matrixWorld),s.position.copy(pl),xg.copy(s.position),xg.add(this._cubeDirections[t]),s.up.copy(this._cubeUps[t]),s.lookAt(xg),s.updateMatrixWorld(),r.makeTranslation(-pl.x,-pl.y,-pl.z),Ww.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ww)}}class A1t extends yp{constructor(e,t,s=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=s,this.decay=r,this.shadow=new R1t}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class M1t extends Ty{constructor(){super(new gy(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class yO extends yp{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Jt.DEFAULT_UP),this.updateMatrix(),this.target=new Jt,this.shadow=new M1t}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class N1t extends yp{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Dl{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let s=0,r=e.length;s"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,s,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=Aa.get(e);if(o!==void 0)return i.manager.itemStart(e),setTimeout(function(){t&&t(o),i.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(i.options,{colorSpaceConversion:"none"}))}).then(function(c){Aa.add(e,c),t&&t(c),i.manager.itemEnd(e)}).catch(function(c){r&&r(c),i.manager.itemError(e),i.manager.itemEnd(e)}),i.manager.itemStart(e)}}const xy="\\[\\]\\.:\\/",I1t=new RegExp("["+xy+"]","g"),Cy="[^"+xy+"]",k1t="[^"+xy.replace("\\.","")+"]",D1t=/((?:WC+[\/:])*)/.source.replace("WC",Cy),L1t=/(WCOD+)?/.source.replace("WCOD",k1t),P1t=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cy),F1t=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cy),U1t=new RegExp("^"+D1t+L1t+P1t+F1t+"$"),B1t=["material","materials","bones","map"];class G1t{constructor(e,t,s){const r=s||Ut.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const s=this._targetGroup.nCachedObjects_,r=this._bindings[s];r!==void 0&&r.getValue(e,t)}setValue(e,t){const s=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=s.length;r!==i;++r)s[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].unbind()}}class Ut{constructor(e,t,s){this.path=t,this.parsedPath=s||Ut.parseTrackName(t),this.node=Ut.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,s){return e&&e.isAnimationObjectGroup?new Ut.Composite(e,t,s):new Ut(e,t,s)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(I1t,"")}static parseTrackName(e){const t=U1t.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const s={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=s.nodeName&&s.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const i=s.nodeName.substring(r+1);B1t.indexOf(i)!==-1&&(s.nodeName=s.nodeName.substring(0,r),s.objectName=i)}if(s.propertyName===null||s.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return s}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const s=e.skeleton.getBoneByName(t);if(s!==void 0)return s}if(e.children){const s=function(i){for(let o=0;o=2.0 are supported."));return}const d=new yTt(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});d.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[_]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+_+'".')}}d.setExtensions(o),d.setPlugins(a),d.parse(s,r)}parseAsync(e,t){const s=this;return new Promise(function(r,i){s.parse(e,t,r,i)})}}function z1t(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const wt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class H1t{constructor(e){this.parser=e,this.name=wt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,r=t.length;s=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,o)}}class nTt{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,r=s.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const o=i.extensions[t],a=r.images[o.source];let c=s.textureLoader;if(a.uri){const d=s.options.manager.getHandler(a.uri);d!==null&&(c=d)}return this.detectSupport().then(function(d){if(d)return s.loadTextureImage(e,o.source,c);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class sTt{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,r=s.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const o=i.extensions[t],a=r.images[o.source];let c=s.textureLoader;if(a.uri){const d=s.options.manager.getHandler(a.uri);d!==null&&(c=d)}return this.detectSupport().then(function(d){if(d)return s.loadTextureImage(e,o.source,c);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class rTt{constructor(e){this.name=wt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const r=s.extensions[this.name],i=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then(function(a){const c=r.byteOffset||0,d=r.byteLength||0,u=r.count,_=r.byteStride,m=new Uint8Array(a,c,d);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,_,m,r.mode,r.filter).then(function(h){return h.buffer}):o.ready.then(function(){const h=new ArrayBuffer(u*_);return o.decodeGltfBuffer(new Uint8Array(h),u,_,m,r.mode,r.filter),h})})}else return null}}class iTt{constructor(e){this.name=wt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const r=t.meshes[s.mesh];for(const d of r.primitives)if(d.mode!==_s.TRIANGLES&&d.mode!==_s.TRIANGLE_STRIP&&d.mode!==_s.TRIANGLE_FAN&&d.mode!==void 0)return null;const o=s.extensions[this.name].attributes,a=[],c={};for(const d in o)a.push(this.parser.getDependency("accessor",o[d]).then(u=>(c[d]=u,c[d])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(d=>{const u=d.pop(),_=u.isGroup?u.children:[u],m=d[0].count,h=[];for(const f of _){const y=new xt,b=new ie,g=new Ni,E=new ie(1,1,1),v=new l1t(f.geometry,f.material,m);for(let S=0;S0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const bTt=new xt;class yTt{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new z1t,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,r=!1,i=-1;typeof navigator<"u"&&(s=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,i=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||s||r&&i<98?this.textureLoader=new bO(this.options.manager):this.textureLoader=new O1t(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new gO(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:s,userData:{}};return Bi(i,a,r),di(a,r),Promise.all(s._invokeAll(function(c){return c.afterRoot&&c.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let r=0,i=t.length;r{const c=this.associations.get(o);c!=null&&this.associations.set(a,c);for(const[d,u]of o.children.entries())i(u,a.children[d])};return i(s,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s=2&&b.setY(C,w[A*c+1]),c>=3&&b.setZ(C,w[A*c+2]),c>=4&&b.setW(C,w[A*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,s=this.options,i=t.textures[e].source,o=t.images[i];let a=this.textureLoader;if(o.uri){const c=s.manager.getHandler(o.uri);c!==null&&(a=c)}return this.loadTextureImage(e,i,a)}loadTextureImage(e,t,s){const r=this,i=this.json,o=i.textures[e],a=i.images[t],c=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[c])return this.textureCache[c];const d=this.loadImageSource(t,s).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const m=(i.samplers||{})[o.sampler]||{};return u.magFilter=Qw[m.magFilter]||Wn,u.minFilter=Qw[m.minFilter]||_o,u.wrapS=Xw[m.wrapS]||va,u.wrapT=Xw[m.wrapT]||va,r.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[c]=d,d}loadImageSource(e,t){const s=this,r=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(_=>_.clone());const o=r.images[e],a=self.URL||self.webkitURL;let c=o.uri||"",d=!1;if(o.bufferView!==void 0)c=s.getDependency("bufferView",o.bufferView).then(function(_){d=!0;const m=new Blob([_],{type:o.mimeType});return c=a.createObjectURL(m),c});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(c).then(function(_){return new Promise(function(m,h){let f=m;t.isImageBitmapLoader===!0&&(f=function(y){const b=new xn(y);b.needsUpdate=!0,m(b)}),t.load(Dl.resolveURL(_,i.path),f,void 0,h)})}).then(function(_){return d===!0&&a.revokeObjectURL(c),_.userData.mimeType=o.mimeType||gTt(o.uri),_}).catch(function(_){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),_});return this.sourceCache[e]=u,u}assignTexture(e,t,s,r){const i=this;return this.getDependency("texture",s.index).then(function(o){if(!o)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(o=o.clone(),o.channel=s.texCoord),i.extensions[wt.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[wt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const c=i.associations.get(o);o=i.extensions[wt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),i.associations.set(o,c)}}return r!==void 0&&(o.colorSpace=r),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const r=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+s.uuid;let c=this.cache.get(a);c||(c=new _O,Vs.prototype.copy.call(c,s),c.color.copy(s.color),c.map=s.map,c.sizeAttenuation=!1,this.cache.add(a,c)),s=c}else if(e.isLine){const a="LineBasicMaterial:"+s.uuid;let c=this.cache.get(a);c||(c=new fO,Vs.prototype.copy.call(c,s),c.color.copy(s.color),c.map=s.map,this.cache.add(a,c)),s=c}if(r||i||o){let a="ClonedMaterial:"+s.uuid+":";r&&(a+="derivative-tangents:"),i&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let c=this.cache.get(a);c||(c=s.clone(),i&&(c.vertexColors=!0),o&&(c.flatShading=!0),r&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(a,c),this.associations.set(c,this.associations.get(s))),s=c}e.material=s}getMaterialType(){return Sy}loadMaterial(e){const t=this,s=this.json,r=this.extensions,i=s.materials[e];let o;const a={},c=i.extensions||{},d=[];if(c[wt.KHR_MATERIALS_UNLIT]){const _=r[wt.KHR_MATERIALS_UNLIT];o=_.getMaterialType(),d.push(_.extendParams(a,i,t))}else{const _=i.pbrMetallicRoughness||{};if(a.color=new pt(1,1,1),a.opacity=1,Array.isArray(_.baseColorFactor)){const m=_.baseColorFactor;a.color.setRGB(m[0],m[1],m[2],Cn),a.opacity=m[3]}_.baseColorTexture!==void 0&&d.push(t.assignTexture(a,"map",_.baseColorTexture,nn)),a.metalness=_.metallicFactor!==void 0?_.metallicFactor:1,a.roughness=_.roughnessFactor!==void 0?_.roughnessFactor:1,_.metallicRoughnessTexture!==void 0&&(d.push(t.assignTexture(a,"metalnessMap",_.metallicRoughnessTexture)),d.push(t.assignTexture(a,"roughnessMap",_.metallicRoughnessTexture))),o=this._invokeOne(function(m){return m.getMaterialType&&m.getMaterialType(e)}),d.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(e,a)})))}i.doubleSided===!0&&(a.side=Js);const u=i.alphaMode||wg.OPAQUE;if(u===wg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===wg.MASK&&(a.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5)),i.normalTexture!==void 0&&o!==_i&&(d.push(t.assignTexture(a,"normalMap",i.normalTexture)),a.normalScale=new Rt(1,1),i.normalTexture.scale!==void 0)){const _=i.normalTexture.scale;a.normalScale.set(_,_)}if(i.occlusionTexture!==void 0&&o!==_i&&(d.push(t.assignTexture(a,"aoMap",i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&o!==_i){const _=i.emissiveFactor;a.emissive=new pt().setRGB(_[0],_[1],_[2],Cn)}return i.emissiveTexture!==void 0&&o!==_i&&d.push(t.assignTexture(a,"emissiveMap",i.emissiveTexture,nn)),Promise.all(d).then(function(){const _=new o(a);return i.name&&(_.name=i.name),di(_,i),t.associations.set(_,{materials:e}),i.extensions&&Bi(r,_,i),_})}createUniqueName(e){const t=Ut.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,r=this.primitiveCache;function i(a){return s[wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(c){return Zw(c,a,t)})}const o=[];for(let a=0,c=e.length;a0&&mTt(g,i),g.name=t.createUniqueName(i.name||"mesh_"+e),di(g,i),b.extensions&&Bi(r,g,b),t.assignFinalMaterial(g),_.push(g)}for(let h=0,f=_.length;h1?u=new Qi:d.length===1?u=d[0]:u=new Jt,u!==d[0])for(let _=0,m=d.length;_{const _=new Map;for(const[m,h]of r.associations)(m instanceof Vs||m instanceof xn)&&_.set(m,h);return u.traverse(m=>{const h=r.associations.get(m);h!=null&&_.set(m,h)}),_};return r.associations=d(i),i})}_createAnimationTracks(e,t,s,r,i){const o=[],a=e.name?e.name:e.uuid,c=[];Jr[i.path]===Jr.weights?e.traverse(function(m){m.morphTargetInfluences&&c.push(m.name?m.name:m.uuid)}):c.push(a);let d;switch(Jr[i.path]){case Jr.weights:d=wa;break;case Jr.rotation:d=go;break;case Jr.position:case Jr.scale:d=Ra;break;default:switch(s.itemSize){case 1:d=wa;break;case 2:case 3:default:d=Ra;break}break}const u=r.interpolation!==void 0?pTt[r.interpolation]:Ta,_=this._getArrayFromAccessor(s);for(let m=0,h=c.length;m{Ve.replace()})},stopVideoStream(){this.isVideoActive=!1,this.imageData=null,Ye.emit("stop_webcam_video_stream"),Fe(()=>{Ve.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Ve.replace(),Ye.on("video_stream_image",n=>{if(this.isVideoActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},STt=["src"],TTt=["src"],xTt={class:"controls"},CTt={key:2};function wTt(n,e,t,s,r,i){return T(),x("div",{class:"floating-frame bg-white",style:Bt({bottom:r.position.bottom+"px",right:r.position.right+"px","z-index":r.zIndex}),onMousedown:e[4]||(e[4]=$((...o)=>i.startDrag&&i.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=$((...o)=>i.stopDrag&&i.stopDrag(...o),["stop"]))},[l("div",{class:"handle",onMousedown:e[0]||(e[0]=$((...o)=>i.startDrag&&i.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=$((...o)=>i.stopDrag&&i.stopDrag(...o),["stop"]))},"Drag Me",32),r.isVideoActive&&r.imageDataUrl!=null?(T(),x("img",{key:0,src:r.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},null,8,STt)):B("",!0),r.isVideoActive&&r.imageDataUrl==null?(T(),x("p",{key:1,src:r.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},"Loading. Please wait...",8,TTt)):B("",!0),l("div",xTt,[r.isVideoActive?B("",!0):(T(),x("button",{key:0,class:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",onClick:e[2]||(e[2]=(...o)=>i.startVideoStream&&i.startVideoStream(...o))},e[6]||(e[6]=[l("i",{"data-feather":"video"},null,-1)]))),r.isVideoActive?(T(),x("button",{key:1,class:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",onClick:e[3]||(e[3]=(...o)=>i.stopVideoStream&&i.stopVideoStream(...o))},e[7]||(e[7]=[l("i",{"data-feather":"video"},null,-1)]))):B("",!0),r.isVideoActive?(T(),x("span",CTt,"FPS: "+Y(r.frameRate),1)):B("",!0)])],36)}const RTt=rt(vTt,[["render",wTt]]),ATt={data(){return{isAudioActive:!1,imageDataUrl:null,isDragging:!1,position:{bottom:0,right:0},dragStart:{x:0,y:0},zIndex:0,frameRate:0,frameCount:0,lastFrameTime:Date.now()}},methods:{startAudioStream(){Ye.emit("start_audio_stream",()=>{this.isAudioActive=!0}),Fe(()=>{Ve.replace()})},stopAudioStream(){Ye.emit("stop_audio_stream",()=>{this.isAudioActive=!1,this.imageDataUrl=null}),Fe(()=>{Ve.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Ve.replace(),Ye.on("update_spectrogram",n=>{if(this.isAudioActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},MTt=["src"],NTt={class:"controls"};function OTt(n,e,t,s,r,i){return T(),x("div",{class:"floating-frame bg-white",style:Bt({bottom:r.position.bottom+"px",right:r.position.right+"px","z-index":r.zIndex}),onMousedown:e[4]||(e[4]=$((...o)=>i.startDrag&&i.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=$((...o)=>i.stopDrag&&i.stopDrag(...o),["stop"]))},[l("div",{class:"handle",onMousedown:e[0]||(e[0]=$((...o)=>i.startDrag&&i.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=$((...o)=>i.stopDrag&&i.stopDrag(...o),["stop"]))},"Drag Me",32),r.isAudioActive&&r.imageDataUrl!=null?(T(),x("img",{key:0,src:r.imageDataUrl,alt:"Spectrogram",width:"300",height:"300"},null,8,MTt)):B("",!0),l("div",NTt,[r.isAudioActive?B("",!0):(T(),x("button",{key:0,class:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",onClick:e[2]||(e[2]=(...o)=>i.startAudioStream&&i.startAudioStream(...o))},e[6]||(e[6]=[l("i",{"data-feather":"mic"},null,-1)]))),r.isAudioActive?(T(),x("button",{key:1,class:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",onClick:e[3]||(e[3]=(...o)=>i.stopAudioStream&&i.stopAudioStream(...o))},e[7]||(e[7]=[l("i",{"data-feather":"mic"},null,-1)]))):B("",!0)])],36)}const ITt=rt(ATt,[["render",OTt]]),kTt={data(){return{activePersonality:null}},props:{personality:{type:Object,default:()=>({})}},components:{VideoFrame:RTt,AudioFrame:ITt},computed:{isReady:{get(){return this.$store.state.ready}}},watch:{"$store.state.mountedPersArr":"updatePersonality","$store.state.config.active_personality_id":"updatePersonality"},async mounted(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));console.log("Personality:",this.personality),this.initWebGLScene(),this.updatePersonality(),Fe(()=>{Ve.replace()}),this.$refs.video_frame.position={bottom:0,right:0},this.$refs.audio_frame.position={bottom:0,right:100}},beforeDestroy(){},methods:{initWebGLScene(){this.scene=new t1t,this.camera=new Gn(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new uO,this.renderer.setSize(window.innerWidth,window.innerHeight),this.$refs.webglContainer.appendChild(this.renderer.domElement);const n=new Ei,e=new Hw({color:65280});this.cube=new Vn(n,e),this.scene.add(this.cube);const t=new N1t(4210752),s=new yO(16777215,.5);s.position.set(0,1,0),this.scene.add(t),this.scene.add(s),this.camera.position.z=5,this.animate()},updatePersonality(){const{mountedPersArr:n,config:e}=this.$store.state;this.activePersonality=n[e.active_personality_id],this.activePersonality.avatar?this.showBoxWithAvatar(this.activePersonality.avatar):this.showDefaultCube(),this.$emit("update:personality",this.activePersonality)},loadScene(n){new V1t().load(n,t=>{this.scene.remove(this.cube),this.cube=t.scene,this.scene.add(this.cube)})},showBoxWithAvatar(n){this.cube&&this.scene.remove(this.cube);const e=new Ei,t=new bO().load(n),s=new _i({map:t});this.cube=new Vn(e,s),this.scene.add(this.cube)},showDefaultCube(){this.scene.remove(this.cube);const n=new Ei,e=new Hw({color:65280});this.cube=new Vn(n,e),this.scene.add(this.cube)},animate(){requestAnimationFrame(this.animate),this.cube&&(this.cube.rotation.x+=.01,this.cube.rotation.y+=.01),this.renderer.render(this.scene,this.camera)}}},DTt={ref:"webglContainer"},LTt={class:"flex-col y-overflow scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},PTt={key:0,class:"text-center"},FTt={key:1,class:"text-center"},UTt={class:"floating-frame2"},BTt=["innerHTML"];function GTt(n,e,t,s,r,i){const o=nt("VideoFrame"),a=nt("AudioFrame");return T(),x(Be,null,[l("div",DTt,null,512),l("div",LTt,[!r.activePersonality||!r.activePersonality.scene_path?(T(),x("div",PTt," Personality does not have a 3d avatar. ")):B("",!0),!r.activePersonality||!r.activePersonality.avatar||r.activePersonality.avatar===""?(T(),x("div",FTt," Personality does not have an avatar. ")):B("",!0),l("div",UTt,[l("div",{innerHTML:n.htmlContent},null,8,BTt)])]),z(o,{ref:"video_frame"},null,512),z(a,{ref:"audio_frame"},null,512)],64)}const VTt=rt(kTt,[["render",GTt]]);let gd;const zTt=new Uint8Array(16);function HTt(){if(!gd&&(gd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gd(zTt)}const En=[];for(let n=0;n<256;++n)En.push((n+256).toString(16).slice(1));function qTt(n,e=0){return En[n[e+0]]+En[n[e+1]]+En[n[e+2]]+En[n[e+3]]+"-"+En[n[e+4]]+En[n[e+5]]+"-"+En[n[e+6]]+En[n[e+7]]+"-"+En[n[e+8]]+En[n[e+9]]+"-"+En[n[e+10]]+En[n[e+11]]+En[n[e+12]]+En[n[e+13]]+En[n[e+14]]+En[n[e+15]]}const YTt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Jw={randomUUID:YTt};function Dr(n,e,t){if(Jw.randomUUID&&!e&&!n)return Jw.randomUUID();n=n||{};const s=n.random||(n.rng||HTt)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,qTt(s)}class io{constructor(){this.listenerMap=new Map,this._listeners=[],this.proxyMap=new Map,this.proxies=[]}get listeners(){return this._listeners.concat(this.proxies.flatMap(e=>e()))}subscribe(e,t){this.listenerMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. +}`;function jSt(n,e,t){let s=new my;const r=new Rt,i=new Rt,o=new Wt,a=new YSt({depthPacking:Nbt}),c=new $St,d={},u=t.maxTextureSize,_={[Fr]:Zn,[Zn]:Fr,[Js]:Js},m=new ho({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Rt},radius:{value:4}},vertexShader:WSt,fragmentShader:KSt}),h=m.clone();h.defines.HORIZONTAL_PASS=1;const f=new fr;f.setAttribute("position",new zn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new Vn(f,m),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=DN;let g=this.type;this.render=function(R,w,A){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||R.length===0)return;const I=n.getRenderTarget(),C=n.getActiveCubeFace(),M=n.getActiveMipmapLevel(),G=n.state;G.setBlending(gi),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const V=g!==xr&&this.type===xr,ee=g===xr&&this.type!==xr;for(let O=0,H=R.length;Ou||r.y>u)&&(r.x>u&&(i.x=Math.floor(u/W.x),r.x=i.x*W.x,L.mapSize.x=i.x),r.y>u&&(i.y=Math.floor(u/W.y),r.y=i.y*W.y,L.mapSize.y=i.y)),L.map===null||V===!0||ee===!0){const oe=this.type!==xr?{minFilter:gn,magFilter:gn}:{};L.map!==null&&L.map.dispose(),L.map=new mo(r.x,r.y,oe),L.map.texture.name=q.name+".shadowMap",L.camera.updateProjectionMatrix()}n.setRenderTarget(L.map),n.clear();const se=L.getViewportCount();for(let oe=0;oe0||w.map&&w.alphaTest>0){const G=C.uuid,V=w.uuid;let ee=d[G];ee===void 0&&(ee={},d[G]=ee);let O=ee[V];O===void 0&&(O=C.clone(),ee[V]=O),C=O}if(C.visible=w.visible,C.wireframe=w.wireframe,I===xr?C.side=w.shadowSide!==null?w.shadowSide:w.side:C.side=w.shadowSide!==null?w.shadowSide:_[w.side],C.alphaMap=w.alphaMap,C.alphaTest=w.alphaTest,C.map=w.map,C.clipShadows=w.clipShadows,C.clippingPlanes=w.clippingPlanes,C.clipIntersection=w.clipIntersection,C.displacementMap=w.displacementMap,C.displacementScale=w.displacementScale,C.displacementBias=w.displacementBias,C.wireframeLinewidth=w.wireframeLinewidth,C.linewidth=w.linewidth,A.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const G=n.properties.get(C);G.light=A}return C}function S(R,w,A,I,C){if(R.visible===!1)return;if(R.layers.test(w.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&C===xr)&&(!R.frustumCulled||s.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,R.matrixWorld);const V=e.update(R),ee=R.material;if(Array.isArray(ee)){const O=V.groups;for(let H=0,q=O.length;H=1):oe.indexOf("OpenGL ES")!==-1&&(se=parseFloat(/^OpenGL ES (\d)/.exec(oe)[1]),W=se>=2);let ye=null,xe={};const ce=n.getParameter(n.SCISSOR_BOX),ve=n.getParameter(n.VIEWPORT),Oe=new Wt().fromArray(ce),De=new Wt().fromArray(ve);function Q(J,Qe,Ge,Ne){const qe=new Uint8Array(4),dt=n.createTexture();n.bindTexture(J,dt),n.texParameteri(J,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(J,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Nt=0;Nt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let y;const b=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function E(D,N){return g?new OffscreenCanvas(D,N):Zl("canvas")}function v(D,N,K,me){let j=1;if((D.width>me||D.height>me)&&(j=me/Math.max(D.width,D.height)),j<1||N===!0)if(typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&D instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&D instanceof ImageBitmap){const re=N?Su:Math.floor,Ce=re(j*D.width),we=re(j*D.height);y===void 0&&(y=E(Ce,we));const ke=K?E(Ce,we):y;return ke.width=Ce,ke.height=we,ke.getContext("2d").drawImage(D,0,0,Ce,we),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+D.width+"x"+D.height+") to ("+Ce+"x"+we+")."),ke}else return"data"in D&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+D.width+"x"+D.height+")."),D;return D}function S(D){return Sb(D.width)&&Sb(D.height)}function R(D){return a?!1:D.wrapS!==hs||D.wrapT!==hs||D.minFilter!==gn&&D.minFilter!==Wn}function w(D,N){return D.generateMipmaps&&N&&D.minFilter!==gn&&D.minFilter!==Wn}function A(D){n.generateMipmap(D)}function I(D,N,K,me,j=!1){if(a===!1)return N;if(D!==null){if(n[D]!==void 0)return n[D];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+D+"'")}let re=N;if(N===n.RED&&(K===n.FLOAT&&(re=n.R32F),K===n.HALF_FLOAT&&(re=n.R16F),K===n.UNSIGNED_BYTE&&(re=n.R8)),N===n.RED_INTEGER&&(K===n.UNSIGNED_BYTE&&(re=n.R8UI),K===n.UNSIGNED_SHORT&&(re=n.R16UI),K===n.UNSIGNED_INT&&(re=n.R32UI),K===n.BYTE&&(re=n.R8I),K===n.SHORT&&(re=n.R16I),K===n.INT&&(re=n.R32I)),N===n.RG&&(K===n.FLOAT&&(re=n.RG32F),K===n.HALF_FLOAT&&(re=n.RG16F),K===n.UNSIGNED_BYTE&&(re=n.RG8)),N===n.RGBA){const Ce=j?bu:Lt.getTransfer(me);K===n.FLOAT&&(re=n.RGBA32F),K===n.HALF_FLOAT&&(re=n.RGBA16F),K===n.UNSIGNED_BYTE&&(re=Ce===jt?n.SRGB8_ALPHA8:n.RGBA8),K===n.UNSIGNED_SHORT_4_4_4_4&&(re=n.RGBA4),K===n.UNSIGNED_SHORT_5_5_5_1&&(re=n.RGB5_A1)}return(re===n.R16F||re===n.R32F||re===n.RG16F||re===n.RG32F||re===n.RGBA16F||re===n.RGBA32F)&&e.get("EXT_color_buffer_float"),re}function C(D,N,K){return w(D,K)===!0||D.isFramebufferTexture&&D.minFilter!==gn&&D.minFilter!==Wn?Math.log2(Math.max(N.width,N.height))+1:D.mipmaps!==void 0&&D.mipmaps.length>0?D.mipmaps.length:D.isCompressedTexture&&Array.isArray(D.image)?N.mipmaps.length:1}function M(D){return D===gn||D===bb||D===kd?n.NEAREST:n.LINEAR}function G(D){const N=D.target;N.removeEventListener("dispose",G),ee(N),N.isVideoTexture&&f.delete(N)}function V(D){const N=D.target;N.removeEventListener("dispose",V),H(N)}function ee(D){const N=s.get(D);if(N.__webglInit===void 0)return;const K=D.source,me=b.get(K);if(me){const j=me[N.__cacheKey];j.usedTimes--,j.usedTimes===0&&O(D),Object.keys(me).length===0&&b.delete(K)}s.remove(D)}function O(D){const N=s.get(D);n.deleteTexture(N.__webglTexture);const K=D.source,me=b.get(K);delete me[N.__cacheKey],o.memory.textures--}function H(D){const N=D.texture,K=s.get(D),me=s.get(N);if(me.__webglTexture!==void 0&&(n.deleteTexture(me.__webglTexture),o.memory.textures--),D.depthTexture&&D.depthTexture.dispose(),D.isWebGLCubeRenderTarget)for(let j=0;j<6;j++){if(Array.isArray(K.__webglFramebuffer[j]))for(let re=0;re=c&&console.warn("THREE.WebGLTextures: Trying to use "+D+" texture units while this GPU supports only "+c),q+=1,D}function se(D){const N=[];return N.push(D.wrapS),N.push(D.wrapT),N.push(D.wrapR||0),N.push(D.magFilter),N.push(D.minFilter),N.push(D.anisotropy),N.push(D.internalFormat),N.push(D.format),N.push(D.type),N.push(D.generateMipmaps),N.push(D.premultiplyAlpha),N.push(D.flipY),N.push(D.unpackAlignment),N.push(D.colorSpace),N.join()}function oe(D,N){const K=s.get(D);if(D.isVideoTexture&&Re(D),D.isRenderTargetTexture===!1&&D.version>0&&K.__version!==D.version){const me=D.image;if(me===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(me.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{_e(K,D,N);return}}t.bindTexture(n.TEXTURE_2D,K.__webglTexture,n.TEXTURE0+N)}function ye(D,N){const K=s.get(D);if(D.version>0&&K.__version!==D.version){_e(K,D,N);return}t.bindTexture(n.TEXTURE_2D_ARRAY,K.__webglTexture,n.TEXTURE0+N)}function xe(D,N){const K=s.get(D);if(D.version>0&&K.__version!==D.version){_e(K,D,N);return}t.bindTexture(n.TEXTURE_3D,K.__webglTexture,n.TEXTURE0+N)}function ce(D,N){const K=s.get(D);if(D.version>0&&K.__version!==D.version){Ae(K,D,N);return}t.bindTexture(n.TEXTURE_CUBE_MAP,K.__webglTexture,n.TEXTURE0+N)}const ve={[va]:n.REPEAT,[hs]:n.CLAMP_TO_EDGE,[gu]:n.MIRRORED_REPEAT},Oe={[gn]:n.NEAREST,[bb]:n.NEAREST_MIPMAP_NEAREST,[kd]:n.NEAREST_MIPMAP_LINEAR,[Wn]:n.LINEAR,[PN]:n.LINEAR_MIPMAP_NEAREST,[_o]:n.LINEAR_MIPMAP_LINEAR},De={[Ibt]:n.NEVER,[Ubt]:n.ALWAYS,[kbt]:n.LESS,[$N]:n.LEQUAL,[Dbt]:n.EQUAL,[Fbt]:n.GEQUAL,[Lbt]:n.GREATER,[Pbt]:n.NOTEQUAL};function Q(D,N,K){if(K?(n.texParameteri(D,n.TEXTURE_WRAP_S,ve[N.wrapS]),n.texParameteri(D,n.TEXTURE_WRAP_T,ve[N.wrapT]),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,ve[N.wrapR]),n.texParameteri(D,n.TEXTURE_MAG_FILTER,Oe[N.magFilter]),n.texParameteri(D,n.TEXTURE_MIN_FILTER,Oe[N.minFilter])):(n.texParameteri(D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(N.wrapS!==hs||N.wrapT!==hs)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(D,n.TEXTURE_MAG_FILTER,M(N.magFilter)),n.texParameteri(D,n.TEXTURE_MIN_FILTER,M(N.minFilter)),N.minFilter!==gn&&N.minFilter!==Wn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),N.compareFunction&&(n.texParameteri(D,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(D,n.TEXTURE_COMPARE_FUNC,De[N.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const me=e.get("EXT_texture_filter_anisotropic");if(N.magFilter===gn||N.minFilter!==kd&&N.minFilter!==_o||N.type===Ar&&e.has("OES_texture_float_linear")===!1||a===!1&&N.type===Ql&&e.has("OES_texture_half_float_linear")===!1)return;(N.anisotropy>1||s.get(N).__currentAnisotropy)&&(n.texParameterf(D,me.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,r.getMaxAnisotropy())),s.get(N).__currentAnisotropy=N.anisotropy)}}function fe(D,N){let K=!1;D.__webglInit===void 0&&(D.__webglInit=!0,N.addEventListener("dispose",G));const me=N.source;let j=b.get(me);j===void 0&&(j={},b.set(me,j));const re=se(N);if(re!==D.__cacheKey){j[re]===void 0&&(j[re]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,K=!0),j[re].usedTimes++;const Ce=j[D.__cacheKey];Ce!==void 0&&(j[D.__cacheKey].usedTimes--,Ce.usedTimes===0&&O(N)),D.__cacheKey=re,D.__webglTexture=j[re].texture}return K}function _e(D,N,K){let me=n.TEXTURE_2D;(N.isDataArrayTexture||N.isCompressedArrayTexture)&&(me=n.TEXTURE_2D_ARRAY),N.isData3DTexture&&(me=n.TEXTURE_3D);const j=fe(D,N),re=N.source;t.bindTexture(me,D.__webglTexture,n.TEXTURE0+K);const Ce=s.get(re);if(re.version!==Ce.__version||j===!0){t.activeTexture(n.TEXTURE0+K);const we=Lt.getPrimaries(Lt.workingColorSpace),ke=N.colorSpace===bs?null:Lt.getPrimaries(N.colorSpace),We=N.colorSpace===bs||we===ke?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,N.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,N.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,N.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,We);const lt=R(N)&&S(N.image)===!1;let Pe=v(N.image,lt,!1,u);Pe=ge(N,Pe);const Mt=S(Pe)||a,et=i.convert(N.format,N.colorSpace);let tt=i.convert(N.type),ze=I(N.internalFormat,et,tt,N.colorSpace,N.isVideoTexture);Q(me,N,Mt);let je;const _t=N.mipmaps,J=a&&N.isVideoTexture!==!0&&ze!==HN,Qe=Ce.__version===void 0||j===!0,Ge=C(N,Pe,Mt);if(N.isDepthTexture)ze=n.DEPTH_COMPONENT,a?N.type===Ar?ze=n.DEPTH_COMPONENT32F:N.type===fi?ze=n.DEPTH_COMPONENT24:N.type===no?ze=n.DEPTH24_STENCIL8:ze=n.DEPTH_COMPONENT16:N.type===Ar&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),N.format===so&&ze===n.DEPTH_COMPONENT&&N.type!==uy&&N.type!==fi&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),N.type=fi,tt=i.convert(N.type)),N.format===Sa&&ze===n.DEPTH_COMPONENT&&(ze=n.DEPTH_STENCIL,N.type!==no&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),N.type=no,tt=i.convert(N.type))),Qe&&(J?t.texStorage2D(n.TEXTURE_2D,1,ze,Pe.width,Pe.height):t.texImage2D(n.TEXTURE_2D,0,ze,Pe.width,Pe.height,0,et,tt,null));else if(N.isDataTexture)if(_t.length>0&&Mt){J&&Qe&&t.texStorage2D(n.TEXTURE_2D,Ge,ze,_t[0].width,_t[0].height);for(let Ne=0,qe=_t.length;Ne>=1,qe>>=1}}else if(_t.length>0&&Mt){J&&Qe&&t.texStorage2D(n.TEXTURE_2D,Ge,ze,_t[0].width,_t[0].height);for(let Ne=0,qe=_t.length;Ne0&&Qe++,t.texStorage2D(n.TEXTURE_CUBE_MAP,Qe,je,Pe[0].width,Pe[0].height));for(let Ne=0;Ne<6;Ne++)if(lt){_t?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,0,0,Pe[Ne].width,Pe[Ne].height,tt,ze,Pe[Ne].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,je,Pe[Ne].width,Pe[Ne].height,0,tt,ze,Pe[Ne].data);for(let qe=0;qe>re),Pe=Math.max(1,N.height>>re);j===n.TEXTURE_3D||j===n.TEXTURE_2D_ARRAY?t.texImage3D(j,re,ke,lt,Pe,N.depth,0,Ce,we,null):t.texImage2D(j,re,ke,lt,Pe,0,Ce,we,null)}t.bindFramebuffer(n.FRAMEBUFFER,D),Me(N)?m.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,me,j,s.get(K).__webglTexture,0,le(N)):(j===n.TEXTURE_2D||j>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&j<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,me,j,s.get(K).__webglTexture,re),t.bindFramebuffer(n.FRAMEBUFFER,null)}function te(D,N,K){if(n.bindRenderbuffer(n.RENDERBUFFER,D),N.depthBuffer&&!N.stencilBuffer){let me=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(K||Me(N)){const j=N.depthTexture;j&&j.isDepthTexture&&(j.type===Ar?me=n.DEPTH_COMPONENT32F:j.type===fi&&(me=n.DEPTH_COMPONENT24));const re=le(N);Me(N)?m.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,re,me,N.width,N.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,re,me,N.width,N.height)}else n.renderbufferStorage(n.RENDERBUFFER,me,N.width,N.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,D)}else if(N.depthBuffer&&N.stencilBuffer){const me=le(N);K&&Me(N)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,me,n.DEPTH24_STENCIL8,N.width,N.height):Me(N)?m.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,me,n.DEPTH24_STENCIL8,N.width,N.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,N.width,N.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,D)}else{const me=N.isWebGLMultipleRenderTargets===!0?N.texture:[N.texture];for(let j=0;j0){K.__webglFramebuffer[we]=[];for(let ke=0;ke0){K.__webglFramebuffer=[];for(let we=0;we0&&Me(D)===!1){const we=re?N:[N];K.__webglMultisampledFramebuffer=n.createFramebuffer(),K.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,K.__webglMultisampledFramebuffer);for(let ke=0;ke0)for(let ke=0;ke0)for(let ke=0;ke0&&Me(D)===!1){const N=D.isWebGLMultipleRenderTargets?D.texture:[D.texture],K=D.width,me=D.height;let j=n.COLOR_BUFFER_BIT;const re=[],Ce=D.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,we=s.get(D),ke=D.isWebGLMultipleRenderTargets===!0;if(ke)for(let We=0;We0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&N.__useRenderToTexture!==!1}function Re(D){const N=o.render.frame;f.get(D)!==N&&(f.set(D,N),D.update())}function ge(D,N){const K=D.colorSpace,me=D.format,j=D.type;return D.isCompressedTexture===!0||D.isVideoTexture===!0||D.format===vb||K!==Cn&&K!==bs&&(Lt.getTransfer(K)===jt?a===!1?e.has("EXT_sRGB")===!0&&me===gs?(D.format=vb,D.minFilter=Wn,D.generateMipmaps=!1):N=KN.sRGBToLinear(N):(me!==gs||j!==yi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",K)),N}this.allocateTextureUnit=W,this.resetTextureUnits=L,this.setTexture2D=oe,this.setTexture2DArray=ye,this.setTexture3D=xe,this.setTextureCube=ce,this.rebindTextures=Z,this.setupRenderTarget=de,this.updateRenderTargetMipmap=pe,this.updateMultisampleRenderTarget=he,this.setupDepthRenderbuffer=P,this.setupFrameBufferTexture=Ue,this.useMultisampledRTT=Me}function ZSt(n,e,t){const s=t.isWebGL2;function r(i,o=bs){let a;const c=Lt.getTransfer(o);if(i===yi)return n.UNSIGNED_BYTE;if(i===UN)return n.UNSIGNED_SHORT_4_4_4_4;if(i===BN)return n.UNSIGNED_SHORT_5_5_5_1;if(i===ybt)return n.BYTE;if(i===Ebt)return n.SHORT;if(i===uy)return n.UNSIGNED_SHORT;if(i===FN)return n.INT;if(i===fi)return n.UNSIGNED_INT;if(i===Ar)return n.FLOAT;if(i===Ql)return s?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(i===vbt)return n.ALPHA;if(i===gs)return n.RGBA;if(i===Sbt)return n.LUMINANCE;if(i===Tbt)return n.LUMINANCE_ALPHA;if(i===so)return n.DEPTH_COMPONENT;if(i===Sa)return n.DEPTH_STENCIL;if(i===vb)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(i===xbt)return n.RED;if(i===GN)return n.RED_INTEGER;if(i===Cbt)return n.RG;if(i===VN)return n.RG_INTEGER;if(i===zN)return n.RGBA_INTEGER;if(i===Yh||i===$h||i===Wh||i===Kh)if(c===jt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(i===Yh)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===$h)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Wh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Kh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(i===Yh)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===$h)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Wh)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Kh)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===fC||i===_C||i===mC||i===hC)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(i===fC)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===_C)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===mC)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===hC)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===HN)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(i===gC||i===bC)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(i===gC)return c===jt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(i===bC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===yC||i===EC||i===vC||i===SC||i===TC||i===xC||i===CC||i===wC||i===RC||i===AC||i===MC||i===NC||i===OC||i===IC)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(i===yC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===EC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===vC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===SC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===TC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===xC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===CC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===wC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===RC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===AC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===MC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===NC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===OC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===IC)return c===jt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===jh||i===kC||i===DC)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(i===jh)return c===jt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===kC)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===DC)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===wbt||i===LC||i===PC||i===FC)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(i===jh)return a.COMPRESSED_RED_RGTC1_EXT;if(i===LC)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===PC)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===FC)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===no?s?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[i]!==void 0?n[i]:null}return{convert:r}}class JSt extends Gn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Qi extends Jt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const e1t={type:"move"};class yg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Qi,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Qi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ie,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ie),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Qi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ie,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ie),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const s of e.hand.values())this._getHandJoint(t,s)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,s){let r=null,i=null,o=null;const a=this._targetRay,c=this._grip,d=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(d&&e.hand){o=!0;for(const y of e.hand.values()){const b=t.getJointPose(y,s),g=this._getHandJoint(d,y);b!==null&&(g.matrix.fromArray(b.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=b.radius),g.visible=b!==null}const u=d.joints["index-finger-tip"],_=d.joints["thumb-tip"],m=u.position.distanceTo(_.position),h=.02,f=.005;d.inputState.pinching&&m>h+f?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!d.inputState.pinching&&m<=h-f&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,s),i!==null&&(c.matrix.fromArray(i.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,i.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(i.linearVelocity)):c.hasLinearVelocity=!1,i.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(i.angularVelocity)):c.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,s),r===null&&i!==null&&(r=i),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(e1t)))}return a!==null&&(a.visible=r!==null),c!==null&&(c.visible=i!==null),d!==null&&(d.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const s=new Qi;s.matrixAutoUpdate=!1,s.visible=!1,e.joints[t.jointName]=s,e.add(s)}return e.joints[t.jointName]}}class t1t extends Ha{constructor(e,t){super();const s=this;let r=null,i=1,o=null,a="local-floor",c=1,d=null,u=null,_=null,m=null,h=null,f=null;const y=t.getContextAttributes();let b=null,g=null;const E=[],v=[],S=new Rt;let R=null;const w=new Gn;w.layers.enable(1),w.viewport=new Wt;const A=new Gn;A.layers.enable(2),A.viewport=new Wt;const I=[w,A],C=new JSt;C.layers.enable(1),C.layers.enable(2);let M=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ce){let ve=E[ce];return ve===void 0&&(ve=new yg,E[ce]=ve),ve.getTargetRaySpace()},this.getControllerGrip=function(ce){let ve=E[ce];return ve===void 0&&(ve=new yg,E[ce]=ve),ve.getGripSpace()},this.getHand=function(ce){let ve=E[ce];return ve===void 0&&(ve=new yg,E[ce]=ve),ve.getHandSpace()};function V(ce){const ve=v.indexOf(ce.inputSource);if(ve===-1)return;const Oe=E[ve];Oe!==void 0&&(Oe.update(ce.inputSource,ce.frame,d||o),Oe.dispatchEvent({type:ce.type,data:ce.inputSource}))}function ee(){r.removeEventListener("select",V),r.removeEventListener("selectstart",V),r.removeEventListener("selectend",V),r.removeEventListener("squeeze",V),r.removeEventListener("squeezestart",V),r.removeEventListener("squeezeend",V),r.removeEventListener("end",ee),r.removeEventListener("inputsourceschange",O);for(let ce=0;ce=0&&(v[De]=null,E[De].disconnect(Oe))}for(let ve=0;ve=v.length){v.push(Oe),De=fe;break}else if(v[fe]===null){v[fe]=Oe,De=fe;break}if(De===-1)break}const Q=E[De];Q&&Q.connect(Oe)}}const H=new ie,q=new ie;function L(ce,ve,Oe){H.setFromMatrixPosition(ve.matrixWorld),q.setFromMatrixPosition(Oe.matrixWorld);const De=H.distanceTo(q),Q=ve.projectionMatrix.elements,fe=Oe.projectionMatrix.elements,_e=Q[14]/(Q[10]-1),Ae=Q[14]/(Q[10]+1),Ue=(Q[9]+1)/Q[5],te=(Q[9]-1)/Q[5],U=(Q[8]-1)/Q[0],P=(fe[8]+1)/fe[0],Z=_e*U,de=_e*P,pe=De/(-U+P),he=pe*-U;ve.matrixWorld.decompose(ce.position,ce.quaternion,ce.scale),ce.translateX(he),ce.translateZ(pe),ce.matrixWorld.compose(ce.position,ce.quaternion,ce.scale),ce.matrixWorldInverse.copy(ce.matrixWorld).invert();const le=_e+pe,Me=Ae+pe,Re=Z-he,ge=de+(De-he),D=Ue*Ae/Me*le,N=te*Ae/Me*le;ce.projectionMatrix.makePerspective(Re,ge,D,N,le,Me),ce.projectionMatrixInverse.copy(ce.projectionMatrix).invert()}function W(ce,ve){ve===null?ce.matrixWorld.copy(ce.matrix):ce.matrixWorld.multiplyMatrices(ve.matrixWorld,ce.matrix),ce.matrixWorldInverse.copy(ce.matrixWorld).invert()}this.updateCamera=function(ce){if(r===null)return;C.near=A.near=w.near=ce.near,C.far=A.far=w.far=ce.far,(M!==C.near||G!==C.far)&&(r.updateRenderState({depthNear:C.near,depthFar:C.far}),M=C.near,G=C.far);const ve=ce.parent,Oe=C.cameras;W(C,ve);for(let De=0;De0&&(b.alphaTest.value=g.alphaTest);const E=e.get(g).envMap;if(E&&(b.envMap.value=E,b.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,b.reflectivity.value=g.reflectivity,b.ior.value=g.ior,b.refractionRatio.value=g.refractionRatio),g.lightMap){b.lightMap.value=g.lightMap;const v=n._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=g.lightMapIntensity*v,t(g.lightMap,b.lightMapTransform)}g.aoMap&&(b.aoMap.value=g.aoMap,b.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,b.aoMapTransform))}function o(b,g){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,g.map&&(b.map.value=g.map,t(g.map,b.mapTransform))}function a(b,g){b.dashSize.value=g.dashSize,b.totalSize.value=g.dashSize+g.gapSize,b.scale.value=g.scale}function c(b,g,E,v){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,b.size.value=g.size*E,b.scale.value=v*.5,g.map&&(b.map.value=g.map,t(g.map,b.uvTransform)),g.alphaMap&&(b.alphaMap.value=g.alphaMap,t(g.alphaMap,b.alphaMapTransform)),g.alphaTest>0&&(b.alphaTest.value=g.alphaTest)}function d(b,g){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,b.rotation.value=g.rotation,g.map&&(b.map.value=g.map,t(g.map,b.mapTransform)),g.alphaMap&&(b.alphaMap.value=g.alphaMap,t(g.alphaMap,b.alphaMapTransform)),g.alphaTest>0&&(b.alphaTest.value=g.alphaTest)}function u(b,g){b.specular.value.copy(g.specular),b.shininess.value=Math.max(g.shininess,1e-4)}function _(b,g){g.gradientMap&&(b.gradientMap.value=g.gradientMap)}function m(b,g){b.metalness.value=g.metalness,g.metalnessMap&&(b.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,b.metalnessMapTransform)),b.roughness.value=g.roughness,g.roughnessMap&&(b.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,b.roughnessMapTransform)),e.get(g).envMap&&(b.envMapIntensity.value=g.envMapIntensity)}function h(b,g,E){b.ior.value=g.ior,g.sheen>0&&(b.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),b.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(b.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,b.sheenColorMapTransform)),g.sheenRoughnessMap&&(b.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,b.sheenRoughnessMapTransform))),g.clearcoat>0&&(b.clearcoat.value=g.clearcoat,b.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(b.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,b.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(b.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Zn&&b.clearcoatNormalScale.value.negate())),g.iridescence>0&&(b.iridescence.value=g.iridescence,b.iridescenceIOR.value=g.iridescenceIOR,b.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],b.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(b.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,b.iridescenceMapTransform)),g.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,b.iridescenceThicknessMapTransform))),g.transmission>0&&(b.transmission.value=g.transmission,b.transmissionSamplerMap.value=E.texture,b.transmissionSamplerSize.value.set(E.width,E.height),g.transmissionMap&&(b.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,b.transmissionMapTransform)),b.thickness.value=g.thickness,g.thicknessMap&&(b.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,b.thicknessMapTransform)),b.attenuationDistance.value=g.attenuationDistance,b.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(b.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(b.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=g.specularIntensity,b.specularColor.value.copy(g.specularColor),g.specularColorMap&&(b.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,b.specularColorMapTransform)),g.specularIntensityMap&&(b.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,b.specularIntensityMapTransform))}function f(b,g){g.matcap&&(b.matcap.value=g.matcap)}function y(b,g){const E=e.get(g).light;b.referencePosition.value.setFromMatrixPosition(E.matrixWorld),b.nearDistance.value=E.shadow.camera.near,b.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:r}}function s1t(n,e,t,s){let r={},i={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function c(E,v){const S=v.program;s.uniformBlockBinding(E,S)}function d(E,v){let S=r[E.id];S===void 0&&(f(E),S=u(E),r[E.id]=S,E.addEventListener("dispose",b));const R=v.program;s.updateUBOMapping(E,R);const w=e.render.frame;i[E.id]!==w&&(m(E),i[E.id]=w)}function u(E){const v=_();E.__bindingPointIndex=v;const S=n.createBuffer(),R=E.__size,w=E.usage;return n.bindBuffer(n.UNIFORM_BUFFER,S),n.bufferData(n.UNIFORM_BUFFER,R,w),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,v,S),S}function _(){for(let E=0;E0){w=S%R;const V=R-w;w!==0&&V-M.boundary<0&&(S+=R-w,C.__offset=S)}S+=M.storage}return w=S%R,w>0&&(S+=R-w),E.__size=S,E.__cache={},this}function y(E){const v={boundary:0,storage:0};return typeof E=="number"?(v.boundary=4,v.storage=4):E.isVector2?(v.boundary=8,v.storage=8):E.isVector3||E.isColor?(v.boundary=16,v.storage=12):E.isVector4?(v.boundary=16,v.storage=16):E.isMatrix3?(v.boundary=48,v.storage=48):E.isMatrix4?(v.boundary=64,v.storage=64):E.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",E),v}function b(E){const v=E.target;v.removeEventListener("dispose",b);const S=o.indexOf(v.__bindingPointIndex);o.splice(S,1),n.deleteBuffer(r[v.id]),delete r[v.id],delete i[v.id]}function g(){for(const E in r)n.deleteBuffer(r[E]);o=[],r={},i={}}return{bind:c,update:d,dispose:g}}class uO{constructor(e={}){const{canvas:t=e0t(),context:s=null,depth:r=!0,stencil:i=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:d=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:_=!1}=e;this.isWebGLRenderer=!0;let m;s!==null?m=s.getContextAttributes().alpha:m=o;const h=new Uint32Array(4),f=new Int32Array(4);let y=null,b=null;const g=[],E=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=nn,this._useLegacyLights=!1,this.toneMapping=bi,this.toneMappingExposure=1;const v=this;let S=!1,R=0,w=0,A=null,I=-1,C=null;const M=new Wt,G=new Wt;let V=null;const ee=new pt(0);let O=0,H=t.width,q=t.height,L=1,W=null,se=null;const oe=new Wt(0,0,H,q),ye=new Wt(0,0,H,q);let xe=!1;const ce=new my;let ve=!1,Oe=!1,De=null;const Q=new xt,fe=new Rt,_e=new ie,Ae={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ue(){return A===null?L:1}let te=s;function U(F,ue){for(let Ee=0;Ee{function Xe(){if(Se.forEach(function(st){he.get(st).currentProgram.isReady()&&Se.delete(st)}),Se.size===0){be(F);return}setTimeout(Xe,10)}P.get("KHR_parallel_shader_compile")!==null?Xe():setTimeout(Xe,10)})};let Nt=null;function dn(F){Nt&&Nt(F)}function wn(){Rn.stop()}function qt(){Rn.start()}const Rn=new rO;Rn.setAnimationLoop(dn),typeof self<"u"&&Rn.setContext(self),this.setAnimationLoop=function(F){Nt=F,je.setAnimationLoop(F),F===null?Rn.stop():Rn.start()},je.addEventListener("sessionstart",wn),je.addEventListener("sessionend",qt),this.render=function(F,ue){if(ue!==void 0&&ue.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),ue.parent===null&&ue.matrixWorldAutoUpdate===!0&&ue.updateMatrixWorld(),je.enabled===!0&&je.isPresenting===!0&&(je.cameraAutoUpdate===!0&&je.updateCamera(ue),ue=je.getCamera()),F.isScene===!0&&F.onBeforeRender(v,F,ue,A),b=re.get(F,E.length),b.init(),E.push(b),Q.multiplyMatrices(ue.projectionMatrix,ue.matrixWorldInverse),ce.setFromProjectionMatrix(Q),Oe=this.localClippingEnabled,ve=Ce.init(this.clippingPlanes,Oe),y=j.get(F,g.length),y.init(),g.push(y),Os(F,ue,0,v.sortObjects),y.finish(),v.sortObjects===!0&&y.sort(W,se),this.info.render.frame++,ve===!0&&Ce.beginShadows();const Ee=b.state.shadowsArray;if(we.render(Ee,F,ue),ve===!0&&Ce.endShadows(),this.info.autoReset===!0&&this.info.reset(),ke.render(y,F),b.setupLights(v._useLegacyLights),ue.isArrayCamera){const Se=ue.cameras;for(let be=0,Xe=Se.length;be0?b=E[E.length-1]:b=null,g.pop(),g.length>0?y=g[g.length-1]:y=null};function Os(F,ue,Ee,Se){if(F.visible===!1)return;if(F.layers.test(ue.layers)){if(F.isGroup)Ee=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(ue);else if(F.isLight)b.pushLight(F),F.castShadow&&b.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||ce.intersectsSprite(F)){Se&&_e.setFromMatrixPosition(F.matrixWorld).applyMatrix4(Q);const st=N.update(F),ct=F.material;ct.visible&&y.push(F,st,ct,Ee,_e.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||ce.intersectsObject(F))){const st=N.update(F),ct=F.material;if(Se&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),_e.copy(F.boundingSphere.center)):(st.boundingSphere===null&&st.computeBoundingSphere(),_e.copy(st.boundingSphere.center)),_e.applyMatrix4(F.matrixWorld).applyMatrix4(Q)),Array.isArray(ct)){const ut=st.groups;for(let Et=0,mt=ut.length;Et0&&ky(be,Xe,ue,Ee),Se&&de.viewport(M.copy(Se)),be.length>0&&ja(be,ue,Ee),Xe.length>0&&ja(Xe,ue,Ee),st.length>0&&ja(st,ue,Ee),de.buffers.depth.setTest(!0),de.buffers.depth.setMask(!0),de.buffers.color.setMask(!0),de.setPolygonOffset(!1)}function ky(F,ue,Ee,Se){if((Ee.isScene===!0?Ee.overrideMaterial:null)!==null)return;const Xe=Z.isWebGL2;De===null&&(De=new mo(1,1,{generateMipmaps:!0,type:P.has("EXT_color_buffer_half_float")?Ql:yi,minFilter:_o,samples:Xe?4:0})),v.getDrawingBufferSize(fe),Xe?De.setSize(fe.x,fe.y):De.setSize(Su(fe.x),Su(fe.y));const st=v.getRenderTarget();v.setRenderTarget(De),v.getClearColor(ee),O=v.getClearAlpha(),O<1&&v.setClearColor(16777215,.5),v.clear();const ct=v.toneMapping;v.toneMapping=bi,ja(F,Ee,Se),le.updateMultisampleRenderTarget(De),le.updateRenderTargetMipmap(De);let ut=!1;for(let Et=0,mt=ue.length;Et0),gt=!!Ee.morphAttributes.position,tn=!!Ee.morphAttributes.normal,qn=!!Ee.morphAttributes.color;let un=bi;Se.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(un=v.toneMapping);const Ws=Ee.morphAttributes.position||Ee.morphAttributes.normal||Ee.morphAttributes.color,Qt=Ws!==void 0?Ws.length:0,St=he.get(Se),hc=b.state.lights;if(ve===!0&&(Oe===!0||F!==C)){const es=F===C&&Se.id===I;Ce.setState(Se,F,es)}let Zt=!1;Se.version===St.__version?(St.needsLights&&St.lightsStateVersion!==hc.state.version||St.outputColorSpace!==ct||be.isBatchedMesh&&St.batching===!1||!be.isBatchedMesh&&St.batching===!0||be.isInstancedMesh&&St.instancing===!1||!be.isInstancedMesh&&St.instancing===!0||be.isSkinnedMesh&&St.skinning===!1||!be.isSkinnedMesh&&St.skinning===!0||be.isInstancedMesh&&St.instancingColor===!0&&be.instanceColor===null||be.isInstancedMesh&&St.instancingColor===!1&&be.instanceColor!==null||St.envMap!==ut||Se.fog===!0&&St.fog!==Xe||St.numClippingPlanes!==void 0&&(St.numClippingPlanes!==Ce.numPlanes||St.numIntersection!==Ce.numIntersection)||St.vertexAlphas!==Et||St.vertexTangents!==mt||St.morphTargets!==gt||St.morphNormals!==tn||St.morphColors!==qn||St.toneMapping!==un||Z.isWebGL2===!0&&St.morphTargetsCount!==Qt)&&(Zt=!0):(Zt=!0,St.__version=Se.version);let zr=St.currentProgram;Zt===!0&&(zr=Qa(Se,ue,be));let wp=!1,vo=!1,gc=!1;const yn=zr.getUniforms(),Hr=St.uniforms;if(de.useProgram(zr.program)&&(wp=!0,vo=!0,gc=!0),Se.id!==I&&(I=Se.id,vo=!0),wp||C!==F){yn.setValue(te,"projectionMatrix",F.projectionMatrix),yn.setValue(te,"viewMatrix",F.matrixWorldInverse);const es=yn.map.cameraPosition;es!==void 0&&es.setValue(te,_e.setFromMatrixPosition(F.matrixWorld)),Z.logarithmicDepthBuffer&&yn.setValue(te,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(Se.isMeshPhongMaterial||Se.isMeshToonMaterial||Se.isMeshLambertMaterial||Se.isMeshBasicMaterial||Se.isMeshStandardMaterial||Se.isShaderMaterial)&&yn.setValue(te,"isOrthographic",F.isOrthographicCamera===!0),C!==F&&(C=F,vo=!0,gc=!0)}if(be.isSkinnedMesh){yn.setOptional(te,be,"bindMatrix"),yn.setOptional(te,be,"bindMatrixInverse");const es=be.skeleton;es&&(Z.floatVertexTextures?(es.boneTexture===null&&es.computeBoneTexture(),yn.setValue(te,"boneTexture",es.boneTexture,le)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}be.isBatchedMesh&&(yn.setOptional(te,be,"batchingTexture"),yn.setValue(te,"batchingTexture",be._matricesTexture,le));const bc=Ee.morphAttributes;if((bc.position!==void 0||bc.normal!==void 0||bc.color!==void 0&&Z.isWebGL2===!0)&&We.update(be,Ee,zr),(vo||St.receiveShadow!==be.receiveShadow)&&(St.receiveShadow=be.receiveShadow,yn.setValue(te,"receiveShadow",be.receiveShadow)),Se.isMeshGouraudMaterial&&Se.envMap!==null&&(Hr.envMap.value=ut,Hr.flipEnvMap.value=ut.isCubeTexture&&ut.isRenderTargetTexture===!1?-1:1),vo&&(yn.setValue(te,"toneMappingExposure",v.toneMappingExposure),St.needsLights&&Ly(Hr,gc),Xe&&Se.fog===!0&&me.refreshFogUniforms(Hr,Xe),me.refreshMaterialUniforms(Hr,Se,L,q,De),Dd.upload(te,xp(St),Hr,le)),Se.isShaderMaterial&&Se.uniformsNeedUpdate===!0&&(Dd.upload(te,xp(St),Hr,le),Se.uniformsNeedUpdate=!1),Se.isSpriteMaterial&&yn.setValue(te,"center",be.center),yn.setValue(te,"modelViewMatrix",be.modelViewMatrix),yn.setValue(te,"normalMatrix",be.normalMatrix),yn.setValue(te,"modelMatrix",be.matrixWorld),Se.isShaderMaterial||Se.isRawShaderMaterial){const es=Se.uniformsGroups;for(let yc=0,Fy=es.length;yc0&&le.useMultisampledRTT(F)===!1?be=he.get(F).__webglMultisampledFramebuffer:Array.isArray(mt)?be=mt[Ee]:be=mt,M.copy(F.viewport),G.copy(F.scissor),V=F.scissorTest}else M.copy(oe).multiplyScalar(L).floor(),G.copy(ye).multiplyScalar(L).floor(),V=xe;if(de.bindFramebuffer(te.FRAMEBUFFER,be)&&Z.drawBuffers&&Se&&de.drawBuffers(F,be),de.viewport(M),de.scissor(G),de.setScissorTest(V),Xe){const ut=he.get(F.texture);te.framebufferTexture2D(te.FRAMEBUFFER,te.COLOR_ATTACHMENT0,te.TEXTURE_CUBE_MAP_POSITIVE_X+ue,ut.__webglTexture,Ee)}else if(st){const ut=he.get(F.texture),Et=ue||0;te.framebufferTextureLayer(te.FRAMEBUFFER,te.COLOR_ATTACHMENT0,ut.__webglTexture,Ee||0,Et)}I=-1},this.readRenderTargetPixels=function(F,ue,Ee,Se,be,Xe,st){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ct=he.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&st!==void 0&&(ct=ct[st]),ct){de.bindFramebuffer(te.FRAMEBUFFER,ct);try{const ut=F.texture,Et=ut.format,mt=ut.type;if(Et!==gs&&Mt.convert(Et)!==te.getParameter(te.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const gt=mt===Ql&&(P.has("EXT_color_buffer_half_float")||Z.isWebGL2&&P.has("EXT_color_buffer_float"));if(mt!==yi&&Mt.convert(mt)!==te.getParameter(te.IMPLEMENTATION_COLOR_READ_TYPE)&&!(mt===Ar&&(Z.isWebGL2||P.has("OES_texture_float")||P.has("WEBGL_color_buffer_float")))&&!gt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ue>=0&&ue<=F.width-Se&&Ee>=0&&Ee<=F.height-be&&te.readPixels(ue,Ee,Se,be,Mt.convert(Et),Mt.convert(mt),Xe)}finally{const ut=A!==null?he.get(A).__webglFramebuffer:null;de.bindFramebuffer(te.FRAMEBUFFER,ut)}}},this.copyFramebufferToTexture=function(F,ue,Ee=0){const Se=Math.pow(2,-Ee),be=Math.floor(ue.image.width*Se),Xe=Math.floor(ue.image.height*Se);le.setTexture2D(ue,0),te.copyTexSubImage2D(te.TEXTURE_2D,Ee,0,0,F.x,F.y,be,Xe),de.unbindTexture()},this.copyTextureToTexture=function(F,ue,Ee,Se=0){const be=ue.image.width,Xe=ue.image.height,st=Mt.convert(Ee.format),ct=Mt.convert(Ee.type);le.setTexture2D(Ee,0),te.pixelStorei(te.UNPACK_FLIP_Y_WEBGL,Ee.flipY),te.pixelStorei(te.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ee.premultiplyAlpha),te.pixelStorei(te.UNPACK_ALIGNMENT,Ee.unpackAlignment),ue.isDataTexture?te.texSubImage2D(te.TEXTURE_2D,Se,F.x,F.y,be,Xe,st,ct,ue.image.data):ue.isCompressedTexture?te.compressedTexSubImage2D(te.TEXTURE_2D,Se,F.x,F.y,ue.mipmaps[0].width,ue.mipmaps[0].height,st,ue.mipmaps[0].data):te.texSubImage2D(te.TEXTURE_2D,Se,F.x,F.y,st,ct,ue.image),Se===0&&Ee.generateMipmaps&&te.generateMipmap(te.TEXTURE_2D),de.unbindTexture()},this.copyTextureToTexture3D=function(F,ue,Ee,Se,be=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Xe=F.max.x-F.min.x+1,st=F.max.y-F.min.y+1,ct=F.max.z-F.min.z+1,ut=Mt.convert(Se.format),Et=Mt.convert(Se.type);let mt;if(Se.isData3DTexture)le.setTexture3D(Se,0),mt=te.TEXTURE_3D;else if(Se.isDataArrayTexture)le.setTexture2DArray(Se,0),mt=te.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}te.pixelStorei(te.UNPACK_FLIP_Y_WEBGL,Se.flipY),te.pixelStorei(te.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Se.premultiplyAlpha),te.pixelStorei(te.UNPACK_ALIGNMENT,Se.unpackAlignment);const gt=te.getParameter(te.UNPACK_ROW_LENGTH),tn=te.getParameter(te.UNPACK_IMAGE_HEIGHT),qn=te.getParameter(te.UNPACK_SKIP_PIXELS),un=te.getParameter(te.UNPACK_SKIP_ROWS),Ws=te.getParameter(te.UNPACK_SKIP_IMAGES),Qt=Ee.isCompressedTexture?Ee.mipmaps[0]:Ee.image;te.pixelStorei(te.UNPACK_ROW_LENGTH,Qt.width),te.pixelStorei(te.UNPACK_IMAGE_HEIGHT,Qt.height),te.pixelStorei(te.UNPACK_SKIP_PIXELS,F.min.x),te.pixelStorei(te.UNPACK_SKIP_ROWS,F.min.y),te.pixelStorei(te.UNPACK_SKIP_IMAGES,F.min.z),Ee.isDataTexture||Ee.isData3DTexture?te.texSubImage3D(mt,be,ue.x,ue.y,ue.z,Xe,st,ct,ut,Et,Qt.data):Ee.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),te.compressedTexSubImage3D(mt,be,ue.x,ue.y,ue.z,Xe,st,ct,ut,Qt.data)):te.texSubImage3D(mt,be,ue.x,ue.y,ue.z,Xe,st,ct,ut,Et,Qt),te.pixelStorei(te.UNPACK_ROW_LENGTH,gt),te.pixelStorei(te.UNPACK_IMAGE_HEIGHT,tn),te.pixelStorei(te.UNPACK_SKIP_PIXELS,qn),te.pixelStorei(te.UNPACK_SKIP_ROWS,un),te.pixelStorei(te.UNPACK_SKIP_IMAGES,Ws),be===0&&Se.generateMipmaps&&te.generateMipmap(mt),de.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?le.setTextureCube(F,0):F.isData3DTexture?le.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?le.setTexture2DArray(F,0):le.setTexture2D(F,0),de.unbindTexture()},this.resetState=function(){R=0,w=0,A=null,de.reset(),et.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Mr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===fy?"display-p3":"srgb",t.unpackColorSpace=Lt.workingColorSpace===mp?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===nn?ro:YN}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===ro?nn:Cn}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class r1t extends uO{}r1t.prototype.isWebGL1Renderer=!0;class i1t extends Jt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class o1t{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Eb,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Gs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,s){e*=this.stride,s*=t.stride;for(let r=0,i=this.stride;rc)continue;m.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(m);Ie.far||t.push({distance:I,point:_.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),E=Math.min(b.count,o.start+o.count);for(let v=g,S=E-1;vc)continue;m.applyMatrix4(this.matrixWorld);const w=e.ray.origin.distanceTo(m);we.far||t.push({distance:w,point:_.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,s=Object.keys(t);if(s.length>0){const r=t[s[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,o=r.length;i0){const r=t[s[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,o=r.length;ir.far)return;i.push({distance:d,distanceToRay:Math.sqrt(a),point:c,index:e,face:null,object:o})}}class Sy extends Vs{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new pt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=py,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Vr extends Sy{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Rt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return On(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new pt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new pt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new pt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Hw extends Vs{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new pt(16777215),this.specular=new pt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=py,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=dy,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}function hd(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function h1t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function g1t(n){function e(r,i){return n[r]-n[i]}const t=n.length,s=new Array(t);for(let r=0;r!==t;++r)s[r]=r;return s.sort(e),s}function qw(n,e,t){const s=n.length,r=new n.constructor(s);for(let i=0,o=0;o!==s;++i){const a=t[i]*e;for(let c=0;c!==e;++c)r[o++]=n[a+c]}return r}function mO(n,e,t,s){let r=1,i=n[0];for(;i!==void 0&&i[s]===void 0;)i=n[r++];if(i===void 0)return;let o=i[s];if(o!==void 0)if(Array.isArray(o))do o=i[s],o!==void 0&&(e.push(i.time),t.push.apply(t,o)),i=n[r++];while(i!==void 0);else if(o.toArray!==void 0)do o=i[s],o!==void 0&&(e.push(i.time),o.toArray(t,t.length)),i=n[r++];while(i!==void 0);else do o=i[s],o!==void 0&&(e.push(i.time),t.push(o)),i=n[r++];while(i!==void 0)}class fc{constructor(e,t,s,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(s),this.sampleValues=t,this.valueSize=s,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let s=this._cachedIndex,r=t[s],i=t[s-1];e:{t:{let o;n:{s:if(!(e=i)){const a=t[1];e=i)break t}o=s,s=0;break n}break e}for(;s>>1;et;)--o;if(++o,i!==0||o!==r){i>=o&&(o=Math.max(o,1),i=o-1);const a=this.getValueSize();this.times=s.slice(i,o),this.values=this.values.slice(i*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const s=this.times,r=this.values,i=s.length;i===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==i;a++){const c=s[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),e=!1;break}o=c}if(r!==void 0&&h1t(r))for(let a=0,c=r.length;a!==c;++a){const d=r[a];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,d),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),s=this.getValueSize(),r=this.getInterpolation()===Qh,i=e.length-1;let o=1;for(let a=1;a0){e[o]=e[i];for(let a=i*s,c=o*s,d=0;d!==s;++d)t[c+d]=t[a+d];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*s)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),s=this.constructor,r=new s(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}_r.prototype.TimeBufferType=Float32Array;_r.prototype.ValueBufferType=Float32Array;_r.prototype.DefaultInterpolation=Ta;class Ya extends _r{}Ya.prototype.ValueTypeName="bool";Ya.prototype.ValueBufferType=Array;Ya.prototype.DefaultInterpolation=Xl;Ya.prototype.InterpolantFactoryMethodLinear=void 0;Ya.prototype.InterpolantFactoryMethodSmooth=void 0;class hO extends _r{}hO.prototype.ValueTypeName="color";class wa extends _r{}wa.prototype.ValueTypeName="number";class v1t extends fc{constructor(e,t,s,r){super(e,t,s,r)}interpolate_(e,t,s,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(s-t)/(r-t);let d=e*a;for(let u=d+a;d!==u;d+=4)Ni.slerpFlat(i,0,o,d-a,o,d,c);return i}}class go extends _r{InterpolantFactoryMethodLinear(e){return new v1t(this.times,this.values,this.getValueSize(),e)}}go.prototype.ValueTypeName="quaternion";go.prototype.DefaultInterpolation=Ta;go.prototype.InterpolantFactoryMethodSmooth=void 0;class $a extends _r{}$a.prototype.ValueTypeName="string";$a.prototype.ValueBufferType=Array;$a.prototype.DefaultInterpolation=Xl;$a.prototype.InterpolantFactoryMethodLinear=void 0;$a.prototype.InterpolantFactoryMethodSmooth=void 0;class Ra extends _r{}Ra.prototype.ValueTypeName="vector";class S1t{constructor(e,t=-1,s,r=Rbt){this.name=e,this.tracks=s,this.duration=t,this.blendMode=r,this.uuid=Gs(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],s=e.tracks,r=1/(e.fps||1);for(let o=0,a=s.length;o!==a;++o)t.push(x1t(s[o]).scale(r));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],s=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let i=0,o=s.length;i!==o;++i)t.push(_r.toJSON(s[i]));return r}static CreateFromMorphTargetSequence(e,t,s,r){const i=t.length,o=[];for(let a=0;a1){const _=u[1];let m=r[_];m||(r[_]=m=[]),m.push(d)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,s));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const s=function(_,m,h,f,y){if(h.length!==0){const b=[],g=[];mO(h,b,g,f),b.length!==0&&y.push(new _(m,b,g))}},r=[],i=e.name||"default",o=e.fps||30,a=e.blendMode;let c=e.length||-1;const d=e.hierarchy||[];for(let _=0;_{t&&t(i),this.manager.itemEnd(e)},0),i;if(Sr[e]!==void 0){Sr[e].push({onLoad:t,onProgress:s,onError:r});return}Sr[e]=[],Sr[e].push({onLoad:t,onProgress:s,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,c=this.responseType;fetch(o).then(d=>{if(d.status===200||d.status===0){if(d.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||d.body===void 0||d.body.getReader===void 0)return d;const u=Sr[e],_=d.body.getReader(),m=d.headers.get("Content-Length")||d.headers.get("X-File-Size"),h=m?parseInt(m):0,f=h!==0;let y=0;const b=new ReadableStream({start(g){E();function E(){_.read().then(({done:v,value:S})=>{if(v)g.close();else{y+=S.byteLength;const R=new ProgressEvent("progress",{lengthComputable:f,loaded:y,total:h});for(let w=0,A=u.length;w{switch(c){case"arraybuffer":return d.arrayBuffer();case"blob":return d.blob();case"document":return d.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return d.json();default:if(a===void 0)return d.text();{const _=/charset="?([^;"\s]*)"?/i.exec(a),m=_&&_[1]?_[1].toLowerCase():void 0,h=new TextDecoder(m);return d.arrayBuffer().then(f=>h.decode(f))}}}).then(d=>{Aa.add(e,d);const u=Sr[e];delete Sr[e];for(let _=0,m=u.length;_{const u=Sr[e];if(u===void 0)throw this.manager.itemError(e),d;delete Sr[e];for(let _=0,m=u.length;_{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class A1t extends Wa{constructor(e){super(e)}load(e,t,s,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=Aa.get(e);if(o!==void 0)return i.manager.itemStart(e),setTimeout(function(){t&&t(o),i.manager.itemEnd(e)},0),o;const a=Zl("img");function c(){u(),Aa.add(e,this),t&&t(this),i.manager.itemEnd(e)}function d(_){u(),r&&r(_),i.manager.itemError(e),i.manager.itemEnd(e)}function u(){a.removeEventListener("load",c,!1),a.removeEventListener("error",d,!1)}return a.addEventListener("load",c,!1),a.addEventListener("error",d,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(e),a.src=e,a}}class bO extends Wa{constructor(e){super(e)}load(e,t,s,r){const i=new xn,o=new A1t(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){i.image=a,i.needsUpdate=!0,t!==void 0&&t(i)},s,r),i}}class yp extends Jt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new pt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}const Tg=new xt,Yw=new ie,$w=new ie;class Ty{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Rt(512,512),this.map=null,this.mapPass=null,this.matrix=new xt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new my,this._frameExtents=new Rt(1,1),this._viewportCount=1,this._viewports=[new Wt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,s=this.matrix;Yw.setFromMatrixPosition(e.matrixWorld),t.position.copy(Yw),$w.setFromMatrixPosition(e.target.matrixWorld),t.lookAt($w),t.updateMatrixWorld(),Tg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Tg),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(Tg)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class M1t extends Ty{constructor(){super(new Gn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,s=xa*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;(s!==t.fov||r!==t.aspect||i!==t.far)&&(t.fov=s,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class N1t extends yp{constructor(e,t,s=0,r=Math.PI/3,i=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Jt.DEFAULT_UP),this.updateMatrix(),this.target=new Jt,this.distance=s,this.angle=r,this.penumbra=i,this.decay=o,this.map=null,this.shadow=new M1t}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Ww=new xt,pl=new ie,xg=new ie;class O1t extends Ty{constructor(){super(new Gn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Rt(4,2),this._viewportCount=6,this._viewports=[new Wt(2,1,1,1),new Wt(0,1,1,1),new Wt(3,1,1,1),new Wt(1,1,1,1),new Wt(3,0,1,1),new Wt(1,0,1,1)],this._cubeDirections=[new ie(1,0,0),new ie(-1,0,0),new ie(0,0,1),new ie(0,0,-1),new ie(0,1,0),new ie(0,-1,0)],this._cubeUps=[new ie(0,1,0),new ie(0,1,0),new ie(0,1,0),new ie(0,1,0),new ie(0,0,1),new ie(0,0,-1)]}updateMatrices(e,t=0){const s=this.camera,r=this.matrix,i=e.distance||s.far;i!==s.far&&(s.far=i,s.updateProjectionMatrix()),pl.setFromMatrixPosition(e.matrixWorld),s.position.copy(pl),xg.copy(s.position),xg.add(this._cubeDirections[t]),s.up.copy(this._cubeUps[t]),s.lookAt(xg),s.updateMatrixWorld(),r.makeTranslation(-pl.x,-pl.y,-pl.z),Ww.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Ww)}}class I1t extends yp{constructor(e,t,s=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=s,this.decay=r,this.shadow=new O1t}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class k1t extends Ty{constructor(){super(new gy(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class yO extends yp{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Jt.DEFAULT_UP),this.updateMatrix(),this.target=new Jt,this.shadow=new k1t}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class D1t extends yp{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Dl{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let s=0,r=e.length;s"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,s,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=Aa.get(e);if(o!==void 0)return i.manager.itemStart(e),setTimeout(function(){t&&t(o),i.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(i.options,{colorSpaceConversion:"none"}))}).then(function(c){Aa.add(e,c),t&&t(c),i.manager.itemEnd(e)}).catch(function(c){r&&r(c),i.manager.itemError(e),i.manager.itemEnd(e)}),i.manager.itemStart(e)}}const xy="\\[\\]\\.:\\/",P1t=new RegExp("["+xy+"]","g"),Cy="[^"+xy+"]",F1t="[^"+xy.replace("\\.","")+"]",U1t=/((?:WC+[\/:])*)/.source.replace("WC",Cy),B1t=/(WCOD+)?/.source.replace("WCOD",F1t),G1t=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cy),V1t=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cy),z1t=new RegExp("^"+U1t+B1t+G1t+V1t+"$"),H1t=["material","materials","bones","map"];class q1t{constructor(e,t,s){const r=s||Ut.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const s=this._targetGroup.nCachedObjects_,r=this._bindings[s];r!==void 0&&r.getValue(e,t)}setValue(e,t){const s=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=s.length;r!==i;++r)s[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,s=e.length;t!==s;++t)e[t].unbind()}}class Ut{constructor(e,t,s){this.path=t,this.parsedPath=s||Ut.parseTrackName(t),this.node=Ut.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,s){return e&&e.isAnimationObjectGroup?new Ut.Composite(e,t,s):new Ut(e,t,s)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(P1t,"")}static parseTrackName(e){const t=z1t.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const s={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=s.nodeName&&s.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const i=s.nodeName.substring(r+1);H1t.indexOf(i)!==-1&&(s.nodeName=s.nodeName.substring(0,r),s.objectName=i)}if(s.propertyName===null||s.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return s}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const s=e.skeleton.getBoneByName(t);if(s!==void 0)return s}if(e.children){const s=function(i){for(let o=0;o=2.0 are supported."));return}const d=new TTt(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});d.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[_]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+_+'".')}}d.setExtensions(o),d.setPlugins(a),d.parse(s,r)}parseAsync(e,t){const s=this;return new Promise(function(r,i){s.parse(e,t,r,i)})}}function $1t(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const wt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class W1t{constructor(e){this.parser=e,this.name=wt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,r=t.length;s=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,o)}}class oTt{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,r=s.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const o=i.extensions[t],a=r.images[o.source];let c=s.textureLoader;if(a.uri){const d=s.options.manager.getHandler(a.uri);d!==null&&(c=d)}return this.detectSupport().then(function(d){if(d)return s.loadTextureImage(e,o.source,c);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class aTt{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,r=s.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const o=i.extensions[t],a=r.images[o.source];let c=s.textureLoader;if(a.uri){const d=s.options.manager.getHandler(a.uri);d!==null&&(c=d)}return this.detectSupport().then(function(d){if(d)return s.loadTextureImage(e,o.source,c);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class lTt{constructor(e){this.name=wt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const r=s.extensions[this.name],i=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then(function(a){const c=r.byteOffset||0,d=r.byteLength||0,u=r.count,_=r.byteStride,m=new Uint8Array(a,c,d);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,_,m,r.mode,r.filter).then(function(h){return h.buffer}):o.ready.then(function(){const h=new ArrayBuffer(u*_);return o.decodeGltfBuffer(new Uint8Array(h),u,_,m,r.mode,r.filter),h})})}else return null}}class cTt{constructor(e){this.name=wt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const r=t.meshes[s.mesh];for(const d of r.primitives)if(d.mode!==_s.TRIANGLES&&d.mode!==_s.TRIANGLE_STRIP&&d.mode!==_s.TRIANGLE_FAN&&d.mode!==void 0)return null;const o=s.extensions[this.name].attributes,a=[],c={};for(const d in o)a.push(this.parser.getDependency("accessor",o[d]).then(u=>(c[d]=u,c[d])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(d=>{const u=d.pop(),_=u.isGroup?u.children:[u],m=d[0].count,h=[];for(const f of _){const y=new xt,b=new ie,g=new Ni,E=new ie(1,1,1),v=new p1t(f.geometry,f.material,m);for(let S=0;S0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const STt=new xt;class TTt{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new $1t,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,r=!1,i=-1;typeof navigator<"u"&&(s=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,i=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||s||r&&i<98?this.textureLoader=new bO(this.options.manager):this.textureLoader=new L1t(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new gO(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:s,userData:{}};return Bi(i,a,r),di(a,r),Promise.all(s._invokeAll(function(c){return c.afterRoot&&c.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let r=0,i=t.length;r{const c=this.associations.get(o);c!=null&&this.associations.set(a,c);for(const[d,u]of o.children.entries())i(u,a.children[d])};return i(s,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s=2&&b.setY(C,w[A*c+1]),c>=3&&b.setZ(C,w[A*c+2]),c>=4&&b.setW(C,w[A*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,s=this.options,i=t.textures[e].source,o=t.images[i];let a=this.textureLoader;if(o.uri){const c=s.manager.getHandler(o.uri);c!==null&&(a=c)}return this.loadTextureImage(e,i,a)}loadTextureImage(e,t,s){const r=this,i=this.json,o=i.textures[e],a=i.images[t],c=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[c])return this.textureCache[c];const d=this.loadImageSource(t,s).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const m=(i.samplers||{})[o.sampler]||{};return u.magFilter=Qw[m.magFilter]||Wn,u.minFilter=Qw[m.minFilter]||_o,u.wrapS=Xw[m.wrapS]||va,u.wrapT=Xw[m.wrapT]||va,r.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[c]=d,d}loadImageSource(e,t){const s=this,r=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(_=>_.clone());const o=r.images[e],a=self.URL||self.webkitURL;let c=o.uri||"",d=!1;if(o.bufferView!==void 0)c=s.getDependency("bufferView",o.bufferView).then(function(_){d=!0;const m=new Blob([_],{type:o.mimeType});return c=a.createObjectURL(m),c});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(c).then(function(_){return new Promise(function(m,h){let f=m;t.isImageBitmapLoader===!0&&(f=function(y){const b=new xn(y);b.needsUpdate=!0,m(b)}),t.load(Dl.resolveURL(_,i.path),f,void 0,h)})}).then(function(_){return d===!0&&a.revokeObjectURL(c),_.userData.mimeType=o.mimeType||vTt(o.uri),_}).catch(function(_){throw console.error("THREE.GLTFLoader: Couldn't load texture",c),_});return this.sourceCache[e]=u,u}assignTexture(e,t,s,r){const i=this;return this.getDependency("texture",s.index).then(function(o){if(!o)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(o=o.clone(),o.channel=s.texCoord),i.extensions[wt.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[wt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const c=i.associations.get(o);o=i.extensions[wt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),i.associations.set(o,c)}}return r!==void 0&&(o.colorSpace=r),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const r=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+s.uuid;let c=this.cache.get(a);c||(c=new _O,Vs.prototype.copy.call(c,s),c.color.copy(s.color),c.map=s.map,c.sizeAttenuation=!1,this.cache.add(a,c)),s=c}else if(e.isLine){const a="LineBasicMaterial:"+s.uuid;let c=this.cache.get(a);c||(c=new fO,Vs.prototype.copy.call(c,s),c.color.copy(s.color),c.map=s.map,this.cache.add(a,c)),s=c}if(r||i||o){let a="ClonedMaterial:"+s.uuid+":";r&&(a+="derivative-tangents:"),i&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let c=this.cache.get(a);c||(c=s.clone(),i&&(c.vertexColors=!0),o&&(c.flatShading=!0),r&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(a,c),this.associations.set(c,this.associations.get(s))),s=c}e.material=s}getMaterialType(){return Sy}loadMaterial(e){const t=this,s=this.json,r=this.extensions,i=s.materials[e];let o;const a={},c=i.extensions||{},d=[];if(c[wt.KHR_MATERIALS_UNLIT]){const _=r[wt.KHR_MATERIALS_UNLIT];o=_.getMaterialType(),d.push(_.extendParams(a,i,t))}else{const _=i.pbrMetallicRoughness||{};if(a.color=new pt(1,1,1),a.opacity=1,Array.isArray(_.baseColorFactor)){const m=_.baseColorFactor;a.color.setRGB(m[0],m[1],m[2],Cn),a.opacity=m[3]}_.baseColorTexture!==void 0&&d.push(t.assignTexture(a,"map",_.baseColorTexture,nn)),a.metalness=_.metallicFactor!==void 0?_.metallicFactor:1,a.roughness=_.roughnessFactor!==void 0?_.roughnessFactor:1,_.metallicRoughnessTexture!==void 0&&(d.push(t.assignTexture(a,"metalnessMap",_.metallicRoughnessTexture)),d.push(t.assignTexture(a,"roughnessMap",_.metallicRoughnessTexture))),o=this._invokeOne(function(m){return m.getMaterialType&&m.getMaterialType(e)}),d.push(Promise.all(this._invokeAll(function(m){return m.extendMaterialParams&&m.extendMaterialParams(e,a)})))}i.doubleSided===!0&&(a.side=Js);const u=i.alphaMode||wg.OPAQUE;if(u===wg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===wg.MASK&&(a.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5)),i.normalTexture!==void 0&&o!==_i&&(d.push(t.assignTexture(a,"normalMap",i.normalTexture)),a.normalScale=new Rt(1,1),i.normalTexture.scale!==void 0)){const _=i.normalTexture.scale;a.normalScale.set(_,_)}if(i.occlusionTexture!==void 0&&o!==_i&&(d.push(t.assignTexture(a,"aoMap",i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&o!==_i){const _=i.emissiveFactor;a.emissive=new pt().setRGB(_[0],_[1],_[2],Cn)}return i.emissiveTexture!==void 0&&o!==_i&&d.push(t.assignTexture(a,"emissiveMap",i.emissiveTexture,nn)),Promise.all(d).then(function(){const _=new o(a);return i.name&&(_.name=i.name),di(_,i),t.associations.set(_,{materials:e}),i.extensions&&Bi(r,_,i),_})}createUniqueName(e){const t=Ut.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,r=this.primitiveCache;function i(a){return s[wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(c){return Zw(c,a,t)})}const o=[];for(let a=0,c=e.length;a0&&yTt(g,i),g.name=t.createUniqueName(i.name||"mesh_"+e),di(g,i),b.extensions&&Bi(r,g,b),t.assignFinalMaterial(g),_.push(g)}for(let h=0,f=_.length;h1?u=new Qi:d.length===1?u=d[0]:u=new Jt,u!==d[0])for(let _=0,m=d.length;_{const _=new Map;for(const[m,h]of r.associations)(m instanceof Vs||m instanceof xn)&&_.set(m,h);return u.traverse(m=>{const h=r.associations.get(m);h!=null&&_.set(m,h)}),_};return r.associations=d(i),i})}_createAnimationTracks(e,t,s,r,i){const o=[],a=e.name?e.name:e.uuid,c=[];Jr[i.path]===Jr.weights?e.traverse(function(m){m.morphTargetInfluences&&c.push(m.name?m.name:m.uuid)}):c.push(a);let d;switch(Jr[i.path]){case Jr.weights:d=wa;break;case Jr.rotation:d=go;break;case Jr.position:case Jr.scale:d=Ra;break;default:switch(s.itemSize){case 1:d=wa;break;case 2:case 3:default:d=Ra;break}break}const u=r.interpolation!==void 0?hTt[r.interpolation]:Ta,_=this._getArrayFromAccessor(s);for(let m=0,h=c.length;m{Ve.replace()})},stopVideoStream(){this.isVideoActive=!1,this.imageData=null,Ye.emit("stop_webcam_video_stream"),Fe(()=>{Ve.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Ve.replace(),Ye.on("video_stream_image",n=>{if(this.isVideoActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},wTt=["src"],RTt=["src"],ATt={class:"controls"},MTt={key:2};function NTt(n,e,t,s,r,i){return T(),x("div",{class:"floating-frame bg-white",style:Bt({bottom:r.position.bottom+"px",right:r.position.right+"px","z-index":r.zIndex}),onMousedown:e[4]||(e[4]=$((...o)=>i.startDrag&&i.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=$((...o)=>i.stopDrag&&i.stopDrag(...o),["stop"]))},[l("div",{class:"handle",onMousedown:e[0]||(e[0]=$((...o)=>i.startDrag&&i.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=$((...o)=>i.stopDrag&&i.stopDrag(...o),["stop"]))},"Drag Me",32),r.isVideoActive&&r.imageDataUrl!=null?(T(),x("img",{key:0,src:r.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},null,8,wTt)):B("",!0),r.isVideoActive&&r.imageDataUrl==null?(T(),x("p",{key:1,src:r.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},"Loading. Please wait...",8,RTt)):B("",!0),l("div",ATt,[r.isVideoActive?B("",!0):(T(),x("button",{key:0,class:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",onClick:e[2]||(e[2]=(...o)=>i.startVideoStream&&i.startVideoStream(...o))},e[6]||(e[6]=[l("i",{"data-feather":"video"},null,-1)]))),r.isVideoActive?(T(),x("button",{key:1,class:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",onClick:e[3]||(e[3]=(...o)=>i.stopVideoStream&&i.stopVideoStream(...o))},e[7]||(e[7]=[l("i",{"data-feather":"video"},null,-1)]))):B("",!0),r.isVideoActive?(T(),x("span",MTt,"FPS: "+Y(r.frameRate),1)):B("",!0)])],36)}const OTt=rt(CTt,[["render",NTt]]),ITt={data(){return{isAudioActive:!1,imageDataUrl:null,isDragging:!1,position:{bottom:0,right:0},dragStart:{x:0,y:0},zIndex:0,frameRate:0,frameCount:0,lastFrameTime:Date.now()}},methods:{startAudioStream(){Ye.emit("start_audio_stream",()=>{this.isAudioActive=!0}),Fe(()=>{Ve.replace()})},stopAudioStream(){Ye.emit("stop_audio_stream",()=>{this.isAudioActive=!1,this.imageDataUrl=null}),Fe(()=>{Ve.replace()})},startDrag(n){this.isDragging=!0,this.zIndex=5001,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY,document.addEventListener("mousemove",this.drag),document.addEventListener("mouseup",this.stopDrag)},drag(n){if(this.isDragging){const e=n.clientX-this.dragStart.x,t=n.clientY-this.dragStart.y;this.position.bottom-=t,this.position.right-=e,this.dragStart.x=n.clientX,this.dragStart.y=n.clientY}},stopDrag(){this.isDragging=!1,this.zIndex=0,document.removeEventListener("mousemove",this.drag),document.removeEventListener("mouseup",this.stopDrag)}},mounted(){Ve.replace(),Ye.on("update_spectrogram",n=>{if(this.isAudioActive){this.imageDataUrl="data:image/jpeg;base64,"+n,this.frameCount++;const e=Date.now();e-this.lastFrameTime>=1e3&&(this.frameRate=this.frameCount,this.frameCount=0,this.lastFrameTime=e)}})}},kTt=["src"],DTt={class:"controls"};function LTt(n,e,t,s,r,i){return T(),x("div",{class:"floating-frame bg-white",style:Bt({bottom:r.position.bottom+"px",right:r.position.right+"px","z-index":r.zIndex}),onMousedown:e[4]||(e[4]=$((...o)=>i.startDrag&&i.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=$((...o)=>i.stopDrag&&i.stopDrag(...o),["stop"]))},[l("div",{class:"handle",onMousedown:e[0]||(e[0]=$((...o)=>i.startDrag&&i.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=$((...o)=>i.stopDrag&&i.stopDrag(...o),["stop"]))},"Drag Me",32),r.isAudioActive&&r.imageDataUrl!=null?(T(),x("img",{key:0,src:r.imageDataUrl,alt:"Spectrogram",width:"300",height:"300"},null,8,kTt)):B("",!0),l("div",DTt,[r.isAudioActive?B("",!0):(T(),x("button",{key:0,class:"bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded",onClick:e[2]||(e[2]=(...o)=>i.startAudioStream&&i.startAudioStream(...o))},e[6]||(e[6]=[l("i",{"data-feather":"mic"},null,-1)]))),r.isAudioActive?(T(),x("button",{key:1,class:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded",onClick:e[3]||(e[3]=(...o)=>i.stopAudioStream&&i.stopAudioStream(...o))},e[7]||(e[7]=[l("i",{"data-feather":"mic"},null,-1)]))):B("",!0)])],36)}const PTt=rt(ITt,[["render",LTt]]),FTt={data(){return{activePersonality:null}},props:{personality:{type:Object,default:()=>({})}},components:{VideoFrame:OTt,AudioFrame:PTt},computed:{isReady:{get(){return this.$store.state.ready}}},watch:{"$store.state.mountedPersArr":"updatePersonality","$store.state.config.active_personality_id":"updatePersonality"},async mounted(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));console.log("Personality:",this.personality),this.initWebGLScene(),this.updatePersonality(),Fe(()=>{Ve.replace()}),this.$refs.video_frame.position={bottom:0,right:0},this.$refs.audio_frame.position={bottom:0,right:100}},beforeDestroy(){},methods:{initWebGLScene(){this.scene=new i1t,this.camera=new Gn(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new uO,this.renderer.setSize(window.innerWidth,window.innerHeight),this.$refs.webglContainer.appendChild(this.renderer.domElement);const n=new Ei,e=new Hw({color:65280});this.cube=new Vn(n,e),this.scene.add(this.cube);const t=new D1t(4210752),s=new yO(16777215,.5);s.position.set(0,1,0),this.scene.add(t),this.scene.add(s),this.camera.position.z=5,this.animate()},updatePersonality(){const{mountedPersArr:n,config:e}=this.$store.state;this.activePersonality=n[e.active_personality_id],this.activePersonality.avatar?this.showBoxWithAvatar(this.activePersonality.avatar):this.showDefaultCube(),this.$emit("update:personality",this.activePersonality)},loadScene(n){new Y1t().load(n,t=>{this.scene.remove(this.cube),this.cube=t.scene,this.scene.add(this.cube)})},showBoxWithAvatar(n){this.cube&&this.scene.remove(this.cube);const e=new Ei,t=new bO().load(n),s=new _i({map:t});this.cube=new Vn(e,s),this.scene.add(this.cube)},showDefaultCube(){this.scene.remove(this.cube);const n=new Ei,e=new Hw({color:65280});this.cube=new Vn(n,e),this.scene.add(this.cube)},animate(){requestAnimationFrame(this.animate),this.cube&&(this.cube.rotation.x+=.01,this.cube.rotation.y+=.01),this.renderer.render(this.scene,this.camera)}}},UTt={ref:"webglContainer"},BTt={class:"flex-col y-overflow scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},GTt={key:0,class:"text-center"},VTt={key:1,class:"text-center"},zTt={class:"floating-frame2"},HTt=["innerHTML"];function qTt(n,e,t,s,r,i){const o=nt("VideoFrame"),a=nt("AudioFrame");return T(),x(Be,null,[l("div",UTt,null,512),l("div",BTt,[!r.activePersonality||!r.activePersonality.scene_path?(T(),x("div",GTt," Personality does not have a 3d avatar. ")):B("",!0),!r.activePersonality||!r.activePersonality.avatar||r.activePersonality.avatar===""?(T(),x("div",VTt," Personality does not have an avatar. ")):B("",!0),l("div",zTt,[l("div",{innerHTML:n.htmlContent},null,8,HTt)])]),z(o,{ref:"video_frame"},null,512),z(a,{ref:"audio_frame"},null,512)],64)}const YTt=rt(FTt,[["render",qTt]]);let gd;const $Tt=new Uint8Array(16);function WTt(){if(!gd&&(gd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gd($Tt)}const En=[];for(let n=0;n<256;++n)En.push((n+256).toString(16).slice(1));function KTt(n,e=0){return En[n[e+0]]+En[n[e+1]]+En[n[e+2]]+En[n[e+3]]+"-"+En[n[e+4]]+En[n[e+5]]+"-"+En[n[e+6]]+En[n[e+7]]+"-"+En[n[e+8]]+En[n[e+9]]+"-"+En[n[e+10]]+En[n[e+11]]+En[n[e+12]]+En[n[e+13]]+En[n[e+14]]+En[n[e+15]]}const jTt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Jw={randomUUID:jTt};function Dr(n,e,t){if(Jw.randomUUID&&!e&&!n)return Jw.randomUUID();n=n||{};const s=n.random||(n.rng||WTt)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,KTt(s)}class io{constructor(){this.listenerMap=new Map,this._listeners=[],this.proxyMap=new Map,this.proxies=[]}get listeners(){return this._listeners.concat(this.proxies.flatMap(e=>e()))}subscribe(e,t){this.listenerMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. Please check that you don't accidentally use the same token twice to register two different handlers for the same event/hook.`),this.unsubscribe(e)),this.listenerMap.set(e,t),this._listeners.push(t)}unsubscribe(e){if(this.listenerMap.has(e)){const t=this.listenerMap.get(e);this.listenerMap.delete(e);const s=this._listeners.indexOf(t);s>=0&&this._listeners.splice(s,1)}}registerProxy(e,t){this.proxyMap.has(e)&&(console.warn(`Already subscribed. Unsubscribing for you. -Please check that you don't accidentally use the same token twice to register two different proxies for the same event/hook.`),this.unregisterProxy(e)),this.proxyMap.set(e,t),this.proxies.push(t)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const t=this.proxyMap.get(e);this.proxyMap.delete(e);const s=this.proxies.indexOf(t);s>=0&&this.proxies.splice(s,1)}}class Vt extends io{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(t=>t(e,this.entity))}}class kn extends io{constructor(e){super(),this.entity=e}emit(e){let t=!1;const s=()=>[t=!0];for(const r of Array.from(this.listeners.values()))if(r(e,s,this.entity),t)return{prevented:!0};return{prevented:!1}}}class SO extends io{execute(e,t){let s=e;for(const r of this.listeners)s=r(s,t);return s}}class cs extends SO{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class $Tt extends io{constructor(e){super(),this.entity=e}execute(e){const t=[];for(const s of this.listeners)t.push(s(e,this.entity));return t}}function Qs(){const n=Symbol(),e=new Map,t=new Set,s=(c,d)=>{d instanceof io&&d.registerProxy(n,()=>{var u,_;return(_=(u=e.get(c))===null||u===void 0?void 0:u.listeners)!==null&&_!==void 0?_:[]})},r=c=>{const d=new io;e.set(c,d),t.forEach(u=>s(c,u[c]))},i=c=>{t.add(c);for(const d of e.keys())s(d,c[d])},o=c=>{for(const d of e.keys())c[d]instanceof io&&c[d].unregisterProxy(n);t.delete(c)},a=()=>{t.forEach(c=>o(c)),e.clear()};return new Proxy({},{get(c,d){return d==="addTarget"?i:d==="removeTarget"?o:d==="destroy"?a:typeof d!="string"||d.startsWith("_")?c[d]:(e.has(d)||r(d),e.get(d))}})}class e2{constructor(e,t){if(this.destructed=!1,this.events={destruct:new Vt(this)},!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Dr(),this.from=e,this.to=t,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class TO{constructor(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Dr(),this.from=e,this.to=t}}function Ab(n,e){return Object.fromEntries(Object.entries(n).map(([t,s])=>[t,e(s)]))}class xO{constructor(){this._title="",this.id=Dr(),this.events={loaded:new Vt(this),beforeAddInput:new kn(this),addInput:new Vt(this),beforeRemoveInput:new kn(this),removeInput:new Vt(this),beforeAddOutput:new kn(this),addOutput:new Vt(this),beforeRemoveOutput:new kn(this),removeOutput:new Vt(this),beforeTitleChanged:new kn(this),titleChanged:new Vt(this),update:new Vt(this)},this.hooks={beforeLoad:new cs(this),afterSave:new cs(this)}}get graph(){return this.graphInstance}get title(){return this._title}set title(e){this.events.beforeTitleChanged.emit(e).prevented||(this._title=e,this.events.titleChanged.emit(e))}addInput(e,t){return this.addInterface("input",e,t)}addOutput(e,t){return this.addInterface("output",e,t)}removeInput(e){return this.removeInterface("input",e)}removeOutput(e){return this.removeInterface("output",e)}registerGraph(e){this.graphInstance=e}load(e){this.hooks.beforeLoad.execute(e),this.id=e.id,this._title=e.title,Object.entries(e.inputs).forEach(([t,s])=>{this.inputs[t]&&(this.inputs[t].load(s),this.inputs[t].nodeId=this.id)}),Object.entries(e.outputs).forEach(([t,s])=>{this.outputs[t]&&(this.outputs[t].load(s),this.outputs[t].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=Ab(this.inputs,r=>r.save()),t=Ab(this.outputs,r=>r.save()),s={type:this.type,id:this.id,title:this.title,inputs:e,outputs:t};return this.hooks.afterSave.execute(s)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,t])=>this.initializeIntf("input",e,t)),Object.entries(this.outputs).forEach(([e,t])=>this.initializeIntf("output",e,t))}initializeIntf(e,t,s){s.isInput=e==="input",s.nodeId=this.id,s.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:t,intf:s}))}addInterface(e,t,s){const r=e==="input"?this.events.beforeAddInput:this.events.beforeAddOutput,i=e==="input"?this.events.addInput:this.events.addOutput,o=e==="input"?this.inputs:this.outputs;return r.emit(s).prevented?!1:(o[t]=s,this.initializeIntf(e,t,s),i.emit(s),!0)}removeInterface(e,t){const s=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,r=e==="input"?this.events.removeInput:this.events.removeOutput,i=e==="input"?this.inputs[t]:this.outputs[t];if(!i||s.emit(i).prevented)return!1;if(i.connectionCount>0)if(this.graphInstance)this.graphInstance.connections.filter(a=>a.from===i||a.to===i).forEach(a=>{this.graphInstance.removeConnection(a)});else throw new Error("Interface is connected, but no graph instance is specified. Unable to delete interface");return i.events.setValue.unsubscribe(this),e==="input"?delete this.inputs[t]:delete this.outputs[t],r.emit(i),!0}}let CO=class extends xO{load(e){super.load(e)}save(){return super.save()}};function Ka(n){return class extends CO{constructor(){var e,t;super(),this.type=n.type,this.inputs={},this.outputs={},this.calculate=n.calculate?(s,r)=>n.calculate.call(this,s,r):void 0,this._title=(e=n.title)!==null&&e!==void 0?e:n.type,this.executeFactory("input",n.inputs),this.executeFactory("output",n.outputs),(t=n.onCreate)===null||t===void 0||t.call(this)}onPlaced(){var e;(e=n.onPlaced)===null||e===void 0||e.call(this)}onDestroy(){var e;(e=n.onDestroy)===null||e===void 0||e.call(this)}executeFactory(e,t){Object.keys(t||{}).forEach(s=>{const r=t[s]();e==="input"?this.addInput(s,r):this.addOutput(s,r)})}}}class en{set connectionCount(e){this._connectionCount=e,this.events.setConnectionCount.emit(e)}get connectionCount(){return this._connectionCount}set value(e){this.events.beforeSetValue.emit(e).prevented||(this._value=e,this.events.setValue.emit(e))}get value(){return this._value}constructor(e,t){this.id=Dr(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new Vt(this),beforeSetValue:new kn(this),setValue:new Vt(this),updated:new Vt(this)},this.hooks={load:new cs(this),save:new cs(this)},this._connectionCount=0,this.name=e,this._value=t}load(e){this.id=e.id,this.templateId=e.templateId,this.value=e.value,this.hooks.load.execute(e)}save(){const e={id:this.id,templateId:this.templateId,value:this.value};return this.hooks.save.execute(e)}setComponent(e){return this.component=e,this}setPort(e){return this.port=e,this}setHidden(e){return this.hidden=e,this}use(e,...t){return e(this,...t),this}}const Ma="__baklava_SubgraphInputNode",Na="__baklava_SubgraphOutputNode";class wO extends CO{constructor(){super(),this.graphInterfaceId=Dr()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class wy extends wO{constructor(){super(...arguments),this.type=Ma,this.inputs={name:new en("Name","Input")},this.outputs={placeholder:new en("Value",void 0)}}static isGraphInputNode(e){return e.type===Ma}}class Ry extends wO{constructor(){super(...arguments),this.type=Na,this.inputs={name:new en("Name","Output"),placeholder:new en("Value",void 0)},this.outputs={output:new en("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===Na}}class _c{get nodes(){return this._nodes}get connections(){return this._connections}get loading(){return this._loading}get destroying(){return this._destroying}get inputs(){return this.nodes.filter(t=>t.type===Ma).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===Na).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Dr(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new kn(this),addNode:new Vt(this),beforeRemoveNode:new kn(this),removeNode:new Vt(this),beforeAddConnection:new kn(this),addConnection:new Vt(this),checkConnection:new kn(this),beforeRemoveConnection:new kn(this),removeConnection:new Vt(this)},this.hooks={save:new cs(this),load:new cs(this),checkConnection:new $Tt(this)},this.nodeEvents=Qs(),this.nodeHooks=Qs(),this.connectionEvents=Qs(),this.editor=e,this.template=t,e.registerGraph(this)}addNode(e){if(!this.events.beforeAddNode.emit(e).prevented)return this.nodeEvents.addTarget(e.events),this.nodeHooks.addTarget(e.hooks),e.registerGraph(this),this._nodes.push(e),e=this.nodes.find(t=>t.id===e.id),e.onPlaced(),this.events.addNode.emit(e),e}removeNode(e){if(this.nodes.includes(e)){if(this.events.beforeRemoveNode.emit(e).prevented)return;const t=[...Object.values(e.inputs),...Object.values(e.outputs)];this.connections.filter(s=>t.includes(s.from)||t.includes(s.to)).forEach(s=>this.removeConnection(s)),this._nodes.splice(this.nodes.indexOf(e),1),this.events.removeNode.emit(e),e.onDestroy(),this.nodeEvents.removeTarget(e.events),this.nodeHooks.removeTarget(e.hooks)}}addConnection(e,t){const s=this.checkConnection(e,t);if(!s.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:t}).prevented)return;for(const i of s.connectionsInDanger){const o=this.connections.find(a=>a.id===i.id);o&&this.removeConnection(o)}const r=new e2(s.dummyConnection.from,s.dummyConnection.to);return this.internalAddConnection(r),r}removeConnection(e){if(this.connections.includes(e)){if(this.events.beforeRemoveConnection.emit(e).prevented)return;e.destruct(),this._connections.splice(this.connections.indexOf(e),1),this.events.removeConnection.emit(e),this.connectionEvents.removeTarget(e.events)}}checkConnection(e,t){if(!e||!t)return{connectionAllowed:!1};const s=this.findNodeById(e.nodeId),r=this.findNodeById(t.nodeId);if(s&&r&&s===r)return{connectionAllowed:!1};if(e.isInput&&!t.isInput){const a=e;e=t,t=a}if(e.isInput||!t.isInput)return{connectionAllowed:!1};if(this.connections.some(a=>a.from===e&&a.to===t))return{connectionAllowed:!1};if(this.events.checkConnection.emit({from:e,to:t}).prevented)return{connectionAllowed:!1};const i=this.hooks.checkConnection.execute({from:e,to:t});if(i.some(a=>!a.connectionAllowed))return{connectionAllowed:!1};const o=Array.from(new Set(i.flatMap(a=>a.connectionsInDanger)));return{connectionAllowed:!0,dummyConnection:new TO(e,t),connectionsInDanger:o}}findNodeInterface(e){for(const t of this.nodes){for(const s in t.inputs){const r=t.inputs[s];if(r.id===e)return r}for(const s in t.outputs){const r=t.outputs[s];if(r.id===e)return r}}}findNodeById(e){return this.nodes.find(t=>t.id===e)}load(e){try{this._loading=!0;const t=[];for(let s=this.connections.length-1;s>=0;s--)this.removeConnection(this.connections[s]);for(let s=this.nodes.length-1;s>=0;s--)this.removeNode(this.nodes[s]);this.id=e.id;for(const s of e.nodes){const r=this.editor.nodeTypes.get(s.type);if(!r){t.push(`Node type ${s.type} is not registered`);continue}const i=new r.type;this.addNode(i),i.load(s)}for(const s of e.connections){const r=this.findNodeInterface(s.from),i=this.findNodeInterface(s.to);if(r)if(i){const o=new e2(r,i);o.id=s.id,this.internalAddConnection(o)}else{t.push(`Could not find interface with id ${s.to}`);continue}else{t.push(`Could not find interface with id ${s.from}`);continue}}return this.hooks.load.execute(e),t}finally{this._loading=!1}}save(){const e={id:this.id,nodes:this.nodes.map(t=>t.save()),connections:this.connections.map(t=>({id:t.id,from:t.from.id,to:t.to.id})),inputs:this.inputs,outputs:this.outputs};return this.hooks.save.execute(e)}destroy(){this._destroying=!0;for(const e of this.nodes)this.removeNode(e);this.editor.unregisterGraph(this)}internalAddConnection(e){this.connectionEvents.addTarget(e.events),this._connections.push(e),this.events.addConnection.emit(e)}}const Jl="__baklava_GraphNode-";function Oa(n){return Jl+n.id}const WTt=["component","connectionCount","events","hidden","hooks","id","isInput","name","nodeId","port","templateId","value"];function KTt(n){return class extends xO{constructor(){super(...arguments),this.type=Oa(n),this.inputs={},this.outputs={},this.template=n,this.calculate=async(t,s)=>{var r;if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!s.engine||typeof s.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const i=s.engine.getInputValues(this.subgraph);for(const c of this.subgraph.inputs)i.set(c.nodeInterfaceId,t[c.id]);const o=await s.engine.runGraph(this.subgraph,i,s.globalValues),a={};for(const c of this.subgraph.outputs)a[c.id]=(r=o.get(c.nodeId))===null||r===void 0?void 0:r.get("output");return a._calculationResults=o,a}}get title(){return this._title}set title(t){this.template.name=t}load(t){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(t.graphState),super.load(t)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,t=>{this._title=t}),this.initialize()}onDestroy(){var t;this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),(t=this.subgraph)===null||t===void 0||t.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name,this.updateInterfaces(),this.events.update.emit(null)}updateInterfaces(){if(!this.subgraph)throw new Error("Trying to update interfaces without graph instance");for(const t of this.subgraph.inputs)t.id in this.inputs?this.inputs[t.id].name=t.name:this.addInput(t.id,this.createProxyInterface(t,!0));for(const t of Object.keys(this.inputs))this.subgraph.inputs.some(s=>s.id===t)||this.removeInput(t);for(const t of this.subgraph.outputs)t.id in this.outputs?this.outputs[t.id].name=t.name:this.addOutput(t.id,this.createProxyInterface(t,!1));for(const t of Object.keys(this.outputs))this.subgraph.outputs.some(s=>s.id===t)||this.removeOutput(t);this.addOutput("_calculationResults",new en("_calculationResults",void 0).setHidden(!0))}createProxyInterface(t,s){const r=new en(t.name,void 0);return new Proxy(r,{get:(i,o)=>{var a,c,d;if(WTt.includes(o)||o in i||typeof o=="string"&&o.startsWith("__v_"))return Reflect.get(i,o);let u;if(s){const h=(a=this.subgraph)===null||a===void 0?void 0:a.nodes.find(f=>wy.isGraphInputNode(f)&&f.graphInterfaceId===t.id);u=h==null?void 0:h.outputs.placeholder.id}else{const h=(c=this.subgraph)===null||c===void 0?void 0:c.nodes.find(f=>Ry.isGraphOutputNode(f)&&f.graphInterfaceId===t.id);u=h==null?void 0:h.inputs.placeholder.id}const _=(d=this.subgraph)===null||d===void 0?void 0:d.connections.find(h=>{var f;return u===((f=s?h.from:h.to)===null||f===void 0?void 0:f.id)}),m=s?_==null?void 0:_.to:_==null?void 0:_.from;if(m)return Reflect.get(m,o)}})}}}class Ep{static fromGraph(e,t){return new Ep(e.save(),t)}get name(){return this._name}set name(e){this._name=e,this.events.nameChanged.emit(e);const t=this.editor.nodeTypes.get(Oa(this));t&&(t.title=e)}get inputs(){return this.nodes.filter(t=>t.type===Ma).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===Na).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Dr(),this._name="Subgraph",this.events={nameChanged:new Vt(this),updated:new Vt(this)},this.hooks={beforeLoad:new cs(this),afterSave:new cs(this)},this.editor=t,e.id&&(this.id=e.id),e.name&&(this._name=e.name),this.update(e)}update(e){this.nodes=e.nodes,this.connections=e.connections,this.events.updated.emit()}save(){return{id:this.id,name:this.name,nodes:this.nodes,connections:this.connections,inputs:this.inputs,outputs:this.outputs}}createGraph(e){const t=new Map,s=m=>{const h=Dr();return t.set(m,h),h},r=m=>{const h=t.get(m);if(!h)throw new Error(`Unable to create graph from template: Could not map old id ${m} to new id`);return h},i=m=>Ab(m,h=>({id:s(h.id),templateId:h.id,value:h.value})),o=this.nodes.map(m=>({...m,id:s(m.id),inputs:i(m.inputs),outputs:i(m.outputs)})),a=this.connections.map(m=>({id:s(m.id),from:r(m.from),to:r(m.to)})),c=this.inputs.map(m=>({id:m.id,name:m.name,nodeId:r(m.nodeId),nodeInterfaceId:r(m.nodeInterfaceId)})),d=this.outputs.map(m=>({id:m.id,name:m.name,nodeId:r(m.nodeId),nodeInterfaceId:r(m.nodeInterfaceId)})),u={id:Dr(),nodes:o,connections:a,inputs:c,outputs:d};return e||(e=new _c(this.editor)),e.load(u).forEach(m=>console.warn(m)),e.template=this,e}}class jTt{get nodeTypes(){return this._nodeTypes}get graph(){return this._graph}get graphTemplates(){return this._graphTemplates}get graphs(){return this._graphs}get loading(){return this._loading}constructor(){this.events={loaded:new Vt(this),beforeRegisterNodeType:new kn(this),registerNodeType:new Vt(this),beforeUnregisterNodeType:new kn(this),unregisterNodeType:new Vt(this),beforeAddGraphTemplate:new kn(this),addGraphTemplate:new Vt(this),beforeRemoveGraphTemplate:new kn(this),removeGraphTemplate:new Vt(this),registerGraph:new Vt(this),unregisterGraph:new Vt(this)},this.hooks={save:new cs(this),load:new cs(this)},this.graphTemplateEvents=Qs(),this.graphTemplateHooks=Qs(),this.graphEvents=Qs(),this.graphHooks=Qs(),this.nodeEvents=Qs(),this.nodeHooks=Qs(),this.connectionEvents=Qs(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new _c(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType(wy),this.registerNodeType(Ry)}registerNodeType(e,t){var s,r;if(this.events.beforeRegisterNodeType.emit({type:e,options:t}).prevented)return;const i=new e;this._nodeTypes.set(i.type,{type:e,category:(s=t==null?void 0:t.category)!==null&&s!==void 0?s:"default",title:(r=t==null?void 0:t.title)!==null&&r!==void 0?r:i.title}),this.events.registerNodeType.emit({type:e,options:t})}unregisterNodeType(e){const t=typeof e=="string"?e:new e().type;if(this.nodeTypes.has(t)){if(this.events.beforeUnregisterNodeType.emit(t).prevented)return;this._nodeTypes.delete(t),this.events.unregisterNodeType.emit(t)}}addGraphTemplate(e){if(this.events.beforeAddGraphTemplate.emit(e).prevented)return;this._graphTemplates.push(e),this.graphTemplateEvents.addTarget(e.events),this.graphTemplateHooks.addTarget(e.hooks);const t=KTt(e);this.registerNodeType(t,{category:"Subgraphs",title:e.name}),this.events.addGraphTemplate.emit(e)}removeGraphTemplate(e){if(this.graphTemplates.includes(e)){if(this.events.beforeRemoveGraphTemplate.emit(e).prevented)return;const t=Oa(e);for(const s of[this.graph,...this.graphs.values()]){const r=s.nodes.filter(i=>i.type===t);for(const i of r)s.removeNode(i)}this.unregisterNodeType(t),this._graphTemplates.splice(this._graphTemplates.indexOf(e),1),this.graphTemplateEvents.removeTarget(e.events),this.graphTemplateHooks.removeTarget(e.hooks),this.events.removeGraphTemplate.emit(e)}}registerGraph(e){this.graphEvents.addTarget(e.events),this.graphHooks.addTarget(e.hooks),this.nodeEvents.addTarget(e.nodeEvents),this.nodeHooks.addTarget(e.nodeHooks),this.connectionEvents.addTarget(e.connectionEvents),this.events.registerGraph.emit(e),this._graphs.add(e)}unregisterGraph(e){this.graphEvents.removeTarget(e.events),this.graphHooks.removeTarget(e.hooks),this.nodeEvents.removeTarget(e.nodeEvents),this.nodeHooks.removeTarget(e.nodeHooks),this.connectionEvents.removeTarget(e.connectionEvents),this.events.unregisterGraph.emit(e),this._graphs.delete(e)}load(e){try{for(this._loading=!0,e=this.hooks.load.execute(e);this.graphTemplates.length>0;)this.removeGraphTemplate(this.graphTemplates[0]);e.graphTemplates.forEach(s=>{const r=new Ep(s,this);this.addGraphTemplate(r)});const t=this._graph.load(e.graph);return this.events.loaded.emit(),t.forEach(s=>console.warn(s)),t}finally{this._loading=!1}}save(){const e={graph:this.graph.save(),graphTemplates:this.graphTemplates.map(t=>t.save())};return this.hooks.save.execute(e)}}function QTt(n,e){const t=new Map;e.graphs.forEach(s=>{s.nodes.forEach(r=>t.set(r.id,r))}),n.forEach((s,r)=>{const i=t.get(r);i&&s.forEach((o,a)=>{const c=i.outputs[a];c&&(c.value=o)})})}class RO extends Error{constructor(){super("Cycle detected")}}function XTt(n){return typeof n=="string"}function AO(n,e){const t=new Map,s=new Map,r=new Map;let i,o;if(n instanceof _c)i=n.nodes,o=n.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");i=n,o=e}i.forEach(d=>{Object.values(d.inputs).forEach(u=>t.set(u.id,d.id)),Object.values(d.outputs).forEach(u=>t.set(u.id,d.id))}),i.forEach(d=>{const u=o.filter(m=>m.from&&t.get(m.from.id)===d.id),_=new Set(u.map(m=>t.get(m.to.id)).filter(XTt));s.set(d.id,_),r.set(d,u)});const a=i.slice();o.forEach(d=>{const u=a.findIndex(_=>t.get(d.to.id)===_.id);u>=0&&a.splice(u,1)});const c=[];for(;a.length>0;){const d=a.pop();c.push(d);const u=s.get(d.id);for(;u.size>0;){const _=u.values().next().value;if(u.delete(_),Array.from(s.values()).every(m=>!m.has(_))){const m=i.find(h=>h.id===_);a.push(m)}}}if(Array.from(s.values()).some(d=>d.size>0))throw new RO;return{calculationOrder:c,connectionsFromNode:r,interfaceIdToNodeId:t}}function ZTt(n,e){try{return AO(n,e),!1}catch(t){if(t instanceof RO)return!0;throw t}}var Yn;(function(n){n.Running="Running",n.Idle="Idle",n.Paused="Paused",n.Stopped="Stopped"})(Yn||(Yn={}));class JTt{get status(){return this.isRunning?Yn.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new kn(this),afterRun:new Vt(this),statusChange:new Vt(this),beforeNodeCalculation:new Vt(this),afterNodeCalculation:new Vt(this)},this.hooks={gatherCalculationData:new cs(this),transferData:new SO},this.recalculateOrder=!0,this.internalStatus=Yn.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(t,s)=>{s.graph&&!s.graph.loading&&s.graph.activeTransactions===0&&this.internalOnChange(s,t??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,t=>this.checkConnection(t.from,t.to))}start(){this.internalStatus===Yn.Stopped&&(this.internalStatus=Yn.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===Yn.Idle&&(this.internalStatus=Yn.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===Yn.Paused&&(this.internalStatus=Yn.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===Yn.Idle||this.internalStatus===Yn.Paused)&&(this.internalStatus=Yn.Stopped,this.events.statusChange.emit(this.status))}async runOnce(e,...t){if(this.events.beforeRun.emit(e).prevented)return null;try{this.isRunning=!0,this.events.statusChange.emit(this.status),this.recalculateOrder&&this.calculateOrder();const s=await this.execute(e,...t);return this.events.afterRun.emit(s),s}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,t){if(e.templateId){const i=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!i)return{connectionAllowed:!0,connectionsInDanger:[]};e=i}if(t.templateId){const i=this.findInterfaceByTemplateId(this.editor.graph.nodes,t.templateId);if(!i)return{connectionAllowed:!0,connectionsInDanger:[]};t=i}const s=new TO(e,t);let r=this.editor.graph.connections.slice();return t.allowMultipleConnections||(r=r.filter(i=>i.to!==t)),r.push(s),ZTt(this.editor.graph.nodes,r)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:t.allowMultipleConnections?[]:this.editor.graph.connections.filter(i=>i.to===t)}}calculateOrder(){this.recalculateOrder=!0}async calculateWithoutData(...e){const t=this.hooks.gatherCalculationData.execute(void 0);return await this.runOnce(t,...e)}validateNodeCalculationOutput(e,t){if(typeof t!="object")throw new Error(`Invalid calculation return value from node ${e.id} (type ${e.type})`);Object.keys(e.outputs).forEach(s=>{if(!(s in t))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${s}"`)})}internalOnChange(e,t){this.internalStatus===Yn.Idle&&this.onChange(this.recalculateOrder,e,t)}findInterfaceByTemplateId(e,t){for(const s of e)for(const r of[...Object.values(s.inputs),...Object.values(s.outputs)])if(r.templateId===t)return r;return null}}class ext extends JTt{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,t,s){this.order.has(e.id)||this.order.set(e.id,AO(e));const{calculationOrder:r,connectionsFromNode:i}=this.order.get(e.id),o=new Map;for(const a of r){const c={};Object.entries(a.inputs).forEach(([u,_])=>{c[u]=this.getInterfaceValue(t,_.id)}),this.events.beforeNodeCalculation.emit({inputValues:c,node:a});let d;if(a.calculate)d=await a.calculate(c,{globalValues:s,engine:this});else{d={};for(const[u,_]of Object.entries(a.outputs))d[u]=this.getInterfaceValue(t,_.id)}this.validateNodeCalculationOutput(a,d),this.events.afterNodeCalculation.emit({outputValues:d,node:a}),o.set(a.id,new Map(Object.entries(d))),i.has(a)&&i.get(a).forEach(u=>{var _;const m=(_=Object.entries(a.outputs).find(([,f])=>f.id===u.from.id))===null||_===void 0?void 0:_[0];if(!m)throw new Error(`Could not find key for interface ${u.from.id} +Please check that you don't accidentally use the same token twice to register two different proxies for the same event/hook.`),this.unregisterProxy(e)),this.proxyMap.set(e,t),this.proxies.push(t)}unregisterProxy(e){if(!this.proxyMap.has(e))return;const t=this.proxyMap.get(e);this.proxyMap.delete(e);const s=this.proxies.indexOf(t);s>=0&&this.proxies.splice(s,1)}}class Vt extends io{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(t=>t(e,this.entity))}}class kn extends io{constructor(e){super(),this.entity=e}emit(e){let t=!1;const s=()=>[t=!0];for(const r of Array.from(this.listeners.values()))if(r(e,s,this.entity),t)return{prevented:!0};return{prevented:!1}}}class SO extends io{execute(e,t){let s=e;for(const r of this.listeners)s=r(s,t);return s}}class cs extends SO{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class QTt extends io{constructor(e){super(),this.entity=e}execute(e){const t=[];for(const s of this.listeners)t.push(s(e,this.entity));return t}}function Qs(){const n=Symbol(),e=new Map,t=new Set,s=(c,d)=>{d instanceof io&&d.registerProxy(n,()=>{var u,_;return(_=(u=e.get(c))===null||u===void 0?void 0:u.listeners)!==null&&_!==void 0?_:[]})},r=c=>{const d=new io;e.set(c,d),t.forEach(u=>s(c,u[c]))},i=c=>{t.add(c);for(const d of e.keys())s(d,c[d])},o=c=>{for(const d of e.keys())c[d]instanceof io&&c[d].unregisterProxy(n);t.delete(c)},a=()=>{t.forEach(c=>o(c)),e.clear()};return new Proxy({},{get(c,d){return d==="addTarget"?i:d==="removeTarget"?o:d==="destroy"?a:typeof d!="string"||d.startsWith("_")?c[d]:(e.has(d)||r(d),e.get(d))}})}class e2{constructor(e,t){if(this.destructed=!1,this.events={destruct:new Vt(this)},!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Dr(),this.from=e,this.to=t,this.from.connectionCount++,this.to.connectionCount++}destruct(){this.events.destruct.emit(),this.from.connectionCount--,this.to.connectionCount--,this.destructed=!0}}class TO{constructor(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Dr(),this.from=e,this.to=t}}function Ab(n,e){return Object.fromEntries(Object.entries(n).map(([t,s])=>[t,e(s)]))}class xO{constructor(){this._title="",this.id=Dr(),this.events={loaded:new Vt(this),beforeAddInput:new kn(this),addInput:new Vt(this),beforeRemoveInput:new kn(this),removeInput:new Vt(this),beforeAddOutput:new kn(this),addOutput:new Vt(this),beforeRemoveOutput:new kn(this),removeOutput:new Vt(this),beforeTitleChanged:new kn(this),titleChanged:new Vt(this),update:new Vt(this)},this.hooks={beforeLoad:new cs(this),afterSave:new cs(this)}}get graph(){return this.graphInstance}get title(){return this._title}set title(e){this.events.beforeTitleChanged.emit(e).prevented||(this._title=e,this.events.titleChanged.emit(e))}addInput(e,t){return this.addInterface("input",e,t)}addOutput(e,t){return this.addInterface("output",e,t)}removeInput(e){return this.removeInterface("input",e)}removeOutput(e){return this.removeInterface("output",e)}registerGraph(e){this.graphInstance=e}load(e){this.hooks.beforeLoad.execute(e),this.id=e.id,this._title=e.title,Object.entries(e.inputs).forEach(([t,s])=>{this.inputs[t]&&(this.inputs[t].load(s),this.inputs[t].nodeId=this.id)}),Object.entries(e.outputs).forEach(([t,s])=>{this.outputs[t]&&(this.outputs[t].load(s),this.outputs[t].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=Ab(this.inputs,r=>r.save()),t=Ab(this.outputs,r=>r.save()),s={type:this.type,id:this.id,title:this.title,inputs:e,outputs:t};return this.hooks.afterSave.execute(s)}onPlaced(){}onDestroy(){}initializeIo(){Object.entries(this.inputs).forEach(([e,t])=>this.initializeIntf("input",e,t)),Object.entries(this.outputs).forEach(([e,t])=>this.initializeIntf("output",e,t))}initializeIntf(e,t,s){s.isInput=e==="input",s.nodeId=this.id,s.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:t,intf:s}))}addInterface(e,t,s){const r=e==="input"?this.events.beforeAddInput:this.events.beforeAddOutput,i=e==="input"?this.events.addInput:this.events.addOutput,o=e==="input"?this.inputs:this.outputs;return r.emit(s).prevented?!1:(o[t]=s,this.initializeIntf(e,t,s),i.emit(s),!0)}removeInterface(e,t){const s=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,r=e==="input"?this.events.removeInput:this.events.removeOutput,i=e==="input"?this.inputs[t]:this.outputs[t];if(!i||s.emit(i).prevented)return!1;if(i.connectionCount>0)if(this.graphInstance)this.graphInstance.connections.filter(a=>a.from===i||a.to===i).forEach(a=>{this.graphInstance.removeConnection(a)});else throw new Error("Interface is connected, but no graph instance is specified. Unable to delete interface");return i.events.setValue.unsubscribe(this),e==="input"?delete this.inputs[t]:delete this.outputs[t],r.emit(i),!0}}let CO=class extends xO{load(e){super.load(e)}save(){return super.save()}};function Ka(n){return class extends CO{constructor(){var e,t;super(),this.type=n.type,this.inputs={},this.outputs={},this.calculate=n.calculate?(s,r)=>n.calculate.call(this,s,r):void 0,this._title=(e=n.title)!==null&&e!==void 0?e:n.type,this.executeFactory("input",n.inputs),this.executeFactory("output",n.outputs),(t=n.onCreate)===null||t===void 0||t.call(this)}onPlaced(){var e;(e=n.onPlaced)===null||e===void 0||e.call(this)}onDestroy(){var e;(e=n.onDestroy)===null||e===void 0||e.call(this)}executeFactory(e,t){Object.keys(t||{}).forEach(s=>{const r=t[s]();e==="input"?this.addInput(s,r):this.addOutput(s,r)})}}}class en{set connectionCount(e){this._connectionCount=e,this.events.setConnectionCount.emit(e)}get connectionCount(){return this._connectionCount}set value(e){this.events.beforeSetValue.emit(e).prevented||(this._value=e,this.events.setValue.emit(e))}get value(){return this._value}constructor(e,t){this.id=Dr(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new Vt(this),beforeSetValue:new kn(this),setValue:new Vt(this),updated:new Vt(this)},this.hooks={load:new cs(this),save:new cs(this)},this._connectionCount=0,this.name=e,this._value=t}load(e){this.id=e.id,this.templateId=e.templateId,this.value=e.value,this.hooks.load.execute(e)}save(){const e={id:this.id,templateId:this.templateId,value:this.value};return this.hooks.save.execute(e)}setComponent(e){return this.component=e,this}setPort(e){return this.port=e,this}setHidden(e){return this.hidden=e,this}use(e,...t){return e(this,...t),this}}const Ma="__baklava_SubgraphInputNode",Na="__baklava_SubgraphOutputNode";class wO extends CO{constructor(){super(),this.graphInterfaceId=Dr()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class wy extends wO{constructor(){super(...arguments),this.type=Ma,this.inputs={name:new en("Name","Input")},this.outputs={placeholder:new en("Value",void 0)}}static isGraphInputNode(e){return e.type===Ma}}class Ry extends wO{constructor(){super(...arguments),this.type=Na,this.inputs={name:new en("Name","Output"),placeholder:new en("Value",void 0)},this.outputs={output:new en("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===Na}}class _c{get nodes(){return this._nodes}get connections(){return this._connections}get loading(){return this._loading}get destroying(){return this._destroying}get inputs(){return this.nodes.filter(t=>t.type===Ma).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===Na).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Dr(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new kn(this),addNode:new Vt(this),beforeRemoveNode:new kn(this),removeNode:new Vt(this),beforeAddConnection:new kn(this),addConnection:new Vt(this),checkConnection:new kn(this),beforeRemoveConnection:new kn(this),removeConnection:new Vt(this)},this.hooks={save:new cs(this),load:new cs(this),checkConnection:new QTt(this)},this.nodeEvents=Qs(),this.nodeHooks=Qs(),this.connectionEvents=Qs(),this.editor=e,this.template=t,e.registerGraph(this)}addNode(e){if(!this.events.beforeAddNode.emit(e).prevented)return this.nodeEvents.addTarget(e.events),this.nodeHooks.addTarget(e.hooks),e.registerGraph(this),this._nodes.push(e),e=this.nodes.find(t=>t.id===e.id),e.onPlaced(),this.events.addNode.emit(e),e}removeNode(e){if(this.nodes.includes(e)){if(this.events.beforeRemoveNode.emit(e).prevented)return;const t=[...Object.values(e.inputs),...Object.values(e.outputs)];this.connections.filter(s=>t.includes(s.from)||t.includes(s.to)).forEach(s=>this.removeConnection(s)),this._nodes.splice(this.nodes.indexOf(e),1),this.events.removeNode.emit(e),e.onDestroy(),this.nodeEvents.removeTarget(e.events),this.nodeHooks.removeTarget(e.hooks)}}addConnection(e,t){const s=this.checkConnection(e,t);if(!s.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:t}).prevented)return;for(const i of s.connectionsInDanger){const o=this.connections.find(a=>a.id===i.id);o&&this.removeConnection(o)}const r=new e2(s.dummyConnection.from,s.dummyConnection.to);return this.internalAddConnection(r),r}removeConnection(e){if(this.connections.includes(e)){if(this.events.beforeRemoveConnection.emit(e).prevented)return;e.destruct(),this._connections.splice(this.connections.indexOf(e),1),this.events.removeConnection.emit(e),this.connectionEvents.removeTarget(e.events)}}checkConnection(e,t){if(!e||!t)return{connectionAllowed:!1};const s=this.findNodeById(e.nodeId),r=this.findNodeById(t.nodeId);if(s&&r&&s===r)return{connectionAllowed:!1};if(e.isInput&&!t.isInput){const a=e;e=t,t=a}if(e.isInput||!t.isInput)return{connectionAllowed:!1};if(this.connections.some(a=>a.from===e&&a.to===t))return{connectionAllowed:!1};if(this.events.checkConnection.emit({from:e,to:t}).prevented)return{connectionAllowed:!1};const i=this.hooks.checkConnection.execute({from:e,to:t});if(i.some(a=>!a.connectionAllowed))return{connectionAllowed:!1};const o=Array.from(new Set(i.flatMap(a=>a.connectionsInDanger)));return{connectionAllowed:!0,dummyConnection:new TO(e,t),connectionsInDanger:o}}findNodeInterface(e){for(const t of this.nodes){for(const s in t.inputs){const r=t.inputs[s];if(r.id===e)return r}for(const s in t.outputs){const r=t.outputs[s];if(r.id===e)return r}}}findNodeById(e){return this.nodes.find(t=>t.id===e)}load(e){try{this._loading=!0;const t=[];for(let s=this.connections.length-1;s>=0;s--)this.removeConnection(this.connections[s]);for(let s=this.nodes.length-1;s>=0;s--)this.removeNode(this.nodes[s]);this.id=e.id;for(const s of e.nodes){const r=this.editor.nodeTypes.get(s.type);if(!r){t.push(`Node type ${s.type} is not registered`);continue}const i=new r.type;this.addNode(i),i.load(s)}for(const s of e.connections){const r=this.findNodeInterface(s.from),i=this.findNodeInterface(s.to);if(r)if(i){const o=new e2(r,i);o.id=s.id,this.internalAddConnection(o)}else{t.push(`Could not find interface with id ${s.to}`);continue}else{t.push(`Could not find interface with id ${s.from}`);continue}}return this.hooks.load.execute(e),t}finally{this._loading=!1}}save(){const e={id:this.id,nodes:this.nodes.map(t=>t.save()),connections:this.connections.map(t=>({id:t.id,from:t.from.id,to:t.to.id})),inputs:this.inputs,outputs:this.outputs};return this.hooks.save.execute(e)}destroy(){this._destroying=!0;for(const e of this.nodes)this.removeNode(e);this.editor.unregisterGraph(this)}internalAddConnection(e){this.connectionEvents.addTarget(e.events),this._connections.push(e),this.events.addConnection.emit(e)}}const Jl="__baklava_GraphNode-";function Oa(n){return Jl+n.id}const XTt=["component","connectionCount","events","hidden","hooks","id","isInput","name","nodeId","port","templateId","value"];function ZTt(n){return class extends xO{constructor(){super(...arguments),this.type=Oa(n),this.inputs={},this.outputs={},this.template=n,this.calculate=async(t,s)=>{var r;if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!s.engine||typeof s.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const i=s.engine.getInputValues(this.subgraph);for(const c of this.subgraph.inputs)i.set(c.nodeInterfaceId,t[c.id]);const o=await s.engine.runGraph(this.subgraph,i,s.globalValues),a={};for(const c of this.subgraph.outputs)a[c.id]=(r=o.get(c.nodeId))===null||r===void 0?void 0:r.get("output");return a._calculationResults=o,a}}get title(){return this._title}set title(t){this.template.name=t}load(t){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(t.graphState),super.load(t)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,t=>{this._title=t}),this.initialize()}onDestroy(){var t;this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),(t=this.subgraph)===null||t===void 0||t.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name,this.updateInterfaces(),this.events.update.emit(null)}updateInterfaces(){if(!this.subgraph)throw new Error("Trying to update interfaces without graph instance");for(const t of this.subgraph.inputs)t.id in this.inputs?this.inputs[t.id].name=t.name:this.addInput(t.id,this.createProxyInterface(t,!0));for(const t of Object.keys(this.inputs))this.subgraph.inputs.some(s=>s.id===t)||this.removeInput(t);for(const t of this.subgraph.outputs)t.id in this.outputs?this.outputs[t.id].name=t.name:this.addOutput(t.id,this.createProxyInterface(t,!1));for(const t of Object.keys(this.outputs))this.subgraph.outputs.some(s=>s.id===t)||this.removeOutput(t);this.addOutput("_calculationResults",new en("_calculationResults",void 0).setHidden(!0))}createProxyInterface(t,s){const r=new en(t.name,void 0);return new Proxy(r,{get:(i,o)=>{var a,c,d;if(XTt.includes(o)||o in i||typeof o=="string"&&o.startsWith("__v_"))return Reflect.get(i,o);let u;if(s){const h=(a=this.subgraph)===null||a===void 0?void 0:a.nodes.find(f=>wy.isGraphInputNode(f)&&f.graphInterfaceId===t.id);u=h==null?void 0:h.outputs.placeholder.id}else{const h=(c=this.subgraph)===null||c===void 0?void 0:c.nodes.find(f=>Ry.isGraphOutputNode(f)&&f.graphInterfaceId===t.id);u=h==null?void 0:h.inputs.placeholder.id}const _=(d=this.subgraph)===null||d===void 0?void 0:d.connections.find(h=>{var f;return u===((f=s?h.from:h.to)===null||f===void 0?void 0:f.id)}),m=s?_==null?void 0:_.to:_==null?void 0:_.from;if(m)return Reflect.get(m,o)}})}}}class Ep{static fromGraph(e,t){return new Ep(e.save(),t)}get name(){return this._name}set name(e){this._name=e,this.events.nameChanged.emit(e);const t=this.editor.nodeTypes.get(Oa(this));t&&(t.title=e)}get inputs(){return this.nodes.filter(t=>t.type===Ma).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.placeholder.id}))}get outputs(){return this.nodes.filter(t=>t.type===Na).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Dr(),this._name="Subgraph",this.events={nameChanged:new Vt(this),updated:new Vt(this)},this.hooks={beforeLoad:new cs(this),afterSave:new cs(this)},this.editor=t,e.id&&(this.id=e.id),e.name&&(this._name=e.name),this.update(e)}update(e){this.nodes=e.nodes,this.connections=e.connections,this.events.updated.emit()}save(){return{id:this.id,name:this.name,nodes:this.nodes,connections:this.connections,inputs:this.inputs,outputs:this.outputs}}createGraph(e){const t=new Map,s=m=>{const h=Dr();return t.set(m,h),h},r=m=>{const h=t.get(m);if(!h)throw new Error(`Unable to create graph from template: Could not map old id ${m} to new id`);return h},i=m=>Ab(m,h=>({id:s(h.id),templateId:h.id,value:h.value})),o=this.nodes.map(m=>({...m,id:s(m.id),inputs:i(m.inputs),outputs:i(m.outputs)})),a=this.connections.map(m=>({id:s(m.id),from:r(m.from),to:r(m.to)})),c=this.inputs.map(m=>({id:m.id,name:m.name,nodeId:r(m.nodeId),nodeInterfaceId:r(m.nodeInterfaceId)})),d=this.outputs.map(m=>({id:m.id,name:m.name,nodeId:r(m.nodeId),nodeInterfaceId:r(m.nodeInterfaceId)})),u={id:Dr(),nodes:o,connections:a,inputs:c,outputs:d};return e||(e=new _c(this.editor)),e.load(u).forEach(m=>console.warn(m)),e.template=this,e}}class JTt{get nodeTypes(){return this._nodeTypes}get graph(){return this._graph}get graphTemplates(){return this._graphTemplates}get graphs(){return this._graphs}get loading(){return this._loading}constructor(){this.events={loaded:new Vt(this),beforeRegisterNodeType:new kn(this),registerNodeType:new Vt(this),beforeUnregisterNodeType:new kn(this),unregisterNodeType:new Vt(this),beforeAddGraphTemplate:new kn(this),addGraphTemplate:new Vt(this),beforeRemoveGraphTemplate:new kn(this),removeGraphTemplate:new Vt(this),registerGraph:new Vt(this),unregisterGraph:new Vt(this)},this.hooks={save:new cs(this),load:new cs(this)},this.graphTemplateEvents=Qs(),this.graphTemplateHooks=Qs(),this.graphEvents=Qs(),this.graphHooks=Qs(),this.nodeEvents=Qs(),this.nodeHooks=Qs(),this.connectionEvents=Qs(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new _c(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType(wy),this.registerNodeType(Ry)}registerNodeType(e,t){var s,r;if(this.events.beforeRegisterNodeType.emit({type:e,options:t}).prevented)return;const i=new e;this._nodeTypes.set(i.type,{type:e,category:(s=t==null?void 0:t.category)!==null&&s!==void 0?s:"default",title:(r=t==null?void 0:t.title)!==null&&r!==void 0?r:i.title}),this.events.registerNodeType.emit({type:e,options:t})}unregisterNodeType(e){const t=typeof e=="string"?e:new e().type;if(this.nodeTypes.has(t)){if(this.events.beforeUnregisterNodeType.emit(t).prevented)return;this._nodeTypes.delete(t),this.events.unregisterNodeType.emit(t)}}addGraphTemplate(e){if(this.events.beforeAddGraphTemplate.emit(e).prevented)return;this._graphTemplates.push(e),this.graphTemplateEvents.addTarget(e.events),this.graphTemplateHooks.addTarget(e.hooks);const t=ZTt(e);this.registerNodeType(t,{category:"Subgraphs",title:e.name}),this.events.addGraphTemplate.emit(e)}removeGraphTemplate(e){if(this.graphTemplates.includes(e)){if(this.events.beforeRemoveGraphTemplate.emit(e).prevented)return;const t=Oa(e);for(const s of[this.graph,...this.graphs.values()]){const r=s.nodes.filter(i=>i.type===t);for(const i of r)s.removeNode(i)}this.unregisterNodeType(t),this._graphTemplates.splice(this._graphTemplates.indexOf(e),1),this.graphTemplateEvents.removeTarget(e.events),this.graphTemplateHooks.removeTarget(e.hooks),this.events.removeGraphTemplate.emit(e)}}registerGraph(e){this.graphEvents.addTarget(e.events),this.graphHooks.addTarget(e.hooks),this.nodeEvents.addTarget(e.nodeEvents),this.nodeHooks.addTarget(e.nodeHooks),this.connectionEvents.addTarget(e.connectionEvents),this.events.registerGraph.emit(e),this._graphs.add(e)}unregisterGraph(e){this.graphEvents.removeTarget(e.events),this.graphHooks.removeTarget(e.hooks),this.nodeEvents.removeTarget(e.nodeEvents),this.nodeHooks.removeTarget(e.nodeHooks),this.connectionEvents.removeTarget(e.connectionEvents),this.events.unregisterGraph.emit(e),this._graphs.delete(e)}load(e){try{for(this._loading=!0,e=this.hooks.load.execute(e);this.graphTemplates.length>0;)this.removeGraphTemplate(this.graphTemplates[0]);e.graphTemplates.forEach(s=>{const r=new Ep(s,this);this.addGraphTemplate(r)});const t=this._graph.load(e.graph);return this.events.loaded.emit(),t.forEach(s=>console.warn(s)),t}finally{this._loading=!1}}save(){const e={graph:this.graph.save(),graphTemplates:this.graphTemplates.map(t=>t.save())};return this.hooks.save.execute(e)}}function ext(n,e){const t=new Map;e.graphs.forEach(s=>{s.nodes.forEach(r=>t.set(r.id,r))}),n.forEach((s,r)=>{const i=t.get(r);i&&s.forEach((o,a)=>{const c=i.outputs[a];c&&(c.value=o)})})}class RO extends Error{constructor(){super("Cycle detected")}}function txt(n){return typeof n=="string"}function AO(n,e){const t=new Map,s=new Map,r=new Map;let i,o;if(n instanceof _c)i=n.nodes,o=n.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");i=n,o=e}i.forEach(d=>{Object.values(d.inputs).forEach(u=>t.set(u.id,d.id)),Object.values(d.outputs).forEach(u=>t.set(u.id,d.id))}),i.forEach(d=>{const u=o.filter(m=>m.from&&t.get(m.from.id)===d.id),_=new Set(u.map(m=>t.get(m.to.id)).filter(txt));s.set(d.id,_),r.set(d,u)});const a=i.slice();o.forEach(d=>{const u=a.findIndex(_=>t.get(d.to.id)===_.id);u>=0&&a.splice(u,1)});const c=[];for(;a.length>0;){const d=a.pop();c.push(d);const u=s.get(d.id);for(;u.size>0;){const _=u.values().next().value;if(u.delete(_),Array.from(s.values()).every(m=>!m.has(_))){const m=i.find(h=>h.id===_);a.push(m)}}}if(Array.from(s.values()).some(d=>d.size>0))throw new RO;return{calculationOrder:c,connectionsFromNode:r,interfaceIdToNodeId:t}}function nxt(n,e){try{return AO(n,e),!1}catch(t){if(t instanceof RO)return!0;throw t}}var Yn;(function(n){n.Running="Running",n.Idle="Idle",n.Paused="Paused",n.Stopped="Stopped"})(Yn||(Yn={}));class sxt{get status(){return this.isRunning?Yn.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new kn(this),afterRun:new Vt(this),statusChange:new Vt(this),beforeNodeCalculation:new Vt(this),afterNodeCalculation:new Vt(this)},this.hooks={gatherCalculationData:new cs(this),transferData:new SO},this.recalculateOrder=!0,this.internalStatus=Yn.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(t,s)=>{s.graph&&!s.graph.loading&&s.graph.activeTransactions===0&&this.internalOnChange(s,t??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(t,s)=>{this.recalculateOrder=!0,!s.loading&&s.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,t=>this.checkConnection(t.from,t.to))}start(){this.internalStatus===Yn.Stopped&&(this.internalStatus=Yn.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===Yn.Idle&&(this.internalStatus=Yn.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===Yn.Paused&&(this.internalStatus=Yn.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===Yn.Idle||this.internalStatus===Yn.Paused)&&(this.internalStatus=Yn.Stopped,this.events.statusChange.emit(this.status))}async runOnce(e,...t){if(this.events.beforeRun.emit(e).prevented)return null;try{this.isRunning=!0,this.events.statusChange.emit(this.status),this.recalculateOrder&&this.calculateOrder();const s=await this.execute(e,...t);return this.events.afterRun.emit(s),s}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,t){if(e.templateId){const i=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!i)return{connectionAllowed:!0,connectionsInDanger:[]};e=i}if(t.templateId){const i=this.findInterfaceByTemplateId(this.editor.graph.nodes,t.templateId);if(!i)return{connectionAllowed:!0,connectionsInDanger:[]};t=i}const s=new TO(e,t);let r=this.editor.graph.connections.slice();return t.allowMultipleConnections||(r=r.filter(i=>i.to!==t)),r.push(s),nxt(this.editor.graph.nodes,r)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:t.allowMultipleConnections?[]:this.editor.graph.connections.filter(i=>i.to===t)}}calculateOrder(){this.recalculateOrder=!0}async calculateWithoutData(...e){const t=this.hooks.gatherCalculationData.execute(void 0);return await this.runOnce(t,...e)}validateNodeCalculationOutput(e,t){if(typeof t!="object")throw new Error(`Invalid calculation return value from node ${e.id} (type ${e.type})`);Object.keys(e.outputs).forEach(s=>{if(!(s in t))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${s}"`)})}internalOnChange(e,t){this.internalStatus===Yn.Idle&&this.onChange(this.recalculateOrder,e,t)}findInterfaceByTemplateId(e,t){for(const s of e)for(const r of[...Object.values(s.inputs),...Object.values(s.outputs)])if(r.templateId===t)return r;return null}}class rxt extends sxt{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,t,s){this.order.has(e.id)||this.order.set(e.id,AO(e));const{calculationOrder:r,connectionsFromNode:i}=this.order.get(e.id),o=new Map;for(const a of r){const c={};Object.entries(a.inputs).forEach(([u,_])=>{c[u]=this.getInterfaceValue(t,_.id)}),this.events.beforeNodeCalculation.emit({inputValues:c,node:a});let d;if(a.calculate)d=await a.calculate(c,{globalValues:s,engine:this});else{d={};for(const[u,_]of Object.entries(a.outputs))d[u]=this.getInterfaceValue(t,_.id)}this.validateNodeCalculationOutput(a,d),this.events.afterNodeCalculation.emit({outputValues:d,node:a}),o.set(a.id,new Map(Object.entries(d))),i.has(a)&&i.get(a).forEach(u=>{var _;const m=(_=Object.entries(a.outputs).find(([,f])=>f.id===u.from.id))===null||_===void 0?void 0:_[0];if(!m)throw new Error(`Could not find key for interface ${u.from.id} This is likely a Baklava internal issue. Please report it on GitHub.`);const h=this.hooks.transferData.execute(d[m],u);u.to.allowMultipleConnections?t.has(u.to.id)?t.get(u.to.id).push(h):t.set(u.to.id,[h]):t.set(u.to.id,h)})}return o}async execute(e){this.recalculateOrder&&(this.order.clear(),this.recalculateOrder=!1);const t=this.getInputValues(this.editor.graph);return await this.runGraph(this.editor.graph,t,e)}getInputValues(e){const t=new Map;for(const s of e.nodes)Object.values(s.inputs).forEach(r=>{r.connectionCount===0&&t.set(r.id,r.value)}),s.calculate||Object.values(s.outputs).forEach(r=>{t.set(r.id,r.value)});return t}onChange(e){this.recalculateOrder=e||this.recalculateOrder,this.calculateWithoutData()}getInterfaceValue(e,t){if(!e.has(t))throw new Error(`Could not find value for interface ${t} -This is likely a Baklava internal issue. Please report it on GitHub.`);return e.get(t)}}const txt=["INPUT","TEXTAREA","SELECT"];function MO(n){return txt.includes(n.tagName)}let Mb=null;function nxt(n){Mb=n}function ds(){if(!Mb)throw new Error("providePlugin() must be called before usePlugin()");return{viewModel:Mb}}function Ns(){const{viewModel:n}=ds();return{graph:Bd(n.value,"displayedGraph"),switchGraph:n.value.switchGraph}}function NO(n){const{graph:e}=Ns(),t=ot(null),s=ot(null);return{dragging:Je(()=>!!t.value),onPointerDown:c=>{t.value={x:c.pageX,y:c.pageY},s.value={x:n.value.x,y:n.value.y}},onPointerMove:c=>{if(t.value){const d=c.pageX-t.value.x,u=c.pageY-t.value.y;n.value.x=s.value.x+d/e.value.scaling,n.value.y=s.value.y+u/e.value.scaling}},onPointerUp:()=>{t.value=null,s.value=null}}}function OO(n,e,t){if(!e.template)return!1;if(Oa(e.template)===t)return!0;const s=n.graphTemplates.find(i=>Oa(i)===t);return s?s.nodes.filter(i=>i.type.startsWith(Jl)).some(i=>OO(n,e,i.type)):!1}function IO(n){return Je(()=>{const e=Array.from(n.value.editor.nodeTypes.entries()),t=new Set(e.map(([,r])=>r.category)),s=[];for(const r of t.values()){let i=e.filter(([,o])=>o.category===r);n.value.displayedGraph.template?i=i.filter(([o])=>!OO(n.value.editor,n.value.displayedGraph,o)):i=i.filter(([o])=>![Ma,Na].includes(o)),i.length>0&&s.push({name:r,nodeTypes:Object.fromEntries(i)})}return s.sort((r,i)=>r.name==="default"?-1:i.name==="default"||r.name>i.name?1:-1),s})}function kO(){const{graph:n}=Ns();return{transform:(t,s)=>{const r=t/n.value.scaling-n.value.panning.x,i=s/n.value.scaling-n.value.panning.y;return[r,i]}}}function sxt(){const{graph:n}=Ns();let e=[],t=-1,s={x:0,y:0};const r=Je(()=>n.value.panning),i=NO(r),o=Je(()=>({"transform-origin":"0 0",transform:`scale(${n.value.scaling}) translate(${n.value.panning.x}px, ${n.value.panning.y}px)`})),a=(h,f,y)=>{const b=[h/n.value.scaling-n.value.panning.x,f/n.value.scaling-n.value.panning.y],g=[h/y-n.value.panning.x,f/y-n.value.panning.y],E=[g[0]-b[0],g[1]-b[1]];n.value.panning.x+=E[0],n.value.panning.y+=E[1],n.value.scaling=y},c=h=>{h.preventDefault();let f=h.deltaY;h.deltaMode===1&&(f*=32);const y=n.value.scaling*(1-f/3e3);a(h.offsetX,h.offsetY,y)},d=()=>({ax:e[0].clientX,ay:e[0].clientY,bx:e[1].clientX,by:e[1].clientY});return{styles:o,...i,onPointerDown:h=>{if(e.push(h),i.onPointerDown(h),e.length===2){const{ax:f,ay:y,bx:b,by:g}=d();s={x:f+(b-f)/2,y:y+(g-y)/2}}},onPointerMove:h=>{for(let f=0;f0){const R=n.value.scaling*(1+(S-t)/500);a(s.x,s.y,R)}t=S}else i.onPointerMove(h)},onPointerUp:h=>{e=e.filter(f=>f.pointerId!==h.pointerId),t=-1,i.onPointerUp()},onMouseWheel:c}}var ys=(n=>(n[n.NONE=0]="NONE",n[n.ALLOWED=1]="ALLOWED",n[n.FORBIDDEN=2]="FORBIDDEN",n))(ys||{});const DO=Symbol();function rxt(){const{graph:n}=Ns(),e=ot(null),t=ot(null),s=a=>{e.value&&(e.value.mx=a.offsetX/n.value.scaling-n.value.panning.x,e.value.my=a.offsetY/n.value.scaling-n.value.panning.y)},r=()=>{if(t.value){if(e.value)return;const a=n.value.connections.find(c=>c.to===t.value);t.value.isInput&&a?(e.value={status:ys.NONE,from:a.from},n.value.removeConnection(a)):e.value={status:ys.NONE,from:t.value},e.value.mx=void 0,e.value.my=void 0}},i=()=>{if(e.value&&t.value){if(e.value.from===t.value)return;n.value.addConnection(e.value.from,e.value.to)}e.value=null},o=a=>{if(t.value=a??null,a&&e.value){e.value.to=a;const c=n.value.checkConnection(e.value.from,e.value.to);if(e.value.status=c.connectionAllowed?ys.ALLOWED:ys.FORBIDDEN,c.connectionAllowed){const d=c.connectionsInDanger.map(u=>u.id);n.value.connections.forEach(u=>{d.includes(u.id)&&(u.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=ys.NONE,n.value.connections.forEach(c=>{c.isInDanger=!1}))};return na(DO,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:s,onMouseDown:r,onMouseUp:i,hoveredOver:o}}function ixt(n){const e=ot(!1),t=ot(0),s=ot(0),r=IO(n),{transform:i}=kO(),o=Je(()=>{let u=[];const _={};for(const h of r.value){const f=Object.entries(h.nodeTypes).map(([y,b])=>({label:b.title,value:"addNode:"+y}));h.name==="default"?u=f:_[h.name]=f}const m=[...Object.entries(_).map(([h,f])=>({label:h,submenu:f}))];return m.length>0&&u.length>0&&m.push({isDivider:!0}),m.push(...u),m}),a=Je(()=>n.value.settings.contextMenu.additionalItems.length===0?o.value:[{label:"Add node",submenu:o.value},...n.value.settings.contextMenu.additionalItems.map(u=>"isDivider"in u||"submenu"in u?u:{label:u.label,value:"command:"+u.command,disabled:!n.value.commandHandler.canExecuteCommand(u.command)})]);function c(u){const _=u.target;if(!(_ instanceof Element)||MO(_))return;u.preventDefault(),e.value=!0;const m=_.getBoundingClientRect(),f=_.closest(".baklava-editor").getBoundingClientRect();t.value=m.x+u.offsetX-f.x,s.value=m.y+u.offsetY-f.y}function d(u){if(u.startsWith("addNode:")){const _=u.substring(8),m=n.value.editor.nodeTypes.get(_);if(!m)return;const h=Hn(new m.type);n.value.displayedGraph.addNode(h);const[f,y]=i(t.value,s.value);h.position.x=f,h.position.y=y}else if(u.startsWith("command:")){const _=u.substring(8);n.value.commandHandler.canExecuteCommand(_)&&n.value.commandHandler.executeCommand(_)}}return{show:e,x:t,y:s,items:a,open:c,onClick:d}}const Ld="START_SELECTION_BOX";function oxt(n){const{viewModel:e}=ds(),{graph:t}=Ns(),s=Je(()=>t.value.nodes),r=ot(!1),i=ot(!1),o=ot([0,0]),a=ot([0,0]);Tn(e,()=>{e.value.commandHandler.hasCommand(Ld)||(e.value.commandHandler.registerCommand(Ld,{canExecute:()=>!0,execute(){r.value=!0}}),e.value.commandHandler.registerHotkey(["b"],Ld))},{immediate:!0});function c(g){return[g.clientX-n.value.getBoundingClientRect().left,g.clientY-n.value.getBoundingClientRect().top]}function d(g){return r.value?(i.value=!0,r.value=!1,o.value=c(g),a.value=c(g),document.addEventListener("pointermove",u),document.addEventListener("pointerup",_),!0):!1}function u(g){o.value=c(g)}function _(g){document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",_),o.value=c(g),i.value=!1;const E=m();for(const v of E)e.value.displayedGraph.selectedNodes.push(v)}function m(){const g=h(),v=document.querySelector(".baklava-editor").getBoundingClientRect();return s.value.filter(S=>{const R=f(S,v);return y(g,R)})}function h(){return{left:Math.min(o.value[0],a.value[0]),top:Math.min(o.value[1],a.value[1]),right:Math.max(o.value[0],a.value[0]),bottom:Math.max(o.value[1],a.value[1])}}function f(g,E){const v=document.getElementById(g.id),S=v?v.getBoundingClientRect():{x:0,y:0,width:0,height:0},R=S.x-E.left,w=S.y-E.top;return{left:R,top:w,right:R+S.width,bottom:w+S.height}}function y(g,E){return g.leftE.left&&g.topE.top}function b(){return{width:Math.abs(a.value[0]-o.value[0])+"px",height:Math.abs(a.value[1]-o.value[1])+"px",left:(a.value[0]>o.value[0]?o.value[0]:a.value[0])+"px",top:(a.value[1]>o.value[1]?o.value[1]:a.value[1])+"px"}}return Hn({startSelection:r,isSelecting:i,start:o,end:a,onPointerDown:d,getStyles:b})}const axt=cn({setup(){const{viewModel:n}=ds(),{graph:e}=Ns();return{styles:Je(()=>{const s=n.value.settings.background,r=e.value.panning.x*e.value.scaling,i=e.value.panning.y*e.value.scaling,o=e.value.scaling*s.gridSize,a=o/s.gridDivision,c=`${o}px ${o}px, ${o}px ${o}px`,d=e.value.scaling>s.subGridVisibleThreshold?`, ${a}px ${a}px, ${a}px ${a}px`:"";return{backgroundPosition:`left ${r}px top ${i}px`,backgroundSize:`${c} ${d}`}})}}}),sn=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t};function lxt(n,e,t,s,r,i){return T(),x("div",{class:"background",style:Bt(n.styles)},null,4)}const cxt=sn(axt,[["render",lxt]]);function dxt(n){return E2()?(bI(n),!0):!1}function Ay(n){return typeof n=="function"?n():bt(n)}const LO=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const uxt=Object.prototype.toString,pxt=n=>uxt.call(n)==="[object Object]",Pd=()=>{},fxt=_xt();function _xt(){var n,e;return LO&&((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function mxt(n,e,t=!1){return e.reduce((s,r)=>(r in n&&(!t||n[r]!==void 0)&&(s[r]=n[r]),s),{})}function hxt(n,e={}){if(!pn(n))return WI(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const s in n.value)t[s]=$I(()=>({get(){return n.value[s]},set(r){var i;if((i=Ay(e.replaceRef))!=null?i:!0)if(Array.isArray(n.value)){const a=[...n.value];a[s]=r,n.value=a}else{const a={...n.value,[s]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[s]=r}}));return t}function bl(n){var e;const t=Ay(n);return(e=t==null?void 0:t.$el)!=null?e:t}const My=LO?window:void 0;function Ll(...n){let e,t,s,r;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,s,r]=n,e=My):[e,t,s,r]=n,!e)return Pd;Array.isArray(t)||(t=[t]),Array.isArray(s)||(s=[s]);const i=[],o=()=>{i.forEach(u=>u()),i.length=0},a=(u,_,m,h)=>(u.addEventListener(_,m,h),()=>u.removeEventListener(_,m,h)),c=Tn(()=>[bl(e),Ay(r)],([u,_])=>{if(o(),!u)return;const m=pxt(_)?{..._}:_;i.push(...t.flatMap(h=>s.map(f=>a(u,h,f,m))))},{immediate:!0,flush:"post"}),d=()=>{c(),o()};return dxt(d),d}let t2=!1;function PO(n,e,t={}){const{window:s=My,ignore:r=[],capture:i=!0,detectIframe:o=!1}=t;if(!s)return Pd;fxt&&!t2&&(t2=!0,Array.from(s.document.body.children).forEach(m=>m.addEventListener("click",Pd)),s.document.documentElement.addEventListener("click",Pd));let a=!0;const c=m=>r.some(h=>{if(typeof h=="string")return Array.from(s.document.querySelectorAll(h)).some(f=>f===m.target||m.composedPath().includes(f));{const f=bl(h);return f&&(m.target===f||m.composedPath().includes(f))}}),u=[Ll(s,"click",m=>{const h=bl(n);if(!(!h||h===m.target||m.composedPath().includes(h))){if(m.detail===0&&(a=!c(m)),!a){a=!0;return}e(m)}},{passive:!0,capture:i}),Ll(s,"pointerdown",m=>{const h=bl(n);a=!c(m)&&!!(h&&!m.composedPath().includes(h))},{passive:!0}),o&&Ll(s,"blur",m=>{setTimeout(()=>{var h;const f=bl(n);((h=s.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(f!=null&&f.contains(s.document.activeElement))&&e(m)},0)})].filter(Boolean);return()=>u.forEach(m=>m())}const FO={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},gxt=Object.keys(FO);function bxt(n={}){const{target:e=My}=n,t=ot(!1),s=ot(n.initialValue||{});Object.assign(s.value,FO,s.value);const r=i=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(i.pointerType))&&(s.value=mxt(i,gxt,!1))};if(e){const i={passive:!0};Ll(e,["pointerdown","pointermove","pointerup"],r,i),Ll(e,"pointerleave",()=>t.value=!1,i)}return{...hxt(s),isInside:t}}const yxt=["onMouseenter","onMouseleave","onClick"],Ext={class:"flex-fill"},vxt={key:0,class:"__submenu-icon",style:{"line-height":"1em"}},Sxt=l("svg",{width:"13",height:"13",viewBox:"-60 120 250 250"},[l("path",{d:"M160.875 279.5625 L70.875 369.5625 L70.875 189.5625 L160.875 279.5625 Z",stroke:"none",fill:"white"})],-1),Txt=[Sxt],Ny=cn({__name:"ContextMenu",props:{modelValue:{type:Boolean},items:{},x:{default:0},y:{default:0},isNested:{type:Boolean,default:!1},isFlipped:{default:()=>({x:!1,y:!1})},flippable:{type:Boolean,default:!1}},emits:["update:modelValue","click"],setup(n,{emit:e}){const t=n,s=e;let r=null;const i=ot(null),o=ot(-1),a=ot(0),c=ot({x:!1,y:!1}),d=Je(()=>t.flippable&&(c.value.x||t.isFlipped.x)),u=Je(()=>t.flippable&&(c.value.y||t.isFlipped.y)),_=Je(()=>{const E={};return t.isNested||(E.top=(u.value?t.y-a.value:t.y)+"px",E.left=t.x+"px"),E}),m=Je(()=>({"--flipped-x":d.value,"--flipped-y":u.value,"--nested":t.isNested})),h=Je(()=>t.items.map(E=>({...E,hover:!1})));Tn([()=>t.y,()=>t.items],()=>{var E,v,S,R;a.value=t.items.length*30;const w=((v=(E=i.value)==null?void 0:E.parentElement)==null?void 0:v.offsetWidth)??0,A=((R=(S=i.value)==null?void 0:S.parentElement)==null?void 0:R.offsetHeight)??0;c.value.x=!t.isNested&&t.x>w*.75,c.value.y=!t.isNested&&t.y+a.value>A-20}),PO(i,()=>{t.modelValue&&s("update:modelValue",!1)});const f=E=>{!E.submenu&&E.value&&(s("click",E.value),s("update:modelValue",!1))},y=E=>{s("click",E),o.value=-1,t.isNested||s("update:modelValue",!1)},b=(E,v)=>{t.items[v].submenu&&(o.value=v,r!==null&&(clearTimeout(r),r=null))},g=(E,v)=>{t.items[v].submenu&&(r=window.setTimeout(()=>{o.value=-1,r=null},200))};return(E,v)=>{const S=nt("ContextMenu",!0);return T(),at(Or,{name:"slide-fade"},{default:Ie(()=>[k(l("div",{ref_key:"el",ref:i,class:Le(["baklava-context-menu",m.value]),style:Bt(_.value)},[(T(!0),x(Be,null,Ke(h.value,(R,w)=>(T(),x(Be,null,[R.isDivider?(T(),x("div",{key:`d-${w}`,class:"divider"})):(T(),x("div",{key:`i-${w}`,class:Le(["item",{submenu:!!R.submenu,"--disabled":!!R.disabled}]),onMouseenter:A=>b(A,w),onMouseleave:A=>g(A,w),onClick:$(A=>f(R),["stop","prevent"])},[l("div",Ext,Y(R.label),1),R.submenu?(T(),x("div",vxt,Txt)):B("",!0),R.submenu?(T(),at(S,{key:1,"model-value":o.value===w,items:R.submenu,"is-nested":!0,"is-flipped":{x:d.value,y:u.value},flippable:E.flippable,onClick:y},null,8,["model-value","items","is-flipped","flippable"])):B("",!0)],42,yxt))],64))),256))],6),[[ht,E.modelValue]])]),_:1})}}}),xxt={},Cxt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"16",height:"16",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},wxt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Rxt=l("circle",{cx:"12",cy:"12",r:"1"},null,-1),Axt=l("circle",{cx:"12",cy:"19",r:"1"},null,-1),Mxt=l("circle",{cx:"12",cy:"5",r:"1"},null,-1),Nxt=[wxt,Rxt,Axt,Mxt];function Oxt(n,e){return T(),x("svg",Cxt,Nxt)}const UO=sn(xxt,[["render",Oxt]]),Ixt=["id"],kxt={key:0,class:"__tooltip"},Dxt={key:2,class:"align-middle"},n2=cn({__name:"NodeInterface",props:{node:{},intf:{}},setup(n){const e=(b,g=100)=>{const E=typeof(b==null?void 0:b.toString)=="function"?String(b):"";return E.length>g?E.slice(0,g)+"...":E},t=n,{viewModel:s}=ds(),{hoveredOver:r,temporaryConnection:i}=is(DO),o=ot(null),a=Je(()=>t.intf.connectionCount>0),c=ot(!1),d=Je(()=>s.value.settings.displayValueOnHover&&c.value),u=Je(()=>({"--input":t.intf.isInput,"--output":!t.intf.isInput,"--connected":a.value})),_=Je(()=>t.intf.component&&(!t.intf.isInput||!t.intf.port||t.intf.connectionCount===0)),m=()=>{c.value=!0,r(t.intf)},h=()=>{c.value=!1,r(void 0)},f=()=>{o.value&&s.value.hooks.renderInterface.execute({intf:t.intf,el:o.value})},y=()=>{const b=s.value.displayedGraph.sidebar;b.nodeId=t.node.id,b.optionName=t.intf.name,b.visible=!0};return cr(f),nc(f),(b,g)=>{var E;return T(),x("div",{id:b.intf.id,ref_key:"el",ref:o,class:Le(["baklava-node-interface",u.value])},[b.intf.port?(T(),x("div",{key:0,class:Le(["__port",{"--selected":((E=bt(i))==null?void 0:E.from)===b.intf}]),onPointerover:m,onPointerout:h},[on(b.$slots,"portTooltip",{showTooltip:d.value},()=>[d.value===!0?(T(),x("span",kxt,Y(e(b.intf.value)),1)):B("",!0)])],34)):B("",!0),_.value?(T(),at(Fu(b.intf.component),{key:1,modelValue:b.intf.value,"onUpdate:modelValue":g[0]||(g[0]=v=>b.intf.value=v),node:b.node,intf:b.intf,onOpenSidebar:y},null,40,["modelValue","node","intf"])):(T(),x("span",Dxt,Y(b.intf.name),1))],10,Ixt)}}}),Lxt=["id","data-node-type"],Pxt={class:"__title-label"},Fxt={class:"__menu"},Uxt={class:"__outputs"},Bxt={class:"__inputs"},Gxt=cn({__name:"Node",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag"],setup(n,{emit:e}){const t=n,s=e,{viewModel:r}=ds(),{graph:i,switchGraph:o}=Ns(),a=ot(null),c=ot(!1),d=ot(""),u=ot(null),_=ot(!1),m=ot(!1),h=Je(()=>{const V=[{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return t.node.type.startsWith(Jl)&&V.push({value:"editSubgraph",label:"Edit Subgraph"}),V}),f=Je(()=>({"--selected":t.selected,"--dragging":t.dragging,"--two-column":!!t.node.twoColumn})),y=Je(()=>({"--reverse-y":t.node.reverseY??r.value.settings.nodes.reverseY})),b=Je(()=>{var V,ee;return{top:`${((V=t.node.position)==null?void 0:V.y)??0}px`,left:`${((ee=t.node.position)==null?void 0:ee.x)??0}px`,"--width":`${t.node.width??r.value.settings.nodes.defaultWidth}px`}}),g=Je(()=>Object.values(t.node.inputs).filter(V=>!V.hidden)),E=Je(()=>Object.values(t.node.outputs).filter(V=>!V.hidden)),v=()=>{s("select")},S=V=>{t.selected||v(),s("start-drag",V)},R=()=>{m.value=!0},w=async V=>{var ee;switch(V){case"delete":i.value.removeNode(t.node);break;case"rename":d.value=t.node.title,c.value=!0,await Fe(),(ee=u.value)==null||ee.focus();break;case"editSubgraph":o(t.node.template);break}},A=()=>{t.node.title=d.value,c.value=!1},I=()=>{a.value&&r.value.hooks.renderNode.execute({node:t.node,el:a.value})},C=V=>{_.value=!0,V.preventDefault()},M=V=>{if(!_.value)return;const ee=t.node.width+V.movementX/i.value.scaling,O=r.value.settings.nodes.minWidth,H=r.value.settings.nodes.maxWidth;t.node.width=Math.max(O,Math.min(H,ee))},G=()=>{_.value=!1};return cr(()=>{I(),window.addEventListener("mousemove",M),window.addEventListener("mouseup",G)}),nc(I),La(()=>{window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",G)}),(V,ee)=>(T(),x("div",{id:V.node.id,ref_key:"el",ref:a,class:Le(["baklava-node",f.value]),style:Bt(b.value),"data-node-type":V.node.type,onPointerdown:v},[bt(r).settings.nodes.resizable?(T(),x("div",{key:0,class:"__resize-handle",onMousedown:C},null,32)):B("",!0),on(V.$slots,"title",{},()=>[l("div",{class:"__title",onPointerdown:$(S,["self","stop"])},[c.value?k((T(),x("input",{key:1,ref_key:"renameInputEl",ref:u,"onUpdate:modelValue":ee[1]||(ee[1]=O=>d.value=O),type:"text",class:"baklava-input",placeholder:"Node Name",onBlur:A,onKeydown:ws(A,["enter"])},null,544)),[[ae,d.value]]):(T(),x(Be,{key:0},[l("div",Pxt,Y(V.node.title),1),l("div",Fxt,[z(UO,{class:"--clickable",onClick:R}),z(bt(Ny),{modelValue:m.value,"onUpdate:modelValue":ee[0]||(ee[0]=O=>m.value=O),x:0,y:0,items:h.value,onClick:w},null,8,["modelValue","items"])])],64))],32)]),on(V.$slots,"content",{},()=>[l("div",{class:Le(["__content",y.value]),onKeydown:ee[2]||(ee[2]=ws($(()=>{},["stop"]),["delete"]))},[l("div",Uxt,[(T(!0),x(Be,null,Ke(E.value,O=>on(V.$slots,"nodeInterface",{key:O.id,type:"output",node:V.node,intf:O},()=>[z(n2,{node:V.node,intf:O},null,8,["node","intf"])])),128))]),l("div",Bxt,[(T(!0),x(Be,null,Ke(g.value,O=>on(V.$slots,"nodeInterface",{key:O.id,type:"input",node:V.node,intf:O},()=>[z(n2,{node:V.node,intf:O},null,8,["node","intf"])])),128))])],34)])],46,Lxt))}}),Vxt=cn({props:{x1:{type:Number,required:!0},y1:{type:Number,required:!0},x2:{type:Number,required:!0},y2:{type:Number,required:!0},state:{type:Number,default:ys.NONE},isTemporary:{type:Boolean,default:!1}},setup(n){const{viewModel:e}=ds(),{graph:t}=Ns(),s=(o,a)=>{const c=(o+t.value.panning.x)*t.value.scaling,d=(a+t.value.panning.y)*t.value.scaling;return[c,d]},r=Je(()=>{const[o,a]=s(n.x1,n.y1),[c,d]=s(n.x2,n.y2);if(e.value.settings.useStraightConnections)return`M ${o} ${a} L ${c} ${d}`;{const u=.3*Math.abs(o-c);return`M ${o} ${a} C ${o+u} ${a}, ${c-u} ${d}, ${c} ${d}`}}),i=Je(()=>({"--temporary":n.isTemporary,"--allowed":n.state===ys.ALLOWED,"--forbidden":n.state===ys.FORBIDDEN}));return{d:r,classes:i}}}),zxt=["d"];function Hxt(n,e,t,s,r,i){return T(),x("path",{class:Le(["baklava-connection",n.classes]),d:n.d},null,10,zxt)}const BO=sn(Vxt,[["render",Hxt]]);function qxt(n){return document.getElementById(n.id)}function Ia(n){const e=document.getElementById(n.id),t=e==null?void 0:e.getElementsByClassName("__port");return{node:(e==null?void 0:e.closest(".baklava-node"))??null,interface:e,port:t&&t.length>0?t[0]:null}}const Yxt=cn({components:{"connection-view":BO},props:{connection:{type:Object,required:!0}},setup(n){const{graph:e}=Ns();let t;const s=ot({x1:0,y1:0,x2:0,y2:0}),r=Je(()=>n.connection.isInDanger?ys.FORBIDDEN:ys.NONE),i=Je(()=>{var d;return(d=e.value.findNodeById(n.connection.from.nodeId))==null?void 0:d.position}),o=Je(()=>{var d;return(d=e.value.findNodeById(n.connection.to.nodeId))==null?void 0:d.position}),a=d=>d.node&&d.interface&&d.port?[d.node.offsetLeft+d.interface.offsetLeft+d.port.offsetLeft+d.port.clientWidth/2,d.node.offsetTop+d.interface.offsetTop+d.port.offsetTop+d.port.clientHeight/2]:[0,0],c=()=>{const d=Ia(n.connection.from),u=Ia(n.connection.to);d.node&&u.node&&(t||(t=new ResizeObserver(()=>{c()}),t.observe(d.node),t.observe(u.node)));const[_,m]=a(d),[h,f]=a(u);s.value={x1:_,y1:m,x2:h,y2:f}};return cr(async()=>{await Fe(),c()}),La(()=>{t&&t.disconnect()}),Tn([i,o],()=>c(),{deep:!0}),{d:s,state:r}}});function $xt(n,e,t,s,r,i){const o=nt("connection-view");return T(),at(o,{x1:n.d.x1,y1:n.d.y1,x2:n.d.x2,y2:n.d.y2,state:n.state},null,8,["x1","y1","x2","y2","state"])}const Wxt=sn(Yxt,[["render",$xt]]);function Tu(n){return n.node&&n.interface&&n.port?[n.node.offsetLeft+n.interface.offsetLeft+n.port.offsetLeft+n.port.clientWidth/2,n.node.offsetTop+n.interface.offsetTop+n.port.offsetTop+n.port.clientHeight/2]:[0,0]}const Kxt=cn({components:{"connection-view":BO},props:{connection:{type:Object,required:!0}},setup(n){const e=Je(()=>n.connection?n.connection.status:ys.NONE);return{d:Je(()=>{if(!n.connection)return{input:[0,0],output:[0,0]};const s=Tu(Ia(n.connection.from)),r=n.connection.to?Tu(Ia(n.connection.to)):[n.connection.mx||s[0],n.connection.my||s[1]];return n.connection.from.isInput?{input:r,output:s}:{input:s,output:r}}),status:e}}});function jxt(n,e,t,s,r,i){const o=nt("connection-view");return T(),at(o,{x1:n.d.input[0],y1:n.d.input[1],x2:n.d.output[0],y2:n.d.output[1],state:n.status,"is-temporary":""},null,8,["x1","y1","x2","y2","state"])}const Qxt=sn(Kxt,[["render",jxt]]),Xxt=cn({setup(){const{viewModel:n}=ds(),{graph:e}=Ns(),t=ot(null),s=Bd(n.value.settings.sidebar,"width"),r=Je(()=>n.value.settings.sidebar.resizable),i=Je(()=>{const _=e.value.sidebar.nodeId;return e.value.nodes.find(m=>m.id===_)}),o=Je(()=>({width:`${s.value}px`})),a=Je(()=>i.value?[...Object.values(i.value.inputs),...Object.values(i.value.outputs)].filter(m=>m.displayInSidebar&&m.component):[]),c=()=>{e.value.sidebar.visible=!1},d=()=>{window.addEventListener("mousemove",u),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",u)},{once:!0})},u=_=>{var m,h;const f=((h=(m=t.value)==null?void 0:m.parentElement)==null?void 0:h.getBoundingClientRect().width)??500;let y=s.value-_.movementX;y<300?y=300:y>.9*f&&(y=.9*f),s.value=y};return{el:t,graph:e,resizable:r,node:i,styles:o,displayedInterfaces:a,startResize:d,close:c}}}),Zxt={class:"__header"},Jxt={class:"__node-name"};function eCt(n,e,t,s,r,i){return T(),x("div",{ref:"el",class:Le(["baklava-sidebar",{"--open":n.graph.sidebar.visible}]),style:Bt(n.styles)},[n.resizable?(T(),x("div",{key:0,class:"__resizer",onMousedown:e[0]||(e[0]=(...o)=>n.startResize&&n.startResize(...o))},null,32)):B("",!0),l("div",Zxt,[l("button",{tabindex:"-1",class:"__close",onClick:e[1]||(e[1]=(...o)=>n.close&&n.close(...o))},"×"),l("div",Jxt,[l("b",null,Y(n.node?n.node.title:""),1)])]),(T(!0),x(Be,null,Ke(n.displayedInterfaces,o=>(T(),x("div",{key:o.id,class:"__interface"},[(T(),at(Fu(o.component),{modelValue:o.value,"onUpdate:modelValue":a=>o.value=a,node:n.node,intf:o},null,8,["modelValue","onUpdate:modelValue","node","intf"]))]))),128))],6)}const tCt=sn(Xxt,[["render",eCt]]),nCt=cn({__name:"Minimap",setup(n){const{viewModel:e}=ds(),{graph:t}=Ns(),s=ot(null),r=ot(!1);let i,o=!1,a={x1:0,y1:0,x2:0,y2:0},c;const d=()=>{var w,A;if(!i)return;i.canvas.width=s.value.offsetWidth,i.canvas.height=s.value.offsetHeight;const I=new Map,C=new Map;for(const O of t.value.nodes){const H=qxt(O),q=(H==null?void 0:H.offsetWidth)??0,L=(H==null?void 0:H.offsetHeight)??0,W=((w=O.position)==null?void 0:w.x)??0,se=((A=O.position)==null?void 0:A.y)??0;I.set(O,{x1:W,y1:se,x2:W+q,y2:se+L}),C.set(O,H)}const M={x1:Number.MAX_SAFE_INTEGER,y1:Number.MAX_SAFE_INTEGER,x2:Number.MIN_SAFE_INTEGER,y2:Number.MIN_SAFE_INTEGER};for(const O of I.values())O.x1M.x2&&(M.x2=O.x2),O.y2>M.y2&&(M.y2=O.y2);const G=50;M.x1-=G,M.y1-=G,M.x2+=G,M.y2+=G,a=M;const V=i.canvas.width/i.canvas.height,ee=(a.x2-a.x1)/(a.y2-a.y1);if(V>ee){const O=(V-ee)*(a.y2-a.y1)*.5;a.x1-=O,a.x2+=O}else{const O=a.x2-a.x1,H=a.y2-a.y1,q=(O-V*H)/V*.5;a.y1-=q,a.y2+=q}i.clearRect(0,0,i.canvas.width,i.canvas.height),i.strokeStyle="white";for(const O of t.value.connections){const[H,q]=Tu(Ia(O.from)),[L,W]=Tu(Ia(O.to)),[se,oe]=u(H,q),[ye,xe]=u(L,W);if(i.beginPath(),i.moveTo(se,oe),e.value.settings.useStraightConnections)i.lineTo(ye,xe);else{const ce=.3*Math.abs(se-ye);i.bezierCurveTo(se+ce,oe,ye-ce,xe,ye,xe)}i.stroke()}i.strokeStyle="lightgray";for(const[O,H]of I.entries()){const[q,L]=u(H.x1,H.y1),[W,se]=u(H.x2,H.y2);i.fillStyle=m(C.get(O)),i.beginPath(),i.rect(q,L,W-q,se-L),i.fill(),i.stroke()}if(r.value){const O=f(),[H,q]=u(O.x1,O.y1),[L,W]=u(O.x2,O.y2);i.fillStyle="rgba(255, 255, 255, 0.2)",i.fillRect(H,q,L-H,W-q)}},u=(w,A)=>[(w-a.x1)/(a.x2-a.x1)*i.canvas.width,(A-a.y1)/(a.y2-a.y1)*i.canvas.height],_=(w,A)=>[w*(a.x2-a.x1)/i.canvas.width+a.x1,A*(a.y2-a.y1)/i.canvas.height+a.y1],m=w=>{if(w){const A=w.querySelector(".__content");if(A){const C=h(A);if(C)return C}const I=h(w);if(I)return I}return"gray"},h=w=>{const A=getComputedStyle(w).backgroundColor;if(A&&A!=="rgba(0, 0, 0, 0)")return A},f=()=>{const w=s.value.parentElement.offsetWidth,A=s.value.parentElement.offsetHeight,I=w/t.value.scaling-t.value.panning.x,C=A/t.value.scaling-t.value.panning.y;return{x1:-t.value.panning.x,y1:-t.value.panning.y,x2:I,y2:C}},y=w=>{w.button===0&&(o=!0,b(w))},b=w=>{if(o){const[A,I]=_(w.offsetX,w.offsetY),C=f(),M=(C.x2-C.x1)/2,G=(C.y2-C.y1)/2;t.value.panning.x=-(A-M),t.value.panning.y=-(I-G)}},g=()=>{o=!1},E=()=>{r.value=!0},v=()=>{r.value=!1,g()};Tn([r,t.value.panning,()=>t.value.scaling,()=>t.value.connections.length],()=>{d()});const S=Je(()=>t.value.nodes.map(w=>w.position)),R=Je(()=>t.value.nodes.map(w=>w.width));return Tn([S,R],()=>{d()},{deep:!0}),cr(()=>{i=s.value.getContext("2d"),i.imageSmoothingQuality="high",d(),c=setInterval(d,500)}),La(()=>{clearInterval(c)}),(w,A)=>(T(),x("canvas",{ref_key:"canvas",ref:s,class:"baklava-minimap",onMouseenter:E,onMouseleave:v,onMousedown:$(y,["self"]),onMousemove:$(b,["self"]),onMouseup:g,onContextmenu:A[0]||(A[0]=$(()=>{},["stop","prevent"]))},null,544))}}),sCt=cn({components:{ContextMenu:Ny,VerticalDots:UO},props:{type:{type:String,required:!0},title:{type:String,required:!0}},setup(n){const{viewModel:e}=ds(),{switchGraph:t}=Ns(),s=ot(!1),r=Je(()=>n.type.startsWith(Jl));return{showContextMenu:s,hasContextMenu:r,contextMenuItems:[{label:"Edit Subgraph",value:"editSubgraph"},{label:"Delete Subgraph",value:"deleteSubgraph"}],openContextMenu:()=>{s.value=!0},onContextMenuClick:c=>{const d=n.type.substring(Jl.length),u=e.value.editor.graphTemplates.find(_=>_.id===d);if(u)switch(c){case"editSubgraph":t(u);break;case"deleteSubgraph":e.value.editor.removeGraphTemplate(u);break}}}}}),rCt=["data-node-type"],iCt={class:"__title"},oCt={class:"__title-label"},aCt={key:0,class:"__menu"};function lCt(n,e,t,s,r,i){const o=nt("vertical-dots"),a=nt("context-menu");return T(),x("div",{class:"baklava-node --palette","data-node-type":n.type},[l("div",iCt,[l("div",oCt,Y(n.title),1),n.hasContextMenu?(T(),x("div",aCt,[z(o,{class:"--clickable",onPointerdown:e[0]||(e[0]=$(()=>{},["stop","prevent"])),onClick:$(n.openContextMenu,["stop","prevent"])},null,8,["onClick"]),z(a,{modelValue:n.showContextMenu,"onUpdate:modelValue":e[1]||(e[1]=c=>n.showContextMenu=c),x:-100,y:0,items:n.contextMenuItems,onClick:n.onContextMenuClick,onPointerdown:e[2]||(e[2]=$(()=>{},["stop","prevent"]))},null,8,["modelValue","items","onClick"])])):B("",!0)])],8,rCt)}const s2=sn(sCt,[["render",lCt]]),cCt={key:0},dCt=cn({__name:"NodePalette",setup(n){const{viewModel:e}=ds(),{x:t,y:s}=bxt(),{transform:r}=kO(),i=IO(e),o=is("editorEl"),a=ot(null),c=Je(()=>{if(!a.value||!(o!=null&&o.value))return{};const{left:u,top:_}=o.value.getBoundingClientRect();return{top:`${s.value-_}px`,left:`${t.value-u}px`}}),d=(u,_)=>{a.value={type:u,nodeInformation:_};const m=()=>{const h=Hn(new _.type);e.value.displayedGraph.addNode(h);const f=o.value.getBoundingClientRect(),[y,b]=r(t.value-f.left,s.value-f.top);h.position.x=y,h.position.y=b,a.value=null,document.removeEventListener("pointerup",m)};document.addEventListener("pointerup",m)};return(u,_)=>(T(),x(Be,null,[l("div",{class:"baklava-node-palette",onContextmenu:_[0]||(_[0]=$(()=>{},["stop","prevent"]))},[(T(!0),x(Be,null,Ke(bt(i),m=>(T(),x("section",{key:m.name},[m.name!=="default"?(T(),x("h1",cCt,Y(m.name),1)):B("",!0),(T(!0),x(Be,null,Ke(m.nodeTypes,(h,f)=>(T(),at(s2,{key:f,type:f,title:h.title,onPointerdown:y=>d(f,h)},null,8,["type","title","onPointerdown"]))),128))]))),128))],32),z(Or,{name:"fade"},{default:Ie(()=>[a.value?(T(),x("div",{key:0,class:"baklava-dragged-node",style:Bt(c.value)},[z(s2,{type:a.value.type,title:a.value.nodeInformation.title},null,8,["type","title"])],4)):B("",!0)]),_:1})],64))}});let bd;const uCt=new Uint8Array(16);function pCt(){if(!bd&&(bd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!bd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return bd(uCt)}const vn=[];for(let n=0;n<256;++n)vn.push((n+256).toString(16).slice(1));function fCt(n,e=0){return vn[n[e+0]]+vn[n[e+1]]+vn[n[e+2]]+vn[n[e+3]]+"-"+vn[n[e+4]]+vn[n[e+5]]+"-"+vn[n[e+6]]+vn[n[e+7]]+"-"+vn[n[e+8]]+vn[n[e+9]]+"-"+vn[n[e+10]]+vn[n[e+11]]+vn[n[e+12]]+vn[n[e+13]]+vn[n[e+14]]+vn[n[e+15]]}const _Ct=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),r2={randomUUID:_Ct};function xu(n,e,t){if(r2.randomUUID&&!e&&!n)return r2.randomUUID();n=n||{};const s=n.random||(n.rng||pCt)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,fCt(s)}const ec="SAVE_SUBGRAPH";function mCt(n,e){const t=()=>{const s=n.value;if(!s.template)throw new Error("Graph template property not set");s.template.update(s.save()),s.template.panning=s.panning,s.template.scaling=s.scaling};e.registerCommand(ec,{canExecute:()=>{var s;return n.value!==((s=n.value.editor)==null?void 0:s.graph)},execute:t})}const hCt={},gCt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},bCt=l("polyline",{points:"6 9 12 15 18 9"},null,-1),yCt=[bCt];function ECt(n,e){return T(),x("svg",gCt,yCt)}const vCt=sn(hCt,[["render",ECt]]),SCt=cn({components:{"i-arrow":vCt},props:{intf:{type:Object,required:!0}},setup(n){const e=ot(null),t=ot(!1),s=Je(()=>n.intf.items.find(o=>typeof o=="string"?o===n.intf.value:o.value===n.intf.value)),r=Je(()=>s.value?typeof s.value=="string"?s.value:s.value.text:""),i=o=>{n.intf.value=typeof o=="string"?o:o.value};return PO(e,()=>{t.value=!1}),{el:e,open:t,selectedItem:s,selectedText:r,setSelected:i}}}),TCt=["title"],xCt={class:"__selected"},CCt={class:"__text"},wCt={class:"__icon"},RCt={class:"__dropdown"},ACt={class:"item --header"},MCt=["onClick"];function NCt(n,e,t,s,r,i){const o=nt("i-arrow");return T(),x("div",{ref:"el",class:Le(["baklava-select",{"--open":n.open}]),title:n.intf.name,onClick:e[0]||(e[0]=a=>n.open=!n.open)},[l("div",xCt,[l("div",CCt,Y(n.selectedText),1),l("div",wCt,[z(o)])]),z(Or,{name:"slide-fade"},{default:Ie(()=>[k(l("div",RCt,[l("div",ACt,Y(n.intf.name),1),(T(!0),x(Be,null,Ke(n.intf.items,(a,c)=>(T(),x("div",{key:c,class:Le(["item",{"--active":a===n.selectedItem}]),onClick:d=>n.setSelected(a)},Y(typeof a=="string"?a:a.text),11,MCt))),128))],512),[[ht,n.open]])]),_:1})],10,TCt)}const OCt=sn(SCt,[["render",NCt]]);class ICt extends en{constructor(e,t,s){super(e,t),this.component=ku(OCt),this.items=s}}const kCt=cn({props:{intf:{type:Object,required:!0}}});function DCt(n,e,t,s,r,i){return T(),x("div",null,Y(n.intf.value),1)}const LCt=sn(kCt,[["render",DCt]]);class PCt extends en{constructor(e,t){super(e,t),this.component=ku(LCt),this.setPort(!1)}}const FCt=cn({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(n,{emit:e}){return{v:Je({get:()=>n.modelValue,set:s=>{e("update:modelValue",s)}})}}}),UCt=["placeholder","title"];function BCt(n,e,t,s,r,i){return T(),x("div",null,[k(l("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>n.v=o),type:"text",class:"baklava-input",placeholder:n.intf.name,title:n.intf.name},null,8,UCt),[[ae,n.v]])])}const GCt=sn(FCt,[["render",BCt]]);class mc extends en{constructor(){super(...arguments),this.component=ku(GCt)}}class GO extends wy{constructor(){super(...arguments),this._title="Subgraph Input",this.inputs={name:new mc("Name","Input").setPort(!1)},this.outputs={placeholder:new en("Connection",void 0)}}}class VO extends Ry{constructor(){super(...arguments),this._title="Subgraph Output",this.inputs={name:new mc("Name","Output").setPort(!1),placeholder:new en("Connection",void 0)},this.outputs={output:new en("Output",void 0).setHidden(!0)}}}const zO="CREATE_SUBGRAPH",i2=[Ma,Na];function VCt(n,e,t){const s=()=>n.value.selectedNodes.filter(i=>!i2.includes(i.type)).length>0,r=()=>{const{viewModel:i}=ds(),o=n.value,a=n.value.editor;if(o.selectedNodes.length===0)return;const c=o.selectedNodes.filter(C=>!i2.includes(C.type)),d=c.flatMap(C=>Object.values(C.inputs)),u=c.flatMap(C=>Object.values(C.outputs)),_=o.connections.filter(C=>!u.includes(C.from)&&d.includes(C.to)),m=o.connections.filter(C=>u.includes(C.from)&&!d.includes(C.to)),h=o.connections.filter(C=>u.includes(C.from)&&d.includes(C.to)),f=c.map(C=>C.save()),y=h.map(C=>({id:C.id,from:C.from.id,to:C.to.id})),b=new Map,{xLeft:g,xRight:E,yTop:v}=zCt(c);for(const[C,M]of _.entries()){const G=new GO;G.inputs.name.value=M.to.name,f.push({...G.save(),position:{x:E-i.value.settings.nodes.defaultWidth-100,y:v+C*200}}),y.push({id:xu(),from:G.outputs.placeholder.id,to:M.to.id}),b.set(M.to.id,G.graphInterfaceId)}for(const[C,M]of m.entries()){const G=new VO;G.inputs.name.value=M.from.name,f.push({...G.save(),position:{x:g+100,y:v+C*200}}),y.push({id:xu(),from:M.from.id,to:G.inputs.placeholder.id}),b.set(M.from.id,G.graphInterfaceId)}const S=Hn(new Ep({connections:y,nodes:f,inputs:[],outputs:[]},a));a.addGraphTemplate(S);const R=a.nodeTypes.get(Oa(S));if(!R)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");o.activeTransactions++;const w=Hn(new R.type);o.addNode(w);const A=Math.round(c.map(C=>C.position.x).reduce((C,M)=>C+M,0)/c.length),I=Math.round(c.map(C=>C.position.y).reduce((C,M)=>C+M,0)/c.length);w.position.x=A,w.position.y=I,_.forEach(C=>{o.removeConnection(C),o.addConnection(C.from,w.inputs[b.get(C.to.id)])}),m.forEach(C=>{o.removeConnection(C),o.addConnection(w.outputs[b.get(C.from.id)],C.to)}),c.forEach(C=>o.removeNode(C)),o.activeTransactions--,e.canExecuteCommand(ec)&&e.executeCommand(ec),t(S),n.value.panning={...o.panning},n.value.scaling=o.scaling};e.registerCommand(zO,{canExecute:s,execute:r})}function zCt(n){const e=n.reduce((r,i)=>{const o=i.position.x;return o{const o=i.position.y;return o{const o=i.position.x+i.width;return o>r?o:r},-1/0),xRight:e,yTop:t}}class o2{constructor(e,t){this.type=e,e==="addNode"?this.nodeId=t:this.nodeState=t}undo(e){this.type==="addNode"?this.removeNode(e):this.addNode(e)}redo(e){this.type==="addNode"&&this.nodeState?this.addNode(e):this.type==="removeNode"&&this.nodeId&&this.removeNode(e)}addNode(e){const t=e.editor.nodeTypes.get(this.nodeState.type);if(!t)return;const s=new t.type;e.addNode(s),s.load(this.nodeState),this.nodeId=s.id}removeNode(e){const t=e.nodes.find(s=>s.id===this.nodeId);t&&(this.nodeState=t.save(),e.removeNode(t))}}class a2{constructor(e,t){if(this.type=e,e==="addConnection")this.connectionId=t;else{const s=t;this.connectionState={id:s.id,from:s.from.id,to:s.to.id}}}undo(e){this.type==="addConnection"?this.removeConnection(e):this.addConnection(e)}redo(e){this.type==="addConnection"&&this.connectionState?this.addConnection(e):this.type==="removeConnection"&&this.connectionId&&this.removeConnection(e)}addConnection(e){const t=e.findNodeInterface(this.connectionState.from),s=e.findNodeInterface(this.connectionState.to);if(!t||!s)return;const r=e.addConnection(t,s);r&&(r.id=this.connectionState.id),this.connectionId=r==null?void 0:r.id}removeConnection(e){const t=e.connections.find(s=>s.id===this.connectionId);t&&(this.connectionState={id:t.id,from:t.from.id,to:t.to.id},e.removeConnection(t))}}class HCt{constructor(e){if(this.type="transaction",e.length===0)throw new Error("Can't create a transaction with no steps");this.steps=e}undo(e){for(let t=this.steps.length-1;t>=0;t--)this.steps[t].undo(e)}redo(e){for(let t=0;t{if(!i.value)if(a.value)c.value.push(b);else for(o.value!==r.value.length-1&&(r.value=r.value.slice(0,o.value+1)),r.value.push(b),o.value++;r.value.length>s.value;)r.value.shift()},u=()=>{a.value=!0},_=()=>{a.value=!1,c.value.length>0&&(d(new HCt(c.value)),c.value=[])},m=()=>r.value.length!==0&&o.value!==-1,h=()=>{m()&&(i.value=!0,r.value[o.value--].undo(n.value),i.value=!1)},f=()=>r.value.length!==0&&o.value{f()&&(i.value=!0,r.value[++o.value].redo(n.value),i.value=!1)};return Tn(n,(b,g)=>{g&&(g.events.addNode.unsubscribe(t),g.events.removeNode.unsubscribe(t),g.events.addConnection.unsubscribe(t),g.events.removeConnection.unsubscribe(t)),b&&(b.events.addNode.subscribe(t,E=>{d(new o2("addNode",E.id))}),b.events.removeNode.subscribe(t,E=>{d(new o2("removeNode",E.save()))}),b.events.addConnection.subscribe(t,E=>{d(new a2("addConnection",E.id))}),b.events.removeConnection.subscribe(t,E=>{d(new a2("removeConnection",E))}))},{immediate:!0}),e.registerCommand(Nb,{canExecute:m,execute:h}),e.registerCommand(Ob,{canExecute:f,execute:y}),e.registerCommand(Oy,{canExecute:()=>!a.value,execute:u}),e.registerCommand(Iy,{canExecute:()=>a.value,execute:_}),e.registerHotkey(["Control","z"],Nb),e.registerHotkey(["Control","y"],Ob),Hn({maxSteps:s})}const Ib="DELETE_NODES";function YCt(n,e){e.registerCommand(Ib,{canExecute:()=>n.value.selectedNodes.length>0,execute(){e.executeCommand(Oy);for(let t=n.value.selectedNodes.length-1;t>=0;t--){const s=n.value.selectedNodes[t];n.value.removeNode(s)}e.executeCommand(Iy)}}),e.registerHotkey(["Delete"],Ib)}const HO="SWITCH_TO_MAIN_GRAPH";function $Ct(n,e,t){e.registerCommand(HO,{canExecute:()=>n.value!==n.value.editor.graph,execute:()=>{e.executeCommand(ec),t(n.value.editor.graph)}})}function WCt(n,e,t){YCt(n,e),VCt(n,e,t),mCt(n,e),$Ct(n,e,t)}const kb="COPY",Db="PASTE",KCt="CLEAR_CLIPBOARD";function jCt(n,e,t){const s=Symbol("ClipboardToken"),r=ot(""),i=ot(""),o=Je(()=>!r.value),a=()=>{r.value="",i.value=""},c=()=>{const _=n.value.selectedNodes.flatMap(h=>[...Object.values(h.inputs),...Object.values(h.outputs)]),m=n.value.connections.filter(h=>_.includes(h.from)||_.includes(h.to)).map(h=>({from:h.from.id,to:h.to.id}));i.value=JSON.stringify(m),r.value=JSON.stringify(n.value.selectedNodes.map(h=>h.save()))},d=(_,m,h)=>{for(const f of _){let y;if((!h||h==="input")&&(y=Object.values(f.inputs).find(b=>b.id===m)),!y&&(!h||h==="output")&&(y=Object.values(f.outputs).find(b=>b.id===m)),y)return y}},u=()=>{if(o.value)return;const _=new Map,m=JSON.parse(r.value),h=JSON.parse(i.value),f=[],y=[],b=n.value;t.executeCommand(Oy);for(const g of m){const E=e.value.nodeTypes.get(g.type);if(!E){console.warn(`Node type ${g.type} not registered`);return}const v=new E.type,S=v.id;f.push(v),v.hooks.beforeLoad.subscribe(s,R=>{const w=R;return w.position&&(w.position.x+=100,w.position.y+=100),v.hooks.beforeLoad.unsubscribe(s),w}),b.addNode(v),v.load({...g,id:S}),v.id=S,_.set(g.id,S);for(const R of Object.values(v.inputs)){const w=xu();_.set(R.id,w),R.id=w}for(const R of Object.values(v.outputs)){const w=xu();_.set(R.id,w),R.id=w}}for(const g of h){const E=d(f,_.get(g.from),"output"),v=d(f,_.get(g.to),"input");if(!E||!v)continue;const S=b.addConnection(E,v);S&&y.push(S)}return n.value.selectedNodes=f,t.executeCommand(Iy),{newNodes:f,newConnections:y}};return t.registerCommand(kb,{canExecute:()=>n.value.selectedNodes.length>0,execute:c}),t.registerHotkey(["Control","c"],kb),t.registerCommand(Db,{canExecute:()=>!o.value,execute:u}),t.registerHotkey(["Control","v"],Db),t.registerCommand(KCt,{canExecute:()=>!0,execute:a}),Hn({isEmpty:o})}const QCt="OPEN_SIDEBAR";function XCt(n,e){e.registerCommand(QCt,{execute:t=>{n.value.sidebar.nodeId=t,n.value.sidebar.visible=!0},canExecute:()=>!0})}function ZCt(n,e){XCt(n,e)}const JCt={},ewt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},twt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),nwt=l("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"},null,-1),swt=[twt,nwt];function rwt(n,e){return T(),x("svg",ewt,swt)}const iwt=sn(JCt,[["render",rwt]]),owt={},awt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},lwt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),cwt=l("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"},null,-1),dwt=[lwt,cwt];function uwt(n,e){return T(),x("svg",awt,dwt)}const pwt=sn(owt,[["render",uwt]]),fwt={},_wt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},mwt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),hwt=l("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1),gwt=l("line",{x1:"5",y1:"12",x2:"11",y2:"18"},null,-1),bwt=l("line",{x1:"5",y1:"12",x2:"11",y2:"6"},null,-1),ywt=[mwt,hwt,gwt,bwt];function Ewt(n,e){return T(),x("svg",_wt,ywt)}const vwt=sn(fwt,[["render",Ewt]]),Swt={},Twt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},xwt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Cwt=l("path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2"},null,-1),wwt=l("rect",{x:"9",y:"3",width:"6",height:"4",rx:"2"},null,-1),Rwt=[xwt,Cwt,wwt];function Awt(n,e){return T(),x("svg",Twt,Rwt)}const Mwt=sn(Swt,[["render",Awt]]),Nwt={},Owt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Iwt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),kwt=l("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1),Dwt=l("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"},null,-1),Lwt=[Iwt,kwt,Dwt];function Pwt(n,e){return T(),x("svg",Owt,Lwt)}const Fwt=sn(Nwt,[["render",Pwt]]),Uwt={},Bwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Gwt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Vwt=l("path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"},null,-1),zwt=l("circle",{cx:"12",cy:"14",r:"2"},null,-1),Hwt=l("polyline",{points:"14 4 14 8 8 8 8 4"},null,-1),qwt=[Gwt,Vwt,zwt,Hwt];function Ywt(n,e){return T(),x("svg",Bwt,qwt)}const $wt=sn(Uwt,[["render",Ywt]]),Wwt={},Kwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},jwt=mi('',6),Qwt=[jwt];function Xwt(n,e){return T(),x("svg",Kwt,Qwt)}const Zwt=sn(Wwt,[["render",Xwt]]),Jwt={},e2t={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t2t=mi('',18),n2t=[t2t];function s2t(n,e){return T(),x("svg",e2t,n2t)}const r2t=sn(Jwt,[["render",s2t]]),i2t={},o2t={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},a2t=mi('',6),l2t=[a2t];function c2t(n,e){return T(),x("svg",o2t,l2t)}const d2t=sn(i2t,[["render",c2t]]),u2t=cn({props:{command:{type:String,required:!0},title:{type:String,required:!0},icon:{type:Object,required:!1,default:void 0}},setup(){const{viewModel:n}=ds();return{viewModel:n}}}),p2t=["disabled","title"];function f2t(n,e,t,s,r,i){return T(),x("button",{class:"baklava-toolbar-entry baklava-toolbar-button",disabled:!n.viewModel.commandHandler.canExecuteCommand(n.command),title:n.title,onClick:e[0]||(e[0]=o=>n.viewModel.commandHandler.executeCommand(n.command))},[n.icon?(T(),at(Fu(n.icon),{key:0})):(T(),x(Be,{key:1},[Ze(Y(n.title),1)],64))],8,p2t)}const _2t=sn(u2t,[["render",f2t]]),m2t=cn({components:{ToolbarButton:_2t},setup(){const{viewModel:n}=ds();return{isSubgraph:Je(()=>n.value.displayedGraph!==n.value.editor.graph),commands:[{command:kb,title:"Copy",icon:Fwt},{command:Db,title:"Paste",icon:Mwt},{command:Ib,title:"Delete selected nodes",icon:d2t},{command:Nb,title:"Undo",icon:iwt},{command:Ob,title:"Redo",icon:pwt},{command:Ld,title:"Box Select",icon:r2t},{command:zO,title:"Create Subgraph",icon:Zwt}],subgraphCommands:[{command:ec,title:"Save Subgraph",icon:$wt},{command:HO,title:"Back to Main Graph",icon:vwt}]}}});function h2t(n,e,t,s,r,i){const o=nt("toolbar-button");return T(),x("div",{class:"baklava-toolbar",onContextmenu:e[0]||(e[0]=$(()=>{},["stop","prevent"]))},[(T(!0),x(Be,null,Ke(n.commands,a=>(T(),at(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)),n.isSubgraph?(T(!0),x(Be,{key:0},Ke(n.subgraphCommands,a=>(T(),at(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)):B("",!0)],32)}const g2t=sn(m2t,[["render",h2t]]),b2t={class:"connections-container"},y2t=cn({__name:"Editor",props:{viewModel:{}},setup(n){const e=n,t=Symbol("EditorToken"),s=Bd(e,"viewModel");nxt(s);const r=ot(null);na("editorEl",r);const i=Je(()=>e.viewModel.displayedGraph.nodes),o=Je(()=>e.viewModel.displayedGraph.nodes.map(I=>NO(Bd(I,"position")))),a=Je(()=>e.viewModel.displayedGraph.connections),c=Je(()=>e.viewModel.displayedGraph.selectedNodes),d=sxt(),u=rxt(),_=ixt(s),m=oxt(r),h=Je(()=>({...d.styles.value})),f=ot(0);e.viewModel.editor.hooks.load.subscribe(t,I=>(f.value++,I));const y=I=>{d.onPointerMove(I),u.onMouseMove(I)},b=I=>{if(I.button===0){if(m.onPointerDown(I))return;I.target===r.value&&(R(),d.onPointerDown(I)),u.onMouseDown()}},g=I=>{d.onPointerUp(I),u.onMouseUp()},E=I=>{I.key==="Tab"&&I.preventDefault(),e.viewModel.commandHandler.handleKeyDown(I)},v=I=>{e.viewModel.commandHandler.handleKeyUp(I)},S=I=>{["Control","Shift"].some(C=>e.viewModel.commandHandler.pressedKeys.includes(C))||R(),e.viewModel.displayedGraph.selectedNodes.push(I)},R=()=>{e.viewModel.displayedGraph.selectedNodes=[]},w=I=>{for(const C of e.viewModel.displayedGraph.selectedNodes){const M=i.value.indexOf(C),G=o.value[M];G.onPointerDown(I),document.addEventListener("pointermove",G.onPointerMove)}document.addEventListener("pointerup",A)},A=()=>{for(const I of e.viewModel.displayedGraph.selectedNodes){const C=i.value.indexOf(I),M=o.value[C];M.onPointerUp(),document.removeEventListener("pointermove",M.onPointerMove)}document.removeEventListener("pointerup",A)};return(I,C)=>(T(),x("div",{ref_key:"el",ref:r,tabindex:"-1",class:Le(["baklava-editor",{"baklava-ignore-mouse":!!bt(u).temporaryConnection.value||bt(d).dragging.value,"--temporary-connection":!!bt(u).temporaryConnection.value,"--start-selection-box":bt(m).startSelection}]),onPointermove:$(y,["self"]),onPointerdown:b,onPointerup:g,onWheel:C[1]||(C[1]=$((...M)=>bt(d).onMouseWheel&&bt(d).onMouseWheel(...M),["self"])),onKeydown:E,onKeyup:v,onContextmenu:C[2]||(C[2]=(...M)=>bt(_).open&&bt(_).open(...M))},[on(I.$slots,"background",{},()=>[z(cxt)]),on(I.$slots,"toolbar",{},()=>[I.viewModel.settings.toolbar.enabled?(T(),at(g2t,{key:0})):B("",!0)]),on(I.$slots,"palette",{},()=>[I.viewModel.settings.palette.enabled?(T(),at(dCt,{key:0})):B("",!0)]),(T(),x("svg",b2t,[(T(!0),x(Be,null,Ke(a.value,M=>(T(),x("g",{key:M.id+f.value.toString()},[on(I.$slots,"connection",{connection:M},()=>[z(Wxt,{connection:M},null,8,["connection"])])]))),128)),on(I.$slots,"temporaryConnection",{temporaryConnection:bt(u).temporaryConnection.value},()=>[bt(u).temporaryConnection.value?(T(),at(Qxt,{key:0,connection:bt(u).temporaryConnection.value},null,8,["connection"])):B("",!0)])])),l("div",{class:"node-container",style:Bt(h.value)},[z(Ir,{name:"fade"},{default:Ie(()=>[(T(!0),x(Be,null,Ke(i.value,(M,G)=>on(I.$slots,"node",{key:M.id+f.value.toString(),node:M,selected:c.value.includes(M),dragging:o.value[G].dragging.value,onSelect:V=>S(M),onStartDrag:w},()=>[z(Gxt,{node:M,selected:c.value.includes(M),dragging:o.value[G].dragging.value,onSelect:V=>S(M),onStartDrag:w},null,8,["node","selected","dragging","onSelect"])])),128))]),_:3})],4),on(I.$slots,"sidebar",{},()=>[I.viewModel.settings.sidebar.enabled?(T(),at(tCt,{key:0})):B("",!0)]),on(I.$slots,"minimap",{},()=>[I.viewModel.settings.enableMinimap?(T(),at(nCt,{key:0})):B("",!0)]),on(I.$slots,"contextMenu",{contextMenu:bt(_)},()=>[I.viewModel.settings.contextMenu.enabled?(T(),at(Ny,{key:0,modelValue:bt(_).show.value,"onUpdate:modelValue":C[0]||(C[0]=M=>bt(_).show.value=M),items:bt(_).items.value,x:bt(_).x.value,y:bt(_).y.value,onClick:bt(_).onClick},null,8,["modelValue","items","x","y","onClick"])):B("",!0)]),bt(m).isSelecting?(T(),x("div",{key:0,class:"selection-box",style:Bt(bt(m).getStyles())},null,4)):B("",!0)],34))}});function E2t(n){const e=ot([]),t=ot([]);return{pressedKeys:e,handleKeyDown:o=>{e.value.includes(o.key)||e.value.push(o.key),!(document.activeElement&&MO(document.activeElement))&&t.value.forEach(a=>{var c,d;a.keys.every(u=>e.value.includes(u))&&((c=a.options)!=null&&c.preventDefault&&o.preventDefault(),(d=a.options)!=null&&d.stopPropagation&&o.stopPropagation(),n(a.commandName))})},handleKeyUp:o=>{const a=e.value.indexOf(o.key);a>=0&&e.value.splice(a,1)},registerHotkey:(o,a,c)=>{t.value.push({keys:o,commandName:a,options:c})}}}const v2t=()=>{const n=ot(new Map),e=o=>n.value.has(o),t=(o,a)=>{if(n.value.has(o))throw new Error(`Command "${o}" already exists`);n.value.set(o,a)},s=(o,a=!1,...c)=>{if(!n.value.has(o)){if(a)throw new Error(`[CommandHandler] Command ${o} not registered`);return}return n.value.get(o).execute(...c)},r=(o,a=!1,...c)=>{if(!n.value.has(o)){if(a)throw new Error(`[CommandHandler] Command ${o} not registered`);return!1}return n.value.get(o).canExecute(c)},i=E2t(s);return Hn({hasCommand:e,registerCommand:t,executeCommand:s,canExecuteCommand:r,...i})},S2t=n=>!(n instanceof _c);function T2t(n,e){return{switchGraph:s=>{let r;if(S2t(s))r=new _c(n.value),s.createGraph(r);else{if(s!==n.value.graph)throw new Error("Can only switch using 'Graph' instance when it is the root graph. Otherwise a 'GraphTemplate' must be used.");r=s}e.value&&e.value!==n.value.graph&&e.value.destroy(),r.panning=r.panning??s.panning??{x:0,y:0},r.scaling=r.scaling??s.scaling??1,r.selectedNodes=r.selectedNodes??[],r.sidebar=r.sidebar??{visible:!1,nodeId:"",optionName:""},e.value=r}}}function x2t(n,e){n.position=n.position??{x:0,y:0},n.disablePointerEvents=!1,n.twoColumn=n.twoColumn??!1,n.width=n.width??e.defaultWidth}const C2t=()=>({useStraightConnections:!1,enableMinimap:!1,toolbar:{enabled:!0},palette:{enabled:!0},background:{gridSize:100,gridDivision:5,subGridVisibleThreshold:.6},sidebar:{enabled:!0,width:300,resizable:!0},displayValueOnHover:!1,nodes:{defaultWidth:200,maxWidth:320,minWidth:150,resizable:!1,reverseY:!1},contextMenu:{enabled:!0,additionalItems:[]}});function w2t(n){const e=ot(new jTt),t=Symbol("ViewModelToken"),s=ot(null),r=VI(s),{switchGraph:i}=T2t(e,s),o=Je(()=>r.value&&r.value!==e.value.graph),a=Hn(C2t()),c=v2t(),d=qCt(r,c),u=jCt(r,e,c),_={renderNode:new cs(null),renderInterface:new cs(null)};return WCt(r,c,i),ZCt(r,c),Tn(e,(m,h)=>{h&&(h.events.registerGraph.unsubscribe(t),h.graphEvents.beforeAddNode.unsubscribe(t),m.nodeHooks.beforeLoad.unsubscribe(t),m.nodeHooks.afterSave.unsubscribe(t),m.graphTemplateHooks.beforeLoad.unsubscribe(t),m.graphTemplateHooks.afterSave.unsubscribe(t),m.graph.hooks.load.unsubscribe(t),m.graph.hooks.save.unsubscribe(t)),m&&(m.nodeHooks.beforeLoad.subscribe(t,(f,y)=>(y.position=f.position??{x:0,y:0},y.width=f.width??a.nodes.defaultWidth,y.twoColumn=f.twoColumn??!1,f)),m.nodeHooks.afterSave.subscribe(t,(f,y)=>(f.position=y.position,f.width=y.width,f.twoColumn=y.twoColumn,f)),m.graphTemplateHooks.beforeLoad.subscribe(t,(f,y)=>(y.panning=f.panning,y.scaling=f.scaling,f)),m.graphTemplateHooks.afterSave.subscribe(t,(f,y)=>(f.panning=y.panning,f.scaling=y.scaling,f)),m.graph.hooks.load.subscribe(t,(f,y)=>(y.panning=f.panning,y.scaling=f.scaling,f)),m.graph.hooks.save.subscribe(t,(f,y)=>(f.panning=y.panning,f.scaling=y.scaling,f)),m.graphEvents.beforeAddNode.subscribe(t,f=>x2t(f,{defaultWidth:a.nodes.defaultWidth})),e.value.registerNodeType(GO,{category:"Subgraphs"}),e.value.registerNodeType(VO,{category:"Subgraphs"}),i(m.graph))},{immediate:!0}),Hn({editor:e,displayedGraph:r,isSubgraph:o,settings:a,commandHandler:c,history:d,clipboard:u,hooks:_,switchGraph:i})}const R2t=Ka({type:"PersonalityNode",title:"Personality",inputs:{request:()=>new en("Request",""),agent_name:()=>new ICt("Personality","",Ps.state.config.personalities).setPort(!1)},outputs:{response:()=>new en("Response","")},async calculate({request:n}){console.log(Ps.state.config.personalities);let e="";try{e=(await ne.post("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),A2t=Ka({type:"RAGNode",title:"RAG",inputs:{request:()=>new en("Prompt",""),document_path:()=>new mc("Document path","").setPort(!1)},outputs:{prompt:()=>new en("Prompt with Data","")},async calculate({request:n,document_path:e}){let t="";try{t=(await ne.get("/rag",{params:{text:n,doc_path:e}})).data}catch(s){console.error(s)}return{response:t}}}),l2=Ka({type:"Task",title:"Task",inputs:{description:()=>new mc("Task description","").setPort(!1)},outputs:{prompt:()=>new en("Prompt")},calculate({description:n}){return{prompt:n}}}),c2=Ka({type:"TextDisplayNode",title:"TextDisplay",inputs:{text2display:()=>new en("Input","")},outputs:{response:()=>new PCt("Text","")},async calculate({request:n}){}}),d2=Ka({type:"LLMNode",title:"LLM",inputs:{request:()=>new en("Request","")},outputs:{response:()=>new en("Response","")},async calculate({request:n}){console.log(Ps.state.config.personalities);let e="";try{e=(await ne.post("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),M2t=Ka({type:"MultichoiceNode",title:"Multichoice",inputs:{question:()=>new en("Question",""),outputs:()=>new mc("choices, one per line","","").setPort(!1)},outputs:{response:()=>new en("Response","")}}),N2t=cn({components:{"baklava-editor":y2t},setup(){const n=w2t(),e=new ext(n.editor);n.editor.registerNodeType(R2t),n.editor.registerNodeType(l2),n.editor.registerNodeType(A2t),n.editor.registerNodeType(c2),n.editor.registerNodeType(d2),n.editor.registerNodeType(M2t);const t=Symbol();e.events.afterRun.subscribe(t,a=>{e.pause(),QTt(a,n.editor),e.resume()}),e.start();function s(a,c,d){const u=new a;return n.displayedGraph.addNode(u),u.position.x=c,u.position.y=d,u}const r=s(l2,300,140),i=s(d2,550,140),o=s(c2,850,140);return n.displayedGraph.addConnection(r.outputs.prompt,i.inputs.request),n.displayedGraph.addConnection(i.outputs.response,o.inputs.text2display),{baklava:n,saveGraph:()=>{const a=e.export();localStorage.setItem("myGraph",JSON.stringify(a))},loadGraph:()=>{const a=JSON.parse(localStorage.getItem("myGraph"));e.import(a)}}}}),O2t={style:{width:"100vw",height:"100vh"}};function I2t(n,e,t,s,r,i){const o=nt("baklava-editor");return T(),x("div",O2t,[z(o,{"view-model":n.baklava},null,8,["view-model"]),l("button",{onClick:e[0]||(e[0]=(...a)=>n.saveGraph&&n.saveGraph(...a))},"Save Graph"),l("button",{onClick:e[1]||(e[1]=(...a)=>n.loadGraph&&n.loadGraph(...a))},"Load Graph")])}const k2t=rt(N2t,[["render",I2t]]),D2t={},L2t={style:{width:"100vw",height:"100vh"}},P2t=["src"];function F2t(n,e,t,s,r,i){return T(),x("div",L2t,[l("iframe",{src:n.$store.state.config.comfyui_base_url,class:"m-0 p-0 w-full h-full"},null,8,P2t)])}const U2t=rt(D2t,[["render",F2t]]),B2t={},G2t={style:{width:"100vw",height:"100vh"}},V2t=["src"];function z2t(n,e,t,s,r,i){return T(),x("div",G2t,[l("iframe",{src:n.$store.state.config.sd_base_url,class:"m-0 p-0 w-full h-full"},null,8,V2t)])}const H2t=rt(B2t,[["render",z2t]]),q2t={name:"AppCard",props:{app:{type:Object,required:!0},isFavorite:{type:Boolean,default:!1}},methods:{formatDate(n){const e={year:"numeric",month:"short",day:"numeric"};return new Date(n).toLocaleDateString(void 0,e)}}},Y2t={class:"app-card bg-white border rounded-xl shadow-lg p-6 hover:shadow-xl transition duration-300 ease-in-out flex flex-col h-full"},$2t={class:"flex-grow"},W2t={class:"flex items-center mb-4"},K2t=["src"],j2t={class:"font-bold text-xl text-gray-800"},Q2t={class:"text-sm text-gray-600"},X2t={class:"text-sm text-gray-600"},Z2t={class:"text-sm text-gray-600"},J2t={class:"text-sm text-gray-600"},eRt={class:"text-sm text-gray-600"},tRt={class:"mb-4"},nRt={class:"text-sm text-gray-600 h-20 overflow-y-auto"},sRt={class:"text-sm text-gray-600 mb-2"},rRt={key:0,class:"mb-4"},iRt={class:"text-xs text-gray-500 italic h-16 overflow-y-auto"},oRt={class:"mt-auto pt-4 border-t"},aRt={class:"flex justify-between items-center flex-wrap"},lRt=["title"],cRt=["fill"];function dRt(n,e,t,s,r,i){return T(),x("div",Y2t,[l("div",$2t,[l("div",W2t,[l("img",{src:t.app.icon,alt:"App Icon",class:"w-16 h-16 rounded-full border border-gray-300 mr-4"},null,8,K2t),l("div",null,[l("h3",j2t,Y(t.app.name),1),l("p",Q2t,"Author: "+Y(t.app.author),1),l("p",X2t,"Version: "+Y(t.app.version),1),l("p",Z2t,"Category: "+Y(t.app.category),1),l("p",J2t,"Creation date: "+Y(i.formatDate(t.app.creation_date)),1),l("p",eRt,"Last update: "+Y(i.formatDate(t.app.last_update_date)),1),l("p",{class:Le(["text-sm",t.app.is_public?"text-green-600":"text-orange-600"])},Y(t.app.is_public?"Public App":"Local App"),3)])]),l("div",tRt,[e[10]||(e[10]=l("h4",{class:"font-semibold mb-1 text-gray-700"},"Description:",-1)),l("p",nRt,Y(t.app.description),1)]),l("p",sRt,"AI Model: "+Y(t.app.model_name),1),t.app.disclaimer&&t.app.disclaimer.trim()!==""?(T(),x("div",rRt,[e[11]||(e[11]=l("h4",{class:"font-semibold mb-1 text-gray-700"},"Disclaimer:",-1)),l("p",iRt,Y(t.app.disclaimer),1)])):B("",!0)]),l("div",oRt,[l("div",aRt,[l("button",{onClick:e[0]||(e[0]=$(o=>n.$emit("toggle-favorite",t.app.name),["stop"])),class:"text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out",title:t.isFavorite?"Remove from favorites":"Add to favorites"},[(T(),x("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:t.isFavorite?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor"},e[12]||(e[12]=[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)]),8,cRt))],8,lRt),t.app.installed?(T(),x("button",{key:0,onClick:e[1]||(e[1]=$(o=>n.$emit("uninstall",t.app.folder_name),["stop"])),class:"text-red-500 hover:text-red-600 transition duration-300 ease-in-out",title:"Uninstall"},e[13]||(e[13]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]))):t.app.existsInFolder?(T(),x("button",{key:1,onClick:e[2]||(e[2]=$(o=>n.$emit("delete",t.app.name),["stop"])),class:"text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out",title:"Delete"},e[14]||(e[14]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]))):(T(),x("button",{key:2,onClick:e[3]||(e[3]=$(o=>n.$emit("install",t.app.folder_name),["stop"])),class:"text-blue-500 hover:text-blue-600 transition duration-300 ease-in-out",title:"Install"},e[15]||(e[15]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)]))),t.app.installed?(T(),x("button",{key:3,onClick:e[4]||(e[4]=$(o=>n.$emit("edit",t.app),["stop"])),class:"text-purple-500 hover:text-purple-600 transition duration-300 ease-in-out",title:"Edit"},e[16]||(e[16]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1)]))):B("",!0),l("button",{onClick:e[5]||(e[5]=$(o=>n.$emit("download",t.app.folder_name),["stop"])),class:"text-green-500 hover:text-green-600 transition duration-300 ease-in-out",title:"Download"},e[17]||(e[17]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)])),t.app.has_readme?(T(),x("button",{key:4,onClick:e[6]||(e[6]=$(o=>n.$emit("help",t.app),["stop"])),class:"text-gray-500 hover:text-gray-600 transition duration-300 ease-in-out",title:"Help"},e[18]||(e[18]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M12 21a9 9 0 100-18 9 9 0 000 18z"})],-1)]))):B("",!0),t.app.installed?(T(),x("button",{key:5,onClick:e[7]||(e[7]=$(o=>n.$emit("open",t.app),["stop"])),class:"text-indigo-500 hover:text-indigo-600 transition duration-300 ease-in-out",title:"Open"},e[19]||(e[19]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)]))):B("",!0),t.app.has_server&&t.app.installed?(T(),x("button",{key:6,onClick:e[8]||(e[8]=$(o=>n.$emit("start-server",t.app.folder_name),["stop"])),class:"text-teal-500 hover:text-teal-600 transition duration-300 ease-in-out",title:"Start Server"},e[20]||(e[20]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M12 5l7 7-7 7"})],-1)]))):B("",!0),t.app.has_update?(T(),x("button",{key:7,onClick:e[9]||(e[9]=$(o=>n.$emit("install",t.app.folder_name),["stop"])),class:"relative text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out animate-pulse",title:"Update Available"},e[21]||(e[21]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),l("span",{class:"absolute top-0 right-0 inline-flex items-center justify-center px-2 py-1 text-xs font-bold leading-none text-red-100 transform translate-x-1/2 -translate-y-1/2 bg-red-600 rounded-full"},"!",-1)]))):B("",!0)])])])}const uRt=rt(q2t,[["render",dRt],["__scopeId","data-v-a946557e"]]),pRt={components:{AppCard:uRt},data(){return{apps:[],githubApps:[],favorites:[],selectedCategory:"all",selectedApp:null,appCode:"",loading:!1,message:"",successMessage:!0,searchQuery:"",selectedFile:null,isUploading:!1,error:"",sortBy:"update",sortOrder:"desc",showOnlyInstalled:!1,showOnlyUnInstalled:!1}},computed:{currentCategoryName(){return this.selectedCategory==="all"?"All Apps":this.selectedCategory},combinedApps(){this.apps.map(e=>e.name);const n=new Map(this.apps.map(e=>[e.name,{...e,installed:!0,existsInFolder:!0}]));return this.githubApps.forEach(e=>{n.has(e.name)||n.set(e.name,{...e,installed:!1,existsInFolder:!1})}),Array.from(n.values())},categories(){return[...new Set(this.combinedApps.map(n=>n.category))]},filteredApps(){return this.combinedApps.filter(n=>{const e=n.name.toLowerCase().includes(this.searchQuery.toLowerCase())||n.description.toLowerCase().includes(this.searchQuery.toLowerCase())||n.author.toLowerCase().includes(this.searchQuery.toLowerCase()),t=this.selectedCategory==="all"||n.category===this.selectedCategory,s=this.showOnlyInstalled&&n.installed||this.showOnlyUnInstalled&&!n.installed||!this.showOnlyInstalled&&!this.showOnlyUnInstalled;return e&&t&&s})},sortedAndFilteredApps(){return this.filteredApps.sort((n,e)=>{let t=0;switch(this.sortBy){case"name":t=n.name.localeCompare(e.name);break;case"author":t=n.author.localeCompare(e.author);break;case"date":t=new Date(n.creation_date)-new Date(e.creation_date);break;case"update":t=new Date(n.last_update_date)-new Date(e.last_update_date);break}return this.sortOrder==="asc"?t:-t})},favoriteApps(){return this.combinedApps.filter(n=>this.favorites.includes(n.appName))}},methods:{toggleSortOrder(){this.sortOrder=this.sortOrder==="asc"?"desc":"asc"},toggleFavorite(n){console.log("Toggling favorite"),console.log(n);const e=this.favorites.indexOf(n);e===-1?this.favorites.push(n):this.favorites.splice(e,1),this.saveFavoritesToLocalStorage()},saveFavoritesToLocalStorage(){localStorage.setItem("appZooFavorites",JSON.stringify(this.favorites))},loadFavoritesFromLocalStorage(){const n=localStorage.getItem("appZooFavorites");console.log("savedFavorites",n),n&&(this.favorites=JSON.parse(n))},startServer(n){const e={client_id:this.$store.state.client_id,app_name:n};this.$store.state.messageBox.showBlockingMessage(`Loading server. -This may take some time the first time as some libraries need to be installed.`),ne.post("/apps/start_server",e).then(t=>{this.$store.state.messageBox.hideMessage(),console.log("Server start initiated:",t.data.message),this.$notify({type:"success",title:"Server Starting",text:t.data.message})}).catch(t=>{var s,r;this.$store.state.messageBox.hideMessage(),console.error("Error starting server:",t),this.$notify({type:"error",title:"Server Start Failed",text:((r=(s=t.response)==null?void 0:s.data)==null?void 0:r.detail)||"An error occurred while starting the server"})})},triggerFileInput(){this.$refs.fileInput.click()},onFileSelected(n){this.selectedFile=n.target.files[0],this.message="",this.error="",this.uploadApp()},async uploadApp(){var e,t;if(!this.selectedFile){this.error="Please select a file to upload.";return}this.isUploading=!0,this.message="",this.error="";const n=new FormData;n.append("file",this.selectedFile),n.append("client_id",this.$store.state.client_id);try{const s=await ne.post("/upload_app",n,{headers:{"Content-Type":"multipart/form-data"}});this.message=s.data.message,this.$refs.fileInput.value="",this.selectedFile=null}catch(s){console.error("Error uploading app:",s),this.error=((t=(e=s.response)==null?void 0:e.data)==null?void 0:t.detail)||"Failed to upload the app. Please try again."}finally{this.isUploading=!1}},async fetchApps(){this.loading=!0;try{const n=await ne.get("/apps");this.apps=n.data,this.showMessage("Refresh successful!",!0)}catch{this.showMessage("Failed to refresh apps.",!1)}finally{this.loading=!1}},async openAppsFolder(){this.loading=!0;try{console.log("opening apps folder");const n=await ne.post("/show_apps_folder",{client_id:this.$store.state.client_id})}catch{this.showMessage("Failed to open apps folder.",!1)}finally{this.loading=!1}},async fetchGithubApps(){this.loading=!0;try{const n=await ne.get("/github/apps");this.githubApps=n.data.apps,await this.fetchApps()}catch{this.showMessage("Failed to refresh GitHub apps.",!1)}finally{this.loading=!1}},async handleAppClick(n){if(n.installed){this.selectedApp=n;const e=await ne.get(`/apps/${n.folder_name}/README.md`);this.appCode=Pt(e.data)}else this.showMessage(`Please install ${n.folder_name} to view its code.`,!1)},backToZoo(){this.selectedApp=null,this.appCode=""},async installApp(n){this.loading=!0,this.$store.state.messageBox.showBlockingMessage(`Installing app ${n}`);try{await ne.post(`/install/${n}`,{client_id:this.$store.state.client_id}),this.showMessage("Installation succeeded!",!0)}catch{this.showMessage("Installation failed.",!1)}finally{this.loading=!1,this.fetchApps(),this.fetchGithubApps(),this.$store.state.messageBox.hideMessage()}},async uninstallApp(n){this.loading=!0;try{await ne.post(`/uninstall/${n}`,{client_id:this.$store.state.client_id}),this.showMessage("Uninstallation succeeded!",!0)}catch{this.showMessage("Uninstallation failed.",!1)}finally{this.loading=!1,this.fetchApps()}},async deleteApp(n){this.loading=!0;try{await ne.post(`/delete/${n}`,{client_id:this.$store.state.client_id}),this.showMessage("Deletion succeeded!",!0)}catch{this.showMessage("Deletion failed.",!1)}finally{this.loading=!1,this.fetchApps()}},async editApp(n){this.loading=!0;try{const e=await ne.post("/open_app_in_vscode",{client_id:this.$store.state.client_id,app_name:n.folder_name});this.showMessage(e.data.message,!0)}catch{this.showMessage("Failed to open folder in VSCode.",!1)}finally{this.loading=!1}},async downloadApp(n){this.isLoading=!0,this.error=null;try{const e=await ne.post("/download_app",{client_id:this.$store.state.client_id,app_name:n},{responseType:"arraybuffer"}),t=e.headers["content-disposition"],s=t&&t.match(/filename="?(.+)"?/i),r=s?s[1]:"app.zip",i=new Blob([e.data],{type:"application/zip"}),o=window.URL.createObjectURL(i),a=document.createElement("a");a.style.display="none",a.href=o,a.download=r,document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(o),document.body.removeChild(a)}catch(e){console.error("Error downloading app:",e),this.error="Failed to download the app. Please try again."}finally{this.isLoading=!1}},openApp(n){n.installed?window.open(`/apps/${n.folder_name}/index.html?client_id=${this.$store.state.client_id}`,"_blank"):this.showMessage(`Please install ${n.name} before opening.`,!1)},showMessage(n,e){this.message=n,this.successMessage=e,setTimeout(()=>{this.message=""},3e3)}},mounted(){this.fetchGithubApps(),this.loadFavoritesFromLocalStorage()}},fRt={class:"app-zoo background-color w-full p-6 pt-12 min-h-screen overflow-y-auto"},_Rt={class:"panels-color shadow-lg rounded-lg p-4 max-w-4xl mx-auto mb-8"},mRt={class:"flex flex-wrap items-center justify-between gap-4"},hRt={class:"flex items-center space-x-4"},gRt=["disabled"],bRt={key:0},yRt={key:1,class:"error"},ERt={class:"relative flex-grow max-w-md"},vRt={class:"flex items-center space-x-4"},SRt=["value"],TRt={class:"flex items-center space-x-4"},xRt={for:"installed-only",class:"font-semibold"},CRt={for:"installed-only",class:"font-semibold"},wRt={class:"flex items-center space-x-4"},RRt={key:0,class:"flex justify-center items-center space-x-2 my-8","aria-live":"polite"},ARt={key:1,class:"pb-20"},MRt={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-8"},NRt={class:"text-2xl font-bold mb-4"},ORt={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"},IRt={key:2,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"},kRt={class:"bg-white rounded-lg p-6 w-11/12 h-5/6 flex flex-col"},DRt={class:"flex justify-between items-center mb-4"},LRt={class:"text-2xl font-bold"},PRt=["srcdoc"],FRt={key:1,class:"text-center text-red-500"};function URt(n,e,t,s,r,i){const o=nt("app-card");return T(),x("div",fRt,[l("nav",_Rt,[l("div",mRt,[l("div",hRt,[l("button",{onClick:e[0]||(e[0]=(...a)=>i.fetchGithubApps&&i.fetchGithubApps(...a)),class:"btn btn-primary","aria-label":"Refresh apps from GitHub"},e[11]||(e[11]=[l("svg",{class:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),Ze(" Refresh ")])),l("button",{onClick:e[1]||(e[1]=(...a)=>i.openAppsFolder&&i.openAppsFolder(...a)),class:"btn btn-secondary","aria-label":"Open apps folder"},e[12]||(e[12]=[l("svg",{class:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"})],-1),Ze(" Open Folder ")])),l("input",{type:"file",onChange:e[2]||(e[2]=(...a)=>i.onFileSelected&&i.onFileSelected(...a)),accept:".zip",ref:"fileInput",style:{display:"none"}},null,544),l("button",{onClick:e[3]||(e[3]=(...a)=>i.triggerFileInput&&i.triggerFileInput(...a)),disabled:r.isUploading,class:"btn-secondary text-green-500 hover:text-green-600 transition duration-300 ease-in-out",title:"Upload App"},Y(r.isUploading?"Uploading...":"Upload App"),9,gRt)]),r.message?(T(),x("p",bRt,Y(r.message),1)):B("",!0),r.error?(T(),x("p",yRt,Y(r.error),1)):B("",!0),l("div",ERt,[k(l("input",{"onUpdate:modelValue":e[4]||(e[4]=a=>r.searchQuery=a),placeholder:"Search apps...",class:"w-full border-b-2 border-gray-300 px-4 py-2 pl-10 focus:outline-none focus:border-blue-500 transition duration-300 ease-in-out","aria-label":"Search apps"},null,512),[[ae,r.searchQuery]]),e[13]||(e[13]=l("svg",{class:"w-5 h-5 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))]),l("div",vRt,[e[15]||(e[15]=l("label",{for:"category-select",class:"font-semibold"},"Category:",-1)),k(l("select",{id:"category-select","onUpdate:modelValue":e[5]||(e[5]=a=>r.selectedCategory=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},[e[14]||(e[14]=l("option",{value:"all"},"All Categories",-1)),(T(!0),x(Be,null,Ke(i.categories,a=>(T(),x("option",{key:a,value:a},Y(a),9,SRt))),128))],512),[[Ot,r.selectedCategory]])]),l("div",TRt,[l("label",xRt,[k(l("input",{id:"installed-only",type:"checkbox","onUpdate:modelValue":e[6]||(e[6]=a=>r.showOnlyInstalled=a),class:"mr-2"},null,512),[[He,r.showOnlyInstalled]]),e[16]||(e[16]=Ze(" Show only installed apps "))]),l("label",CRt,[k(l("input",{id:"uninstalled-only",type:"checkbox","onUpdate:modelValue":e[7]||(e[7]=a=>r.showOnlyUnInstalled=a),class:"mr-2"},null,512),[[He,r.showOnlyUnInstalled]]),e[17]||(e[17]=Ze(" Show only non installed apps "))])]),l("div",wRt,[e[19]||(e[19]=l("label",{for:"sort-select",class:"font-semibold"},"Sort by:",-1)),k(l("select",{id:"sort-select","onUpdate:modelValue":e[8]||(e[8]=a=>r.sortBy=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},e[18]||(e[18]=[l("option",{value:"name"},"Name",-1),l("option",{value:"author"},"Author",-1),l("option",{value:"date"},"Creation Date",-1),l("option",{value:"update"},"Last Update",-1)]),512),[[Ot,r.sortBy]]),l("button",{onClick:e[9]||(e[9]=(...a)=>i.toggleSortOrder&&i.toggleSortOrder(...a)),class:"btn btn-secondary"},Y(r.sortOrder==="asc"?"↑":"↓"),1)])])]),r.loading?(T(),x("div",RRt,e[20]||(e[20]=[l("div",{class:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"},null,-1),l("span",{class:"text-xl text-gray-700 font-semibold"},"Loading...",-1)]))):(T(),x("div",ARt,[e[21]||(e[21]=l("h2",{class:"text-2xl font-bold mb-4"},"Favorite Apps",-1)),l("div",MRt,[(T(!0),x(Be,null,Ke(i.favoriteApps,a=>(T(),at(o,{key:a.appName,app:a,onToggleFavorite:i.toggleFavorite,onInstall:i.installApp,onUninstall:i.uninstallApp,onDelete:i.deleteApp,onEdit:i.editApp,onDownload:i.downloadApp,onHelp:i.handleAppClick,onOpen:i.openApp,onStartServer:i.startServer},null,8,["app","onToggleFavorite","onInstall","onUninstall","onDelete","onEdit","onDownload","onHelp","onOpen","onStartServer"]))),128))]),l("h2",NRt,Y(i.currentCategoryName)+" ("+Y(i.sortedAndFilteredApps.length)+")",1),l("div",ORt,[(T(!0),x(Be,null,Ke(i.sortedAndFilteredApps,a=>(T(),at(o,{key:a.name,app:a,onToggleFavorite:i.toggleFavorite,onInstall:i.installApp,onUninstall:i.uninstallApp,onDelete:i.deleteApp,onEdit:i.editApp,onDownload:i.downloadApp,onHelp:i.handleAppClick,onOpen:i.openApp,onStartServer:i.startServer},null,8,["app","onToggleFavorite","onInstall","onUninstall","onDelete","onEdit","onDownload","onHelp","onOpen","onStartServer"]))),128))])])),r.selectedApp?(T(),x("div",IRt,[l("div",kRt,[l("div",DRt,[l("h2",LRt,Y(r.selectedApp.name),1),l("button",{onClick:e[10]||(e[10]=(...a)=>i.backToZoo&&i.backToZoo(...a)),class:"bg-gray-300 hover:bg-gray-400 px-4 py-2 rounded-lg transition duration-300 ease-in-out"},"Close")]),r.appCode?(T(),x("iframe",{key:0,srcdoc:r.appCode,class:"flex-grow border-none"},null,8,PRt)):(T(),x("p",FRt,"Please install this app to view its code."))])])):B("",!0),r.message?(T(),x("div",{key:3,class:Le(["fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-md",{"bg-green-100 text-green-800":r.successMessage,"bg-red-100 text-red-800":!r.successMessage}])},Y(r.message),3)):B("",!0)])}const BRt=rt(pRt,[["render",URt]]),GRt={components:{PersonalityEntry:dN},data(){return{personalities:[],githubApps:[],favorites:[],selectedCategory:"all",selectedApp:null,appCode:"",loading:!1,message:"",successMessage:!0,searchQuery:"",selectedFile:null,isUploading:!1,error:"",sortBy:"name",sortOrder:"asc"}},computed:{currentCategoryName(){return this.selectedCategory=="all"?"All Personalities":this.selectedCategory},configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},combinedApps(){this.personalities.map(e=>e.name);const n=new Map(this.personalities.map(e=>[e.name,{...e,installed:!0,existsInFolder:!0}]));return this.githubApps.forEach(e=>{n.has(e.name)||n.set(e.name,{...e,installed:!1,existsInFolder:!1})}),Array.from(n.values())},categories(){return[...new Set(this.combinedApps.map(n=>n.category))].sort((n,e)=>n.localeCompare(e))},filteredApps(){return this.combinedApps.filter(n=>{const e=n.name.toLowerCase().includes(this.searchQuery.toLowerCase())||n.author.toLowerCase().includes(this.searchQuery.toLowerCase())||n.description.toLowerCase().includes(this.searchQuery.toLowerCase()),t=this.selectedCategory==="all"||n.category===this.selectedCategory;return e&&t})},sortedAndFilteredApps(){return this.filteredApps.sort((n,e)=>{let t=0;switch(this.sortBy){case"name":t=n.name.localeCompare(e.name);break;case"author":t=n.author.localeCompare(e.author);break;case"date":t=new Date(n.creation_date)-new Date(e.creation_date);break;case"update":t=new Date(n.last_update_date)-new Date(e.last_update_date);break}return this.sortOrder==="asc"?t:-t})},favoriteApps(){return this.combinedApps.filter(n=>this.favorites.includes(n.uid))}},methods:{async onPersonalitySelected(n){if(console.log("on pers",n),this.isLoading&&this.$store.state.toast.showToast("Loading... please wait",4,!1),this.isLoading=!0,console.log("selecting ",n),n){if(n.selected){this.$store.state.toast.showToast("Personality already selected",4,!0),this.isLoading=!1;return}let e=n.language==null?n.full_path:n.full_path+":"+n.language;if(console.log("pth",e),n.isMounted&&this.configFile.personalities.includes(e)){const t=await this.select_personality(n);console.log("pers is mounted",t),t&&t.status&&t.active_personality_id>-1?this.$store.state.toast.showToast(`Selected personality: +This is likely a Baklava internal issue. Please report it on GitHub.`);return e.get(t)}}const ixt=["INPUT","TEXTAREA","SELECT"];function MO(n){return ixt.includes(n.tagName)}let Mb=null;function oxt(n){Mb=n}function ds(){if(!Mb)throw new Error("providePlugin() must be called before usePlugin()");return{viewModel:Mb}}function Ns(){const{viewModel:n}=ds();return{graph:Bd(n.value,"displayedGraph"),switchGraph:n.value.switchGraph}}function NO(n){const{graph:e}=Ns(),t=ot(null),s=ot(null);return{dragging:Je(()=>!!t.value),onPointerDown:c=>{t.value={x:c.pageX,y:c.pageY},s.value={x:n.value.x,y:n.value.y}},onPointerMove:c=>{if(t.value){const d=c.pageX-t.value.x,u=c.pageY-t.value.y;n.value.x=s.value.x+d/e.value.scaling,n.value.y=s.value.y+u/e.value.scaling}},onPointerUp:()=>{t.value=null,s.value=null}}}function OO(n,e,t){if(!e.template)return!1;if(Oa(e.template)===t)return!0;const s=n.graphTemplates.find(i=>Oa(i)===t);return s?s.nodes.filter(i=>i.type.startsWith(Jl)).some(i=>OO(n,e,i.type)):!1}function IO(n){return Je(()=>{const e=Array.from(n.value.editor.nodeTypes.entries()),t=new Set(e.map(([,r])=>r.category)),s=[];for(const r of t.values()){let i=e.filter(([,o])=>o.category===r);n.value.displayedGraph.template?i=i.filter(([o])=>!OO(n.value.editor,n.value.displayedGraph,o)):i=i.filter(([o])=>![Ma,Na].includes(o)),i.length>0&&s.push({name:r,nodeTypes:Object.fromEntries(i)})}return s.sort((r,i)=>r.name==="default"?-1:i.name==="default"||r.name>i.name?1:-1),s})}function kO(){const{graph:n}=Ns();return{transform:(t,s)=>{const r=t/n.value.scaling-n.value.panning.x,i=s/n.value.scaling-n.value.panning.y;return[r,i]}}}function axt(){const{graph:n}=Ns();let e=[],t=-1,s={x:0,y:0};const r=Je(()=>n.value.panning),i=NO(r),o=Je(()=>({"transform-origin":"0 0",transform:`scale(${n.value.scaling}) translate(${n.value.panning.x}px, ${n.value.panning.y}px)`})),a=(h,f,y)=>{const b=[h/n.value.scaling-n.value.panning.x,f/n.value.scaling-n.value.panning.y],g=[h/y-n.value.panning.x,f/y-n.value.panning.y],E=[g[0]-b[0],g[1]-b[1]];n.value.panning.x+=E[0],n.value.panning.y+=E[1],n.value.scaling=y},c=h=>{h.preventDefault();let f=h.deltaY;h.deltaMode===1&&(f*=32);const y=n.value.scaling*(1-f/3e3);a(h.offsetX,h.offsetY,y)},d=()=>({ax:e[0].clientX,ay:e[0].clientY,bx:e[1].clientX,by:e[1].clientY});return{styles:o,...i,onPointerDown:h=>{if(e.push(h),i.onPointerDown(h),e.length===2){const{ax:f,ay:y,bx:b,by:g}=d();s={x:f+(b-f)/2,y:y+(g-y)/2}}},onPointerMove:h=>{for(let f=0;f0){const R=n.value.scaling*(1+(S-t)/500);a(s.x,s.y,R)}t=S}else i.onPointerMove(h)},onPointerUp:h=>{e=e.filter(f=>f.pointerId!==h.pointerId),t=-1,i.onPointerUp()},onMouseWheel:c}}var ys=(n=>(n[n.NONE=0]="NONE",n[n.ALLOWED=1]="ALLOWED",n[n.FORBIDDEN=2]="FORBIDDEN",n))(ys||{});const DO=Symbol();function lxt(){const{graph:n}=Ns(),e=ot(null),t=ot(null),s=a=>{e.value&&(e.value.mx=a.offsetX/n.value.scaling-n.value.panning.x,e.value.my=a.offsetY/n.value.scaling-n.value.panning.y)},r=()=>{if(t.value){if(e.value)return;const a=n.value.connections.find(c=>c.to===t.value);t.value.isInput&&a?(e.value={status:ys.NONE,from:a.from},n.value.removeConnection(a)):e.value={status:ys.NONE,from:t.value},e.value.mx=void 0,e.value.my=void 0}},i=()=>{if(e.value&&t.value){if(e.value.from===t.value)return;n.value.addConnection(e.value.from,e.value.to)}e.value=null},o=a=>{if(t.value=a??null,a&&e.value){e.value.to=a;const c=n.value.checkConnection(e.value.from,e.value.to);if(e.value.status=c.connectionAllowed?ys.ALLOWED:ys.FORBIDDEN,c.connectionAllowed){const d=c.connectionsInDanger.map(u=>u.id);n.value.connections.forEach(u=>{d.includes(u.id)&&(u.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=ys.NONE,n.value.connections.forEach(c=>{c.isInDanger=!1}))};return na(DO,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:s,onMouseDown:r,onMouseUp:i,hoveredOver:o}}function cxt(n){const e=ot(!1),t=ot(0),s=ot(0),r=IO(n),{transform:i}=kO(),o=Je(()=>{let u=[];const _={};for(const h of r.value){const f=Object.entries(h.nodeTypes).map(([y,b])=>({label:b.title,value:"addNode:"+y}));h.name==="default"?u=f:_[h.name]=f}const m=[...Object.entries(_).map(([h,f])=>({label:h,submenu:f}))];return m.length>0&&u.length>0&&m.push({isDivider:!0}),m.push(...u),m}),a=Je(()=>n.value.settings.contextMenu.additionalItems.length===0?o.value:[{label:"Add node",submenu:o.value},...n.value.settings.contextMenu.additionalItems.map(u=>"isDivider"in u||"submenu"in u?u:{label:u.label,value:"command:"+u.command,disabled:!n.value.commandHandler.canExecuteCommand(u.command)})]);function c(u){const _=u.target;if(!(_ instanceof Element)||MO(_))return;u.preventDefault(),e.value=!0;const m=_.getBoundingClientRect(),f=_.closest(".baklava-editor").getBoundingClientRect();t.value=m.x+u.offsetX-f.x,s.value=m.y+u.offsetY-f.y}function d(u){if(u.startsWith("addNode:")){const _=u.substring(8),m=n.value.editor.nodeTypes.get(_);if(!m)return;const h=Hn(new m.type);n.value.displayedGraph.addNode(h);const[f,y]=i(t.value,s.value);h.position.x=f,h.position.y=y}else if(u.startsWith("command:")){const _=u.substring(8);n.value.commandHandler.canExecuteCommand(_)&&n.value.commandHandler.executeCommand(_)}}return{show:e,x:t,y:s,items:a,open:c,onClick:d}}const Ld="START_SELECTION_BOX";function dxt(n){const{viewModel:e}=ds(),{graph:t}=Ns(),s=Je(()=>t.value.nodes),r=ot(!1),i=ot(!1),o=ot([0,0]),a=ot([0,0]);Tn(e,()=>{e.value.commandHandler.hasCommand(Ld)||(e.value.commandHandler.registerCommand(Ld,{canExecute:()=>!0,execute(){r.value=!0}}),e.value.commandHandler.registerHotkey(["b"],Ld))},{immediate:!0});function c(g){return[g.clientX-n.value.getBoundingClientRect().left,g.clientY-n.value.getBoundingClientRect().top]}function d(g){return r.value?(i.value=!0,r.value=!1,o.value=c(g),a.value=c(g),document.addEventListener("pointermove",u),document.addEventListener("pointerup",_),!0):!1}function u(g){o.value=c(g)}function _(g){document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",_),o.value=c(g),i.value=!1;const E=m();for(const v of E)e.value.displayedGraph.selectedNodes.push(v)}function m(){const g=h(),v=document.querySelector(".baklava-editor").getBoundingClientRect();return s.value.filter(S=>{const R=f(S,v);return y(g,R)})}function h(){return{left:Math.min(o.value[0],a.value[0]),top:Math.min(o.value[1],a.value[1]),right:Math.max(o.value[0],a.value[0]),bottom:Math.max(o.value[1],a.value[1])}}function f(g,E){const v=document.getElementById(g.id),S=v?v.getBoundingClientRect():{x:0,y:0,width:0,height:0},R=S.x-E.left,w=S.y-E.top;return{left:R,top:w,right:R+S.width,bottom:w+S.height}}function y(g,E){return g.leftE.left&&g.topE.top}function b(){return{width:Math.abs(a.value[0]-o.value[0])+"px",height:Math.abs(a.value[1]-o.value[1])+"px",left:(a.value[0]>o.value[0]?o.value[0]:a.value[0])+"px",top:(a.value[1]>o.value[1]?o.value[1]:a.value[1])+"px"}}return Hn({startSelection:r,isSelecting:i,start:o,end:a,onPointerDown:d,getStyles:b})}const uxt=cn({setup(){const{viewModel:n}=ds(),{graph:e}=Ns();return{styles:Je(()=>{const s=n.value.settings.background,r=e.value.panning.x*e.value.scaling,i=e.value.panning.y*e.value.scaling,o=e.value.scaling*s.gridSize,a=o/s.gridDivision,c=`${o}px ${o}px, ${o}px ${o}px`,d=e.value.scaling>s.subGridVisibleThreshold?`, ${a}px ${a}px, ${a}px ${a}px`:"";return{backgroundPosition:`left ${r}px top ${i}px`,backgroundSize:`${c} ${d}`}})}}}),sn=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t};function pxt(n,e,t,s,r,i){return T(),x("div",{class:"background",style:Bt(n.styles)},null,4)}const fxt=sn(uxt,[["render",pxt]]);function _xt(n){return E2()?(bI(n),!0):!1}function Ay(n){return typeof n=="function"?n():bt(n)}const LO=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const mxt=Object.prototype.toString,hxt=n=>mxt.call(n)==="[object Object]",Pd=()=>{},gxt=bxt();function bxt(){var n,e;return LO&&((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function yxt(n,e,t=!1){return e.reduce((s,r)=>(r in n&&(!t||n[r]!==void 0)&&(s[r]=n[r]),s),{})}function Ext(n,e={}){if(!pn(n))return WI(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const s in n.value)t[s]=$I(()=>({get(){return n.value[s]},set(r){var i;if((i=Ay(e.replaceRef))!=null?i:!0)if(Array.isArray(n.value)){const a=[...n.value];a[s]=r,n.value=a}else{const a={...n.value,[s]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[s]=r}}));return t}function bl(n){var e;const t=Ay(n);return(e=t==null?void 0:t.$el)!=null?e:t}const My=LO?window:void 0;function Ll(...n){let e,t,s,r;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,s,r]=n,e=My):[e,t,s,r]=n,!e)return Pd;Array.isArray(t)||(t=[t]),Array.isArray(s)||(s=[s]);const i=[],o=()=>{i.forEach(u=>u()),i.length=0},a=(u,_,m,h)=>(u.addEventListener(_,m,h),()=>u.removeEventListener(_,m,h)),c=Tn(()=>[bl(e),Ay(r)],([u,_])=>{if(o(),!u)return;const m=hxt(_)?{..._}:_;i.push(...t.flatMap(h=>s.map(f=>a(u,h,f,m))))},{immediate:!0,flush:"post"}),d=()=>{c(),o()};return _xt(d),d}let t2=!1;function PO(n,e,t={}){const{window:s=My,ignore:r=[],capture:i=!0,detectIframe:o=!1}=t;if(!s)return Pd;gxt&&!t2&&(t2=!0,Array.from(s.document.body.children).forEach(m=>m.addEventListener("click",Pd)),s.document.documentElement.addEventListener("click",Pd));let a=!0;const c=m=>r.some(h=>{if(typeof h=="string")return Array.from(s.document.querySelectorAll(h)).some(f=>f===m.target||m.composedPath().includes(f));{const f=bl(h);return f&&(m.target===f||m.composedPath().includes(f))}}),u=[Ll(s,"click",m=>{const h=bl(n);if(!(!h||h===m.target||m.composedPath().includes(h))){if(m.detail===0&&(a=!c(m)),!a){a=!0;return}e(m)}},{passive:!0,capture:i}),Ll(s,"pointerdown",m=>{const h=bl(n);a=!c(m)&&!!(h&&!m.composedPath().includes(h))},{passive:!0}),o&&Ll(s,"blur",m=>{setTimeout(()=>{var h;const f=bl(n);((h=s.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(f!=null&&f.contains(s.document.activeElement))&&e(m)},0)})].filter(Boolean);return()=>u.forEach(m=>m())}const FO={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},vxt=Object.keys(FO);function Sxt(n={}){const{target:e=My}=n,t=ot(!1),s=ot(n.initialValue||{});Object.assign(s.value,FO,s.value);const r=i=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(i.pointerType))&&(s.value=yxt(i,vxt,!1))};if(e){const i={passive:!0};Ll(e,["pointerdown","pointermove","pointerup"],r,i),Ll(e,"pointerleave",()=>t.value=!1,i)}return{...Ext(s),isInside:t}}const Txt=["onMouseenter","onMouseleave","onClick"],xxt={class:"flex-fill"},Cxt={key:0,class:"__submenu-icon",style:{"line-height":"1em"}},wxt=l("svg",{width:"13",height:"13",viewBox:"-60 120 250 250"},[l("path",{d:"M160.875 279.5625 L70.875 369.5625 L70.875 189.5625 L160.875 279.5625 Z",stroke:"none",fill:"white"})],-1),Rxt=[wxt],Ny=cn({__name:"ContextMenu",props:{modelValue:{type:Boolean},items:{},x:{default:0},y:{default:0},isNested:{type:Boolean,default:!1},isFlipped:{default:()=>({x:!1,y:!1})},flippable:{type:Boolean,default:!1}},emits:["update:modelValue","click"],setup(n,{emit:e}){const t=n,s=e;let r=null;const i=ot(null),o=ot(-1),a=ot(0),c=ot({x:!1,y:!1}),d=Je(()=>t.flippable&&(c.value.x||t.isFlipped.x)),u=Je(()=>t.flippable&&(c.value.y||t.isFlipped.y)),_=Je(()=>{const E={};return t.isNested||(E.top=(u.value?t.y-a.value:t.y)+"px",E.left=t.x+"px"),E}),m=Je(()=>({"--flipped-x":d.value,"--flipped-y":u.value,"--nested":t.isNested})),h=Je(()=>t.items.map(E=>({...E,hover:!1})));Tn([()=>t.y,()=>t.items],()=>{var E,v,S,R;a.value=t.items.length*30;const w=((v=(E=i.value)==null?void 0:E.parentElement)==null?void 0:v.offsetWidth)??0,A=((R=(S=i.value)==null?void 0:S.parentElement)==null?void 0:R.offsetHeight)??0;c.value.x=!t.isNested&&t.x>w*.75,c.value.y=!t.isNested&&t.y+a.value>A-20}),PO(i,()=>{t.modelValue&&s("update:modelValue",!1)});const f=E=>{!E.submenu&&E.value&&(s("click",E.value),s("update:modelValue",!1))},y=E=>{s("click",E),o.value=-1,t.isNested||s("update:modelValue",!1)},b=(E,v)=>{t.items[v].submenu&&(o.value=v,r!==null&&(clearTimeout(r),r=null))},g=(E,v)=>{t.items[v].submenu&&(r=window.setTimeout(()=>{o.value=-1,r=null},200))};return(E,v)=>{const S=nt("ContextMenu",!0);return T(),at(Or,{name:"slide-fade"},{default:Ie(()=>[k(l("div",{ref_key:"el",ref:i,class:Le(["baklava-context-menu",m.value]),style:Bt(_.value)},[(T(!0),x(Be,null,Ke(h.value,(R,w)=>(T(),x(Be,null,[R.isDivider?(T(),x("div",{key:`d-${w}`,class:"divider"})):(T(),x("div",{key:`i-${w}`,class:Le(["item",{submenu:!!R.submenu,"--disabled":!!R.disabled}]),onMouseenter:A=>b(A,w),onMouseleave:A=>g(A,w),onClick:$(A=>f(R),["stop","prevent"])},[l("div",xxt,Y(R.label),1),R.submenu?(T(),x("div",Cxt,Rxt)):B("",!0),R.submenu?(T(),at(S,{key:1,"model-value":o.value===w,items:R.submenu,"is-nested":!0,"is-flipped":{x:d.value,y:u.value},flippable:E.flippable,onClick:y},null,8,["model-value","items","is-flipped","flippable"])):B("",!0)],42,Txt))],64))),256))],6),[[ht,E.modelValue]])]),_:1})}}}),Axt={},Mxt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"16",height:"16",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Nxt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Oxt=l("circle",{cx:"12",cy:"12",r:"1"},null,-1),Ixt=l("circle",{cx:"12",cy:"19",r:"1"},null,-1),kxt=l("circle",{cx:"12",cy:"5",r:"1"},null,-1),Dxt=[Nxt,Oxt,Ixt,kxt];function Lxt(n,e){return T(),x("svg",Mxt,Dxt)}const UO=sn(Axt,[["render",Lxt]]),Pxt=["id"],Fxt={key:0,class:"__tooltip"},Uxt={key:2,class:"align-middle"},n2=cn({__name:"NodeInterface",props:{node:{},intf:{}},setup(n){const e=(b,g=100)=>{const E=typeof(b==null?void 0:b.toString)=="function"?String(b):"";return E.length>g?E.slice(0,g)+"...":E},t=n,{viewModel:s}=ds(),{hoveredOver:r,temporaryConnection:i}=is(DO),o=ot(null),a=Je(()=>t.intf.connectionCount>0),c=ot(!1),d=Je(()=>s.value.settings.displayValueOnHover&&c.value),u=Je(()=>({"--input":t.intf.isInput,"--output":!t.intf.isInput,"--connected":a.value})),_=Je(()=>t.intf.component&&(!t.intf.isInput||!t.intf.port||t.intf.connectionCount===0)),m=()=>{c.value=!0,r(t.intf)},h=()=>{c.value=!1,r(void 0)},f=()=>{o.value&&s.value.hooks.renderInterface.execute({intf:t.intf,el:o.value})},y=()=>{const b=s.value.displayedGraph.sidebar;b.nodeId=t.node.id,b.optionName=t.intf.name,b.visible=!0};return cr(f),nc(f),(b,g)=>{var E;return T(),x("div",{id:b.intf.id,ref_key:"el",ref:o,class:Le(["baklava-node-interface",u.value])},[b.intf.port?(T(),x("div",{key:0,class:Le(["__port",{"--selected":((E=bt(i))==null?void 0:E.from)===b.intf}]),onPointerover:m,onPointerout:h},[on(b.$slots,"portTooltip",{showTooltip:d.value},()=>[d.value===!0?(T(),x("span",Fxt,Y(e(b.intf.value)),1)):B("",!0)])],34)):B("",!0),_.value?(T(),at(Fu(b.intf.component),{key:1,modelValue:b.intf.value,"onUpdate:modelValue":g[0]||(g[0]=v=>b.intf.value=v),node:b.node,intf:b.intf,onOpenSidebar:y},null,40,["modelValue","node","intf"])):(T(),x("span",Uxt,Y(b.intf.name),1))],10,Pxt)}}}),Bxt=["id","data-node-type"],Gxt={class:"__title-label"},Vxt={class:"__menu"},zxt={class:"__outputs"},Hxt={class:"__inputs"},qxt=cn({__name:"Node",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag"],setup(n,{emit:e}){const t=n,s=e,{viewModel:r}=ds(),{graph:i,switchGraph:o}=Ns(),a=ot(null),c=ot(!1),d=ot(""),u=ot(null),_=ot(!1),m=ot(!1),h=Je(()=>{const V=[{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return t.node.type.startsWith(Jl)&&V.push({value:"editSubgraph",label:"Edit Subgraph"}),V}),f=Je(()=>({"--selected":t.selected,"--dragging":t.dragging,"--two-column":!!t.node.twoColumn})),y=Je(()=>({"--reverse-y":t.node.reverseY??r.value.settings.nodes.reverseY})),b=Je(()=>{var V,ee;return{top:`${((V=t.node.position)==null?void 0:V.y)??0}px`,left:`${((ee=t.node.position)==null?void 0:ee.x)??0}px`,"--width":`${t.node.width??r.value.settings.nodes.defaultWidth}px`}}),g=Je(()=>Object.values(t.node.inputs).filter(V=>!V.hidden)),E=Je(()=>Object.values(t.node.outputs).filter(V=>!V.hidden)),v=()=>{s("select")},S=V=>{t.selected||v(),s("start-drag",V)},R=()=>{m.value=!0},w=async V=>{var ee;switch(V){case"delete":i.value.removeNode(t.node);break;case"rename":d.value=t.node.title,c.value=!0,await Fe(),(ee=u.value)==null||ee.focus();break;case"editSubgraph":o(t.node.template);break}},A=()=>{t.node.title=d.value,c.value=!1},I=()=>{a.value&&r.value.hooks.renderNode.execute({node:t.node,el:a.value})},C=V=>{_.value=!0,V.preventDefault()},M=V=>{if(!_.value)return;const ee=t.node.width+V.movementX/i.value.scaling,O=r.value.settings.nodes.minWidth,H=r.value.settings.nodes.maxWidth;t.node.width=Math.max(O,Math.min(H,ee))},G=()=>{_.value=!1};return cr(()=>{I(),window.addEventListener("mousemove",M),window.addEventListener("mouseup",G)}),nc(I),La(()=>{window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",G)}),(V,ee)=>(T(),x("div",{id:V.node.id,ref_key:"el",ref:a,class:Le(["baklava-node",f.value]),style:Bt(b.value),"data-node-type":V.node.type,onPointerdown:v},[bt(r).settings.nodes.resizable?(T(),x("div",{key:0,class:"__resize-handle",onMousedown:C},null,32)):B("",!0),on(V.$slots,"title",{},()=>[l("div",{class:"__title",onPointerdown:$(S,["self","stop"])},[c.value?k((T(),x("input",{key:1,ref_key:"renameInputEl",ref:u,"onUpdate:modelValue":ee[1]||(ee[1]=O=>d.value=O),type:"text",class:"baklava-input",placeholder:"Node Name",onBlur:A,onKeydown:ws(A,["enter"])},null,544)),[[ae,d.value]]):(T(),x(Be,{key:0},[l("div",Gxt,Y(V.node.title),1),l("div",Vxt,[z(UO,{class:"--clickable",onClick:R}),z(bt(Ny),{modelValue:m.value,"onUpdate:modelValue":ee[0]||(ee[0]=O=>m.value=O),x:0,y:0,items:h.value,onClick:w},null,8,["modelValue","items"])])],64))],32)]),on(V.$slots,"content",{},()=>[l("div",{class:Le(["__content",y.value]),onKeydown:ee[2]||(ee[2]=ws($(()=>{},["stop"]),["delete"]))},[l("div",zxt,[(T(!0),x(Be,null,Ke(E.value,O=>on(V.$slots,"nodeInterface",{key:O.id,type:"output",node:V.node,intf:O},()=>[z(n2,{node:V.node,intf:O},null,8,["node","intf"])])),128))]),l("div",Hxt,[(T(!0),x(Be,null,Ke(g.value,O=>on(V.$slots,"nodeInterface",{key:O.id,type:"input",node:V.node,intf:O},()=>[z(n2,{node:V.node,intf:O},null,8,["node","intf"])])),128))])],34)])],46,Bxt))}}),Yxt=cn({props:{x1:{type:Number,required:!0},y1:{type:Number,required:!0},x2:{type:Number,required:!0},y2:{type:Number,required:!0},state:{type:Number,default:ys.NONE},isTemporary:{type:Boolean,default:!1}},setup(n){const{viewModel:e}=ds(),{graph:t}=Ns(),s=(o,a)=>{const c=(o+t.value.panning.x)*t.value.scaling,d=(a+t.value.panning.y)*t.value.scaling;return[c,d]},r=Je(()=>{const[o,a]=s(n.x1,n.y1),[c,d]=s(n.x2,n.y2);if(e.value.settings.useStraightConnections)return`M ${o} ${a} L ${c} ${d}`;{const u=.3*Math.abs(o-c);return`M ${o} ${a} C ${o+u} ${a}, ${c-u} ${d}, ${c} ${d}`}}),i=Je(()=>({"--temporary":n.isTemporary,"--allowed":n.state===ys.ALLOWED,"--forbidden":n.state===ys.FORBIDDEN}));return{d:r,classes:i}}}),$xt=["d"];function Wxt(n,e,t,s,r,i){return T(),x("path",{class:Le(["baklava-connection",n.classes]),d:n.d},null,10,$xt)}const BO=sn(Yxt,[["render",Wxt]]);function Kxt(n){return document.getElementById(n.id)}function Ia(n){const e=document.getElementById(n.id),t=e==null?void 0:e.getElementsByClassName("__port");return{node:(e==null?void 0:e.closest(".baklava-node"))??null,interface:e,port:t&&t.length>0?t[0]:null}}const jxt=cn({components:{"connection-view":BO},props:{connection:{type:Object,required:!0}},setup(n){const{graph:e}=Ns();let t;const s=ot({x1:0,y1:0,x2:0,y2:0}),r=Je(()=>n.connection.isInDanger?ys.FORBIDDEN:ys.NONE),i=Je(()=>{var d;return(d=e.value.findNodeById(n.connection.from.nodeId))==null?void 0:d.position}),o=Je(()=>{var d;return(d=e.value.findNodeById(n.connection.to.nodeId))==null?void 0:d.position}),a=d=>d.node&&d.interface&&d.port?[d.node.offsetLeft+d.interface.offsetLeft+d.port.offsetLeft+d.port.clientWidth/2,d.node.offsetTop+d.interface.offsetTop+d.port.offsetTop+d.port.clientHeight/2]:[0,0],c=()=>{const d=Ia(n.connection.from),u=Ia(n.connection.to);d.node&&u.node&&(t||(t=new ResizeObserver(()=>{c()}),t.observe(d.node),t.observe(u.node)));const[_,m]=a(d),[h,f]=a(u);s.value={x1:_,y1:m,x2:h,y2:f}};return cr(async()=>{await Fe(),c()}),La(()=>{t&&t.disconnect()}),Tn([i,o],()=>c(),{deep:!0}),{d:s,state:r}}});function Qxt(n,e,t,s,r,i){const o=nt("connection-view");return T(),at(o,{x1:n.d.x1,y1:n.d.y1,x2:n.d.x2,y2:n.d.y2,state:n.state},null,8,["x1","y1","x2","y2","state"])}const Xxt=sn(jxt,[["render",Qxt]]);function Tu(n){return n.node&&n.interface&&n.port?[n.node.offsetLeft+n.interface.offsetLeft+n.port.offsetLeft+n.port.clientWidth/2,n.node.offsetTop+n.interface.offsetTop+n.port.offsetTop+n.port.clientHeight/2]:[0,0]}const Zxt=cn({components:{"connection-view":BO},props:{connection:{type:Object,required:!0}},setup(n){const e=Je(()=>n.connection?n.connection.status:ys.NONE);return{d:Je(()=>{if(!n.connection)return{input:[0,0],output:[0,0]};const s=Tu(Ia(n.connection.from)),r=n.connection.to?Tu(Ia(n.connection.to)):[n.connection.mx||s[0],n.connection.my||s[1]];return n.connection.from.isInput?{input:r,output:s}:{input:s,output:r}}),status:e}}});function Jxt(n,e,t,s,r,i){const o=nt("connection-view");return T(),at(o,{x1:n.d.input[0],y1:n.d.input[1],x2:n.d.output[0],y2:n.d.output[1],state:n.status,"is-temporary":""},null,8,["x1","y1","x2","y2","state"])}const eCt=sn(Zxt,[["render",Jxt]]),tCt=cn({setup(){const{viewModel:n}=ds(),{graph:e}=Ns(),t=ot(null),s=Bd(n.value.settings.sidebar,"width"),r=Je(()=>n.value.settings.sidebar.resizable),i=Je(()=>{const _=e.value.sidebar.nodeId;return e.value.nodes.find(m=>m.id===_)}),o=Je(()=>({width:`${s.value}px`})),a=Je(()=>i.value?[...Object.values(i.value.inputs),...Object.values(i.value.outputs)].filter(m=>m.displayInSidebar&&m.component):[]),c=()=>{e.value.sidebar.visible=!1},d=()=>{window.addEventListener("mousemove",u),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",u)},{once:!0})},u=_=>{var m,h;const f=((h=(m=t.value)==null?void 0:m.parentElement)==null?void 0:h.getBoundingClientRect().width)??500;let y=s.value-_.movementX;y<300?y=300:y>.9*f&&(y=.9*f),s.value=y};return{el:t,graph:e,resizable:r,node:i,styles:o,displayedInterfaces:a,startResize:d,close:c}}}),nCt={class:"__header"},sCt={class:"__node-name"};function rCt(n,e,t,s,r,i){return T(),x("div",{ref:"el",class:Le(["baklava-sidebar",{"--open":n.graph.sidebar.visible}]),style:Bt(n.styles)},[n.resizable?(T(),x("div",{key:0,class:"__resizer",onMousedown:e[0]||(e[0]=(...o)=>n.startResize&&n.startResize(...o))},null,32)):B("",!0),l("div",nCt,[l("button",{tabindex:"-1",class:"__close",onClick:e[1]||(e[1]=(...o)=>n.close&&n.close(...o))},"×"),l("div",sCt,[l("b",null,Y(n.node?n.node.title:""),1)])]),(T(!0),x(Be,null,Ke(n.displayedInterfaces,o=>(T(),x("div",{key:o.id,class:"__interface"},[(T(),at(Fu(o.component),{modelValue:o.value,"onUpdate:modelValue":a=>o.value=a,node:n.node,intf:o},null,8,["modelValue","onUpdate:modelValue","node","intf"]))]))),128))],6)}const iCt=sn(tCt,[["render",rCt]]),oCt=cn({__name:"Minimap",setup(n){const{viewModel:e}=ds(),{graph:t}=Ns(),s=ot(null),r=ot(!1);let i,o=!1,a={x1:0,y1:0,x2:0,y2:0},c;const d=()=>{var w,A;if(!i)return;i.canvas.width=s.value.offsetWidth,i.canvas.height=s.value.offsetHeight;const I=new Map,C=new Map;for(const O of t.value.nodes){const H=Kxt(O),q=(H==null?void 0:H.offsetWidth)??0,L=(H==null?void 0:H.offsetHeight)??0,W=((w=O.position)==null?void 0:w.x)??0,se=((A=O.position)==null?void 0:A.y)??0;I.set(O,{x1:W,y1:se,x2:W+q,y2:se+L}),C.set(O,H)}const M={x1:Number.MAX_SAFE_INTEGER,y1:Number.MAX_SAFE_INTEGER,x2:Number.MIN_SAFE_INTEGER,y2:Number.MIN_SAFE_INTEGER};for(const O of I.values())O.x1M.x2&&(M.x2=O.x2),O.y2>M.y2&&(M.y2=O.y2);const G=50;M.x1-=G,M.y1-=G,M.x2+=G,M.y2+=G,a=M;const V=i.canvas.width/i.canvas.height,ee=(a.x2-a.x1)/(a.y2-a.y1);if(V>ee){const O=(V-ee)*(a.y2-a.y1)*.5;a.x1-=O,a.x2+=O}else{const O=a.x2-a.x1,H=a.y2-a.y1,q=(O-V*H)/V*.5;a.y1-=q,a.y2+=q}i.clearRect(0,0,i.canvas.width,i.canvas.height),i.strokeStyle="white";for(const O of t.value.connections){const[H,q]=Tu(Ia(O.from)),[L,W]=Tu(Ia(O.to)),[se,oe]=u(H,q),[ye,xe]=u(L,W);if(i.beginPath(),i.moveTo(se,oe),e.value.settings.useStraightConnections)i.lineTo(ye,xe);else{const ce=.3*Math.abs(se-ye);i.bezierCurveTo(se+ce,oe,ye-ce,xe,ye,xe)}i.stroke()}i.strokeStyle="lightgray";for(const[O,H]of I.entries()){const[q,L]=u(H.x1,H.y1),[W,se]=u(H.x2,H.y2);i.fillStyle=m(C.get(O)),i.beginPath(),i.rect(q,L,W-q,se-L),i.fill(),i.stroke()}if(r.value){const O=f(),[H,q]=u(O.x1,O.y1),[L,W]=u(O.x2,O.y2);i.fillStyle="rgba(255, 255, 255, 0.2)",i.fillRect(H,q,L-H,W-q)}},u=(w,A)=>[(w-a.x1)/(a.x2-a.x1)*i.canvas.width,(A-a.y1)/(a.y2-a.y1)*i.canvas.height],_=(w,A)=>[w*(a.x2-a.x1)/i.canvas.width+a.x1,A*(a.y2-a.y1)/i.canvas.height+a.y1],m=w=>{if(w){const A=w.querySelector(".__content");if(A){const C=h(A);if(C)return C}const I=h(w);if(I)return I}return"gray"},h=w=>{const A=getComputedStyle(w).backgroundColor;if(A&&A!=="rgba(0, 0, 0, 0)")return A},f=()=>{const w=s.value.parentElement.offsetWidth,A=s.value.parentElement.offsetHeight,I=w/t.value.scaling-t.value.panning.x,C=A/t.value.scaling-t.value.panning.y;return{x1:-t.value.panning.x,y1:-t.value.panning.y,x2:I,y2:C}},y=w=>{w.button===0&&(o=!0,b(w))},b=w=>{if(o){const[A,I]=_(w.offsetX,w.offsetY),C=f(),M=(C.x2-C.x1)/2,G=(C.y2-C.y1)/2;t.value.panning.x=-(A-M),t.value.panning.y=-(I-G)}},g=()=>{o=!1},E=()=>{r.value=!0},v=()=>{r.value=!1,g()};Tn([r,t.value.panning,()=>t.value.scaling,()=>t.value.connections.length],()=>{d()});const S=Je(()=>t.value.nodes.map(w=>w.position)),R=Je(()=>t.value.nodes.map(w=>w.width));return Tn([S,R],()=>{d()},{deep:!0}),cr(()=>{i=s.value.getContext("2d"),i.imageSmoothingQuality="high",d(),c=setInterval(d,500)}),La(()=>{clearInterval(c)}),(w,A)=>(T(),x("canvas",{ref_key:"canvas",ref:s,class:"baklava-minimap",onMouseenter:E,onMouseleave:v,onMousedown:$(y,["self"]),onMousemove:$(b,["self"]),onMouseup:g,onContextmenu:A[0]||(A[0]=$(()=>{},["stop","prevent"]))},null,544))}}),aCt=cn({components:{ContextMenu:Ny,VerticalDots:UO},props:{type:{type:String,required:!0},title:{type:String,required:!0}},setup(n){const{viewModel:e}=ds(),{switchGraph:t}=Ns(),s=ot(!1),r=Je(()=>n.type.startsWith(Jl));return{showContextMenu:s,hasContextMenu:r,contextMenuItems:[{label:"Edit Subgraph",value:"editSubgraph"},{label:"Delete Subgraph",value:"deleteSubgraph"}],openContextMenu:()=>{s.value=!0},onContextMenuClick:c=>{const d=n.type.substring(Jl.length),u=e.value.editor.graphTemplates.find(_=>_.id===d);if(u)switch(c){case"editSubgraph":t(u);break;case"deleteSubgraph":e.value.editor.removeGraphTemplate(u);break}}}}}),lCt=["data-node-type"],cCt={class:"__title"},dCt={class:"__title-label"},uCt={key:0,class:"__menu"};function pCt(n,e,t,s,r,i){const o=nt("vertical-dots"),a=nt("context-menu");return T(),x("div",{class:"baklava-node --palette","data-node-type":n.type},[l("div",cCt,[l("div",dCt,Y(n.title),1),n.hasContextMenu?(T(),x("div",uCt,[z(o,{class:"--clickable",onPointerdown:e[0]||(e[0]=$(()=>{},["stop","prevent"])),onClick:$(n.openContextMenu,["stop","prevent"])},null,8,["onClick"]),z(a,{modelValue:n.showContextMenu,"onUpdate:modelValue":e[1]||(e[1]=c=>n.showContextMenu=c),x:-100,y:0,items:n.contextMenuItems,onClick:n.onContextMenuClick,onPointerdown:e[2]||(e[2]=$(()=>{},["stop","prevent"]))},null,8,["modelValue","items","onClick"])])):B("",!0)])],8,lCt)}const s2=sn(aCt,[["render",pCt]]),fCt={key:0},_Ct=cn({__name:"NodePalette",setup(n){const{viewModel:e}=ds(),{x:t,y:s}=Sxt(),{transform:r}=kO(),i=IO(e),o=is("editorEl"),a=ot(null),c=Je(()=>{if(!a.value||!(o!=null&&o.value))return{};const{left:u,top:_}=o.value.getBoundingClientRect();return{top:`${s.value-_}px`,left:`${t.value-u}px`}}),d=(u,_)=>{a.value={type:u,nodeInformation:_};const m=()=>{const h=Hn(new _.type);e.value.displayedGraph.addNode(h);const f=o.value.getBoundingClientRect(),[y,b]=r(t.value-f.left,s.value-f.top);h.position.x=y,h.position.y=b,a.value=null,document.removeEventListener("pointerup",m)};document.addEventListener("pointerup",m)};return(u,_)=>(T(),x(Be,null,[l("div",{class:"baklava-node-palette",onContextmenu:_[0]||(_[0]=$(()=>{},["stop","prevent"]))},[(T(!0),x(Be,null,Ke(bt(i),m=>(T(),x("section",{key:m.name},[m.name!=="default"?(T(),x("h1",fCt,Y(m.name),1)):B("",!0),(T(!0),x(Be,null,Ke(m.nodeTypes,(h,f)=>(T(),at(s2,{key:f,type:f,title:h.title,onPointerdown:y=>d(f,h)},null,8,["type","title","onPointerdown"]))),128))]))),128))],32),z(Or,{name:"fade"},{default:Ie(()=>[a.value?(T(),x("div",{key:0,class:"baklava-dragged-node",style:Bt(c.value)},[z(s2,{type:a.value.type,title:a.value.nodeInformation.title},null,8,["type","title"])],4)):B("",!0)]),_:1})],64))}});let bd;const mCt=new Uint8Array(16);function hCt(){if(!bd&&(bd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!bd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return bd(mCt)}const vn=[];for(let n=0;n<256;++n)vn.push((n+256).toString(16).slice(1));function gCt(n,e=0){return vn[n[e+0]]+vn[n[e+1]]+vn[n[e+2]]+vn[n[e+3]]+"-"+vn[n[e+4]]+vn[n[e+5]]+"-"+vn[n[e+6]]+vn[n[e+7]]+"-"+vn[n[e+8]]+vn[n[e+9]]+"-"+vn[n[e+10]]+vn[n[e+11]]+vn[n[e+12]]+vn[n[e+13]]+vn[n[e+14]]+vn[n[e+15]]}const bCt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),r2={randomUUID:bCt};function xu(n,e,t){if(r2.randomUUID&&!e&&!n)return r2.randomUUID();n=n||{};const s=n.random||(n.rng||hCt)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,gCt(s)}const ec="SAVE_SUBGRAPH";function yCt(n,e){const t=()=>{const s=n.value;if(!s.template)throw new Error("Graph template property not set");s.template.update(s.save()),s.template.panning=s.panning,s.template.scaling=s.scaling};e.registerCommand(ec,{canExecute:()=>{var s;return n.value!==((s=n.value.editor)==null?void 0:s.graph)},execute:t})}const ECt={},vCt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},SCt=l("polyline",{points:"6 9 12 15 18 9"},null,-1),TCt=[SCt];function xCt(n,e){return T(),x("svg",vCt,TCt)}const CCt=sn(ECt,[["render",xCt]]),wCt=cn({components:{"i-arrow":CCt},props:{intf:{type:Object,required:!0}},setup(n){const e=ot(null),t=ot(!1),s=Je(()=>n.intf.items.find(o=>typeof o=="string"?o===n.intf.value:o.value===n.intf.value)),r=Je(()=>s.value?typeof s.value=="string"?s.value:s.value.text:""),i=o=>{n.intf.value=typeof o=="string"?o:o.value};return PO(e,()=>{t.value=!1}),{el:e,open:t,selectedItem:s,selectedText:r,setSelected:i}}}),RCt=["title"],ACt={class:"__selected"},MCt={class:"__text"},NCt={class:"__icon"},OCt={class:"__dropdown"},ICt={class:"item --header"},kCt=["onClick"];function DCt(n,e,t,s,r,i){const o=nt("i-arrow");return T(),x("div",{ref:"el",class:Le(["baklava-select",{"--open":n.open}]),title:n.intf.name,onClick:e[0]||(e[0]=a=>n.open=!n.open)},[l("div",ACt,[l("div",MCt,Y(n.selectedText),1),l("div",NCt,[z(o)])]),z(Or,{name:"slide-fade"},{default:Ie(()=>[k(l("div",OCt,[l("div",ICt,Y(n.intf.name),1),(T(!0),x(Be,null,Ke(n.intf.items,(a,c)=>(T(),x("div",{key:c,class:Le(["item",{"--active":a===n.selectedItem}]),onClick:d=>n.setSelected(a)},Y(typeof a=="string"?a:a.text),11,kCt))),128))],512),[[ht,n.open]])]),_:1})],10,RCt)}const LCt=sn(wCt,[["render",DCt]]);class PCt extends en{constructor(e,t,s){super(e,t),this.component=ku(LCt),this.items=s}}const FCt=cn({props:{intf:{type:Object,required:!0}}});function UCt(n,e,t,s,r,i){return T(),x("div",null,Y(n.intf.value),1)}const BCt=sn(FCt,[["render",UCt]]);class GCt extends en{constructor(e,t){super(e,t),this.component=ku(BCt),this.setPort(!1)}}const VCt=cn({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(n,{emit:e}){return{v:Je({get:()=>n.modelValue,set:s=>{e("update:modelValue",s)}})}}}),zCt=["placeholder","title"];function HCt(n,e,t,s,r,i){return T(),x("div",null,[k(l("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>n.v=o),type:"text",class:"baklava-input",placeholder:n.intf.name,title:n.intf.name},null,8,zCt),[[ae,n.v]])])}const qCt=sn(VCt,[["render",HCt]]);class mc extends en{constructor(){super(...arguments),this.component=ku(qCt)}}class GO extends wy{constructor(){super(...arguments),this._title="Subgraph Input",this.inputs={name:new mc("Name","Input").setPort(!1)},this.outputs={placeholder:new en("Connection",void 0)}}}class VO extends Ry{constructor(){super(...arguments),this._title="Subgraph Output",this.inputs={name:new mc("Name","Output").setPort(!1),placeholder:new en("Connection",void 0)},this.outputs={output:new en("Output",void 0).setHidden(!0)}}}const zO="CREATE_SUBGRAPH",i2=[Ma,Na];function YCt(n,e,t){const s=()=>n.value.selectedNodes.filter(i=>!i2.includes(i.type)).length>0,r=()=>{const{viewModel:i}=ds(),o=n.value,a=n.value.editor;if(o.selectedNodes.length===0)return;const c=o.selectedNodes.filter(C=>!i2.includes(C.type)),d=c.flatMap(C=>Object.values(C.inputs)),u=c.flatMap(C=>Object.values(C.outputs)),_=o.connections.filter(C=>!u.includes(C.from)&&d.includes(C.to)),m=o.connections.filter(C=>u.includes(C.from)&&!d.includes(C.to)),h=o.connections.filter(C=>u.includes(C.from)&&d.includes(C.to)),f=c.map(C=>C.save()),y=h.map(C=>({id:C.id,from:C.from.id,to:C.to.id})),b=new Map,{xLeft:g,xRight:E,yTop:v}=$Ct(c);for(const[C,M]of _.entries()){const G=new GO;G.inputs.name.value=M.to.name,f.push({...G.save(),position:{x:E-i.value.settings.nodes.defaultWidth-100,y:v+C*200}}),y.push({id:xu(),from:G.outputs.placeholder.id,to:M.to.id}),b.set(M.to.id,G.graphInterfaceId)}for(const[C,M]of m.entries()){const G=new VO;G.inputs.name.value=M.from.name,f.push({...G.save(),position:{x:g+100,y:v+C*200}}),y.push({id:xu(),from:M.from.id,to:G.inputs.placeholder.id}),b.set(M.from.id,G.graphInterfaceId)}const S=Hn(new Ep({connections:y,nodes:f,inputs:[],outputs:[]},a));a.addGraphTemplate(S);const R=a.nodeTypes.get(Oa(S));if(!R)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");o.activeTransactions++;const w=Hn(new R.type);o.addNode(w);const A=Math.round(c.map(C=>C.position.x).reduce((C,M)=>C+M,0)/c.length),I=Math.round(c.map(C=>C.position.y).reduce((C,M)=>C+M,0)/c.length);w.position.x=A,w.position.y=I,_.forEach(C=>{o.removeConnection(C),o.addConnection(C.from,w.inputs[b.get(C.to.id)])}),m.forEach(C=>{o.removeConnection(C),o.addConnection(w.outputs[b.get(C.from.id)],C.to)}),c.forEach(C=>o.removeNode(C)),o.activeTransactions--,e.canExecuteCommand(ec)&&e.executeCommand(ec),t(S),n.value.panning={...o.panning},n.value.scaling=o.scaling};e.registerCommand(zO,{canExecute:s,execute:r})}function $Ct(n){const e=n.reduce((r,i)=>{const o=i.position.x;return o{const o=i.position.y;return o{const o=i.position.x+i.width;return o>r?o:r},-1/0),xRight:e,yTop:t}}class o2{constructor(e,t){this.type=e,e==="addNode"?this.nodeId=t:this.nodeState=t}undo(e){this.type==="addNode"?this.removeNode(e):this.addNode(e)}redo(e){this.type==="addNode"&&this.nodeState?this.addNode(e):this.type==="removeNode"&&this.nodeId&&this.removeNode(e)}addNode(e){const t=e.editor.nodeTypes.get(this.nodeState.type);if(!t)return;const s=new t.type;e.addNode(s),s.load(this.nodeState),this.nodeId=s.id}removeNode(e){const t=e.nodes.find(s=>s.id===this.nodeId);t&&(this.nodeState=t.save(),e.removeNode(t))}}class a2{constructor(e,t){if(this.type=e,e==="addConnection")this.connectionId=t;else{const s=t;this.connectionState={id:s.id,from:s.from.id,to:s.to.id}}}undo(e){this.type==="addConnection"?this.removeConnection(e):this.addConnection(e)}redo(e){this.type==="addConnection"&&this.connectionState?this.addConnection(e):this.type==="removeConnection"&&this.connectionId&&this.removeConnection(e)}addConnection(e){const t=e.findNodeInterface(this.connectionState.from),s=e.findNodeInterface(this.connectionState.to);if(!t||!s)return;const r=e.addConnection(t,s);r&&(r.id=this.connectionState.id),this.connectionId=r==null?void 0:r.id}removeConnection(e){const t=e.connections.find(s=>s.id===this.connectionId);t&&(this.connectionState={id:t.id,from:t.from.id,to:t.to.id},e.removeConnection(t))}}class WCt{constructor(e){if(this.type="transaction",e.length===0)throw new Error("Can't create a transaction with no steps");this.steps=e}undo(e){for(let t=this.steps.length-1;t>=0;t--)this.steps[t].undo(e)}redo(e){for(let t=0;t{if(!i.value)if(a.value)c.value.push(b);else for(o.value!==r.value.length-1&&(r.value=r.value.slice(0,o.value+1)),r.value.push(b),o.value++;r.value.length>s.value;)r.value.shift()},u=()=>{a.value=!0},_=()=>{a.value=!1,c.value.length>0&&(d(new WCt(c.value)),c.value=[])},m=()=>r.value.length!==0&&o.value!==-1,h=()=>{m()&&(i.value=!0,r.value[o.value--].undo(n.value),i.value=!1)},f=()=>r.value.length!==0&&o.value{f()&&(i.value=!0,r.value[++o.value].redo(n.value),i.value=!1)};return Tn(n,(b,g)=>{g&&(g.events.addNode.unsubscribe(t),g.events.removeNode.unsubscribe(t),g.events.addConnection.unsubscribe(t),g.events.removeConnection.unsubscribe(t)),b&&(b.events.addNode.subscribe(t,E=>{d(new o2("addNode",E.id))}),b.events.removeNode.subscribe(t,E=>{d(new o2("removeNode",E.save()))}),b.events.addConnection.subscribe(t,E=>{d(new a2("addConnection",E.id))}),b.events.removeConnection.subscribe(t,E=>{d(new a2("removeConnection",E))}))},{immediate:!0}),e.registerCommand(Nb,{canExecute:m,execute:h}),e.registerCommand(Ob,{canExecute:f,execute:y}),e.registerCommand(Oy,{canExecute:()=>!a.value,execute:u}),e.registerCommand(Iy,{canExecute:()=>a.value,execute:_}),e.registerHotkey(["Control","z"],Nb),e.registerHotkey(["Control","y"],Ob),Hn({maxSteps:s})}const Ib="DELETE_NODES";function jCt(n,e){e.registerCommand(Ib,{canExecute:()=>n.value.selectedNodes.length>0,execute(){e.executeCommand(Oy);for(let t=n.value.selectedNodes.length-1;t>=0;t--){const s=n.value.selectedNodes[t];n.value.removeNode(s)}e.executeCommand(Iy)}}),e.registerHotkey(["Delete"],Ib)}const HO="SWITCH_TO_MAIN_GRAPH";function QCt(n,e,t){e.registerCommand(HO,{canExecute:()=>n.value!==n.value.editor.graph,execute:()=>{e.executeCommand(ec),t(n.value.editor.graph)}})}function XCt(n,e,t){jCt(n,e),YCt(n,e,t),yCt(n,e),QCt(n,e,t)}const kb="COPY",Db="PASTE",ZCt="CLEAR_CLIPBOARD";function JCt(n,e,t){const s=Symbol("ClipboardToken"),r=ot(""),i=ot(""),o=Je(()=>!r.value),a=()=>{r.value="",i.value=""},c=()=>{const _=n.value.selectedNodes.flatMap(h=>[...Object.values(h.inputs),...Object.values(h.outputs)]),m=n.value.connections.filter(h=>_.includes(h.from)||_.includes(h.to)).map(h=>({from:h.from.id,to:h.to.id}));i.value=JSON.stringify(m),r.value=JSON.stringify(n.value.selectedNodes.map(h=>h.save()))},d=(_,m,h)=>{for(const f of _){let y;if((!h||h==="input")&&(y=Object.values(f.inputs).find(b=>b.id===m)),!y&&(!h||h==="output")&&(y=Object.values(f.outputs).find(b=>b.id===m)),y)return y}},u=()=>{if(o.value)return;const _=new Map,m=JSON.parse(r.value),h=JSON.parse(i.value),f=[],y=[],b=n.value;t.executeCommand(Oy);for(const g of m){const E=e.value.nodeTypes.get(g.type);if(!E){console.warn(`Node type ${g.type} not registered`);return}const v=new E.type,S=v.id;f.push(v),v.hooks.beforeLoad.subscribe(s,R=>{const w=R;return w.position&&(w.position.x+=100,w.position.y+=100),v.hooks.beforeLoad.unsubscribe(s),w}),b.addNode(v),v.load({...g,id:S}),v.id=S,_.set(g.id,S);for(const R of Object.values(v.inputs)){const w=xu();_.set(R.id,w),R.id=w}for(const R of Object.values(v.outputs)){const w=xu();_.set(R.id,w),R.id=w}}for(const g of h){const E=d(f,_.get(g.from),"output"),v=d(f,_.get(g.to),"input");if(!E||!v)continue;const S=b.addConnection(E,v);S&&y.push(S)}return n.value.selectedNodes=f,t.executeCommand(Iy),{newNodes:f,newConnections:y}};return t.registerCommand(kb,{canExecute:()=>n.value.selectedNodes.length>0,execute:c}),t.registerHotkey(["Control","c"],kb),t.registerCommand(Db,{canExecute:()=>!o.value,execute:u}),t.registerHotkey(["Control","v"],Db),t.registerCommand(ZCt,{canExecute:()=>!0,execute:a}),Hn({isEmpty:o})}const ewt="OPEN_SIDEBAR";function twt(n,e){e.registerCommand(ewt,{execute:t=>{n.value.sidebar.nodeId=t,n.value.sidebar.visible=!0},canExecute:()=>!0})}function nwt(n,e){twt(n,e)}const swt={},rwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},iwt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),owt=l("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"},null,-1),awt=[iwt,owt];function lwt(n,e){return T(),x("svg",rwt,awt)}const cwt=sn(swt,[["render",lwt]]),dwt={},uwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},pwt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),fwt=l("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"},null,-1),_wt=[pwt,fwt];function mwt(n,e){return T(),x("svg",uwt,_wt)}const hwt=sn(dwt,[["render",mwt]]),gwt={},bwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},ywt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Ewt=l("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1),vwt=l("line",{x1:"5",y1:"12",x2:"11",y2:"18"},null,-1),Swt=l("line",{x1:"5",y1:"12",x2:"11",y2:"6"},null,-1),Twt=[ywt,Ewt,vwt,Swt];function xwt(n,e){return T(),x("svg",bwt,Twt)}const Cwt=sn(gwt,[["render",xwt]]),wwt={},Rwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Awt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Mwt=l("path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2"},null,-1),Nwt=l("rect",{x:"9",y:"3",width:"6",height:"4",rx:"2"},null,-1),Owt=[Awt,Mwt,Nwt];function Iwt(n,e){return T(),x("svg",Rwt,Owt)}const kwt=sn(wwt,[["render",Iwt]]),Dwt={},Lwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Pwt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Fwt=l("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1),Uwt=l("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"},null,-1),Bwt=[Pwt,Fwt,Uwt];function Gwt(n,e){return T(),x("svg",Lwt,Bwt)}const Vwt=sn(Dwt,[["render",Gwt]]),zwt={},Hwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},qwt=l("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Ywt=l("path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"},null,-1),$wt=l("circle",{cx:"12",cy:"14",r:"2"},null,-1),Wwt=l("polyline",{points:"14 4 14 8 8 8 8 4"},null,-1),Kwt=[qwt,Ywt,$wt,Wwt];function jwt(n,e){return T(),x("svg",Hwt,Kwt)}const Qwt=sn(zwt,[["render",jwt]]),Xwt={},Zwt={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Jwt=mi('',6),e2t=[Jwt];function t2t(n,e){return T(),x("svg",Zwt,e2t)}const n2t=sn(Xwt,[["render",t2t]]),s2t={},r2t={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},i2t=mi('',18),o2t=[i2t];function a2t(n,e){return T(),x("svg",r2t,o2t)}const l2t=sn(s2t,[["render",a2t]]),c2t={},d2t={xmlns:"http://www.w3.org/2000/svg",class:"baklava-icon",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},u2t=mi('',6),p2t=[u2t];function f2t(n,e){return T(),x("svg",d2t,p2t)}const _2t=sn(c2t,[["render",f2t]]),m2t=cn({props:{command:{type:String,required:!0},title:{type:String,required:!0},icon:{type:Object,required:!1,default:void 0}},setup(){const{viewModel:n}=ds();return{viewModel:n}}}),h2t=["disabled","title"];function g2t(n,e,t,s,r,i){return T(),x("button",{class:"baklava-toolbar-entry baklava-toolbar-button",disabled:!n.viewModel.commandHandler.canExecuteCommand(n.command),title:n.title,onClick:e[0]||(e[0]=o=>n.viewModel.commandHandler.executeCommand(n.command))},[n.icon?(T(),at(Fu(n.icon),{key:0})):(T(),x(Be,{key:1},[Ze(Y(n.title),1)],64))],8,h2t)}const b2t=sn(m2t,[["render",g2t]]),y2t=cn({components:{ToolbarButton:b2t},setup(){const{viewModel:n}=ds();return{isSubgraph:Je(()=>n.value.displayedGraph!==n.value.editor.graph),commands:[{command:kb,title:"Copy",icon:Vwt},{command:Db,title:"Paste",icon:kwt},{command:Ib,title:"Delete selected nodes",icon:_2t},{command:Nb,title:"Undo",icon:cwt},{command:Ob,title:"Redo",icon:hwt},{command:Ld,title:"Box Select",icon:l2t},{command:zO,title:"Create Subgraph",icon:n2t}],subgraphCommands:[{command:ec,title:"Save Subgraph",icon:Qwt},{command:HO,title:"Back to Main Graph",icon:Cwt}]}}});function E2t(n,e,t,s,r,i){const o=nt("toolbar-button");return T(),x("div",{class:"baklava-toolbar",onContextmenu:e[0]||(e[0]=$(()=>{},["stop","prevent"]))},[(T(!0),x(Be,null,Ke(n.commands,a=>(T(),at(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)),n.isSubgraph?(T(!0),x(Be,{key:0},Ke(n.subgraphCommands,a=>(T(),at(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)):B("",!0)],32)}const v2t=sn(y2t,[["render",E2t]]),S2t={class:"connections-container"},T2t=cn({__name:"Editor",props:{viewModel:{}},setup(n){const e=n,t=Symbol("EditorToken"),s=Bd(e,"viewModel");oxt(s);const r=ot(null);na("editorEl",r);const i=Je(()=>e.viewModel.displayedGraph.nodes),o=Je(()=>e.viewModel.displayedGraph.nodes.map(I=>NO(Bd(I,"position")))),a=Je(()=>e.viewModel.displayedGraph.connections),c=Je(()=>e.viewModel.displayedGraph.selectedNodes),d=axt(),u=lxt(),_=cxt(s),m=dxt(r),h=Je(()=>({...d.styles.value})),f=ot(0);e.viewModel.editor.hooks.load.subscribe(t,I=>(f.value++,I));const y=I=>{d.onPointerMove(I),u.onMouseMove(I)},b=I=>{if(I.button===0){if(m.onPointerDown(I))return;I.target===r.value&&(R(),d.onPointerDown(I)),u.onMouseDown()}},g=I=>{d.onPointerUp(I),u.onMouseUp()},E=I=>{I.key==="Tab"&&I.preventDefault(),e.viewModel.commandHandler.handleKeyDown(I)},v=I=>{e.viewModel.commandHandler.handleKeyUp(I)},S=I=>{["Control","Shift"].some(C=>e.viewModel.commandHandler.pressedKeys.includes(C))||R(),e.viewModel.displayedGraph.selectedNodes.push(I)},R=()=>{e.viewModel.displayedGraph.selectedNodes=[]},w=I=>{for(const C of e.viewModel.displayedGraph.selectedNodes){const M=i.value.indexOf(C),G=o.value[M];G.onPointerDown(I),document.addEventListener("pointermove",G.onPointerMove)}document.addEventListener("pointerup",A)},A=()=>{for(const I of e.viewModel.displayedGraph.selectedNodes){const C=i.value.indexOf(I),M=o.value[C];M.onPointerUp(),document.removeEventListener("pointermove",M.onPointerMove)}document.removeEventListener("pointerup",A)};return(I,C)=>(T(),x("div",{ref_key:"el",ref:r,tabindex:"-1",class:Le(["baklava-editor",{"baklava-ignore-mouse":!!bt(u).temporaryConnection.value||bt(d).dragging.value,"--temporary-connection":!!bt(u).temporaryConnection.value,"--start-selection-box":bt(m).startSelection}]),onPointermove:$(y,["self"]),onPointerdown:b,onPointerup:g,onWheel:C[1]||(C[1]=$((...M)=>bt(d).onMouseWheel&&bt(d).onMouseWheel(...M),["self"])),onKeydown:E,onKeyup:v,onContextmenu:C[2]||(C[2]=(...M)=>bt(_).open&&bt(_).open(...M))},[on(I.$slots,"background",{},()=>[z(fxt)]),on(I.$slots,"toolbar",{},()=>[I.viewModel.settings.toolbar.enabled?(T(),at(v2t,{key:0})):B("",!0)]),on(I.$slots,"palette",{},()=>[I.viewModel.settings.palette.enabled?(T(),at(_Ct,{key:0})):B("",!0)]),(T(),x("svg",S2t,[(T(!0),x(Be,null,Ke(a.value,M=>(T(),x("g",{key:M.id+f.value.toString()},[on(I.$slots,"connection",{connection:M},()=>[z(Xxt,{connection:M},null,8,["connection"])])]))),128)),on(I.$slots,"temporaryConnection",{temporaryConnection:bt(u).temporaryConnection.value},()=>[bt(u).temporaryConnection.value?(T(),at(eCt,{key:0,connection:bt(u).temporaryConnection.value},null,8,["connection"])):B("",!0)])])),l("div",{class:"node-container",style:Bt(h.value)},[z(Ir,{name:"fade"},{default:Ie(()=>[(T(!0),x(Be,null,Ke(i.value,(M,G)=>on(I.$slots,"node",{key:M.id+f.value.toString(),node:M,selected:c.value.includes(M),dragging:o.value[G].dragging.value,onSelect:V=>S(M),onStartDrag:w},()=>[z(qxt,{node:M,selected:c.value.includes(M),dragging:o.value[G].dragging.value,onSelect:V=>S(M),onStartDrag:w},null,8,["node","selected","dragging","onSelect"])])),128))]),_:3})],4),on(I.$slots,"sidebar",{},()=>[I.viewModel.settings.sidebar.enabled?(T(),at(iCt,{key:0})):B("",!0)]),on(I.$slots,"minimap",{},()=>[I.viewModel.settings.enableMinimap?(T(),at(oCt,{key:0})):B("",!0)]),on(I.$slots,"contextMenu",{contextMenu:bt(_)},()=>[I.viewModel.settings.contextMenu.enabled?(T(),at(Ny,{key:0,modelValue:bt(_).show.value,"onUpdate:modelValue":C[0]||(C[0]=M=>bt(_).show.value=M),items:bt(_).items.value,x:bt(_).x.value,y:bt(_).y.value,onClick:bt(_).onClick},null,8,["modelValue","items","x","y","onClick"])):B("",!0)]),bt(m).isSelecting?(T(),x("div",{key:0,class:"selection-box",style:Bt(bt(m).getStyles())},null,4)):B("",!0)],34))}});function x2t(n){const e=ot([]),t=ot([]);return{pressedKeys:e,handleKeyDown:o=>{e.value.includes(o.key)||e.value.push(o.key),!(document.activeElement&&MO(document.activeElement))&&t.value.forEach(a=>{var c,d;a.keys.every(u=>e.value.includes(u))&&((c=a.options)!=null&&c.preventDefault&&o.preventDefault(),(d=a.options)!=null&&d.stopPropagation&&o.stopPropagation(),n(a.commandName))})},handleKeyUp:o=>{const a=e.value.indexOf(o.key);a>=0&&e.value.splice(a,1)},registerHotkey:(o,a,c)=>{t.value.push({keys:o,commandName:a,options:c})}}}const C2t=()=>{const n=ot(new Map),e=o=>n.value.has(o),t=(o,a)=>{if(n.value.has(o))throw new Error(`Command "${o}" already exists`);n.value.set(o,a)},s=(o,a=!1,...c)=>{if(!n.value.has(o)){if(a)throw new Error(`[CommandHandler] Command ${o} not registered`);return}return n.value.get(o).execute(...c)},r=(o,a=!1,...c)=>{if(!n.value.has(o)){if(a)throw new Error(`[CommandHandler] Command ${o} not registered`);return!1}return n.value.get(o).canExecute(c)},i=x2t(s);return Hn({hasCommand:e,registerCommand:t,executeCommand:s,canExecuteCommand:r,...i})},w2t=n=>!(n instanceof _c);function R2t(n,e){return{switchGraph:s=>{let r;if(w2t(s))r=new _c(n.value),s.createGraph(r);else{if(s!==n.value.graph)throw new Error("Can only switch using 'Graph' instance when it is the root graph. Otherwise a 'GraphTemplate' must be used.");r=s}e.value&&e.value!==n.value.graph&&e.value.destroy(),r.panning=r.panning??s.panning??{x:0,y:0},r.scaling=r.scaling??s.scaling??1,r.selectedNodes=r.selectedNodes??[],r.sidebar=r.sidebar??{visible:!1,nodeId:"",optionName:""},e.value=r}}}function A2t(n,e){n.position=n.position??{x:0,y:0},n.disablePointerEvents=!1,n.twoColumn=n.twoColumn??!1,n.width=n.width??e.defaultWidth}const M2t=()=>({useStraightConnections:!1,enableMinimap:!1,toolbar:{enabled:!0},palette:{enabled:!0},background:{gridSize:100,gridDivision:5,subGridVisibleThreshold:.6},sidebar:{enabled:!0,width:300,resizable:!0},displayValueOnHover:!1,nodes:{defaultWidth:200,maxWidth:320,minWidth:150,resizable:!1,reverseY:!1},contextMenu:{enabled:!0,additionalItems:[]}});function N2t(n){const e=ot(new JTt),t=Symbol("ViewModelToken"),s=ot(null),r=VI(s),{switchGraph:i}=R2t(e,s),o=Je(()=>r.value&&r.value!==e.value.graph),a=Hn(M2t()),c=C2t(),d=KCt(r,c),u=JCt(r,e,c),_={renderNode:new cs(null),renderInterface:new cs(null)};return XCt(r,c,i),nwt(r,c),Tn(e,(m,h)=>{h&&(h.events.registerGraph.unsubscribe(t),h.graphEvents.beforeAddNode.unsubscribe(t),m.nodeHooks.beforeLoad.unsubscribe(t),m.nodeHooks.afterSave.unsubscribe(t),m.graphTemplateHooks.beforeLoad.unsubscribe(t),m.graphTemplateHooks.afterSave.unsubscribe(t),m.graph.hooks.load.unsubscribe(t),m.graph.hooks.save.unsubscribe(t)),m&&(m.nodeHooks.beforeLoad.subscribe(t,(f,y)=>(y.position=f.position??{x:0,y:0},y.width=f.width??a.nodes.defaultWidth,y.twoColumn=f.twoColumn??!1,f)),m.nodeHooks.afterSave.subscribe(t,(f,y)=>(f.position=y.position,f.width=y.width,f.twoColumn=y.twoColumn,f)),m.graphTemplateHooks.beforeLoad.subscribe(t,(f,y)=>(y.panning=f.panning,y.scaling=f.scaling,f)),m.graphTemplateHooks.afterSave.subscribe(t,(f,y)=>(f.panning=y.panning,f.scaling=y.scaling,f)),m.graph.hooks.load.subscribe(t,(f,y)=>(y.panning=f.panning,y.scaling=f.scaling,f)),m.graph.hooks.save.subscribe(t,(f,y)=>(f.panning=y.panning,f.scaling=y.scaling,f)),m.graphEvents.beforeAddNode.subscribe(t,f=>A2t(f,{defaultWidth:a.nodes.defaultWidth})),e.value.registerNodeType(GO,{category:"Subgraphs"}),e.value.registerNodeType(VO,{category:"Subgraphs"}),i(m.graph))},{immediate:!0}),Hn({editor:e,displayedGraph:r,isSubgraph:o,settings:a,commandHandler:c,history:d,clipboard:u,hooks:_,switchGraph:i})}const O2t=Ka({type:"PersonalityNode",title:"Personality",inputs:{request:()=>new en("Request",""),agent_name:()=>new PCt("Personality","",Ps.state.config.personalities).setPort(!1)},outputs:{response:()=>new en("Response","")},async calculate({request:n}){console.log(Ps.state.config.personalities);let e="";try{e=(await ne.post("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),I2t=Ka({type:"RAGNode",title:"RAG",inputs:{request:()=>new en("Prompt",""),document_path:()=>new mc("Document path","").setPort(!1)},outputs:{prompt:()=>new en("Prompt with Data","")},async calculate({request:n,document_path:e}){let t="";try{t=(await ne.get("/rag",{params:{text:n,doc_path:e}})).data}catch(s){console.error(s)}return{response:t}}}),l2=Ka({type:"Task",title:"Task",inputs:{description:()=>new mc("Task description","").setPort(!1)},outputs:{prompt:()=>new en("Prompt")},calculate({description:n}){return{prompt:n}}}),c2=Ka({type:"TextDisplayNode",title:"TextDisplay",inputs:{text2display:()=>new en("Input","")},outputs:{response:()=>new GCt("Text","")},async calculate({request:n}){}}),d2=Ka({type:"LLMNode",title:"LLM",inputs:{request:()=>new en("Request","")},outputs:{response:()=>new en("Response","")},async calculate({request:n}){console.log(Ps.state.config.personalities);let e="";try{e=(await ne.post("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),k2t=Ka({type:"MultichoiceNode",title:"Multichoice",inputs:{question:()=>new en("Question",""),outputs:()=>new mc("choices, one per line","","").setPort(!1)},outputs:{response:()=>new en("Response","")}}),D2t=cn({components:{"baklava-editor":T2t},setup(){const n=N2t(),e=new rxt(n.editor);n.editor.registerNodeType(O2t),n.editor.registerNodeType(l2),n.editor.registerNodeType(I2t),n.editor.registerNodeType(c2),n.editor.registerNodeType(d2),n.editor.registerNodeType(k2t);const t=Symbol();e.events.afterRun.subscribe(t,a=>{e.pause(),ext(a,n.editor),e.resume()}),e.start();function s(a,c,d){const u=new a;return n.displayedGraph.addNode(u),u.position.x=c,u.position.y=d,u}const r=s(l2,300,140),i=s(d2,550,140),o=s(c2,850,140);return n.displayedGraph.addConnection(r.outputs.prompt,i.inputs.request),n.displayedGraph.addConnection(i.outputs.response,o.inputs.text2display),{baklava:n,saveGraph:()=>{const a=e.export();localStorage.setItem("myGraph",JSON.stringify(a))},loadGraph:()=>{const a=JSON.parse(localStorage.getItem("myGraph"));e.import(a)}}}}),L2t={style:{width:"100vw",height:"100vh"}};function P2t(n,e,t,s,r,i){const o=nt("baklava-editor");return T(),x("div",L2t,[z(o,{"view-model":n.baklava},null,8,["view-model"]),l("button",{onClick:e[0]||(e[0]=(...a)=>n.saveGraph&&n.saveGraph(...a))},"Save Graph"),l("button",{onClick:e[1]||(e[1]=(...a)=>n.loadGraph&&n.loadGraph(...a))},"Load Graph")])}const F2t=rt(D2t,[["render",P2t]]),U2t={},B2t={style:{width:"100vw",height:"100vh"}},G2t=["src"];function V2t(n,e,t,s,r,i){return T(),x("div",B2t,[l("iframe",{src:n.$store.state.config.comfyui_base_url,class:"m-0 p-0 w-full h-full"},null,8,G2t)])}const z2t=rt(U2t,[["render",V2t]]),H2t={},q2t={style:{width:"100vw",height:"100vh"}},Y2t=["src"];function $2t(n,e,t,s,r,i){return T(),x("div",q2t,[l("iframe",{src:n.$store.state.config.sd_base_url,class:"m-0 p-0 w-full h-full"},null,8,Y2t)])}const W2t=rt(H2t,[["render",$2t]]),K2t={name:"AppCard",props:{app:{type:Object,required:!0},isFavorite:{type:Boolean,default:!1}},methods:{formatDate(n){const e={year:"numeric",month:"short",day:"numeric"};return new Date(n).toLocaleDateString(void 0,e)}}},j2t={class:"app-card bg-white border rounded-xl shadow-lg p-6 hover:shadow-xl transition duration-300 ease-in-out flex flex-col h-full"},Q2t={class:"flex-grow"},X2t={class:"flex items-center mb-4"},Z2t=["src"],J2t={class:"font-bold text-xl text-gray-800"},eRt={class:"text-sm text-gray-600"},tRt={class:"text-sm text-gray-600"},nRt={class:"text-sm text-gray-600"},sRt={class:"text-sm text-gray-600"},rRt={class:"text-sm text-gray-600"},iRt={class:"mb-4"},oRt={class:"text-sm text-gray-600 h-20 overflow-y-auto"},aRt={class:"text-sm text-gray-600 mb-2"},lRt={key:0,class:"mb-4"},cRt={class:"text-xs text-gray-500 italic h-16 overflow-y-auto"},dRt={class:"mt-auto pt-4 border-t"},uRt={class:"flex justify-between items-center flex-wrap"},pRt=["title"],fRt=["fill"];function _Rt(n,e,t,s,r,i){return T(),x("div",j2t,[l("div",Q2t,[l("div",X2t,[l("img",{src:t.app.icon,alt:"App Icon",class:"w-16 h-16 rounded-full border border-gray-300 mr-4"},null,8,Z2t),l("div",null,[l("h3",J2t,Y(t.app.name),1),l("p",eRt,"Author: "+Y(t.app.author),1),l("p",tRt,"Version: "+Y(t.app.version),1),l("p",nRt,"Category: "+Y(t.app.category),1),l("p",sRt,"Creation date: "+Y(i.formatDate(t.app.creation_date)),1),l("p",rRt,"Last update: "+Y(i.formatDate(t.app.last_update_date)),1),l("p",{class:Le(["text-sm",t.app.is_public?"text-green-600":"text-orange-600"])},Y(t.app.is_public?"Public App":"Local App"),3)])]),l("div",iRt,[e[10]||(e[10]=l("h4",{class:"font-semibold mb-1 text-gray-700"},"Description:",-1)),l("p",oRt,Y(t.app.description),1)]),l("p",aRt,"AI Model: "+Y(t.app.model_name),1),t.app.disclaimer&&t.app.disclaimer.trim()!==""?(T(),x("div",lRt,[e[11]||(e[11]=l("h4",{class:"font-semibold mb-1 text-gray-700"},"Disclaimer:",-1)),l("p",cRt,Y(t.app.disclaimer),1)])):B("",!0)]),l("div",dRt,[l("div",uRt,[l("button",{onClick:e[0]||(e[0]=$(o=>n.$emit("toggle-favorite",t.app.name),["stop"])),class:"text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out",title:t.isFavorite?"Remove from favorites":"Add to favorites"},[(T(),x("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:t.isFavorite?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor"},e[12]||(e[12]=[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"},null,-1)]),8,fRt))],8,pRt),t.app.installed?(T(),x("button",{key:0,onClick:e[1]||(e[1]=$(o=>n.$emit("uninstall",t.app.folder_name),["stop"])),class:"text-red-500 hover:text-red-600 transition duration-300 ease-in-out",title:"Uninstall"},e[13]||(e[13]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]))):t.app.existsInFolder?(T(),x("button",{key:1,onClick:e[2]||(e[2]=$(o=>n.$emit("delete",t.app.name),["stop"])),class:"text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out",title:"Delete"},e[14]||(e[14]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]))):(T(),x("button",{key:2,onClick:e[3]||(e[3]=$(o=>n.$emit("install",t.app.folder_name),["stop"])),class:"text-blue-500 hover:text-blue-600 transition duration-300 ease-in-out",title:"Install"},e[15]||(e[15]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)]))),t.app.installed?(T(),x("button",{key:3,onClick:e[4]||(e[4]=$(o=>n.$emit("edit",t.app),["stop"])),class:"text-purple-500 hover:text-purple-600 transition duration-300 ease-in-out",title:"Edit"},e[16]||(e[16]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1)]))):B("",!0),l("button",{onClick:e[5]||(e[5]=$(o=>n.$emit("download",t.app.folder_name),["stop"])),class:"text-green-500 hover:text-green-600 transition duration-300 ease-in-out",title:"Download"},e[17]||(e[17]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)])),t.app.has_readme?(T(),x("button",{key:4,onClick:e[6]||(e[6]=$(o=>n.$emit("help",t.app),["stop"])),class:"text-gray-500 hover:text-gray-600 transition duration-300 ease-in-out",title:"Help"},e[18]||(e[18]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M12 21a9 9 0 100-18 9 9 0 000 18z"})],-1)]))):B("",!0),t.app.installed?(T(),x("button",{key:5,onClick:e[7]||(e[7]=$(o=>n.$emit("open",t.app),["stop"])),class:"text-indigo-500 hover:text-indigo-600 transition duration-300 ease-in-out",title:"Open"},e[19]||(e[19]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)]))):B("",!0),t.app.has_server&&t.app.installed?(T(),x("button",{key:6,onClick:e[8]||(e[8]=$(o=>n.$emit("start-server",t.app.folder_name),["stop"])),class:"text-teal-500 hover:text-teal-600 transition duration-300 ease-in-out",title:"Start Server"},e[20]||(e[20]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M12 5l7 7-7 7"})],-1)]))):B("",!0),t.app.has_update?(T(),x("button",{key:7,onClick:e[9]||(e[9]=$(o=>n.$emit("install",t.app.folder_name),["stop"])),class:"relative text-yellow-500 hover:text-yellow-600 transition duration-300 ease-in-out animate-pulse",title:"Update Available"},e[21]||(e[21]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),l("span",{class:"absolute top-0 right-0 inline-flex items-center justify-center px-2 py-1 text-xs font-bold leading-none text-red-100 transform translate-x-1/2 -translate-y-1/2 bg-red-600 rounded-full"},"!",-1)]))):B("",!0)])])])}const mRt=rt(K2t,[["render",_Rt],["__scopeId","data-v-a946557e"]]),hRt={components:{AppCard:mRt},data(){return{apps:[],githubApps:[],favorites:[],selectedCategory:"all",selectedApp:null,appCode:"",loading:!1,message:"",successMessage:!0,searchQuery:"",selectedFile:null,isUploading:!1,error:"",sortBy:"update",sortOrder:"desc",showOnlyInstalled:!1,showOnlyUnInstalled:!1}},computed:{currentCategoryName(){return this.selectedCategory==="all"?"All Apps":this.selectedCategory},combinedApps(){this.apps.map(e=>e.name);const n=new Map(this.apps.map(e=>[e.name,{...e,installed:!0,existsInFolder:!0}]));return this.githubApps.forEach(e=>{n.has(e.name)||n.set(e.name,{...e,installed:!1,existsInFolder:!1})}),Array.from(n.values())},categories(){return[...new Set(this.combinedApps.map(n=>n.category))]},filteredApps(){return this.combinedApps.filter(n=>{const e=n.name.toLowerCase().includes(this.searchQuery.toLowerCase())||n.description.toLowerCase().includes(this.searchQuery.toLowerCase())||n.author.toLowerCase().includes(this.searchQuery.toLowerCase()),t=this.selectedCategory==="all"||n.category===this.selectedCategory,s=this.showOnlyInstalled&&n.installed||this.showOnlyUnInstalled&&!n.installed||!this.showOnlyInstalled&&!this.showOnlyUnInstalled;return e&&t&&s})},sortedAndFilteredApps(){return this.filteredApps.sort((n,e)=>{let t=0;switch(this.sortBy){case"name":t=n.name.localeCompare(e.name);break;case"author":t=n.author.localeCompare(e.author);break;case"date":t=new Date(n.creation_date)-new Date(e.creation_date);break;case"update":t=new Date(n.last_update_date)-new Date(e.last_update_date);break}return this.sortOrder==="asc"?t:-t})},favoriteApps(){return this.combinedApps.filter(n=>this.favorites.includes(n.appName))}},methods:{toggleSortOrder(){this.sortOrder=this.sortOrder==="asc"?"desc":"asc"},toggleFavorite(n){console.log("Toggling favorite"),console.log(n);const e=this.favorites.indexOf(n);e===-1?this.favorites.push(n):this.favorites.splice(e,1),this.saveFavoritesToLocalStorage()},saveFavoritesToLocalStorage(){localStorage.setItem("appZooFavorites",JSON.stringify(this.favorites))},loadFavoritesFromLocalStorage(){const n=localStorage.getItem("appZooFavorites");console.log("savedFavorites",n),n&&(this.favorites=JSON.parse(n))},startServer(n){const e={client_id:this.$store.state.client_id,app_name:n};this.$store.state.messageBox.showBlockingMessage(`Loading server. +This may take some time the first time as some libraries need to be installed.`),ne.post("/apps/start_server",e).then(t=>{this.$store.state.messageBox.hideMessage(),console.log("Server start initiated:",t.data.message),this.$notify({type:"success",title:"Server Starting",text:t.data.message})}).catch(t=>{var s,r;this.$store.state.messageBox.hideMessage(),console.error("Error starting server:",t),this.$notify({type:"error",title:"Server Start Failed",text:((r=(s=t.response)==null?void 0:s.data)==null?void 0:r.detail)||"An error occurred while starting the server"})})},triggerFileInput(){this.$refs.fileInput.click()},onFileSelected(n){this.selectedFile=n.target.files[0],this.message="",this.error="",this.uploadApp()},async uploadApp(){var e,t;if(!this.selectedFile){this.error="Please select a file to upload.";return}this.isUploading=!0,this.message="",this.error="";const n=new FormData;n.append("file",this.selectedFile),n.append("client_id",this.$store.state.client_id);try{const s=await ne.post("/upload_app",n,{headers:{"Content-Type":"multipart/form-data"}});this.message=s.data.message,this.$refs.fileInput.value="",this.selectedFile=null}catch(s){console.error("Error uploading app:",s),this.error=((t=(e=s.response)==null?void 0:e.data)==null?void 0:t.detail)||"Failed to upload the app. Please try again."}finally{this.isUploading=!1}},async fetchApps(){this.loading=!0;try{const n=await ne.get("/apps");this.apps=n.data,this.showMessage("Refresh successful!",!0)}catch{this.showMessage("Failed to refresh apps.",!1)}finally{this.loading=!1}},async openAppsFolder(){this.loading=!0;try{console.log("opening apps folder");const n=await ne.post("/show_apps_folder",{client_id:this.$store.state.client_id})}catch{this.showMessage("Failed to open apps folder.",!1)}finally{this.loading=!1}},async fetchGithubApps(){this.loading=!0;try{const n=await ne.get("/github/apps");this.githubApps=n.data.apps,await this.fetchApps()}catch{this.showMessage("Failed to refresh GitHub apps.",!1)}finally{this.loading=!1}},async handleAppClick(n){if(n.installed){this.selectedApp=n;const e=await ne.get(`/apps/${n.folder_name}/README.md`);this.appCode=Pt(e.data)}else this.showMessage(`Please install ${n.folder_name} to view its code.`,!1)},backToZoo(){this.selectedApp=null,this.appCode=""},async installApp(n){this.loading=!0,this.$store.state.messageBox.showBlockingMessage(`Installing app ${n}`);try{await ne.post(`/install/${n}`,{client_id:this.$store.state.client_id}),this.showMessage("Installation succeeded!",!0)}catch{this.showMessage("Installation failed.",!1)}finally{this.loading=!1,this.fetchApps(),this.fetchGithubApps(),this.$store.state.messageBox.hideMessage()}},async uninstallApp(n){this.loading=!0;try{await ne.post(`/uninstall/${n}`,{client_id:this.$store.state.client_id}),this.showMessage("Uninstallation succeeded!",!0)}catch{this.showMessage("Uninstallation failed.",!1)}finally{this.loading=!1,this.fetchApps()}},async deleteApp(n){this.loading=!0;try{await ne.post(`/delete/${n}`,{client_id:this.$store.state.client_id}),this.showMessage("Deletion succeeded!",!0)}catch{this.showMessage("Deletion failed.",!1)}finally{this.loading=!1,this.fetchApps()}},async editApp(n){this.loading=!0;try{const e=await ne.post("/open_app_in_vscode",{client_id:this.$store.state.client_id,app_name:n.folder_name});this.showMessage(e.data.message,!0)}catch{this.showMessage("Failed to open folder in VSCode.",!1)}finally{this.loading=!1}},async downloadApp(n){this.isLoading=!0,this.error=null;try{const e=await ne.post("/download_app",{client_id:this.$store.state.client_id,app_name:n},{responseType:"arraybuffer"}),t=e.headers["content-disposition"],s=t&&t.match(/filename="?(.+)"?/i),r=s?s[1]:"app.zip",i=new Blob([e.data],{type:"application/zip"}),o=window.URL.createObjectURL(i),a=document.createElement("a");a.style.display="none",a.href=o,a.download=r,document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(o),document.body.removeChild(a)}catch(e){console.error("Error downloading app:",e),this.error="Failed to download the app. Please try again."}finally{this.isLoading=!1}},openApp(n){n.installed?window.open(`/apps/${n.folder_name}/index.html?client_id=${this.$store.state.client_id}`,"_blank"):this.showMessage(`Please install ${n.name} before opening.`,!1)},showMessage(n,e){this.message=n,this.successMessage=e,setTimeout(()=>{this.message=""},3e3)}},mounted(){this.fetchGithubApps(),this.loadFavoritesFromLocalStorage()}},gRt={class:"app-zoo background-color w-full p-6 pt-12 min-h-screen overflow-y-auto"},bRt={class:"panels-color shadow-lg rounded-lg p-4 max-w-4xl mx-auto mb-8"},yRt={class:"flex flex-wrap items-center justify-between gap-4"},ERt={class:"flex items-center space-x-4"},vRt=["disabled"],SRt={key:0},TRt={key:1,class:"error"},xRt={class:"relative flex-grow max-w-md"},CRt={class:"flex items-center space-x-4"},wRt=["value"],RRt={class:"flex items-center space-x-4"},ARt={for:"installed-only",class:"font-semibold"},MRt={for:"installed-only",class:"font-semibold"},NRt={class:"flex items-center space-x-4"},ORt={key:0,class:"flex justify-center items-center space-x-2 my-8","aria-live":"polite"},IRt={key:1,class:"pb-20"},kRt={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-8"},DRt={class:"text-2xl font-bold mb-4"},LRt={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"},PRt={key:2,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"},FRt={class:"bg-white rounded-lg p-6 w-11/12 h-5/6 flex flex-col"},URt={class:"flex justify-between items-center mb-4"},BRt={class:"text-2xl font-bold"},GRt=["srcdoc"],VRt={key:1,class:"text-center text-red-500"};function zRt(n,e,t,s,r,i){const o=nt("app-card");return T(),x("div",gRt,[l("nav",bRt,[l("div",yRt,[l("div",ERt,[l("button",{onClick:e[0]||(e[0]=(...a)=>i.fetchGithubApps&&i.fetchGithubApps(...a)),class:"btn btn-primary","aria-label":"Refresh apps from GitHub"},e[11]||(e[11]=[l("svg",{class:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),Ze(" Refresh ")])),l("button",{onClick:e[1]||(e[1]=(...a)=>i.openAppsFolder&&i.openAppsFolder(...a)),class:"btn btn-secondary","aria-label":"Open apps folder"},e[12]||(e[12]=[l("svg",{class:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"})],-1),Ze(" Open Folder ")])),l("input",{type:"file",onChange:e[2]||(e[2]=(...a)=>i.onFileSelected&&i.onFileSelected(...a)),accept:".zip",ref:"fileInput",style:{display:"none"}},null,544),l("button",{onClick:e[3]||(e[3]=(...a)=>i.triggerFileInput&&i.triggerFileInput(...a)),disabled:r.isUploading,class:"btn-secondary text-green-500 hover:text-green-600 transition duration-300 ease-in-out",title:"Upload App"},Y(r.isUploading?"Uploading...":"Upload App"),9,vRt)]),r.message?(T(),x("p",SRt,Y(r.message),1)):B("",!0),r.error?(T(),x("p",TRt,Y(r.error),1)):B("",!0),l("div",xRt,[k(l("input",{"onUpdate:modelValue":e[4]||(e[4]=a=>r.searchQuery=a),placeholder:"Search apps...",class:"w-full border-b-2 border-gray-300 px-4 py-2 pl-10 focus:outline-none focus:border-blue-500 transition duration-300 ease-in-out","aria-label":"Search apps"},null,512),[[ae,r.searchQuery]]),e[13]||(e[13]=l("svg",{class:"w-5 h-5 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))]),l("div",CRt,[e[15]||(e[15]=l("label",{for:"category-select",class:"font-semibold"},"Category:",-1)),k(l("select",{id:"category-select","onUpdate:modelValue":e[5]||(e[5]=a=>r.selectedCategory=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},[e[14]||(e[14]=l("option",{value:"all"},"All Categories",-1)),(T(!0),x(Be,null,Ke(i.categories,a=>(T(),x("option",{key:a,value:a},Y(a),9,wRt))),128))],512),[[Ot,r.selectedCategory]])]),l("div",RRt,[l("label",ARt,[k(l("input",{id:"installed-only",type:"checkbox","onUpdate:modelValue":e[6]||(e[6]=a=>r.showOnlyInstalled=a),class:"mr-2"},null,512),[[He,r.showOnlyInstalled]]),e[16]||(e[16]=Ze(" Show only installed apps "))]),l("label",MRt,[k(l("input",{id:"uninstalled-only",type:"checkbox","onUpdate:modelValue":e[7]||(e[7]=a=>r.showOnlyUnInstalled=a),class:"mr-2"},null,512),[[He,r.showOnlyUnInstalled]]),e[17]||(e[17]=Ze(" Show only non installed apps "))])]),l("div",NRt,[e[19]||(e[19]=l("label",{for:"sort-select",class:"font-semibold"},"Sort by:",-1)),k(l("select",{id:"sort-select","onUpdate:modelValue":e[8]||(e[8]=a=>r.sortBy=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},e[18]||(e[18]=[l("option",{value:"name"},"Name",-1),l("option",{value:"author"},"Author",-1),l("option",{value:"date"},"Creation Date",-1),l("option",{value:"update"},"Last Update",-1)]),512),[[Ot,r.sortBy]]),l("button",{onClick:e[9]||(e[9]=(...a)=>i.toggleSortOrder&&i.toggleSortOrder(...a)),class:"btn btn-secondary"},Y(r.sortOrder==="asc"?"↑":"↓"),1)])])]),r.loading?(T(),x("div",ORt,e[20]||(e[20]=[l("div",{class:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"},null,-1),l("span",{class:"text-xl text-gray-700 font-semibold"},"Loading...",-1)]))):(T(),x("div",IRt,[e[21]||(e[21]=l("h2",{class:"text-2xl font-bold mb-4"},"Favorite Apps",-1)),l("div",kRt,[(T(!0),x(Be,null,Ke(i.favoriteApps,a=>(T(),at(o,{key:a.appName,app:a,onToggleFavorite:i.toggleFavorite,onInstall:i.installApp,onUninstall:i.uninstallApp,onDelete:i.deleteApp,onEdit:i.editApp,onDownload:i.downloadApp,onHelp:i.handleAppClick,onOpen:i.openApp,onStartServer:i.startServer},null,8,["app","onToggleFavorite","onInstall","onUninstall","onDelete","onEdit","onDownload","onHelp","onOpen","onStartServer"]))),128))]),l("h2",DRt,Y(i.currentCategoryName)+" ("+Y(i.sortedAndFilteredApps.length)+")",1),l("div",LRt,[(T(!0),x(Be,null,Ke(i.sortedAndFilteredApps,a=>(T(),at(o,{key:a.name,app:a,onToggleFavorite:i.toggleFavorite,onInstall:i.installApp,onUninstall:i.uninstallApp,onDelete:i.deleteApp,onEdit:i.editApp,onDownload:i.downloadApp,onHelp:i.handleAppClick,onOpen:i.openApp,onStartServer:i.startServer},null,8,["app","onToggleFavorite","onInstall","onUninstall","onDelete","onEdit","onDownload","onHelp","onOpen","onStartServer"]))),128))])])),r.selectedApp?(T(),x("div",PRt,[l("div",FRt,[l("div",URt,[l("h2",BRt,Y(r.selectedApp.name),1),l("button",{onClick:e[10]||(e[10]=(...a)=>i.backToZoo&&i.backToZoo(...a)),class:"bg-gray-300 hover:bg-gray-400 px-4 py-2 rounded-lg transition duration-300 ease-in-out"},"Close")]),r.appCode?(T(),x("iframe",{key:0,srcdoc:r.appCode,class:"flex-grow border-none"},null,8,GRt)):(T(),x("p",VRt,"Please install this app to view its code."))])])):B("",!0),r.message?(T(),x("div",{key:3,class:Le(["fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-md",{"bg-green-100 text-green-800":r.successMessage,"bg-red-100 text-red-800":!r.successMessage}])},Y(r.message),3)):B("",!0)])}const HRt=rt(hRt,[["render",zRt]]),qRt={components:{PersonalityEntry:dN},data(){return{personalities:[],githubApps:[],favorites:[],selectedCategory:"all",selectedApp:null,appCode:"",loading:!1,message:"",successMessage:!0,searchQuery:"",selectedFile:null,isUploading:!1,error:"",sortBy:"name",sortOrder:"asc"}},computed:{currentCategoryName(){return this.selectedCategory=="all"?"All Personalities":this.selectedCategory},configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},combinedApps(){this.personalities.map(e=>e.name);const n=new Map(this.personalities.map(e=>[e.name,{...e,installed:!0,existsInFolder:!0}]));return this.githubApps.forEach(e=>{n.has(e.name)||n.set(e.name,{...e,installed:!1,existsInFolder:!1})}),Array.from(n.values())},categories(){return[...new Set(this.combinedApps.map(n=>n.category))].sort((n,e)=>n.localeCompare(e))},filteredApps(){return this.combinedApps.filter(n=>{const e=n.name.toLowerCase().includes(this.searchQuery.toLowerCase())||n.author.toLowerCase().includes(this.searchQuery.toLowerCase())||n.description.toLowerCase().includes(this.searchQuery.toLowerCase()),t=this.selectedCategory==="all"||n.category===this.selectedCategory;return e&&t})},sortedAndFilteredApps(){return this.filteredApps.sort((n,e)=>{let t=0;switch(this.sortBy){case"name":t=n.name.localeCompare(e.name);break;case"author":t=n.author.localeCompare(e.author);break;case"date":t=new Date(n.creation_date)-new Date(e.creation_date);break;case"update":t=new Date(n.last_update_date)-new Date(e.last_update_date);break}return this.sortOrder==="asc"?t:-t})},favoriteApps(){return this.combinedApps.filter(n=>this.favorites.includes(n.uid))}},methods:{async onPersonalitySelected(n){if(console.log("on pers",n),this.isLoading&&this.$store.state.toast.showToast("Loading... please wait",4,!1),this.isLoading=!0,console.log("selecting ",n),n){if(n.selected){this.$store.state.toast.showToast("Personality already selected",4,!0),this.isLoading=!1;return}let e=n.language==null?n.full_path:n.full_path+":"+n.language;if(console.log("pth",e),n.isMounted&&this.configFile.personalities.includes(e)){const t=await this.select_personality(n);console.log("pers is mounted",t),t&&t.status&&t.active_personality_id>-1?this.$store.state.toast.showToast(`Selected personality: `+n.name,4,!0):this.$store.state.toast.showToast(`Error on select personality: `+n.name,4,!1),this.isLoading=!1}else console.log("mounting pers"),this.mountPersonality(n);Fe(()=>{feather.replace()})}},onModelSelected(n){if(this.isLoading){this.$store.state.toast.showToast("Loading... please wait",4,!1);return}n&&(n.isInstalled?this.update_model(n.model.name).then(e=>{console.log("update_model",e),this.configFile.model_name=n.model.name,e.status?(this.$store.state.toast.showToast(`Selected model: `+n.name,4,!0),Fe(()=>{feather.replace(),this.is_loading_zoo=!1}),this.updateModelsZoo(),this.api_get_req("get_model_status").then(t=>{this.$store.commit("setIsModelOk",t)})):(this.$store.state.toast.showToast(`Couldn't select model: @@ -3994,4 +3994,4 @@ You have the freedom to give, sell, or keep the personas you create for yourself The possibilities are endless, they are now yours to mold and customize as you see fit.`),this.$store.dispatch("refreshPersonalitiesZoo")):this.$store.state.toast.showToast(`Personality couldn't be copied to the custom personalities folder: Verify that the personality is not already copied there.`,4,!1)}).catch(e=>{this.$store.state.toast.showToast(`Personality couldn't be copied to the custom personalities folder: `,4,!1),console.error(e)})},async remountPersonality(n){await this.unmountPersonality(n),await this.mountPersonality(n)},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,console.log("Personality path:",n.personality.path),ne.post("/reinstall_personality",{client_id:this.$store.state.client_id,name:n.personality.path},{headers:this.posts_headers}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$store.state.toast.showToast("Personality reinstalled successfully!",4,!0):this.$store.state.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$store.state.toast.showToast(`Could not reinstall personality -`+e.message,4,!1),{status:!1}))},async handleOpenFolder(n){await ne.post("/open_personality_folder",{client_id:this.$store.state.client_id,personality_folder:n.personality.folder})},showMessage(n,e){this.message=n,this.successMessage=e,setTimeout(()=>{this.message=""},3e3)},loadPersonalities(){this.loading=!0,setTimeout(()=>{this.personalities=this.$store.state.personalities,this.loading=!1},500)}},mounted(){this.loadFavoritesFromLocalStorage(),this.loading=!0,setTimeout(()=>{this.personalities=this.$store.state.personalities,this.loading=!1},500)}},VRt={class:"app-zoo mb-100 pb-100 pt-12 background-color w-full p-6 overflow-y-auto h-screen scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},zRt={class:"panels-color shadow-lg rounded-lg p-4 max-w-4xl mx-auto mb-8"},HRt={class:"flex flex-wrap items-center justify-between gap-4"},qRt={key:0},YRt={key:1,class:"error"},$Rt={class:"relative flex-grow max-w-md"},WRt={class:"flex items-center space-x-4"},KRt=["value"],jRt={class:"flex items-center space-x-4"},QRt={key:0,class:"flex justify-center items-center space-x-2 my-8","aria-live":"polite"},XRt={key:1},ZRt={class:"container mx-auto px-4 flex flex-column pb-20"},JRt={key:0},eAt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},tAt={class:"container mx-auto px-4 flex flex-column pb-20"},nAt={class:"text-2xl font-bold my-8"},sAt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},rAt={key:2,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 overflow-y-auto"},iAt={class:"bg-white rounded-lg p-6 w-11/12 h-5/6 flex flex-col"},oAt={class:"flex justify-between items-center mb-4"},aAt={class:"text-2xl font-bold"},lAt=["srcdoc"],cAt={key:1,class:"text-center text-red-500"};function dAt(n,e,t,s,r,i){const o=nt("personality-entry");return T(),x("div",VRt,[l("nav",zRt,[l("div",HRt,[r.message?(T(),x("p",qRt,Y(r.message),1)):B("",!0),r.error?(T(),x("p",YRt,Y(r.error),1)):B("",!0),l("div",$Rt,[k(l("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>r.searchQuery=a),placeholder:"Search personalities...",class:"w-full border-b-2 border-gray-300 px-4 py-2 pl-10 focus:outline-none focus:border-blue-500 transition duration-300 ease-in-out","aria-label":"Search personalities"},null,512),[[ae,r.searchQuery]]),e[5]||(e[5]=l("svg",{class:"w-5 h-5 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))]),l("div",WRt,[e[7]||(e[7]=l("label",{for:"category-select",class:"font-semibold"},"Category:",-1)),k(l("select",{id:"category-select","onUpdate:modelValue":e[1]||(e[1]=a=>r.selectedCategory=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},[e[6]||(e[6]=l("option",{value:"all"},"All Categories",-1)),(T(!0),x(Be,null,Ke(i.categories,a=>(T(),x("option",{key:a,value:a},Y(a),9,KRt))),128))],512),[[Ot,r.selectedCategory]])]),l("div",jRt,[e[9]||(e[9]=l("label",{for:"sort-select",class:"font-semibold"},"Sort by:",-1)),k(l("select",{id:"sort-select","onUpdate:modelValue":e[2]||(e[2]=a=>r.sortBy=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},e[8]||(e[8]=[l("option",{value:"name"},"Name",-1),l("option",{value:"author"},"Author",-1),l("option",{value:"date"},"Creation Date",-1),l("option",{value:"update"},"Last Update",-1)]),512),[[Ot,r.sortBy]]),l("button",{onClick:e[3]||(e[3]=(...a)=>i.toggleSortOrder&&i.toggleSortOrder(...a)),class:"btn btn-secondary"},Y(r.sortOrder==="asc"?"↑":"↓"),1)])])]),r.loading?(T(),x("div",QRt,e[10]||(e[10]=[l("div",{class:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"},null,-1),l("span",{class:"text-xl text-gray-700 font-semibold"},"Loading...",-1)]))):(T(),x("div",XRt,[l("div",ZRt,[i.favoriteApps.length>0&&!r.searchQuery?(T(),x("div",JRt,[e[11]||(e[11]=l("h2",{class:"text-2xl font-bold my-8"},"Favorite Apps",-1)),l("div",eAt,[(T(!0),x(Be,null,Ke(i.favoriteApps,a=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:a.uid,personality:a,select_language:!0,full_path:a.full_path,selected:i.configFile.active_personality_id==i.configFile.personalities.findIndex(c=>c===a.full_path||c===a.full_path+":"+a.language),"on-selected":i.onPersonalitySelected,"on-mount":i.mountPersonality,"on-un-mount":i.unmountPersonality,"on-remount":i.remountPersonality,"on-edit":i.editPersonality,"on-copy-to-custom":i.copyToCustom,"on-reinstall":i.onPersonalityReinstall,"on-settings":n.onSettingsPersonality,"on-copy-personality-name":n.onCopyPersonalityName,"on-copy-to_custom":n.onCopyToCustom,"on-open-folder":i.handleOpenFolder,"on-toggle-favorite":i.toggleFavorite},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder","on-toggle-favorite"]))),128))])])):B("",!0)]),l("div",tAt,[l("h2",nAt,Y(i.currentCategoryName)+" ("+Y(i.sortedAndFilteredApps.length)+")",1),l("div",sAt,[(T(!0),x(Be,null,Ke(i.sortedAndFilteredApps,a=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:a.uid,personality:a,select_language:!0,full_path:a.full_path,selected:i.configFile.active_personality_id==i.configFile.personalities.findIndex(c=>c===a.full_path||c===a.full_path+":"+a.language),"on-selected":i.onPersonalitySelected,"on-mount":i.mountPersonality,"on-un-mount":i.unmountPersonality,"on-remount":i.remountPersonality,"on-edit":i.editPersonality,"on-copy-to-custom":i.copyToCustom,"on-reinstall":i.onPersonalityReinstall,"on-settings":n.onSettingsPersonality,"on-copy-personality-name":n.onCopyPersonalityName,"on-copy-to_custom":n.onCopyToCustom,"on-open-folder":i.handleOpenFolder,"toggle-favorite":i.toggleFavorite},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder","toggle-favorite"]))),128))])])])),r.selectedApp?(T(),x("div",rAt,[l("div",iAt,[l("div",oAt,[l("h2",aAt,Y(r.selectedApp.name),1),l("button",{onClick:e[4]||(e[4]=(...a)=>n.backToZoo&&n.backToZoo(...a)),class:"bg-gray-300 hover:bg-gray-400 px-4 py-2 rounded-lg transition duration-300 ease-in-out"},"Close")]),r.appCode?(T(),x("iframe",{key:0,srcdoc:r.appCode,class:"flex-grow border-none"},null,8,lAt)):(T(),x("p",cAt,"Please install this app to view its code."))])])):B("",!0),r.message?(T(),x("div",{key:3,class:Le(["fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-md",{"bg-green-100 text-green-800":r.successMessage,"bg-red-100 text-red-800":!r.successMessage}])},Y(r.message),3)):B("",!0),e[12]||(e[12]=l("div",{class:"h-20"},null,-1))])}const uAt=rt(GRt,[["render",dAt],["__scopeId","data-v-fcb6b036"]]),pAt=$3({history:x3("/"),routes:[{path:"/apps_view/",name:"AppsZoo",component:BRt},{path:"/personalities_view/",name:"PersonalitiesZoo",component:uAt},{path:"/auto_sd_view/",name:"AutoSD",component:H2t},{path:"/comfyui_view/",name:"ComfyUI",component:U2t},{path:"/playground/",name:"playground",component:rJe},{path:"/extensions/",name:"extensions",component:fJe},{path:"/help_view/",name:"help_view",component:set},{path:"/settings/",name:"settings",component:Xct},{path:"/training/",name:"training",component:ddt},{path:"/quantizing/",name:"quantizing",component:hdt},{path:"/",name:"discussions",component:Dgt},{path:"/interactive/",name:"interactive",component:VTt},{path:"/nodes/",name:"nodes",component:k2t}]}),vp=GD(e5);function fAt(n){const e={};for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}const Ps=fL({state(){return{personalities_ready:!1,is_rt_on:!1,language:"english",languages:[],currentTheme:"",personality_editor:null,showPersonalityEditor:!1,selectedPersonality:null,currentPersonConfig:{ai_name:"",ai_author:"",ai_category:"",ai_language:"",ai_description:"",ai_conditionning:"",ai_disclaimer:"",ai_icon:null},posts_headers:{accept:"application/json","Content-Type":"application/json"},client_id:"",leftPanelCollapsed:!1,rightPanelCollapsed:!0,view_mode:localStorage.getItem("lollms_webui_view_mode")||"compact",yesNoDialog:null,universalForm:null,toast:null,news:null,messageBox:null,api_get_req:null,api_post_req:null,startSpeechRecognition:null,ready:!1,loading_infos:"",loading_progress:0,version:"unknown",settingsChanged:!1,isConnected:!1,isModelOk:!1,isGenerating:!1,config:null,mountedPers:null,mountedPersArr:[],bindingsZoo:[],modelsArr:[],selectedModel:null,personalities:[],diskUsage:null,ramUsage:null,vramUsage:null,modelsZoo:[],installedModels:[],installedBindings:[],currentModel:null,currentBinding:null,databases:[]}},mutations:{setLeftPanelCollapsed(n,e){n.leftPanelCollapsed=e,console.log(`Saving the status of left panel to ${e}`),localStorage.setItem("lollms_webui_left_panel_collapsed",e)},setRightPanelCollapsed(n,e){n.rightPanelCollapsed=e,console.log(`Saving the status of right panel to ${e}`),localStorage.setItem("lollms_webui_right_panel_collapsed",e)},setViewMode(n,e){n.view_mode=e,localStorage.setItem("lollms_webui_view_mode",e)},setpersonalitiesReady(n,e){n.personalities_ready=e},setisRTOn(n,e){n.is_rt_on=e},setLanguages(n,e){n.languages=e},setLanguage(n,e){n.language=e},setIsReady(n,e){n.ready=e},setIsConnected(n,e){n.isConnected=e},setIsModelOk(n,e){n.isModelOk=e},setIsGenerating(n,e){n.isGenerating=e},setConfig(n,e){n.config=e},setPersonalities(n,e){n.personalities=e},setMountedPers(n,e){n.mountedPers=e},setMountedPersArr(n,e){n.mountedPersArr=e},setbindingsZoo(n,e){n.bindingsZoo=e},setModelsArr(n,e){n.modelsArr=e},setselectedModel(n,e){n.selectedModel=e},setDiskUsage(n,e){n.diskUsage=e},setRamUsage(n,e){n.ramUsage=e},setVramUsage(n,e){n.vramUsage=e},setModelsZoo(n,e){n.modelsZoo=e},setCurrentBinding(n,e){n.currentBinding=e},setCurrentModel(n,e){n.currentModel=e},setDatabases(n,e){n.databases=e},setTheme(n){this.currentTheme=n}},getters:{getLeftPanelCollapsed(n){return n.leftPanelCollapsed},getRightPanelCollapsed(n){return n.rightPanelCollapsed},getViewMode(n){return n.view_mode},getpersonalitiesReady(n){return n.personalities_ready},getisRTOn(n){return n.is_rt_on},getLanguages(n){return n.languages},getLanguage(n){return n.language},getIsConnected(n){return n.isConnected},getIsModelOk(n){return n.isModelOk},getIsGenerating(n){return n.isGenerating},getConfig(n){return n.config},getPersonalities(n){return n.personalities},getMountedPersArr(n){return n.mountedPersArr},getMountedPers(n){return n.mountedPers},getbindingsZoo(n){return n.bindingsZoo},getModelsArr(n){return n.modelsArr},getDiskUsage(n){return n.diskUsage},getRamUsage(n){return n.ramUsage},getVramUsage(n){return n.vramUsage},getDatabasesList(n){return n.databases},getModelsZoo(n){return n.modelsZoo},getCyrrentBinding(n){return n.currentBinding},getCurrentModel(n){return n.currentModel}},actions:{async getVersion(){try{let n=await ne.get("/get_lollms_webui_version",{});n&&(this.state.version=n.data)}catch{console.error("Coudln't get version")}},async refreshConfig({commit:n}){console.log("Fetching configuration");try{console.log("Fetching configuration with client id: ",this.state.client_id);const e=await qO("get_config",this.state.client_id);e.active_personality_id<0&&(e.active_personality_id=0);let t=e.personalities[e.active_personality_id].split("/");e.personality_category=t[0],e.personality_folder=t[1],console.log("Recovered config"),console.log(e),console.log("Committing config"),console.log(e),console.log(this.state.config),n("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshDatabase({commit:n}){let e=await Ks("list_databases");console.log("databases:",e),n("setDatabases",e)},async fetchisRTOn({commit:n}){const t=(await ne.get("/is_rt_on")).data.status;n("setisRTOn",t)},async fetchLanguages({commit:n}){console.log("get_personality_languages_list",this.state.client_id);const e=await ne.post("/get_personality_languages_list",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("languages",t),n("setLanguages",t)},async fetchLanguage({commit:n}){console.log("get_personality_language",this.state.client_id);const e=await ne.post("/get_personality_language",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("language",t),n("setLanguage",t)},async changeLanguage({commit:n},e){console.log("Changing language to ",e);let t=await ne.post("/set_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await ne.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await ne.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const r=t.data;console.log("language",r),n("setLanguage",r),console.log("Language changed successfully:",t.data.message)},async deleteLanguage({commit:n},e){console.log("Deleting ",e);let t=await ne.post("/del_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await ne.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await ne.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const r=t.data;console.log("language",r),n("setLanguage",r),console.log("Language changed successfully:",t.data.message)},async refreshPersonalitiesZoo({commit:n}){let e=[];const t=await Ks("get_all_personalities"),s=Object.keys(t);console.log("Personalities recovered:"+this.state.config.personalities);for(let r=0;r{let d=!1;for(const _ of this.state.config.personalities)if(_.includes(i+"/"+c.folder))if(d=!0,_.includes(":")){const m=_.split(":");c.language=m[1]}else c.language=null;let u={};return u=c,u.category=i,u.full_path=i+"/"+c.folder,u.isMounted=d,u});e.length==0?e=a:e=e.concat(a)}e.sort((r,i)=>r.name.localeCompare(i.name)),n("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:n}){this.state.config.active_personality_id<0&&(this.state.config.active_personality_id=0);let e=[];const t=[];for(let s=0;sa.full_path==r||a.full_path==i[0]);if(o>=0){let a=fAt(this.state.personalities[o]);i.length>1&&(a.language=i[1]),a?e.push(a):e.push(this.state.personalities[this.state.personalities.findIndex(c=>c.full_path=="generic/lollms")])}else t.push(s),console.log("Couldn't load personality : ",r)}for(let s=t.length-1;s>=0;s--)console.log("Removing personality : ",this.state.config.personalities[t[s]]),this.state.config.personalities.splice(t[s],1),this.state.config.active_personality_id>t[s]&&(this.state.config.active_personality_id-=1);n("setMountedPersArr",e),this.state.mountedPers=this.state.personalities[this.state.personalities.findIndex(s=>s.full_path==this.state.config.personalities[this.state.config.active_personality_id]||s.full_path+":"+s.language==this.state.config.personalities[this.state.config.active_personality_id])]},async refreshBindings({commit:n}){let e=await Ks("list_bindings");console.log("Loaded bindings zoo :",e),this.state.installedBindings=e.filter(s=>s.installed),console.log("Loaded bindings zoo ",this.state.installedBindings),n("setbindingsZoo",e);const t=e.findIndex(s=>s.name==this.state.config.binding_name);t!=-1&&n("setCurrentBinding",e[t])},async refreshModelsZoo({commit:n}){console.log("Fetching models");const t=(await ne.get("/get_available_models")).data.filter(s=>s.variants&&s.variants.length>0);console.log(`get_available_models: ${t}`),n("setModelsZoo",t)},async refreshModelStatus({commit:n}){let e=await Ks("get_model_status");n("setIsModelOk",e.status)},async refreshModels({commit:n}){console.log("Fetching models");let e=await Ks("list_models");console.log(`Found ${e}`);let t=await Ks("get_active_model");console.log("Selected model ",t),t!=null&&n("setselectedModel",t.model),n("setModelsArr",e),console.log("setModelsArr",e),console.log("this.state.modelsZoo",this.state.modelsZoo),this.state.modelsZoo.map(r=>{r.isInstalled=e.includes(r.name)}),this.state.installedModels=this.state.modelsZoo.filter(r=>r.isInstalled);const s=this.state.modelsZoo.findIndex(r=>r.name==this.state.config.model_name);s!=-1&&n("setCurrentModel",this.state.modelsZoo[s])},async refreshDiskUsage({commit:n}){this.state.diskUsage=await Ks("disk_usage")},async refreshRamUsage({commit:n}){this.state.ramUsage=await Ks("ram_usage")},async refreshVramUsage({commit:n}){const e=await Ks("vram_usage"),t=[];if(e.nb_gpus>0){for(let r=0;r{this.message=""},3e3)},loadPersonalities(){this.loading=!0,setTimeout(()=>{this.personalities=this.$store.state.personalities,this.loading=!1},500)}},mounted(){this.loadFavoritesFromLocalStorage(),this.loading=!0,setTimeout(()=>{this.personalities=this.$store.state.personalities,this.loading=!1},500)}},YRt={class:"app-zoo mb-100 pb-100 pt-12 background-color w-full p-6 overflow-y-auto h-screen scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},$Rt={class:"panels-color shadow-lg rounded-lg p-4 max-w-4xl mx-auto mb-8"},WRt={class:"flex flex-wrap items-center justify-between gap-4"},KRt={key:0},jRt={key:1,class:"error"},QRt={class:"relative flex-grow max-w-md"},XRt={class:"flex items-center space-x-4"},ZRt=["value"],JRt={class:"flex items-center space-x-4"},eAt={key:0,class:"flex justify-center items-center space-x-2 my-8","aria-live":"polite"},tAt={key:1},nAt={class:"container mx-auto px-4 flex flex-column pb-20"},sAt={key:0},rAt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},iAt={class:"container mx-auto px-4 flex flex-column pb-20"},oAt={class:"text-2xl font-bold my-8"},aAt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12"},lAt={key:2,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 overflow-y-auto"},cAt={class:"bg-white rounded-lg p-6 w-11/12 h-5/6 flex flex-col"},dAt={class:"flex justify-between items-center mb-4"},uAt={class:"text-2xl font-bold"},pAt=["srcdoc"],fAt={key:1,class:"text-center text-red-500"};function _At(n,e,t,s,r,i){const o=nt("personality-entry");return T(),x("div",YRt,[l("nav",$Rt,[l("div",WRt,[r.message?(T(),x("p",KRt,Y(r.message),1)):B("",!0),r.error?(T(),x("p",jRt,Y(r.error),1)):B("",!0),l("div",QRt,[k(l("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>r.searchQuery=a),placeholder:"Search personalities...",class:"w-full border-b-2 border-gray-300 px-4 py-2 pl-10 focus:outline-none focus:border-blue-500 transition duration-300 ease-in-out","aria-label":"Search personalities"},null,512),[[ae,r.searchQuery]]),e[5]||(e[5]=l("svg",{class:"w-5 h-5 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1))]),l("div",XRt,[e[7]||(e[7]=l("label",{for:"category-select",class:"font-semibold"},"Category:",-1)),k(l("select",{id:"category-select","onUpdate:modelValue":e[1]||(e[1]=a=>r.selectedCategory=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},[e[6]||(e[6]=l("option",{value:"all"},"All Categories",-1)),(T(!0),x(Be,null,Ke(i.categories,a=>(T(),x("option",{key:a,value:a},Y(a),9,ZRt))),128))],512),[[Ot,r.selectedCategory]])]),l("div",JRt,[e[9]||(e[9]=l("label",{for:"sort-select",class:"font-semibold"},"Sort by:",-1)),k(l("select",{id:"sort-select","onUpdate:modelValue":e[2]||(e[2]=a=>r.sortBy=a),class:"border-2 border-gray-300 rounded-md px-2 py-1"},e[8]||(e[8]=[l("option",{value:"name"},"Name",-1),l("option",{value:"author"},"Author",-1),l("option",{value:"date"},"Creation Date",-1),l("option",{value:"update"},"Last Update",-1)]),512),[[Ot,r.sortBy]]),l("button",{onClick:e[3]||(e[3]=(...a)=>i.toggleSortOrder&&i.toggleSortOrder(...a)),class:"btn btn-secondary"},Y(r.sortOrder==="asc"?"↑":"↓"),1)])])]),r.loading?(T(),x("div",eAt,e[10]||(e[10]=[l("div",{class:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-500"},null,-1),l("span",{class:"text-xl text-gray-700 font-semibold"},"Loading...",-1)]))):(T(),x("div",tAt,[l("div",nAt,[i.favoriteApps.length>0&&!r.searchQuery?(T(),x("div",sAt,[e[11]||(e[11]=l("h2",{class:"text-2xl font-bold my-8"},"Favorite Apps",-1)),l("div",rAt,[(T(!0),x(Be,null,Ke(i.favoriteApps,a=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:a.uid,personality:a,select_language:!0,full_path:a.full_path,selected:i.configFile.active_personality_id==i.configFile.personalities.findIndex(c=>c===a.full_path||c===a.full_path+":"+a.language),"on-selected":i.onPersonalitySelected,"on-mount":i.mountPersonality,"on-un-mount":i.unmountPersonality,"on-remount":i.remountPersonality,"on-edit":i.editPersonality,"on-copy-to-custom":i.copyToCustom,"on-reinstall":i.onPersonalityReinstall,"on-settings":n.onSettingsPersonality,"on-copy-personality-name":n.onCopyPersonalityName,"on-copy-to_custom":n.onCopyToCustom,"on-open-folder":i.handleOpenFolder,"on-toggle-favorite":i.toggleFavorite},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder","on-toggle-favorite"]))),128))])])):B("",!0)]),l("div",iAt,[l("h2",oAt,Y(i.currentCategoryName)+" ("+Y(i.sortedAndFilteredApps.length)+")",1),l("div",aAt,[(T(!0),x(Be,null,Ke(i.sortedAndFilteredApps,a=>(T(),at(o,{ref_for:!0,ref:"personalitiesZoo",key:a.uid,personality:a,select_language:!0,full_path:a.full_path,selected:i.configFile.active_personality_id==i.configFile.personalities.findIndex(c=>c===a.full_path||c===a.full_path+":"+a.language),"on-selected":i.onPersonalitySelected,"on-mount":i.mountPersonality,"on-un-mount":i.unmountPersonality,"on-remount":i.remountPersonality,"on-edit":i.editPersonality,"on-copy-to-custom":i.copyToCustom,"on-reinstall":i.onPersonalityReinstall,"on-settings":n.onSettingsPersonality,"on-copy-personality-name":n.onCopyPersonalityName,"on-copy-to_custom":n.onCopyToCustom,"on-open-folder":i.handleOpenFolder,"toggle-favorite":i.toggleFavorite},null,8,["personality","full_path","selected","on-selected","on-mount","on-un-mount","on-remount","on-edit","on-copy-to-custom","on-reinstall","on-settings","on-copy-personality-name","on-copy-to_custom","on-open-folder","toggle-favorite"]))),128))])])])),r.selectedApp?(T(),x("div",lAt,[l("div",cAt,[l("div",dAt,[l("h2",uAt,Y(r.selectedApp.name),1),l("button",{onClick:e[4]||(e[4]=(...a)=>n.backToZoo&&n.backToZoo(...a)),class:"bg-gray-300 hover:bg-gray-400 px-4 py-2 rounded-lg transition duration-300 ease-in-out"},"Close")]),r.appCode?(T(),x("iframe",{key:0,srcdoc:r.appCode,class:"flex-grow border-none"},null,8,pAt)):(T(),x("p",fAt,"Please install this app to view its code."))])])):B("",!0),r.message?(T(),x("div",{key:3,class:Le(["fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-md",{"bg-green-100 text-green-800":r.successMessage,"bg-red-100 text-red-800":!r.successMessage}])},Y(r.message),3)):B("",!0),e[12]||(e[12]=l("div",{class:"h-20"},null,-1))])}const mAt=rt(qRt,[["render",_At],["__scopeId","data-v-fcb6b036"]]),hAt=$3({history:x3("/"),routes:[{path:"/apps_view/",name:"AppsZoo",component:HRt},{path:"/personalities_view/",name:"PersonalitiesZoo",component:mAt},{path:"/auto_sd_view/",name:"AutoSD",component:W2t},{path:"/comfyui_view/",name:"ComfyUI",component:z2t},{path:"/playground/",name:"playground",component:rJe},{path:"/extensions/",name:"extensions",component:fJe},{path:"/help_view/",name:"help_view",component:set},{path:"/settings/",name:"settings",component:Xct},{path:"/training/",name:"training",component:ddt},{path:"/quantizing/",name:"quantizing",component:hdt},{path:"/",name:"discussions",component:Ugt},{path:"/interactive/",name:"interactive",component:YTt},{path:"/nodes/",name:"nodes",component:F2t}]}),vp=GD(e5);function gAt(n){const e={};for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}const Ps=fL({state(){return{personalities_ready:!1,is_rt_on:!1,language:"english",languages:[],currentTheme:"",personality_editor:null,showPersonalityEditor:!1,selectedPersonality:null,currentPersonConfig:{ai_name:"",ai_author:"",ai_category:"",ai_language:"",ai_description:"",ai_conditionning:"",ai_disclaimer:"",ai_icon:null},posts_headers:{accept:"application/json","Content-Type":"application/json"},client_id:"",leftPanelCollapsed:!1,rightPanelCollapsed:!0,view_mode:localStorage.getItem("lollms_webui_view_mode")||"compact",yesNoDialog:null,universalForm:null,toast:null,news:null,messageBox:null,api_get_req:null,api_post_req:null,startSpeechRecognition:null,ready:!1,loading_infos:"",loading_progress:0,version:"unknown",settingsChanged:!1,isConnected:!1,isModelOk:!1,isGenerating:!1,config:null,mountedPers:null,mountedPersArr:[],bindingsZoo:[],modelsArr:[],selectedModel:null,personalities:[],diskUsage:null,ramUsage:null,vramUsage:null,modelsZoo:[],installedModels:[],installedBindings:[],currentModel:null,currentBinding:null,databases:[]}},mutations:{setLeftPanelCollapsed(n,e){n.leftPanelCollapsed=e,console.log(`Saving the status of left panel to ${e}`),localStorage.setItem("lollms_webui_left_panel_collapsed",e)},setRightPanelCollapsed(n,e){n.rightPanelCollapsed=e,console.log(`Saving the status of right panel to ${e}`),localStorage.setItem("lollms_webui_right_panel_collapsed",e)},setViewMode(n,e){n.view_mode=e,localStorage.setItem("lollms_webui_view_mode",e)},setpersonalitiesReady(n,e){n.personalities_ready=e},setisRTOn(n,e){n.is_rt_on=e},setLanguages(n,e){n.languages=e},setLanguage(n,e){n.language=e},setIsReady(n,e){n.ready=e},setIsConnected(n,e){n.isConnected=e},setIsModelOk(n,e){n.isModelOk=e},setIsGenerating(n,e){n.isGenerating=e},setConfig(n,e){n.config=e},setPersonalities(n,e){n.personalities=e},setMountedPers(n,e){n.mountedPers=e},setMountedPersArr(n,e){n.mountedPersArr=e},setbindingsZoo(n,e){n.bindingsZoo=e},setModelsArr(n,e){n.modelsArr=e},setselectedModel(n,e){n.selectedModel=e},setDiskUsage(n,e){n.diskUsage=e},setRamUsage(n,e){n.ramUsage=e},setVramUsage(n,e){n.vramUsage=e},setModelsZoo(n,e){n.modelsZoo=e},setCurrentBinding(n,e){n.currentBinding=e},setCurrentModel(n,e){n.currentModel=e},setDatabases(n,e){n.databases=e},setTheme(n){this.currentTheme=n}},getters:{getLeftPanelCollapsed(n){return n.leftPanelCollapsed},getRightPanelCollapsed(n){return n.rightPanelCollapsed},getViewMode(n){return n.view_mode},getpersonalitiesReady(n){return n.personalities_ready},getisRTOn(n){return n.is_rt_on},getLanguages(n){return n.languages},getLanguage(n){return n.language},getIsConnected(n){return n.isConnected},getIsModelOk(n){return n.isModelOk},getIsGenerating(n){return n.isGenerating},getConfig(n){return n.config},getPersonalities(n){return n.personalities},getMountedPersArr(n){return n.mountedPersArr},getMountedPers(n){return n.mountedPers},getbindingsZoo(n){return n.bindingsZoo},getModelsArr(n){return n.modelsArr},getDiskUsage(n){return n.diskUsage},getRamUsage(n){return n.ramUsage},getVramUsage(n){return n.vramUsage},getDatabasesList(n){return n.databases},getModelsZoo(n){return n.modelsZoo},getCyrrentBinding(n){return n.currentBinding},getCurrentModel(n){return n.currentModel}},actions:{async getVersion(){try{let n=await ne.get("/get_lollms_webui_version",{});n&&(this.state.version=n.data)}catch{console.error("Coudln't get version")}},async refreshConfig({commit:n}){console.log("Fetching configuration");try{console.log("Fetching configuration with client id: ",this.state.client_id);const e=await qO("get_config",this.state.client_id);e.active_personality_id<0&&(e.active_personality_id=0);let t=e.personalities[e.active_personality_id].split("/");e.personality_category=t[0],e.personality_folder=t[1],console.log("Recovered config"),console.log(e),console.log("Committing config"),console.log(e),console.log(this.state.config),n("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshDatabase({commit:n}){let e=await Ks("list_databases");console.log("databases:",e),n("setDatabases",e)},async fetchisRTOn({commit:n}){const t=(await ne.get("/is_rt_on")).data.status;n("setisRTOn",t)},async fetchLanguages({commit:n}){console.log("get_personality_languages_list",this.state.client_id);const e=await ne.post("/get_personality_languages_list",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("languages",t),n("setLanguages",t)},async fetchLanguage({commit:n}){console.log("get_personality_language",this.state.client_id);const e=await ne.post("/get_personality_language",{client_id:this.state.client_id});console.log("response",e);const t=e.data;console.log("language",t),n("setLanguage",t)},async changeLanguage({commit:n},e){console.log("Changing language to ",e);let t=await ne.post("/set_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await ne.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await ne.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const r=t.data;console.log("language",r),n("setLanguage",r),console.log("Language changed successfully:",t.data.message)},async deleteLanguage({commit:n},e){console.log("Deleting ",e);let t=await ne.post("/del_personality_language",{client_id:this.state.client_id,language:e});console.log("get_personality_languages_list",this.state.client_id),t=await ne.post("/get_personality_languages_list",{client_id:this.state.client_id}),console.log("response",t);const s=t.data;console.log("languages",s),n("setLanguages",s),t=await ne.post("/get_personality_language",{client_id:this.state.client_id}),console.log("response",t);const r=t.data;console.log("language",r),n("setLanguage",r),console.log("Language changed successfully:",t.data.message)},async refreshPersonalitiesZoo({commit:n}){let e=[];const t=await Ks("get_all_personalities"),s=Object.keys(t);console.log("Personalities recovered:"+this.state.config.personalities);for(let r=0;r{let d=!1;for(const _ of this.state.config.personalities)if(_.includes(i+"/"+c.folder))if(d=!0,_.includes(":")){const m=_.split(":");c.language=m[1]}else c.language=null;let u={};return u=c,u.category=i,u.full_path=i+"/"+c.folder,u.isMounted=d,u});e.length==0?e=a:e=e.concat(a)}e.sort((r,i)=>r.name.localeCompare(i.name)),n("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:n}){this.state.config.active_personality_id<0&&(this.state.config.active_personality_id=0);let e=[];const t=[];for(let s=0;sa.full_path==r||a.full_path==i[0]);if(o>=0){let a=gAt(this.state.personalities[o]);i.length>1&&(a.language=i[1]),a?e.push(a):e.push(this.state.personalities[this.state.personalities.findIndex(c=>c.full_path=="generic/lollms")])}else t.push(s),console.log("Couldn't load personality : ",r)}for(let s=t.length-1;s>=0;s--)console.log("Removing personality : ",this.state.config.personalities[t[s]]),this.state.config.personalities.splice(t[s],1),this.state.config.active_personality_id>t[s]&&(this.state.config.active_personality_id-=1);n("setMountedPersArr",e),this.state.mountedPers=this.state.personalities[this.state.personalities.findIndex(s=>s.full_path==this.state.config.personalities[this.state.config.active_personality_id]||s.full_path+":"+s.language==this.state.config.personalities[this.state.config.active_personality_id])]},async refreshBindings({commit:n}){let e=await Ks("list_bindings");console.log("Loaded bindings zoo :",e),this.state.installedBindings=e.filter(s=>s.installed),console.log("Loaded bindings zoo ",this.state.installedBindings),n("setbindingsZoo",e);const t=e.findIndex(s=>s.name==this.state.config.binding_name);t!=-1&&n("setCurrentBinding",e[t])},async refreshModelsZoo({commit:n}){console.log("Fetching models");const t=(await ne.get("/get_available_models")).data.filter(s=>s.variants&&s.variants.length>0);console.log(`get_available_models: ${t}`),n("setModelsZoo",t)},async refreshModelStatus({commit:n}){let e=await Ks("get_model_status");n("setIsModelOk",e.status)},async refreshModels({commit:n}){console.log("Fetching models");let e=await Ks("list_models");console.log(`Found ${e}`);let t=await Ks("get_active_model");console.log("Selected model ",t),t!=null&&n("setselectedModel",t.model),n("setModelsArr",e),console.log("setModelsArr",e),console.log("this.state.modelsZoo",this.state.modelsZoo),this.state.modelsZoo.map(r=>{r.isInstalled=e.includes(r.name)}),this.state.installedModels=this.state.modelsZoo.filter(r=>r.isInstalled);const s=this.state.modelsZoo.findIndex(r=>r.name==this.state.config.model_name);s!=-1&&n("setCurrentModel",this.state.modelsZoo[s])},async refreshDiskUsage({commit:n}){this.state.diskUsage=await Ks("disk_usage")},async refreshRamUsage({commit:n}){this.state.ramUsage=await Ks("ram_usage")},async refreshVramUsage({commit:n}){const e=await Ks("vram_usage"),t=[];if(e.nb_gpus>0){for(let r=0;r - License: see project LICENSE - Touched: 2022 -*/.hljs-meta,.hljs-comment{color:#565f89}.hljs-tag,.hljs-doctag,.hljs-selector-id,.hljs-selector-class,.hljs-regexp,.hljs-template-tag,.hljs-selector-pseudo,.hljs-selector-attr,.hljs-variable.language_,.hljs-deletion{color:#f7768e}.hljs-variable,.hljs-template-variable,.hljs-number,.hljs-literal,.hljs-type,.hljs-params,.hljs-link{color:#ff9e64}.hljs-built_in,.hljs-attribute{color:#e0af68}.hljs-selector-tag{color:#2ac3de}.hljs-keyword,.hljs-title.function_,.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-subst,.hljs-property{color:#7dcfff}.hljs-selector-tag{color:#73daca}.hljs-quote,.hljs-string,.hljs-symbol,.hljs-bullet,.hljs-addition{color:#9ece6a}.hljs-code,.hljs-formula,.hljs-section{color:#7aa2f7}.hljs-name,.hljs-keyword,.hljs-operator,.hljs-char.escape_,.hljs-attr{color:#bb9af7}.hljs-punctuation{color:#c0caf5}.hljs{background:#1a1b26;color:#9aa5ce}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.code-container{display:flex;margin:0}.line-numbers{flex-shrink:0;padding-right:5px;color:#999;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;margin:0}.code-content{flex-grow:1;margin:0;outline:none}.overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1000}.hovered{transform:scale(1.05);transition:transform .2s ease-in-out}.active{transform:scale(1.1);transition:transform .2s ease-in-out}.dropdown-shadow[data-v-6c3ea3a5]{box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}:root.dark .dropdown-shadow[data-v-6c3ea3a5]{box-shadow:0 4px 6px -1px #ffffff1a,0 2px 4px -1px #ffffff0f}select{width:200px}body{background-color:#fafafa;font-family:sans-serif}.container{margin:4px auto;width:800px}.settings{position:fixed;top:0;right:0;width:500px;background-color:#fff;z-index:1000;overflow-y:auto;height:100%}.slider-container{margin-top:20px}.slider-value{display:inline-block;margin-left:10px;color:#6b7280;font-size:14px}.small-button{padding:.5rem .75rem;font-size:.875rem}.active-tab{font-weight:700}.help-view[data-v-8c1798f3]{min-height:100vh}.big-card[data-v-8c1798f3]{margin-left:auto;margin-right:auto;border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:2rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.big-card[data-v-8c1798f3]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.help-sections-container[data-v-8c1798f3]{max-height:70vh;overflow-y:auto;padding-right:1rem}.help-section[data-v-8c1798f3]{transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.help-content[data-v-8c1798f3]{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.help-content[data-v-8c1798f3]:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.help-sections-container[data-v-8c1798f3]::-webkit-scrollbar{width:12px}.help-sections-container[data-v-8c1798f3]::-webkit-scrollbar-track{background:#f1f1f1;border-radius:10px}.help-sections-container[data-v-8c1798f3]::-webkit-scrollbar-thumb{background:#888;border-radius:10px;border:3px solid #f1f1f1}.help-sections-container[data-v-8c1798f3]::-webkit-scrollbar-thumb:hover{background:#555}.help-sections-container[data-v-8c1798f3]{scrollbar-width:thin;scrollbar-color:#888 #f1f1f1}.menu-container{position:relative;display:inline-block}.menu-button{background-color:#007bff;color:#fff;padding:10px;border:none;cursor:pointer;border-radius:4px}.menu-list{position:absolute;background-color:#fff;color:#000;border:1px solid #ccc;border-radius:4px;box-shadow:0 2px 4px #0003;padding:10px;max-width:500px;z-index:1000}.slide-enter-active,.slide-leave-active{transition:transform .2s}.slide-enter-to,.slide-leave-from{transform:translateY(-10px)}.menu-ul{list-style:none;padding:0;margin:0}.menu-li{cursor:pointer;display:flex;align-items:center;padding:5px}.menu-icon{width:20px;height:20px;margin-right:8px}.menu-command{min-width:200px;text-align:left}.fade-enter-active[data-v-f43216be],.fade-leave-active[data-v-f43216be]{transition:opacity .3s}.fade-enter[data-v-f43216be],.fade-leave-to[data-v-f43216be]{opacity:0}.heartbeat-text[data-v-f29485cf]{font-size:24px;animation:pulsate-f29485cf 1.5s infinite}@keyframes pulsate-f29485cf{0%{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}to{transform:scale(1);opacity:1}}.list-move[data-v-f29485cf],.list-enter-active[data-v-f29485cf],.list-leave-active[data-v-f29485cf]{transition:all .5s ease}.list-enter-from[data-v-f29485cf]{transform:translatey(-30px)}.list-leave-to[data-v-f29485cf]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-f29485cf]{position:absolute}.bounce-enter-active[data-v-f29485cf]{animation:bounce-in-f29485cf .5s}.bounce-leave-active[data-v-f29485cf]{animation:bounce-in-f29485cf .5s reverse}@keyframes bounce-in-f29485cf{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.bg-primary-light[data-v-f29485cf]{background-color:#0ff}.hover[data-v-f29485cf]:bg-primary-light:hover{background-color:#7fffd4}.font-bold[data-v-f29485cf]{font-weight:700}.control-buttons[data-v-5bb76742]{position:absolute;top:0;right:0;height:100%;display:flex;align-items:center;transform:translate(100%);transition:transform .3s}.group:hover .control-buttons[data-v-5bb76742]{transform:translate(0)}.control-buttons-inner[data-v-5bb76742]{display:flex;gap:10px;align-items:center;background-color:#fff;padding:8px;border-radius:0 0 0 8px;box-shadow:0 2px 8px #0000001a}.json-tree-view[data-v-40406ec6]{margin-left:16px}.json-item[data-v-40406ec6]{margin-bottom:4px}.json-key[data-v-40406ec6]{cursor:pointer;display:flex;align-items:center}.toggle-icon[data-v-40406ec6]{margin-right:4px;width:12px}.key[data-v-40406ec6]{font-weight:700;margin-right:4px}.value[data-v-40406ec6]{margin-left:4px}.string[data-v-40406ec6]{color:#0b7285}.number[data-v-40406ec6]{color:#d9480f}.boolean[data-v-40406ec6]{color:#5c940d}.null[data-v-40406ec6]{color:#868e96}.json-nested[data-v-40406ec6]{margin-left:16px;border-left:1px dashed #ccc;padding-left:8px}.json-viewer[data-v-83fc9727]{font-family:Monaco,Menlo,Ubuntu Mono,Consolas,source-code-pro,monospace;font-size:14px;line-height:1.5;color:#333}.collapsible-section[data-v-83fc9727]{cursor:pointer;padding:8px;background-color:#f0f0f0;border-radius:4px;display:flex;align-items:center;transition:background-color .2s}.collapsible-section[data-v-83fc9727]:hover{background-color:#e0e0e0}.toggle-icon[data-v-83fc9727]{margin-right:8px;transition:transform .2s}.json-content[data-v-83fc9727]{margin-top:8px;padding-left:16px}.step-container[data-v-78f415f6]{margin-bottom:1rem}.step-wrapper[data-v-78f415f6]{display:flex;align-items:flex-start;border-radius:.5rem;padding:1rem;--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.step-icon[data-v-78f415f6]{margin-right:1rem;display:flex;height:1.5rem;width:1.5rem;flex-shrink:0;align-items:center;justify-content:center}.feather-icon[data-v-78f415f6]{height:1.5rem;width:1.5rem;stroke:currentColor;stroke-width:2}.spinner[data-v-78f415f6]{height:1.5rem;width:1.5rem}@keyframes spin-78f415f6{to{transform:rotate(360deg)}}.spinner[data-v-78f415f6]{animation:spin-78f415f6 1s linear infinite;border-radius:9999px;border-width:2px;border-top-width:2px;border-color:rgb(75 85 99 / var(--tw-border-opacity));--tw-border-opacity: 1;border-top-color:rgb(28 100 242 / var(--tw-border-opacity))}.step-content[data-v-78f415f6]{flex-grow:1}.step-text[data-v-78f415f6]{margin-bottom:.25rem;font-size:1.125rem;line-height:1.75rem;font-weight:600}.step-description[data-v-78f415f6]{font-size:.875rem;line-height:1.25rem;--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.step-description[data-v-78f415f6]:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.expand-button{margin-left:10px;margin-right:10px;background:none;border:none;padding:0;cursor:pointer}.htmljs{background:none}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.animate-fadeIn{animation:fadeIn .5s ease-out forwards}details[open] summary~*{animation:slideDown .3s ease-in-out}details summary::marker{display:none}details summary::-webkit-details-marker{display:none}@keyframes slideDown{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.custom-scrollbar[data-v-8a34bb65]{scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.5) transparent}.custom-scrollbar[data-v-8a34bb65]::-webkit-scrollbar{width:6px}.custom-scrollbar[data-v-8a34bb65]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-8a34bb65]::-webkit-scrollbar-thumb{background-color:#9ca3af80;border-radius:3px}.custom-scrollbar[data-v-8a34bb65]::-webkit-scrollbar-thumb:hover{background-color:#9ca3afb3}.bounce-enter-active[data-v-f44002af]{animation:bounce-in-f44002af .5s}.bounce-leave-active[data-v-f44002af]{animation:bounce-in-f44002af .5s reverse}@keyframes bounce-in-f44002af{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar-track{background-color:#f1f1f1}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar-thumb{background-color:#888;border-radius:4px}.custom-scrollbar[data-v-1a32c141]::-webkit-scrollbar-thumb:hover{background-color:#555}.menu[data-v-1a32c141]{display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper[data-v-1a32c141]{position:relative;display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper>#commands-menu-items[data-v-1a32c141]{top:calc(-100% - 2rem)}.personalities-hover-area[data-v-e3d676fa]{position:relative;padding-top:10px}.custom-scrollbar[data-v-e3d676fa]{scrollbar-width:thin;scrollbar-color:rgba(155,155,155,.5) transparent}.custom-scrollbar[data-v-e3d676fa]::-webkit-scrollbar{width:6px}.custom-scrollbar[data-v-e3d676fa]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-e3d676fa]::-webkit-scrollbar-thumb{background-color:#9b9b9b80;border-radius:20px;border:transparent}.chat-bar[data-v-e3d676fa]{transition:all .3s ease}.chat-bar[data-v-e3d676fa]:hover{box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.list-move[data-v-e3d676fa],.list-enter-active[data-v-e3d676fa],.list-leave-active[data-v-e3d676fa]{transition:all .5s ease}.list-enter-from[data-v-e3d676fa]{transform:translatey(-30px)}.list-leave-to[data-v-e3d676fa]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-e3d676fa]{position:absolute}@keyframes rolling-ball-1756add6{0%{transform:translate(-50px) rotate(0)}25%{transform:translate(0) rotate(90deg)}50%{transform:translate(50px) rotate(180deg)}75%{transform:translate(0) rotate(270deg)}to{transform:translate(-50px) rotate(360deg)}}@keyframes bounce-1756add6{0%,to{transform:translateY(0)}50%{transform:translateY(-20px)}}@keyframes fade-in-up-1756add6{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.animate-rolling-ball[data-v-1756add6]{animation:rolling-ball-1756add6 4s infinite ease-in-out,bounce-1756add6 1s infinite ease-in-out}.animate-fade-in-up[data-v-1756add6]{animation:fade-in-up-1756add6 1.5s ease-out}.progress-bar-container{background-color:#f0f0f0;border-radius:4px;height:8px;overflow:hidden}.progress-bar{background-color:#3498db;height:100%;transition:width .3s ease}.popup-container[data-v-d504dfc9]{background-color:#fff;color:#333;border-radius:8px;box-shadow:0 4px 6px #0000001a;padding:24px;width:100%;height:100%;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center}.close-button[data-v-d504dfc9]{position:absolute;top:16px;right:16px;background-color:#3490dc;color:#fff;font-weight:700;padding:8px 16px;border-radius:8px;cursor:pointer;transition:background-color .3s ease}.close-button[data-v-d504dfc9]:hover{background-color:#2779bd}.iframe-content[data-v-d504dfc9]{width:100%;height:80%;border:none;margin-bottom:16px}.checkbox-container[data-v-d504dfc9]{display:flex;align-items:center;justify-content:center}.styled-checkbox[data-v-d504dfc9]{width:24px;height:24px;accent-color:#3490dc;cursor:pointer}.checkbox-label[data-v-d504dfc9]{margin-left:8px;font-size:16px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.fade-enter-active[data-v-d504dfc9],.fade-leave-active[data-v-d504dfc9]{transition:opacity .5s}.fade-enter[data-v-d504dfc9],.fade-leave-to[data-v-d504dfc9]{opacity:0}@keyframes giggle-67d2e759{0%,to{transform:translate(0) rotate(0) scale(1)}25%{transform:translate(-5px) rotate(-10deg) scale(1.05)}50%{transform:translate(5px) rotate(10deg) scale(.95)}75%{transform:translate(-5px) rotate(-10deg) scale(1.05)}}.animate-giggle[data-v-67d2e759]{animation:giggle-67d2e759 1.5s infinite ease-in-out}.custom-scrollbar[data-v-67d2e759]{scrollbar-width:thin;scrollbar-color:rgba(155,155,155,.5) transparent}.custom-scrollbar[data-v-67d2e759]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-67d2e759]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-67d2e759]::-webkit-scrollbar-thumb{background-color:#9b9b9b80;border-radius:20px;border:transparent}@keyframes custom-pulse-67d2e759{0%,to{box-shadow:0 0 #3b82f680}50%{box-shadow:0 0 0 15px #3b82f600}}.animate-pulse[data-v-67d2e759]{animation:custom-pulse-67d2e759 2s infinite}.slide-right-enter-active[data-v-67d2e759],.slide-right-leave-active[data-v-67d2e759]{transition:transform .3s ease}.slide-right-enter[data-v-67d2e759],.slide-right-leave-to[data-v-67d2e759]{transform:translate(-100%)}.slide-left-enter-active[data-v-67d2e759],.slide-left-leave-active[data-v-67d2e759]{transition:transform .3s ease}.slide-left-enter[data-v-67d2e759],.slide-left-leave-to[data-v-67d2e759]{transform:translate(100%)}.fade-and-fly-enter-active[data-v-67d2e759]{animation:fade-and-fly-enter-67d2e759 .5s ease}.fade-and-fly-leave-active[data-v-67d2e759]{animation:fade-and-fly-leave-67d2e759 .5s ease}@keyframes fade-and-fly-enter-67d2e759{0%{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes fade-and-fly-leave-67d2e759{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-20px) scale(1.2)}}.list-move[data-v-67d2e759],.list-enter-active[data-v-67d2e759],.list-leave-active[data-v-67d2e759]{transition:all .5s ease}.list-enter-from[data-v-67d2e759]{transform:translatey(-30px)}.list-leave-to[data-v-67d2e759]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-67d2e759]{position:absolute}@keyframes float-67d2e759{0%,to{transform:translateY(0)}50%{transform:translateY(-20px)}}.animate-float[data-v-67d2e759]{animation:float-67d2e759 linear infinite}@keyframes star-move-67d2e759{0%{transform:translate(0) rotate(0)}50%{transform:translate(20px,20px) rotate(180deg)}to{transform:translate(0) rotate(360deg)}}.animate-star[data-v-67d2e759]{animation:star-move-67d2e759 linear infinite}@keyframes fall-67d2e759{0%{transform:translateY(-20px) rotate(0);opacity:1}to{transform:translateY(calc(100vh + 20px)) rotate(360deg);opacity:0}}.animate-fall[data-v-67d2e759]{animation:fall-67d2e759 linear infinite}@keyframes glow-67d2e759{0%,to{text-shadow:0 0 5px rgba(66,153,225,.5),0 0 10px rgba(66,153,225,.5)}50%{text-shadow:0 0 20px rgba(66,153,225,.8),0 0 30px rgba(66,153,225,.8)}}.animate-glow[data-v-67d2e759]{animation:glow-67d2e759 2s ease-in-out infinite}@media (prefers-color-scheme: dark){@keyframes glow-67d2e759{0%,to{text-shadow:0 0 5px rgba(147,197,253,.5),0 0 10px rgba(147,197,253,.5)}50%{text-shadow:0 0 20px rgba(147,197,253,.8),0 0 30px rgba(147,197,253,.8)}0%,to{text-shadow:0 0 5px rgba(147,197,253,.5),0 0 10px rgba(147,197,253,.5)}50%{text-shadow:0 0 20px rgba(147,197,253,.8),0 0 30px rgba(147,197,253,.8)}}}@keyframes roll-67d2e759{0%{transform:translate(-50%) rotate(0)}to{transform:translate(50%) rotate(360deg)}}.animate-roll[data-v-67d2e759]{animation:roll-67d2e759 4s linear infinite}.toolbar[data-v-67d2e759]{position:relative;width:100%}.toolbar-container[data-v-67d2e759]{display:flex;height:2.5rem;align-items:center}.toolbar-button[data-v-67d2e759]{cursor:pointer;border-style:none;background-color:transparent;padding:.5rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.toolbar-button[data-v-67d2e759]:hover{--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.menu-container[data-v-67d2e759]{position:relative}.expandable-menu[data-v-67d2e759]{position:absolute;top:100%;left:.625rem;flex-direction:column;border-radius:.25rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity));--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.menu-container:hover .expandable-menu[data-v-67d2e759],.menu-visible[data-v-67d2e759]{display:flex}.menu-item[data-v-67d2e759]{background:none;border:none;cursor:pointer;padding:8px;color:#333;transition:background-color .3s}.menu-item[data-v-67d2e759]:hover{background-color:#f0f0f0}.dot[data-v-67d2e759]{width:10px;height:10px;border-radius:50%}.dot-green[data-v-67d2e759]{background-color:green}.dot-red[data-v-67d2e759]{background-color:red}.animate-pulse[data-v-67d2e759]{animation:pulse-67d2e759 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes pulse-67d2e759{0%,to{opacity:1}50%{opacity:.7}}.logo-container[data-v-67d2e759]{position:relative;width:48px;height:48px}.logo-image[data-v-67d2e759]{width:100%;height:100%;border-radius:50%;-o-object-fit:cover;object-fit:cover}@keyframes bounce-67d2e759{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:translateY(0);animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce[data-v-67d2e759]{animation:bounce-67d2e759 1s infinite}@keyframes roll-and-bounce-67d2e759{0%,to{transform:translate(0) rotate(0)}45%{transform:translate(100px) rotate(360deg)}50%{transform:translate(90px) rotate(390deg)}55%{transform:translate(100px) rotate(360deg)}95%{transform:translate(0) rotate(0)}}@keyframes spin-67d2e759{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.container{display:flex;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap}.floating-frame{margin:15px;float:left;height:auto;border:1px solid #000;border-radius:4px;overflow:hidden;z-index:5000;position:fixed;cursor:move;bottom:0;right:0}.handle{width:100%;height:20px;background:#ccc;cursor:move;text-align:center}.floating-frame img{width:100%;height:auto}.controls{margin-top:10px}#webglContainer{top:0;left:0}.floating-frame2{margin:15px;width:800px;height:auto;border:1px solid #000;border-radius:4px;overflow:hidden;min-height:200px;z-index:5000}:root{--baklava-control-color-primary: #e28b46;--baklava-control-color-error: #d00000;--baklava-control-color-background: #2c3748;--baklava-control-color-foreground: white;--baklava-control-color-hover: #455670;--baklava-control-color-active: #556986;--baklava-control-color-disabled-foreground: #666c75;--baklava-control-border-radius: 3px;--baklava-sidebar-color-background: #1b202c;--baklava-sidebar-color-foreground: white;--baklava-node-color-background: #1b202c;--baklava-node-color-foreground: white;--baklava-node-color-hover: #e28c4677;--baklava-node-color-selected: var(--baklava-control-color-primary);--baklava-node-color-resize-handle: var(--baklava-control-color-background);--baklava-node-title-color-background: #151a24;--baklava-node-title-color-foreground: white;--baklava-group-node-title-color-background: #215636;--baklava-group-node-title-color-foreground: white;--baklava-node-interface-port-tooltip-color-foreground: var(--baklava-control-color-primary);--baklava-node-interface-port-tooltip-color-background: var(--baklava-editor-background-pattern-black);--baklava-node-border-radius: 6px;--baklava-color-connection-default: #737f96;--baklava-color-connection-allowed: #48bc79;--baklava-color-connection-forbidden: #bc4848;--baklava-editor-background-pattern-default: #202b3c;--baklava-editor-background-pattern-line: #263140;--baklava-editor-background-pattern-black: #263140;--baklava-context-menu-background: #1b202c;--baklava-context-menu-shadow: 0 0 8px rgba(0, 0, 0, .65);--baklava-toolbar-background: #1b202caa;--baklava-toolbar-foreground: white;--baklava-node-palette-background: #1b202caa;--baklava-node-palette-foreground: white;--baklava-selectionbox-color-border: var(--baklava-node-color-background);--baklava-selectionbox-color-background: var(--baklava-node-color-hover);--baklava-visual-transition: .1s linear}.baklava-button{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);transition:background-color var(--baklava-visual-transition);border:none;padding:.45em .35em;border-radius:var(--baklava-control-border-radius);font-size:inherit;cursor:pointer;overflow-x:hidden}.baklava-button:hover{background-color:var(--baklava-control-color-hover)}.baklava-button:active{background-color:var(--baklava-control-color-primary)}.baklava-button.--block{width:100%}.baklava-checkbox{display:flex;padding:.35em 0;cursor:pointer;overflow-x:hidden;align-items:center}.baklava-checkbox .__checkmark-container{display:flex;background-color:var(--baklava-control-color-background);border-radius:var(--baklava-control-border-radius);transition:background-color var(--baklava-visual-transition);width:18px;height:18px}.baklava-checkbox:hover .__checkmark-container{background-color:var(--baklava-control-color-hover)}.baklava-checkbox:active .__checkmark-container{background-color:var(--baklava-control-color-active)}.baklava-checkbox .__checkmark{stroke-dasharray:15;stroke-dashoffset:15;stroke:var(--baklava-control-color-foreground);stroke-width:2px;fill:none;transition:stroke-dashoffset var(--baklava-visual-transition)}.baklava-checkbox.--checked .__checkmark{stroke-dashoffset:0}.baklava-checkbox.--checked .__checkmark-container{background-color:var(--baklava-control-color-primary)}.baklava-checkbox .__label{margin-left:.5rem}.baklava-context-menu{color:var(--baklava-control-color-foreground);position:absolute;display:inline-block;z-index:100;background-color:var(--baklava-context-menu-background);box-shadow:var(--baklava-context-menu-shadow);border-radius:0 0 var(--baklava-control-border-radius) var(--baklava-control-border-radius);min-width:6rem;width:-moz-max-content;width:max-content}.baklava-context-menu>.item{display:flex;align-items:center;padding:.35em 1em;transition:background .05s linear;position:relative}.baklava-context-menu>.item>.__label{flex:1 1 auto}.baklava-context-menu>.item>.__submenu-icon{margin-left:.75rem}.baklava-context-menu>.item.--disabled{color:var(--baklava-control-color-hover)}.baklava-context-menu>.item:not(.--header):not(.--active):not(.--disabled):hover{background:var(--baklava-control-color-primary)}.baklava-context-menu>.item.--active{background:var(--baklava-control-color-primary)}.baklava-context-menu.--nested{left:100%;top:0}.baklava-context-menu.--flipped-x.--nested{left:unset;right:100%}.baklava-context-menu.--flipped-y.--nested{top:unset;bottom:0}.baklava-context-menu>.divider{margin:.35em 0;height:1px;background-color:var(--baklava-control-color-hover)}.baklava-icon{display:block;height:100%}.baklava-icon.--clickable{cursor:pointer;transition:color var(--baklava-visual-transition)}.baklava-icon.--clickable:hover{color:var(--baklava-control-color-primary)}.baklava-input{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);caret-color:var(--baklava-control-color-primary);border:none;border-radius:var(--baklava-control-border-radius);padding:.45em .75em;width:100%;transition:background-color var(--baklava-visual-transition);font-size:inherit;font:inherit}.baklava-input:hover{background-color:var(--baklava-control-color-hover)}.baklava-input:active{background-color:var(--baklava-control-color-active)}.baklava-input:focus-visible{outline:1px solid var(--baklava-control-color-primary)}.baklava-input[type=number]::-webkit-inner-spin-button,.baklava-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.baklava-input.--invalid{box-shadow:0 0 2px 2px var(--baklava-control-color-error)}.baklava-num-input{background:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);border-radius:var(--baklava-control-border-radius);width:100%;display:grid;grid-template-columns:20px 1fr 20px}.baklava-num-input>.__button{display:flex;flex:0 0 auto;width:20px;justify-content:center;align-items:center;transition:background var(--baklava-visual-transition);cursor:pointer}.baklava-num-input>.__button:hover{background-color:var(--baklava-control-color-hover)}.baklava-num-input>.__button:active{background-color:var(--baklava-control-color-active)}.baklava-num-input>.__button.--dec{grid-area:1/1/span 1/span 1}.baklava-num-input>.__button.--dec>svg{transform:rotate(90deg)}.baklava-num-input>.__button.--inc{grid-area:1/3/span 1/span 1}.baklava-num-input>.__button.--inc>svg{transform:rotate(-90deg)}.baklava-num-input>.__button path{stroke:var(--baklava-control-color-foreground);fill:var(--baklava-control-color-foreground)}.baklava-num-input>.__content{grid-area:1/2/span 1/span 1;display:inline-flex;cursor:pointer;max-width:100%;min-width:0;align-items:center;transition:background-color var(--baklava-visual-transition)}.baklava-num-input>.__content:hover{background-color:var(--baklava-control-color-hover)}.baklava-num-input>.__content:active{background-color:var(--baklava-control-color-active)}.baklava-num-input>.__content>.__label,.baklava-num-input>.__content>.__value{margin:.35em 0;padding:0 .5em}.baklava-num-input>.__content>.__label{flex:1;min-width:0;overflow:hidden}.baklava-num-input>.__content>.__value{text-align:right}.baklava-num-input>.__content>input{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);caret-color:var(--baklava-control-color-primary);padding:.35em;width:100%}.baklava-select{width:100%;position:relative;color:var(--baklava-control-color-foreground)}.baklava-select.--open>.__selected{border-bottom-left-radius:0;border-bottom-right-radius:0}.baklava-select.--open>.__selected>.__icon{transform:rotate(180deg)}.baklava-select>.__selected{background-color:var(--baklava-control-color-background);padding:.35em .75em;border-radius:var(--baklava-control-border-radius);transition:background var(--baklava-visual-transition);min-height:1.7em;display:flex;align-items:center;cursor:pointer}.baklava-select>.__selected:hover{background:var(--baklava-control-color-hover)}.baklava-select>.__selected:active{background:var(--baklava-control-color-active)}.baklava-select>.__selected>.__text{flex:1 0 auto;flex-basis:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.baklava-select>.__selected>.__icon{flex:0 0 auto;display:flex;justify-content:center;align-items:center;transition:transform .25s ease;width:18px;height:18px}.baklava-select>.__selected>.__icon path{stroke:var(--baklava-control-color-foreground);fill:var(--baklava-control-color-foreground)}.baklava-select>.__dropdown{position:absolute;top:100%;left:0;right:0;z-index:10;background-color:var(--baklava-context-menu-background);filter:drop-shadow(0 0 4px black);border-radius:0 0 var(--baklava-control-border-radius) var(--baklava-control-border-radius);max-height:15em;overflow-y:scroll}.baklava-select>.__dropdown::-webkit-scrollbar{width:0px;background:transparent}.baklava-select>.__dropdown>.item{padding:.35em .35em .35em 1em;transition:background .05s linear}.baklava-select>.__dropdown>.item:not(.--header):not(.--active){cursor:pointer}.baklava-select>.__dropdown>.item:not(.--header):not(.--active):hover{background:var(--baklava-control-color-hover)}.baklava-select>.__dropdown>.item.--active{background:var(--baklava-control-color-primary)}.baklava-select>.__dropdown>.item.--header{color:var(--baklava-control-color-disabled-foreground);border-bottom:1px solid var(--baklava-control-color-disabled-foreground);padding:.5em .35em .5em 1em}.baklava-slider{background:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);border-radius:var(--baklava-control-border-radius);position:relative;cursor:pointer}.baklava-slider>.__content{display:flex;position:relative}.baklava-slider>.__content>.__label,.baklava-slider>.__content>.__value{flex:1 1 auto;margin:.35em 0;padding:0 .5em;text-overflow:ellipsis}.baklava-slider>.__content>.__value{text-align:right}.baklava-slider>.__content>input{background-color:var(--baklava-control-color-background);color:var(--baklava-control-color-foreground);caret-color:var(--baklava-control-color-primary);padding:.35em;width:100%}.baklava-slider>.__slider{position:absolute;top:0;bottom:0;left:0;background-color:var(--baklava-control-color-primary);border-radius:var(--baklava-control-border-radius)}.baklava-connection{stroke:var(--baklava-color-connection-default);stroke-width:2px;fill:none}.baklava-connection.--temporary{stroke-width:4px;stroke-dasharray:5 5;stroke-dashoffset:0;animation:dash 1s linear infinite;transform:translateY(-1px)}@keyframes dash{to{stroke-dashoffset:20}}.baklava-connection.--allowed{stroke:var(--baklava-color-connection-allowed)}.baklava-connection.--forbidden{stroke:var(--baklava-color-connection-forbidden)}.baklava-minimap{position:absolute;height:15%;width:15%;min-width:150px;max-width:90%;top:20px;right:20px;z-index:900}.baklava-editor{width:100%;height:100%;position:relative;overflow:hidden;outline:none!important;font-family:Lato,Segoe UI,Tahoma,Geneva,Verdana,sans-serif;font-size:15px;touch-action:none}.baklava-editor .background{background-color:var(--baklava-editor-background-pattern-default);background-image:linear-gradient(var(--baklava-editor-background-pattern-black) 2px,transparent 2px),linear-gradient(90deg,var(--baklava-editor-background-pattern-black) 2px,transparent 2px),linear-gradient(var(--baklava-editor-background-pattern-line) 1px,transparent 1px),linear-gradient(90deg,var(--baklava-editor-background-pattern-line) 1px,transparent 1px);background-repeat:repeat;width:100%;height:100%;pointer-events:none!important}.baklava-editor .selection-box{position:absolute;border:1px solid var(--baklava-selectionbox-color-border);background-color:var(--baklava-selectionbox-color-background);pointer-events:none;opacity:.5}.baklava-editor.--start-selection-box{cursor:crosshair}.baklava-editor *:not(input):not(textarea){user-select:none;-moz-user-select:none;-webkit-user-select:none;touch-action:none}.baklava-editor .input-user-select{user-select:auto;-moz-user-select:auto;-webkit-user-select:auto}.baklava-editor *,.baklava-editor *:after,.baklava-editor *:before{box-sizing:border-box}.baklava-editor.--temporary-connection{cursor:crosshair}.baklava-editor .connections-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none!important}.baklava-editor .node-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.baklava-editor .node-container *{pointer-events:all}.baklava-ignore-mouse *{pointer-events:none!important}.baklava-ignore-mouse .__port{pointer-events:all!important}.baklava-node-interface{padding:.25em 0;position:relative}.baklava-node-interface .__port{position:absolute;width:10px;height:10px;background:#fff;border-radius:50%;top:calc(50% - 5px);cursor:crosshair}.baklava-node-interface .__port.--selected{outline:2px var(--baklava-color-connection-default) solid;outline-offset:4px}.baklava-node-interface.--input{text-align:left;padding-left:.5em}.baklava-node-interface.--input .__port{left:-1.1em}.baklava-node-interface.--output{text-align:right;padding-right:.5em}.baklava-node-interface.--output .__port{right:-1.1em}.baklava-node-interface .__tooltip{position:absolute;left:5px;top:15px;transform:translate(-50%);background:var(--baklava-node-interface-port-tooltip-color-background);color:var(--baklava-node-interface-port-tooltip-color-foreground);padding:.25em .5em;text-align:center;z-index:2}.baklava-node-palette{position:absolute;left:0;top:60px;width:250px;height:calc(100% - 60px);z-index:3;padding:2rem;overflow-y:auto;background:var(--baklava-node-palette-background);color:var(--baklava-node-palette-foreground)}.baklava-node-palette h1{margin-top:2rem}.baklava-node.--palette{position:unset;margin:1rem 0;cursor:grab}.baklava-node.--palette:first-child{margin-top:0}.baklava-node.--palette .__title{padding:.5rem;border-radius:var(--baklava-node-border-radius)}.baklava-dragged-node{position:absolute;width:calc(250px - 4rem);height:40px;z-index:4;pointer-events:none}.baklava-node{background:var(--baklava-node-color-background);color:var(--baklava-node-color-foreground);border:1px solid transparent;border-radius:var(--baklava-node-border-radius);position:absolute;box-shadow:0 0 4px #000c;transition:border-color var(--baklava-visual-transition),box-shadow var(--baklava-visual-transition);width:var(--width)}.baklava-node:hover{border-color:var(--baklava-node-color-hover)}.baklava-node:hover .__resize-handle:after{opacity:1}.baklava-node.--selected{z-index:5;border-color:var(--baklava-node-color-selected)}.baklava-node.--dragging{box-shadow:0 0 12px #000c}.baklava-node.--dragging>.__title{cursor:grabbing}.baklava-node>.__title{display:flex;background:var(--baklava-node-title-color-background);color:var(--baklava-node-title-color-foreground);padding:.4em .75em;border-radius:var(--baklava-node-border-radius) var(--baklava-node-border-radius) 0 0;cursor:grab}.baklava-node>.__title>*:first-child{flex-grow:1}.baklava-node>.__title>.__title-label{pointer-events:none}.baklava-node>.__title>.__menu{position:relative;cursor:initial}.baklava-node[data-node-type^=__baklava_]>.__title{background:var(--baklava-group-node-title-color-background);color:var(--baklava-group-node-title-color-foreground)}.baklava-node>.__content{padding:.75em}.baklava-node>.__content.--reverse-y{display:flex;flex-direction:column-reverse}.baklava-node>.__content>div>div{margin:.5em 0}.baklava-node.--two-column>.__content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto;grid-template-areas:". ." ". ."}.baklava-node.--two-column>.__content>.__inputs{grid-row:1;grid-column:1}.baklava-node.--two-column>.__content>.__outputs{grid-row:1;grid-column:2}.baklava-node .__resize-handle{position:absolute;right:0;bottom:0;width:1rem;height:1rem;transform:translate(50%);cursor:ew-resize}.baklava-node .__resize-handle:after{content:"";position:absolute;bottom:0;left:-.5rem;width:1rem;height:1rem;opacity:0;border-bottom-right-radius:var(--baklava-node-border-radius);transition:opacity var(--baklava-visual-transition);background:linear-gradient(-45deg,transparent 10%,var(--baklava-node-color-resize-handle) 10%,var(--baklava-node-color-resize-handle) 15%,transparent 15%,transparent 30%,var(--baklava-node-color-resize-handle) 30%,var(--baklava-node-color-resize-handle) 35%,transparent 35%,transparent 50%,var(--baklava-node-color-resize-handle) 50%,var(--baklava-node-color-resize-handle) 55%,transparent 55%)}.baklava-sidebar{position:absolute;height:100%;width:25%;min-width:300px;max-width:90%;top:0;right:0;z-index:1000;background-color:var(--baklava-sidebar-color-background);color:var(--baklava-sidebar-color-foreground);box-shadow:none;overflow-x:hidden;padding:1em;transform:translate(100%);transition:transform .5s;display:flex;flex-direction:column}.baklava-sidebar.--open{transform:translate(0);box-shadow:0 0 15px #000}.baklava-sidebar .__resizer{position:absolute;left:0;top:0;height:100%;width:4px;cursor:col-resize}.baklava-sidebar .__header{display:flex;align-items:center}.baklava-sidebar .__header .__node-name{margin-left:.5rem}.baklava-sidebar .__close{font-size:2em;border:none;background:none;color:inherit;cursor:pointer}.baklava-sidebar .__interface{margin:.5em 0}.baklava-toolbar{position:absolute;left:0;top:0;width:100%;height:60px;z-index:3;padding:.5rem 2rem;background:var(--baklava-toolbar-background);color:var(--baklava-toolbar-foreground);display:flex;align-items:center}.baklava-toolbar-entry{margin-left:.5rem;margin-right:.5rem}.baklava-toolbar-button{color:var(--baklava-toolbar-foreground);background:none;border:none;transition:color var(--baklava-visual-transition)}.baklava-toolbar-button:not([disabled]){cursor:pointer}.baklava-toolbar-button:hover:not([disabled]){color:var(--baklava-control-color-primary)}.baklava-toolbar-button[disabled]{color:var(--baklava-control-color-disabled-foreground)}.slide-fade-enter-active,.slide-fade-leave-active{transition:all .1s ease-out}.slide-fade-enter-from,.slide-fade-leave-to{transform:translateY(5px);opacity:0}.fade-enter-active,.fade-leave-active{transition:opacity .1s ease-out!important}.fade-enter-from,.fade-leave-to{opacity:0}.loading-indicator[data-v-fcb6b036]{display:flex;justify-content:center;align-items:center;height:100px;font-size:1.2em;color:#666}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(63 131 248 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(63 131 248 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:PTSans,Roboto,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.tooltip-arrow,.tooltip-arrow:before{position:absolute;width:8px;height:8px;background:inherit}.tooltip-arrow{visibility:hidden}.tooltip-arrow:before{content:"";visibility:visible;transform:rotate(45deg)}[data-tooltip-style^=light]+.tooltip>.tooltip-arrow:before{border-style:solid;border-color:#e5e7eb}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=top]>.tooltip-arrow:before{border-bottom-width:1px;border-right-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=right]>.tooltip-arrow:before{border-bottom-width:1px;border-left-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=bottom]>.tooltip-arrow:before{border-top-width:1px;border-left-width:1px}[data-tooltip-style^=light]+.tooltip[data-popper-placement^=left]>.tooltip-arrow:before{border-top-width:1px;border-right-width:1px}.tooltip[data-popper-placement^=top]>.tooltip-arrow{bottom:-4px}.tooltip[data-popper-placement^=bottom]>.tooltip-arrow{top:-4px}.tooltip[data-popper-placement^=left]>.tooltip-arrow{right:-4px}.tooltip[data-popper-placement^=right]>.tooltip-arrow{left:-4px}.tooltip.invisible>.tooltip-arrow:before{visibility:hidden}[data-popper-arrow],[data-popper-arrow]:before{position:absolute;width:8px;height:8px;background:inherit}[data-popper-arrow]{visibility:hidden}[data-popper-arrow]:before{content:"";visibility:visible;transform:rotate(45deg)}[data-popper-arrow]:after{content:"";visibility:visible;transform:rotate(45deg);position:absolute;width:9px;height:9px;background:inherit}[role=tooltip]>[data-popper-arrow]:before{border-style:solid;border-color:#e5e7eb}.dark [role=tooltip]>[data-popper-arrow]:before{border-style:solid;border-color:#4b5563}[role=tooltip]>[data-popper-arrow]:after{border-style:solid;border-color:#e5e7eb}.dark [role=tooltip]>[data-popper-arrow]:after{border-style:solid;border-color:#4b5563}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]:before{border-bottom-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]:after{border-bottom-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]:before{border-bottom-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]:after{border-bottom-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]:before{border-top-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]:after{border-top-width:1px;border-left-width:1px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]:before{border-top-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]:after{border-top-width:1px;border-right-width:1px}[data-popover][role=tooltip][data-popper-placement^=top]>[data-popper-arrow]{bottom:-5px}[data-popover][role=tooltip][data-popper-placement^=bottom]>[data-popper-arrow]{top:-5px}[data-popover][role=tooltip][data-popper-placement^=left]>[data-popper-arrow]{right:-5px}[data-popover][role=tooltip][data-popper-placement^=right]>[data-popper-arrow]{left:-5px}[role=tooltip].invisible>[data-popper-arrow]:before{visibility:hidden}[role=tooltip].invisible>[data-popper-arrow]:after{visibility:hidden}[type=text],[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow: 0 0 #0000}[type=text]:focus,[type=email]:focus,[type=url]:focus,[type=password]:focus,[type=number]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=month]:focus,[type=search]:focus,[type=tel]:focus,[type=time]:focus,[type=week]:focus,[multiple]:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #1C64F2;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#1c64f2}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}select:not([size]){background-image:url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 10 6'%3e %3cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 1 4 4 4-4'/%3e %3c/svg%3e");background-position:right .75rem center;background-repeat:no-repeat;background-size:.75em .75em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple]{background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#1c64f2;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow: 0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 2px;--tw-ring-offset-color: #fff;--tw-ring-color: #1C64F2;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked,.dark [type=checkbox]:checked,.dark [type=radio]:checked{border-color:transparent;background-color:currentColor;background-size:.55em .55em;background-position:center;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3e %3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3e %3c/svg%3e");background-repeat:no-repeat;background-size:.55em .55em;-webkit-print-color-adjust:exact;print-color-adjust:exact}[type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");background-size:1em 1em}.dark [type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");background-size:1em 1em}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml,%3csvg aria-hidden='true' xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 12'%3e %3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M1 5.917 5.724 10.5 15 1.5'/%3e %3c/svg%3e");background-color:currentColor;border-color:transparent;background-position:center;background-repeat:no-repeat;background-size:.55em .55em;-webkit-print-color-adjust:exact;print-color-adjust:exact}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{border-color:transparent;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px auto inherit}input[type=file]::file-selector-button{color:#fff;background:#1f2937;border:0;font-weight:500;font-size:.875rem;cursor:pointer;padding:.625rem 1rem .625rem 2rem;margin-inline-start:-1rem;margin-inline-end:1rem}input[type=file]::file-selector-button:hover{background:#374151}.dark input[type=file]::file-selector-button{color:#fff;background:#4b5563}.dark input[type=file]::file-selector-button:hover{background:#6b7280}input[type=range]::-webkit-slider-thumb{height:1.25rem;width:1.25rem;background:#1c64f2;border-radius:9999px;border:0;appearance:none;-moz-appearance:none;-webkit-appearance:none;cursor:pointer}input[type=range]:disabled::-webkit-slider-thumb{background:#9ca3af}.dark input[type=range]:disabled::-webkit-slider-thumb{background:#6b7280}input[type=range]:focus::-webkit-slider-thumb{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1px;--tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity))}input[type=range]::-moz-range-thumb{height:1.25rem;width:1.25rem;background:#1c64f2;border-radius:9999px;border:0;appearance:none;-moz-appearance:none;-webkit-appearance:none;cursor:pointer}input[type=range]:disabled::-moz-range-thumb{background:#9ca3af}.dark input[type=range]:disabled::-moz-range-thumb{background:#6b7280}input[type=range]::-moz-range-progress{background:#3f83f8}input[type=range]::-ms-fill-lower{background:#3f83f8}.toggle-bg:after{content:"";position:absolute;top:.125rem;left:.125rem;background:#fff;border-color:#d1d5db;border-width:1px;border-radius:9999px;height:1.25rem;width:1.25rem;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-duration:.15s;box-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color)}input:checked+.toggle-bg:after{transform:translate(100%);border-color:#fff}input:checked+.toggle-bg{background:#1c64f2;border-color:#1c64f2}*{scrollbar-color:initial;scrollbar-width:initial}body{min-height:100vh;background-image:linear-gradient(to bottom right,var(--tw-gradient-stops));--tw-gradient-from: #e0eaff var(--tw-gradient-from-position);--tw-gradient-to: rgb(224 234 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #f0e6ff var(--tw-gradient-to-position)}body:is(.dark *){background-image:linear-gradient(to bottom right,var(--tw-gradient-stops));--tw-gradient-from: #0f2647 var(--tw-gradient-from-position);--tw-gradient-to: rgb(15 38 71 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #1e1b4b var(--tw-gradient-to-position)}html{scroll-behavior:smooth}body{font-family:Roboto,sans-serif}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.-bottom-0\.5{bottom:-.125rem}.-bottom-1{bottom:-.25rem}.-bottom-1\.5{bottom:-.375rem}.-bottom-2{bottom:-.5rem}.-bottom-4{bottom:-1rem}.-left-1\.5{left:-.375rem}.-right-0\.5{right:-.125rem}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-top-1\.5{top:-.375rem}.-top-2{top:-.5rem}.bottom-0{bottom:0}.bottom-16{bottom:4rem}.bottom-2{bottom:.5rem}.bottom-2\.5{bottom:.625rem}.bottom-20{bottom:5rem}.bottom-4{bottom:1rem}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.bottom-\[60px\]{bottom:60px}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-20{left:5rem}.left-3{left:.75rem}.right-0{right:0}.right-2{right:.5rem}.right-2\.5{right:.625rem}.right-20{right:5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-20{top:5rem}.top-3{top:.75rem}.top-full{top:100%}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.-m-1{margin:-.25rem}.-m-2{margin:-.5rem}.-m-4{margin:-1rem}.m-0{margin:0}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-4{margin:1rem}.-mx-1\.5{margin-left:-.375rem;margin-right:-.375rem}.-mx-5{margin-left:-1.25rem;margin-right:-1.25rem}.-my-1\.5{margin-top:-.375rem;margin-bottom:-.375rem}.mx-0{margin-left:0;margin-right:0}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-1\.5{margin-left:.375rem;margin-right:.375rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-8{margin-top:2rem;margin-bottom:2rem}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-3\.5{margin-bottom:.875rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-5{margin-left:1.25rem}.ml-auto{margin-left:auto}.mr-0{margin-right:0}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-14{margin-top:3.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-0{height:0px}.h-0\.5{height:.125rem}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-4\/5{height:80%}.h-48{height:12rem}.h-5{height:1.25rem}.h-5\/6{height:83.333333%}.h-56{height:14rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[200px\]{height:200px}.h-\[220px\]{height:220px}.h-auto{height:auto}.h-full{height:100%}.h-modal{height:calc(100% - 2rem)}.h-px{height:1px}.h-screen{height:100vh}.max-h-60{max-height:15rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.max-h-\[400px\]{max-height:400px}.max-h-\[60vh\]{max-height:60vh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.max-h-full{max-height:100%}.min-h-\[500px\]{min-height:500px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-11\/12{width:91.666667%}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-3\/5{width:60%}.w-36{width:9rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[300px\]{width:300px}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.min-w-80{min-width:20rem}.min-w-96{min-width:24rem}.min-w-\[120px\]{min-width:120px}.min-w-\[14rem\]{min-width:14rem}.min-w-\[15rem\]{min-width:15rem}.min-w-\[23rem\]{min-width:23rem}.min-w-\[24rem\]{min-width:24rem}.min-w-\[300px\]{min-width:300px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-6xl{max-width:72rem}.max-w-7xl{max-width:80rem}.max-w-\[14rem\]{max-width:14rem}.max-w-\[15rem\]{max-width:15rem}.max-w-\[23rem\]{max-width:23rem}.max-w-\[24rem\]{max-width:24rem}.max-w-\[300px\]{max-width:300px}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.flex-grow-0{flex-grow:0}.grow{flex-grow:1}.origin-left{transform-origin:left}.origin-top{transform-origin:top}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-0{--tw-translate-y: -0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-full{--tw-translate-y: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\/2{--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1\/2{--tw-translate-y: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-x-0{--tw-scale-x: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-none{transform:none}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-\[50px\,1fr\]{grid-template-columns:50px 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.place-content-center{place-content:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.-space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-1rem * var(--tw-space-x-reverse));margin-left:calc(-1rem * calc(1 - var(--tw-space-x-reverse)))}.-space-x-px>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(-1px * var(--tw-space-x-reverse));margin-left:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.self-center{align-self:center}.self-stretch{align-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.\!rounded-full{border-radius:9999px!important}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-t-2{border-top-width:2px}.border-t-4{border-top-width:4px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-bg-dark{border-color:var(--color-bg-dark)}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(195 221 253 / var(--tw-border-opacity))}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity))}.border-blue-700{--tw-border-opacity: 1;border-color:rgb(26 86 219 / var(--tw-border-opacity))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-500{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(14 159 110 / var(--tw-border-opacity))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(5 122 85 / var(--tw-border-opacity))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(4 108 78 / var(--tw-border-opacity))}.border-pink-600{--tw-border-opacity: 1;border-color:rgb(214 31 105 / var(--tw-border-opacity))}.border-pink-700{--tw-border-opacity: 1;border-color:rgb(191 18 93 / var(--tw-border-opacity))}.border-primary{border-color:var(--color-primary)}.border-primary-light{border-color:var(--color-primary-light)}.border-purple-600{--tw-border-opacity: 1;border-color:rgb(126 58 242 / var(--tw-border-opacity))}.border-purple-700{--tw-border-opacity: 1;border-color:rgb(108 43 217 / var(--tw-border-opacity))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(240 82 82 / var(--tw-border-opacity))}.border-red-600{--tw-border-opacity: 1;border-color:rgb(224 36 36 / var(--tw-border-opacity))}.border-red-700{--tw-border-opacity: 1;border-color:rgb(200 30 30 / var(--tw-border-opacity))}.border-secondary{border-color:var(--color-secondary)}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(227 160 8 / var(--tw-border-opacity))}.border-yellow-500{--tw-border-opacity: 1;border-color:rgb(194 120 3 / var(--tw-border-opacity))}.border-t-blue-600{--tw-border-opacity: 1;border-top-color:rgb(28 100 242 / var(--tw-border-opacity))}.bg-accent{background-color:var(--color-accent)}.bg-bg-dark-tone-panel{background-color:var(--color-bg-dark-tone-panel)}.bg-bg-light{background-color:var(--color-bg-light)}.bg-bg-light-tone{background-color:var(--color-bg-light-tone)}.bg-bg-light-tone-panel{background-color:var(--color-bg-light-tone-panel)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity))}.bg-blue-200{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(118 169 250 / var(--tw-bg-opacity))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(235 245 255 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(222 247 236 / var(--tw-bg-opacity))}.bg-green-200{--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(49 196 141 / var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(14 159 110 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}.bg-green-700{--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}.bg-green-900{--tw-bg-opacity: 1;background-color:rgb(1 71 55 / var(--tw-bg-opacity))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(229 237 255 / var(--tw-bg-opacity))}.bg-indigo-200{--tw-bg-opacity: 1;background-color:rgb(205 219 254 / var(--tw-bg-opacity))}.bg-indigo-500{--tw-bg-opacity: 1;background-color:rgb(104 117 245 / var(--tw-bg-opacity))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(88 80 236 / var(--tw-bg-opacity))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(254 236 220 / var(--tw-bg-opacity))}.bg-pink-100{--tw-bg-opacity: 1;background-color:rgb(252 232 243 / var(--tw-bg-opacity))}.bg-pink-200{--tw-bg-opacity: 1;background-color:rgb(250 209 232 / var(--tw-bg-opacity))}.bg-pink-700{--tw-bg-opacity: 1;background-color:rgb(191 18 93 / var(--tw-bg-opacity))}.bg-primary{background-color:var(--color-primary)}.bg-primary-light{background-color:var(--color-primary-light)}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(237 235 254 / var(--tw-bg-opacity))}.bg-purple-200{--tw-bg-opacity: 1;background-color:rgb(220 215 254 / var(--tw-bg-opacity))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}.bg-purple-600{--tw-bg-opacity: 1;background-color:rgb(126 58 242 / var(--tw-bg-opacity))}.bg-purple-700{--tw-bg-opacity: 1;background-color:rgb(108 43 217 / var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(253 232 232 / var(--tw-bg-opacity))}.bg-red-200{--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(249 128 128 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(240 82 82 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}.bg-red-700{--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}.bg-red-900{--tw-bg-opacity: 1;background-color:rgb(119 29 29 / var(--tw-bg-opacity))}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-white\/30{background-color:#ffffff4d}.bg-white\/50{background-color:#ffffff80}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(253 246 178 / var(--tw-bg-opacity))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(227 160 8 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-70{--tw-bg-opacity: .7}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-bg-light{--tw-gradient-from: var(--color-bg-light) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-bg-light-tone{--tw-gradient-from: var(--color-bg-light-tone) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-400{--tw-gradient-from: #76A9FA var(--tw-gradient-from-position);--tw-gradient-to: rgb(118 169 250 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-500{--tw-gradient-from: #3F83F8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(63 131 248 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-500\/10{--tw-gradient-from: rgb(63 131 248 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(63 131 248 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-500{--tw-gradient-from: #06b6d4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-400{--tw-gradient-from: #31C48D var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 196 141 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #0E9F6E var(--tw-gradient-from-position);--tw-gradient-to: rgb(14 159 110 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-600{--tw-gradient-from: #5850EC var(--tw-gradient-from-position);--tw-gradient-to: rgb(88 80 236 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-lime-500{--tw-gradient-from: #84cc16 var(--tw-gradient-from-position);--tw-gradient-to: rgb(132 204 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-pink-500{--tw-gradient-from: #E74694 var(--tw-gradient-from-position);--tw-gradient-to: rgb(231 70 148 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #9061F9 var(--tw-gradient-from-position);--tw-gradient-to: rgb(144 97 249 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-600{--tw-gradient-from: #7E3AF2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-200{--tw-gradient-from: #FBD5D5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 213 213 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #F05252 var(--tw-gradient-from-position);--tw-gradient-to: rgb(240 82 82 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-200{--tw-gradient-from: #AFECEF var(--tw-gradient-from-position);--tw-gradient-to: rgb(175 236 239 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-300{--tw-gradient-from: #7EDCE2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 220 226 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-500{--tw-gradient-from: #0694A2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 148 162 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-5\%{--tw-gradient-from-position: 5%}.via-bg-light{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--color-bg-light) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-blue-600{--tw-gradient-to: rgb(28 100 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #1C64F2 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-cyan-600{--tw-gradient-to: rgb(8 145 178 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #0891b2 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-green-600{--tw-gradient-to: rgb(5 122 85 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #057A55 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-lime-600{--tw-gradient-to: rgb(101 163 13 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #65a30d var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-pink-600{--tw-gradient-to: rgb(214 31 105 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #D61F69 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-purple-600{--tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #7E3AF2 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-red-300{--tw-gradient-to: rgb(248 180 180 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #F8B4B4 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-red-600{--tw-gradient-to: rgb(224 36 36 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #E02424 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-teal-600{--tw-gradient-to: rgb(4 116 129 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #047481 var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-10\%{--tw-gradient-via-position: 10%}.to-blue-500{--tw-gradient-to: #3F83F8 var(--tw-gradient-to-position)}.to-blue-600{--tw-gradient-to: #1C64F2 var(--tw-gradient-to-position)}.to-blue-700{--tw-gradient-to: #1A56DB var(--tw-gradient-to-position)}.to-cyan-700{--tw-gradient-to: #0e7490 var(--tw-gradient-to-position)}.to-green-700{--tw-gradient-to: #046C4E var(--tw-gradient-to-position)}.to-lime-200{--tw-gradient-to: #d9f99d var(--tw-gradient-to-position)}.to-lime-300{--tw-gradient-to: #bef264 var(--tw-gradient-to-position)}.to-lime-700{--tw-gradient-to: #4d7c0f var(--tw-gradient-to-position)}.to-orange-400{--tw-gradient-to: #FF8A4C var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #E74694 var(--tw-gradient-to-position)}.to-pink-700{--tw-gradient-to: #BF125D var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #9061F9 var(--tw-gradient-to-position)}.to-purple-500\/10{--tw-gradient-to: rgb(144 97 249 / .1) var(--tw-gradient-to-position)}.to-purple-600{--tw-gradient-to: #7E3AF2 var(--tw-gradient-to-position)}.to-purple-700{--tw-gradient-to: #6C2BD9 var(--tw-gradient-to-position)}.to-red-700{--tw-gradient-to: #C81E1E var(--tw-gradient-to-position)}.to-teal-700{--tw-gradient-to: #036672 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-white{--tw-gradient-to: #ffffff var(--tw-gradient-to-position)}.to-yellow-200{--tw-gradient-to: #FCE96A var(--tw-gradient-to-position)}.to-100\%{--tw-gradient-to-position: 100%}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.fill-blue-600{fill:#1c64f2}.fill-current{fill:currentColor}.fill-gray-300{fill:#d1d5db}.fill-gray-600{fill:#4b5563}.fill-green-500{fill:#0e9f6e}.fill-pink-600{fill:#d61f69}.fill-purple-600{fill:#7e3af2}.fill-red-600{fill:#e02424}.fill-secondary{fill:var(--color-secondary)}.fill-white{fill:#fff}.fill-yellow-400{fill:#e3a008}.stroke-2{stroke-width:2}.object-cover{-o-object-fit:cover;object-fit:cover}.object-fill{-o-object-fit:fill;object-fit:fill}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pb-20{padding-bottom:5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pb-80{padding-bottom:20rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pr-10{padding-right:2.5rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-12{padding-top:3rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-bottom{vertical-align:bottom}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:PTSans,Roboto,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-6xl{font-size:3.75rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-100{--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-200{--tw-text-opacity: 1;color:rgb(188 240 218 / var(--tw-text-opacity))}.text-green-400{--tw-text-opacity: 1;color:rgb(49 196 141 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(5 122 85 / var(--tw-text-opacity))}.text-green-700{--tw-text-opacity: 1;color:rgb(4 108 78 / var(--tw-text-opacity))}.text-green-800{--tw-text-opacity: 1;color:rgb(3 84 63 / var(--tw-text-opacity))}.text-green-900{--tw-text-opacity: 1;color:rgb(1 71 55 / var(--tw-text-opacity))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(104 117 245 / var(--tw-text-opacity))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(81 69 205 / var(--tw-text-opacity))}.text-indigo-800{--tw-text-opacity: 1;color:rgb(66 56 157 / var(--tw-text-opacity))}.text-indigo-900{--tw-text-opacity: 1;color:rgb(54 47 120 / var(--tw-text-opacity))}.text-light-text-panel{color:var(--color-light-text-panel)}.text-orange-200{--tw-text-opacity: 1;color:rgb(252 217 189 / var(--tw-text-opacity))}.text-orange-500{--tw-text-opacity: 1;color:rgb(255 90 31 / var(--tw-text-opacity))}.text-orange-600{--tw-text-opacity: 1;color:rgb(208 56 1 / var(--tw-text-opacity))}.text-pink-500{--tw-text-opacity: 1;color:rgb(231 70 148 / var(--tw-text-opacity))}.text-pink-600{--tw-text-opacity: 1;color:rgb(214 31 105 / var(--tw-text-opacity))}.text-pink-700{--tw-text-opacity: 1;color:rgb(191 18 93 / var(--tw-text-opacity))}.text-pink-800{--tw-text-opacity: 1;color:rgb(153 21 75 / var(--tw-text-opacity))}.text-pink-900{--tw-text-opacity: 1;color:rgb(117 26 61 / var(--tw-text-opacity))}.text-purple-500{--tw-text-opacity: 1;color:rgb(144 97 249 / var(--tw-text-opacity))}.text-purple-600{--tw-text-opacity: 1;color:rgb(126 58 242 / var(--tw-text-opacity))}.text-purple-700{--tw-text-opacity: 1;color:rgb(108 43 217 / var(--tw-text-opacity))}.text-purple-800{--tw-text-opacity: 1;color:rgb(85 33 181 / var(--tw-text-opacity))}.text-purple-900{--tw-text-opacity: 1;color:rgb(74 29 150 / var(--tw-text-opacity))}.text-red-100{--tw-text-opacity: 1;color:rgb(253 232 232 / var(--tw-text-opacity))}.text-red-200{--tw-text-opacity: 1;color:rgb(251 213 213 / var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(249 128 128 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(224 36 36 / var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(200 30 30 / var(--tw-text-opacity))}.text-red-800{--tw-text-opacity: 1;color:rgb(155 28 28 / var(--tw-text-opacity))}.text-red-900{--tw-text-opacity: 1;color:rgb(119 29 29 / var(--tw-text-opacity))}.text-secondary{color:var(--color-secondary)}.text-slate-50{--tw-text-opacity: 1;color:rgb(248 250 252 / var(--tw-text-opacity))}.text-slate-950{--tw-text-opacity: 1;color:rgb(2 6 23 / var(--tw-text-opacity))}.text-teal-500{--tw-text-opacity: 1;color:rgb(6 148 162 / var(--tw-text-opacity))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(227 160 8 / var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(194 120 3 / var(--tw-text-opacity))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(142 75 16 / var(--tw-text-opacity))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(114 59 19 / var(--tw-text-opacity))}.text-yellow-900{--tw-text-opacity: 1;color:rgb(99 49 18 / var(--tw-text-opacity))}.text-opacity-95{--tw-text-opacity: .95}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-blue-500\/50{--tw-shadow-color: rgb(63 131 248 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-blue-800\/80{--tw-shadow-color: rgb(30 66 159 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-cyan-500\/50{--tw-shadow-color: rgb(6 182 212 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-cyan-800\/80{--tw-shadow-color: rgb(21 94 117 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-green-500\/50{--tw-shadow-color: rgb(14 159 110 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-green-800\/80{--tw-shadow-color: rgb(3 84 63 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-lime-500\/50{--tw-shadow-color: rgb(132 204 22 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-lime-800\/80{--tw-shadow-color: rgb(63 98 18 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-pink-500\/50{--tw-shadow-color: rgb(231 70 148 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-pink-800\/80{--tw-shadow-color: rgb(153 21 75 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-500\/50{--tw-shadow-color: rgb(144 97 249 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-800\/80{--tw-shadow-color: rgb(85 33 181 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-red-500\/50{--tw-shadow-color: rgb(240 82 82 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-red-800\/80{--tw-shadow-color: rgb(155 28 28 / .8);--tw-shadow: var(--tw-shadow-colored)}.shadow-teal-500\/50{--tw-shadow-color: rgb(6 148 162 / .5);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.ring-blue-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity))}.ring-cyan-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(21 94 117 / var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.ring-gray-600{--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}.ring-gray-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity))}.ring-green-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(3 84 63 / var(--tw-ring-opacity))}.ring-pink-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(153 21 75 / var(--tw-ring-opacity))}.ring-pink-900{--tw-ring-opacity: 1;--tw-ring-color: rgb(117 26 61 / var(--tw-ring-opacity))}.ring-purple-800{--tw-ring-opacity: 1;--tw-ring-color: rgb(85 33 181 / var(--tw-ring-opacity))}.ring-purple-900{--tw-ring-opacity: 1;--tw-ring-color: rgb(74 29 150 / var(--tw-ring-opacity))}.ring-red-400{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}.ring-red-900{--tw-ring-opacity: 1;--tw-ring-color: rgb(119 29 29 / var(--tw-ring-opacity))}.ring-opacity-5{--tw-ring-opacity: .05}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-sm{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-75{transition-duration:75ms}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.scrollbar{scrollbar-width:auto;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar::-webkit-scrollbar{display:block;width:var(--scrollbar-width, 16px);height:var(--scrollbar-height, 16px)}.scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar-thin::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar-thin::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar-thin::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar-thin::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar-thin::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar-thin::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar-thin{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar-thin::-webkit-scrollbar{display:block;width:8px;height:8px}.scrollbar-track-bg-light{--scrollbar-track: var(--color-bg-light) !important}.scrollbar-track-bg-light-tone{--scrollbar-track: var(--color-bg-light-tone) !important}.scrollbar-track-gray-200{--scrollbar-track: #E5E7EB !important}.scrollbar-thumb-bg-light-tone{--scrollbar-thumb: var(--color-bg-light-tone) !important}.scrollbar-thumb-bg-light-tone-panel{--scrollbar-thumb: var(--color-bg-light-tone-panel) !important}.scrollbar-thumb-gray-400{--scrollbar-thumb: #9CA3AF !important}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.display-none{display:none}h1{margin-bottom:1.5rem;font-size:2.25rem;line-height:2.5rem;font-weight:700;--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}h1:is(.dark *){--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}@media (min-width: 768px){h1{font-size:3rem;line-height:1}}h2{margin-bottom:1rem;font-size:1.875rem;line-height:2.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}h2:is(.dark *){--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}h3{margin-bottom:.75rem;font-size:1.5rem;line-height:2rem;font-weight:500;--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}h3:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}h4{margin-bottom:.5rem;font-size:1.25rem;line-height:1.75rem;font-weight:500;--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}h4:is(.dark *){--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}h1,h2{border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity));padding-bottom:.5rem}h1:is(.dark *),h2:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity))}p{overflow-wrap:break-word;font-size:1rem;line-height:1.5rem;--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}p:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}ul{margin-left:0;list-style-type:disc}li{margin-left:1.25rem;list-style-type:disc}ol{margin-left:1.25rem;list-style-type:decimal}:root{--color-primary: #4a90e2;--color-primary-light: #6ab7f1;--color-secondary: #8ab8e0;--color-accent: #3a7ca1;--color-light-text-panel: #ffffff;--color-dark-text-panel: #e0e0e0;--color-bg-light-panel: #f0faff;--color-bg-light: #ffffff;--color-bg-light-tone: #e0f0ff;--color-bg-light-code-block: #f5faff;--color-bg-light-tone-panel: #d0e0f0;--color-bg-light-discussion: #f8faff;--color-bg-light-discussion-odd: #f0faff;--color-bg-dark: #0a0a1a;--color-bg-dark-tone: #151521;--color-bg-dark-tone-panel: #1c1c2a;--color-bg-dark-code-block: #151521;--color-bg-dark-discussion: #0e0e1a;--color-bg-dark-discussion-odd: #0d0d1a}textarea,input,select{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity))}textarea:is(.dark *),input:is(.dark *),select:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}.background-color{min-height:100vh;background-image:linear-gradient(to bottom right,var(--tw-gradient-stops));--tw-gradient-from: #E1EFFE var(--tw-gradient-from-position);--tw-gradient-to: rgb(225 239 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #CABFFD var(--tw-gradient-to-position)}.background-color:is(.dark *){--tw-gradient-from: #1E429F var(--tw-gradient-from-position);--tw-gradient-to: rgb(30 66 159 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #4A1D96 var(--tw-gradient-to-position)}.toolbar-color{border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity));--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.toolbar-color:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.panels-color{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.panels-color:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.unicolor-panels-color{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.unicolor-panels-color:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.chatbox-color{--tw-bg-opacity: 1;background-color:rgb(235 245 255 / var(--tw-bg-opacity))}.chatbox-color:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.message{position:relative;margin:.5rem;display:flex;width:100%;flex-grow:1;flex-direction:column;flex-wrap:wrap;overflow:visible;border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity));padding:1.25rem 1.25rem .75rem;font-size:1.125rem;line-height:1.75rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.message:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity))}.message{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(35 56 118 / var(--tw-text-opacity))}.message:is(.dark *){background-image:linear-gradient(to bottom right,var(--tw-gradient-stops));--tw-gradient-from: #233876 var(--tw-gradient-from-position);--tw-gradient-to: rgb(35 56 118 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #1E429F var(--tw-gradient-to-position);--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.message:hover{--tw-border-opacity: 1;border-color:rgb(118 169 250 / var(--tw-border-opacity))}.message:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.message:nth-child(2n){--tw-bg-opacity: 1;background-color:rgb(235 245 255 / var(--tw-bg-opacity))}.message:nth-child(2n):is(.dark *){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}.message:nth-child(odd){--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity))}.message:nth-child(odd):is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.message-header{margin-bottom:.5rem;font-size:1.25rem;line-height:1.75rem;font-weight:600}.message-content{font-size:1.125rem;line-height:1.75rem;line-height:1.625}body{min-height:100vh;--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity));font-size:1rem;line-height:1.5rem}body:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}.discussion{margin-right:.5rem;font-size:.75rem;line-height:1rem}.discussion-hilighted{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity));font-size:.75rem;line-height:1rem}.discussion-hilighted:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.bg-gradient-welcome{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops));--tw-gradient-from: #E1EFFE var(--tw-gradient-from-position);--tw-gradient-to: rgb(225 239 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #CABFFD var(--tw-gradient-to-position)}.bg-gradient-welcome:is(.dark *){--tw-gradient-from: #1E429F var(--tw-gradient-from-position);--tw-gradient-to: rgb(30 66 159 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #4A1D96 var(--tw-gradient-to-position)}.bg-gradient-progress{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #C3DDFD var(--tw-gradient-from-position);--tw-gradient-to: rgb(195 221 253 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #A4CAFE var(--tw-gradient-to-position)}.bg-gradient-progress:is(.dark *){--tw-gradient-from: #1A56DB var(--tw-gradient-from-position);--tw-gradient-to: rgb(26 86 219 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #1C64F2 var(--tw-gradient-to-position)}.text-gradient-title{background-image:linear-gradient(to right,var(--tw-gradient-stops));--tw-gradient-from: #1A56DB var(--tw-gradient-from-position);--tw-gradient-to: rgb(26 86 219 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #3F83F8 var(--tw-gradient-to-position);-webkit-background-clip:text;background-clip:text;color:transparent}.text-gradient-title:is(.dark *){--tw-gradient-from: #A4CAFE var(--tw-gradient-from-position);--tw-gradient-to: rgb(164 202 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to: #3F83F8 var(--tw-gradient-to-position)}.text-subtitle{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.text-subtitle:is(.dark *){--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.text-author{--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.text-author:is(.dark *){--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.text-loading{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.text-loading:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}.text-progress{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.text-progress:is(.dark *){--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.btn-primary{border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity));padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-secondary{border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(118 169 250 / var(--tw-bg-opacity));padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-secondary:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.card{border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:1.5rem;--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.card:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.input{border-radius:.375rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity));padding:.5rem 1rem}.input:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity))}.input:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.input:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(118 169 250 / var(--tw-ring-opacity))}.label{margin-bottom:.25rem;display:block;font-size:.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.label:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}.link{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.link:hover{--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.link:is(.dark *){--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.link:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.navbar-container{border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity));--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.navbar-container:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.game-menu{position:relative;display:flex;align-items:center;justify-content:center}.text-shadow-custom{text-shadow:1px 1px 0px #e0e0e0,-1px -1px 0px #e0e0e0,1px -1px 0px #e0e0e0,-1px 1px 0px #e0e0e0}.menu-item{margin-bottom:.5rem;padding:.5rem 1rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity));transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.menu-item:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}.menu-item:hover{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.menu-item:is(.dark *):hover{--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.menu-item.active-link{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));border-top-left-radius:.375rem;border-top-right-radius:.375rem;--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity));font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity));transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1);text-shadow:1px 1px 0px #e0e0e0,-1px -1px 0px #e0e0e0,1px -1px 0px #e0e0e0,-1px 1px 0px #e0e0e0}.menu-item.active-link:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}.menu-item.active-link:hover{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-text-opacity: 1;color:rgb(35 56 118 / var(--tw-text-opacity))}.menu-item.active-link:is(.dark *):hover{--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.menu-item.active-link{text-shadow:0 0 10px rgba(128,128,128,.5)}.menu-item.active-link:before{content:"";position:absolute;bottom:-5px;left:0;width:100%;height:5px;background:linear-gradient(to right,#4a90e2,#8ab8e0,#4a90e2);border-radius:10px;animation:shimmer 2s infinite}.dark .menu-item.active-link:before{background:linear-gradient(to right,#6ab7f1,#aaa,#6ab7f1)}@keyframes shimmer{0%{background-position:-100% 0}to{background-position:100% 0}}@keyframes bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-5px)}}.feather-emoji{display:inline-block;margin-left:5px;animation:bounce 2s infinite}.app-card{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity));--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.app-card:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.app-card:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.app-card:hover{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}button{transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}button:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scrollbar-thin{scrollbar-width:thin;scrollbar-color:#76A9FA #C3DDFD}.dark .scrollbar-thin{scrollbar-color:#1C64F2 #1E429F}.scrollbar-thin::-webkit-scrollbar{width:.5rem}.scrollbar-thin::-webkit-scrollbar-track{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.scrollbar-thin:is(.dark *)::-webkit-scrollbar-track{--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.scrollbar-thin::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(118 169 250 / var(--tw-bg-opacity))}.scrollbar-thin:is(.dark *)::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.scrollbar-thin::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.scrollbar-thin:is(.dark *)::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.btn{display:flex;align-items:center;border-radius:.5rem;padding:.5rem 1rem;font-weight:600;--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.btn-primary{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-primary:hover{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.btn-primary:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity))}.btn-primary:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(28 100 242 / var(--tw-ring-opacity))}.btn-secondary{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.btn-secondary:hover{--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}.btn-secondary:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(195 221 253 / var(--tw-ring-opacity))}.btn-secondary:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.btn-secondary:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.btn-secondary:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(28 100 242 / var(--tw-ring-opacity))}.search-input{width:100%;border-bottom-width:2px;--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity));background-color:transparent;padding:.5rem 1rem .5rem 2.5rem;--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.search-input:focus{--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity));outline:2px solid transparent;outline-offset:2px}.search-input:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.search-input:focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(118 169 250 / var(--tw-border-opacity))}.scrollbar::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover, var(--scrollbar-track))}.scrollbar::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active, var(--scrollbar-track-hover, var(--scrollbar-track)))}.scrollbar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover, var(--scrollbar-thumb))}.scrollbar::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active, var(--scrollbar-thumb-hover, var(--scrollbar-thumb)))}.scrollbar::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover, var(--scrollbar-corner))}.scrollbar::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active, var(--scrollbar-corner-hover, var(--scrollbar-corner)))}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.scrollbar::-webkit-scrollbar{display:block;width:8px;height:8px}.scrollbar{--scrollbar-track: #C3DDFD;--scrollbar-thumb: #76A9FA;scrollbar-width:thin;scrollbar-color:#76A9FA #C3DDFD}.dark .scrollbar{scrollbar-color:#1C64F2 #1E429F}.scrollbar::-webkit-scrollbar{width:.5rem}.scrollbar::-webkit-scrollbar-track{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.scrollbar:is(.dark *)::-webkit-scrollbar-track{--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(118 169 250 / var(--tw-bg-opacity))}.scrollbar:is(.dark *)::-webkit-scrollbar-thumb{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.scrollbar::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.scrollbar:is(.dark *)::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.scrollbar{--scrollbar-thumb-hover: #3F83F8}.scrollbar:is(.dark *){--scrollbar-track: #1A56DB;--scrollbar-thumb: #1C64F2;--scrollbar-thumb-hover: #3F83F8}.card-title{margin-bottom:.5rem;font-size:1.25rem;line-height:1.75rem;font-weight:700;--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.card-title:is(.dark *){--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.card-content{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.card-content:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}.card-footer{margin-top:1rem;display:flex;align-items:center;justify-content:space-between}.card-footer-button{border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity));padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.card-footer-button:hover{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.subcard{border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(235 245 255 / var(--tw-bg-opacity));padding:1rem;--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.subcard:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.subcard-title{margin-bottom:.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.subcard-title:is(.dark *){--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.subcard-content{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.subcard-content:is(.dark *){--tw-text-opacity: 1;color:rgb(164 202 254 / var(--tw-text-opacity))}.subcard-footer{margin-top:1rem;display:flex;align-items:center;justify-content:space-between}.subcard-footer-button{border-radius:.25rem;--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity));padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.subcard-footer-button:hover{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.last\:mb-0:last-child{margin-bottom:0}.last\:\!border-transparent:last-child{border-color:transparent!important}.last\:pb-0:last-child{padding-bottom:0}.even\:bg-bg-light-discussion-odd:nth-child(2n){background-color:var(--color-bg-light-discussion-odd)}.group:hover .group-hover\:visible{visibility:visible}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\/item:hover .group-hover\/item\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\/item:hover .group-hover\/item\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:border-secondary{border-color:var(--color-secondary)}.group:hover .group-hover\:bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.group:hover .group-hover\:bg-white\/50{background-color:#ffffff80}.group:hover .group-hover\:bg-opacity-0{--tw-bg-opacity: 0}.group:hover .group-hover\:from-cyan-500{--tw-gradient-from: #06b6d4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-green-400{--tw-gradient-from: #31C48D var(--tw-gradient-from-position);--tw-gradient-to: rgb(49 196 141 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-pink-500{--tw-gradient-from: #E74694 var(--tw-gradient-from-position);--tw-gradient-to: rgb(231 70 148 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-purple-500{--tw-gradient-from: #9061F9 var(--tw-gradient-from-position);--tw-gradient-to: rgb(144 97 249 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-purple-600{--tw-gradient-from: #7E3AF2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 58 242 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-red-200{--tw-gradient-from: #FBD5D5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(251 213 213 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:from-teal-300{--tw-gradient-from: #7EDCE2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 220 226 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:via-red-300{--tw-gradient-to: rgb(248 180 180 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #F8B4B4 var(--tw-gradient-via-position), var(--tw-gradient-to)}.group:hover .group-hover\:to-blue-500{--tw-gradient-to: #3F83F8 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-blue-600{--tw-gradient-to: #1C64F2 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-lime-300{--tw-gradient-to: #bef264 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-orange-400{--tw-gradient-to: #FF8A4C var(--tw-gradient-to-position)}.group:hover .group-hover\:to-pink-500{--tw-gradient-to: #E74694 var(--tw-gradient-to-position)}.group:hover .group-hover\:to-yellow-200{--tw-gradient-to: #FCE96A var(--tw-gradient-to-position)}.group:hover .group-hover\:text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.group\/item:hover .group-hover\/item\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-0{opacity:0}.group:hover .group-hover\:opacity-100{opacity:1}.group:focus .group-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.group:focus .group-focus\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.group:focus .group-focus\:ring-white{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity))}.peer:checked~.peer-checked\:text-primary{color:var(--color-primary)}.hover\:z-10:hover{z-index:10}.hover\:z-20:hover{z-index:20}.hover\:h-8:hover{height:2rem}.hover\:-translate-y-1:hover{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:-translate-y-2:hover{--tw-translate-y: -.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-x-100:hover{--tw-scale-x: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-2:hover{border-width:2px}.hover\:border-solid:hover{border-style:solid}.hover\:border-blue-300:hover{--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity))}.hover\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.hover\:border-gray-600:hover{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.hover\:border-green-200:hover{--tw-border-opacity: 1;border-color:rgb(188 240 218 / var(--tw-border-opacity))}.hover\:border-primary:hover{border-color:var(--color-primary)}.hover\:border-primary-light:hover{border-color:var(--color-primary-light)}.hover\:border-secondary:hover{border-color:var(--color-secondary)}.hover\:bg-bg-light-tone:hover{background-color:var(--color-bg-light-tone)}.hover\:bg-bg-light-tone-panel:hover{background-color:var(--color-bg-light-tone-panel)}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(225 239 254 / var(--tw-bg-opacity))}.hover\:bg-blue-200:hover{--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.hover\:bg-blue-300:hover{--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}.hover\:bg-blue-400:hover{--tw-bg-opacity: 1;background-color:rgb(118 169 250 / var(--tw-bg-opacity))}.hover\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.hover\:bg-blue-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.hover\:bg-gray-400:hover{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.hover\:bg-gray-900:hover{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.hover\:bg-green-200:hover{--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}.hover\:bg-green-300:hover{--tw-bg-opacity: 1;background-color:rgb(132 225 188 / var(--tw-bg-opacity))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}.hover\:bg-green-800:hover{--tw-bg-opacity: 1;background-color:rgb(3 84 63 / var(--tw-bg-opacity))}.hover\:bg-pink-800:hover{--tw-bg-opacity: 1;background-color:rgb(153 21 75 / var(--tw-bg-opacity))}.hover\:bg-primary:hover{background-color:var(--color-primary)}.hover\:bg-primary-light:hover{background-color:var(--color-primary-light)}.hover\:bg-purple-800:hover{--tw-bg-opacity: 1;background-color:rgb(85 33 181 / var(--tw-bg-opacity))}.hover\:bg-red-200:hover{--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}.hover\:bg-red-300:hover{--tw-bg-opacity: 1;background-color:rgb(248 180 180 / var(--tw-bg-opacity))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}.hover\:bg-red-800:hover{--tw-bg-opacity: 1;background-color:rgb(155 28 28 / var(--tw-bg-opacity))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.hover\:bg-yellow-200:hover{--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}.hover\:bg-yellow-500:hover{--tw-bg-opacity: 1;background-color:rgb(194 120 3 / var(--tw-bg-opacity))}.hover\:bg-gradient-to-bl:hover{background-image:linear-gradient(to bottom left,var(--tw-gradient-stops))}.hover\:bg-gradient-to-br:hover{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.hover\:bg-gradient-to-l:hover{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.hover\:bg-gradient-to-r:hover{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.hover\:from-blue-50:hover{--tw-gradient-from: #EBF5FF var(--tw-gradient-from-position);--tw-gradient-to: rgb(235 245 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-teal-200:hover{--tw-gradient-from: #AFECEF var(--tw-gradient-from-position);--tw-gradient-to: rgb(175 236 239 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-lime-200:hover{--tw-gradient-to: #d9f99d var(--tw-gradient-to-position)}.hover\:to-purple-50:hover{--tw-gradient-to: #F6F5FF var(--tw-gradient-to-position)}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(28 100 242 / var(--tw-text-opacity))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\:text-green-300:hover{--tw-text-opacity: 1;color:rgb(132 225 188 / var(--tw-text-opacity))}.hover\:text-green-500:hover{--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}.hover\:text-green-600:hover{--tw-text-opacity: 1;color:rgb(5 122 85 / var(--tw-text-opacity))}.hover\:text-indigo-600:hover{--tw-text-opacity: 1;color:rgb(88 80 236 / var(--tw-text-opacity))}.hover\:text-primary:hover{color:var(--color-primary)}.hover\:text-purple-600:hover{--tw-text-opacity: 1;color:rgb(126 58 242 / var(--tw-text-opacity))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(248 180 180 / var(--tw-text-opacity))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(224 36 36 / var(--tw-text-opacity))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(200 30 30 / var(--tw-text-opacity))}.hover\:text-secondary:hover{color:var(--color-secondary)}.hover\:text-teal-600:hover{--tw-text-opacity: 1;color:rgb(4 116 129 / var(--tw-text-opacity))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.hover\:text-yellow-600:hover{--tw-text-opacity: 1;color:rgb(159 88 10 / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:no-underline:hover{text-decoration-line:none}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-none:hover{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:scrollbar-thumb-primary{--scrollbar-thumb-hover: var(--color-primary) !important}.focus\:z-10:focus{z-index:10}.focus\:border-blue-300:focus{--tw-border-opacity: 1;border-color:rgb(164 202 254 / var(--tw-border-opacity))}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.focus\:border-secondary:focus{border-color:var(--color-secondary)}.focus\:border-transparent:focus{border-color:transparent}.focus\:text-blue-700:focus{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-4:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(195 221 253 / var(--tw-ring-opacity))}.focus\:ring-blue-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(164 202 254 / var(--tw-ring-opacity))}.focus\:ring-blue-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(118 169 250 / var(--tw-ring-opacity))}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity))}.focus\:ring-blue-500\/50:focus{--tw-ring-color: rgb(63 131 248 / .5)}.focus\:ring-blue-700:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(26 86 219 / var(--tw-ring-opacity))}.focus\:ring-cyan-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(165 243 252 / var(--tw-ring-opacity))}.focus\:ring-cyan-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(103 232 249 / var(--tw-ring-opacity))}.focus\:ring-gray-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity))}.focus\:ring-gray-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.focus\:ring-gray-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus\:ring-green-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(188 240 218 / var(--tw-ring-opacity))}.focus\:ring-green-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(132 225 188 / var(--tw-ring-opacity))}.focus\:ring-green-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(49 196 141 / var(--tw-ring-opacity))}.focus\:ring-lime-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(217 249 157 / var(--tw-ring-opacity))}.focus\:ring-lime-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(190 242 100 / var(--tw-ring-opacity))}.focus\:ring-pink-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(250 209 232 / var(--tw-ring-opacity))}.focus\:ring-pink-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 180 217 / var(--tw-ring-opacity))}.focus\:ring-purple-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(220 215 254 / var(--tw-ring-opacity))}.focus\:ring-purple-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(202 191 253 / var(--tw-ring-opacity))}.focus\:ring-red-100:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(253 232 232 / var(--tw-ring-opacity))}.focus\:ring-red-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 180 180 / var(--tw-ring-opacity))}.focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}.focus\:ring-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(240 82 82 / var(--tw-ring-opacity))}.focus\:ring-secondary:focus{--tw-ring-color: var(--color-secondary)}.focus\:ring-teal-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(126 220 226 / var(--tw-ring-opacity))}.focus\:ring-yellow-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(250 202 21 / var(--tw-ring-opacity))}.focus\:ring-yellow-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(227 160 8 / var(--tw-ring-opacity))}.focus\:ring-opacity-50:focus{--tw-ring-opacity: .5}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.active\:scale-75:active{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:bg-gray-300:active{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.active\:scrollbar-thumb-secondary{--scrollbar-thumb-active: var(--color-secondary) !important}.dark\:divide-gray-700:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity))}.dark\:border-bg-light:is(.dark *){border-color:var(--color-bg-light)}.dark\:border-blue-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(26 86 219 / var(--tw-border-opacity))}.dark\:border-gray-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}.dark\:border-gray-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.dark\:border-gray-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity))}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity))}.dark\:border-green-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(14 159 110 / var(--tw-border-opacity))}.dark\:border-pink-400:is(.dark *){--tw-border-opacity: 1;border-color:rgb(241 126 184 / var(--tw-border-opacity))}.dark\:border-pink-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(231 70 148 / var(--tw-border-opacity))}.dark\:border-purple-400:is(.dark *){--tw-border-opacity: 1;border-color:rgb(172 148 250 / var(--tw-border-opacity))}.dark\:border-purple-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(144 97 249 / var(--tw-border-opacity))}.dark\:border-red-500:is(.dark *){--tw-border-opacity: 1;border-color:rgb(240 82 82 / var(--tw-border-opacity))}.dark\:border-transparent:is(.dark *){border-color:transparent}.dark\:border-yellow-300:is(.dark *){--tw-border-opacity: 1;border-color:rgb(250 202 21 / var(--tw-border-opacity))}.dark\:bg-bg-dark:is(.dark *){background-color:var(--color-bg-dark)}.dark\:bg-bg-dark-tone:is(.dark *){background-color:var(--color-bg-dark-tone)}.dark\:bg-bg-dark-tone-panel:is(.dark *){background-color:var(--color-bg-dark-tone-panel)}.dark\:bg-black:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.dark\:bg-blue-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}.dark\:bg-blue-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}.dark\:bg-blue-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.dark\:bg-blue-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.dark\:bg-blue-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}.dark\:bg-gray-300:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}.dark\:bg-gray-400:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.dark\:bg-gray-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.dark\:bg-gray-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\:bg-gray-800\/30:is(.dark *){background-color:#1f29374d}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.dark\:bg-green-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}.dark\:bg-green-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(14 159 110 / var(--tw-bg-opacity))}.dark\:bg-green-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}.dark\:bg-green-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 84 63 / var(--tw-bg-opacity))}.dark\:bg-green-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(1 71 55 / var(--tw-bg-opacity))}.dark\:bg-indigo-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(205 219 254 / var(--tw-bg-opacity))}.dark\:bg-indigo-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(104 117 245 / var(--tw-bg-opacity))}.dark\:bg-orange-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(180 52 3 / var(--tw-bg-opacity))}.dark\:bg-orange-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(138 44 13 / var(--tw-bg-opacity))}.dark\:bg-pink-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(250 209 232 / var(--tw-bg-opacity))}.dark\:bg-pink-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(214 31 105 / var(--tw-bg-opacity))}.dark\:bg-purple-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(220 215 254 / var(--tw-bg-opacity))}.dark\:bg-purple-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}.dark\:bg-purple-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(126 58 242 / var(--tw-bg-opacity))}.dark\:bg-red-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}.dark\:bg-red-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(240 82 82 / var(--tw-bg-opacity))}.dark\:bg-red-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}.dark\:bg-red-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(155 28 28 / var(--tw-bg-opacity))}.dark\:bg-red-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(119 29 29 / var(--tw-bg-opacity))}.dark\:bg-white:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.dark\:bg-yellow-200:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}.dark\:bg-opacity-70:is(.dark *){--tw-bg-opacity: .7}.dark\:bg-opacity-80:is(.dark *){--tw-bg-opacity: .8}.dark\:from-bg-dark:is(.dark *){--tw-gradient-from: var(--color-bg-dark) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-bg-dark-tone:is(.dark *){--tw-gradient-from: var(--color-bg-dark-tone) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-blue-400\/20:is(.dark *){--tw-gradient-from: rgb(118 169 250 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(118 169 250 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-indigo-400:is(.dark *){--tw-gradient-from: #8DA2FB var(--tw-gradient-from-position);--tw-gradient-to: rgb(141 162 251 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:via-bg-dark:is(.dark *){--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--color-bg-dark) var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark\:to-gray-800:is(.dark *){--tw-gradient-to: #1F2937 var(--tw-gradient-to-position)}.dark\:to-purple-400:is(.dark *){--tw-gradient-to: #AC94FA var(--tw-gradient-to-position)}.dark\:to-purple-400\/20:is(.dark *){--tw-gradient-to: rgb(172 148 250 / .2) var(--tw-gradient-to-position)}.dark\:fill-gray-300:is(.dark *){fill:#d1d5db}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.dark\:text-blue-500:is(.dark *){--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.dark\:text-blue-800:is(.dark *){--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}.dark\:text-dark-text-panel:is(.dark *){color:var(--color-dark-text-panel)}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity))}.dark\:text-gray-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.dark\:text-gray-500:is(.dark *){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.dark\:text-gray-800:is(.dark *){--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.dark\:text-green-200:is(.dark *){--tw-text-opacity: 1;color:rgb(188 240 218 / var(--tw-text-opacity))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(49 196 141 / var(--tw-text-opacity))}.dark\:text-green-500:is(.dark *){--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}.dark\:text-green-800:is(.dark *){--tw-text-opacity: 1;color:rgb(3 84 63 / var(--tw-text-opacity))}.dark\:text-green-900:is(.dark *){--tw-text-opacity: 1;color:rgb(1 71 55 / var(--tw-text-opacity))}.dark\:text-indigo-500:is(.dark *){--tw-text-opacity: 1;color:rgb(104 117 245 / var(--tw-text-opacity))}.dark\:text-indigo-900:is(.dark *){--tw-text-opacity: 1;color:rgb(54 47 120 / var(--tw-text-opacity))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(252 217 189 / var(--tw-text-opacity))}.dark\:text-pink-400:is(.dark *){--tw-text-opacity: 1;color:rgb(241 126 184 / var(--tw-text-opacity))}.dark\:text-pink-500:is(.dark *){--tw-text-opacity: 1;color:rgb(231 70 148 / var(--tw-text-opacity))}.dark\:text-pink-900:is(.dark *){--tw-text-opacity: 1;color:rgb(117 26 61 / var(--tw-text-opacity))}.dark\:text-primary:is(.dark *){color:var(--color-primary)}.dark\:text-purple-400:is(.dark *){--tw-text-opacity: 1;color:rgb(172 148 250 / var(--tw-text-opacity))}.dark\:text-purple-500:is(.dark *){--tw-text-opacity: 1;color:rgb(144 97 249 / var(--tw-text-opacity))}.dark\:text-purple-900:is(.dark *){--tw-text-opacity: 1;color:rgb(74 29 150 / var(--tw-text-opacity))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(251 213 213 / var(--tw-text-opacity))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(248 180 180 / var(--tw-text-opacity))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(249 128 128 / var(--tw-text-opacity))}.dark\:text-red-500:is(.dark *){--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}.dark\:text-red-800:is(.dark *){--tw-text-opacity: 1;color:rgb(155 28 28 / var(--tw-text-opacity))}.dark\:text-red-900:is(.dark *){--tw-text-opacity: 1;color:rgb(119 29 29 / var(--tw-text-opacity))}.dark\:text-slate-50:is(.dark *){--tw-text-opacity: 1;color:rgb(248 250 252 / var(--tw-text-opacity))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(250 202 21 / var(--tw-text-opacity))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(227 160 8 / var(--tw-text-opacity))}.dark\:text-yellow-500:is(.dark *){--tw-text-opacity: 1;color:rgb(194 120 3 / var(--tw-text-opacity))}.dark\:text-yellow-800:is(.dark *){--tw-text-opacity: 1;color:rgb(114 59 19 / var(--tw-text-opacity))}.dark\:text-yellow-900:is(.dark *){--tw-text-opacity: 1;color:rgb(99 49 18 / var(--tw-text-opacity))}.dark\:placeholder-gray-400:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}.dark\:placeholder-gray-400:is(.dark *)::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}.dark\:shadow-lg:is(.dark *){--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\:shadow-blue-800\/80:is(.dark *){--tw-shadow-color: rgb(30 66 159 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-cyan-800\/80:is(.dark *){--tw-shadow-color: rgb(21 94 117 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-green-800\/80:is(.dark *){--tw-shadow-color: rgb(3 84 63 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-lime-800\/80:is(.dark *){--tw-shadow-color: rgb(63 98 18 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-pink-800\/80:is(.dark *){--tw-shadow-color: rgb(153 21 75 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-purple-800\/80:is(.dark *){--tw-shadow-color: rgb(85 33 181 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-red-800\/80:is(.dark *){--tw-shadow-color: rgb(155 28 28 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:shadow-teal-800\/80:is(.dark *){--tw-shadow-color: rgb(5 80 92 / .8);--tw-shadow: var(--tw-shadow-colored)}.dark\:ring-gray-500:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}.dark\:ring-white:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity))}.dark\:ring-opacity-20:is(.dark *){--tw-ring-opacity: .2}.dark\:ring-offset-gray-700:is(.dark *){--tw-ring-offset-color: #374151}.dark\:ring-offset-gray-800:is(.dark *){--tw-ring-offset-color: #1F2937}.dark\:scrollbar-track-bg-dark:is(.dark *){--scrollbar-track: var(--color-bg-dark) !important}.dark\:scrollbar-track-bg-dark-tone:is(.dark *){--scrollbar-track: var(--color-bg-dark-tone) !important}.dark\:scrollbar-track-gray-800:is(.dark *){--scrollbar-track: #1F2937 !important}.dark\:scrollbar-thumb-bg-dark-tone:is(.dark *){--scrollbar-thumb: var(--color-bg-dark-tone) !important}.dark\:scrollbar-thumb-bg-dark-tone-panel:is(.dark *){--scrollbar-thumb: var(--color-bg-dark-tone-panel) !important}.dark\:scrollbar-thumb-gray-600:is(.dark *){--scrollbar-thumb: #4B5563 !important}.dark\:even\:bg-bg-dark-discussion-odd:nth-child(2n):is(.dark *){background-color:var(--color-bg-dark-discussion-odd)}.group:hover .dark\:group-hover\:bg-gray-800\/60:is(.dark *){background-color:#1f293799}.group:hover .dark\:group-hover\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.group:focus .dark\:group-focus\:ring-gray-800\/70:is(.dark *){--tw-ring-color: rgb(31 41 55 / .7)}.dark\:hover\:border-blue-600:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(28 100 242 / var(--tw-border-opacity))}.dark\:hover\:border-gray-600:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.dark\:hover\:border-primary:hover:is(.dark *){border-color:var(--color-primary)}.dark\:hover\:bg-blue-300:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}.dark\:hover\:bg-blue-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}.dark\:hover\:bg-blue-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}.dark\:hover\:bg-blue-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}.dark\:hover\:bg-gray-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\:hover\:bg-green-300:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(132 225 188 / var(--tw-bg-opacity))}.dark\:hover\:bg-green-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}.dark\:hover\:bg-green-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}.dark\:hover\:bg-pink-500:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(231 70 148 / var(--tw-bg-opacity))}.dark\:hover\:bg-pink-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(191 18 93 / var(--tw-bg-opacity))}.dark\:hover\:bg-primary:hover:is(.dark *){background-color:var(--color-primary)}.dark\:hover\:bg-purple-500:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}.dark\:hover\:bg-purple-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(108 43 217 / var(--tw-bg-opacity))}.dark\:hover\:bg-red-300:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(248 180 180 / var(--tw-bg-opacity))}.dark\:hover\:bg-red-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}.dark\:hover\:bg-red-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}.dark\:hover\:bg-yellow-300:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(250 202 21 / var(--tw-bg-opacity))}.dark\:hover\:bg-yellow-400:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(227 160 8 / var(--tw-bg-opacity))}.hover\:dark\:bg-bg-dark-tone:is(.dark *):hover{background-color:var(--color-bg-dark-tone)}.hover\:dark\:bg-bg-dark-tone-panel:is(.dark *):hover{background-color:var(--color-bg-dark-tone-panel)}.dark\:hover\:from-blue-900\/30:hover:is(.dark *){--tw-gradient-from: rgb(35 56 118 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(35 56 118 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:hover\:to-purple-900\/30:hover:is(.dark *){--tw-gradient-to: rgb(74 29 150 / .3) var(--tw-gradient-to-position)}.dark\:hover\:text-blue-500:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}.dark\:hover\:text-gray-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.dark\:hover\:text-gray-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.dark\:hover\:text-gray-900:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.dark\:hover\:text-green-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(132 225 188 / var(--tw-text-opacity))}.dark\:hover\:text-green-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(49 196 141 / var(--tw-text-opacity))}.dark\:hover\:text-primary:hover:is(.dark *){color:var(--color-primary)}.dark\:hover\:text-red-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(249 128 128 / var(--tw-text-opacity))}.dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:hover\:scrollbar-thumb-primary:is(.dark *){--scrollbar-thumb-hover: var(--color-primary) !important}.dark\:focus\:border-blue-500:focus:is(.dark *){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}.dark\:focus\:border-secondary:focus:is(.dark *){border-color:var(--color-secondary)}.dark\:focus\:text-white:focus:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:focus\:ring-blue-500:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity))}.dark\:focus\:ring-blue-600:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(28 100 242 / var(--tw-ring-opacity))}.dark\:focus\:ring-blue-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity))}.dark\:focus\:ring-cyan-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(21 94 117 / var(--tw-ring-opacity))}.dark\:focus\:ring-gray-500:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}.dark\:focus\:ring-gray-600:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}.dark\:focus\:ring-gray-700:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity))}.dark\:focus\:ring-gray-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity))}.dark\:focus\:ring-green-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(3 84 63 / var(--tw-ring-opacity))}.dark\:focus\:ring-lime-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(63 98 18 / var(--tw-ring-opacity))}.dark\:focus\:ring-pink-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(153 21 75 / var(--tw-ring-opacity))}.dark\:focus\:ring-pink-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(117 26 61 / var(--tw-ring-opacity))}.dark\:focus\:ring-purple-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(85 33 181 / var(--tw-ring-opacity))}.dark\:focus\:ring-purple-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(74 29 150 / var(--tw-ring-opacity))}.dark\:focus\:ring-red-400:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}.dark\:focus\:ring-red-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(155 28 28 / var(--tw-ring-opacity))}.dark\:focus\:ring-red-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(119 29 29 / var(--tw-ring-opacity))}.dark\:focus\:ring-secondary:focus:is(.dark *){--tw-ring-color: var(--color-secondary)}.dark\:focus\:ring-teal-700:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(3 102 114 / var(--tw-ring-opacity))}.dark\:focus\:ring-teal-800:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(5 80 92 / var(--tw-ring-opacity))}.dark\:focus\:ring-yellow-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(99 49 18 / var(--tw-ring-opacity))}.dark\:focus\:ring-offset-gray-700:focus:is(.dark *){--tw-ring-offset-color: #374151}.dark\:active\:bg-gray-600:active:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}@media (min-width: 640px){.sm\:mt-0{margin-top:0}.sm\:h-10{height:2.5rem}.sm\:h-6{height:1.5rem}.sm\:h-64{height:16rem}.sm\:w-1\/4{width:25%}.sm\:w-10{width:2.5rem}.sm\:w-6{width:1.5rem}.sm\:w-auto{width:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:rounded-lg{border-radius:.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:text-center{text-align:center}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media (min-width: 768px){.md\:inset-0{top:0;right:0;bottom:0;left:0}.md\:order-2{order:2}.md\:mr-6{margin-right:1.5rem}.md\:mt-0{margin-top:0}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-auto{height:auto}.md\:h-full{height:100%}.md\:w-1\/4{width:25%}.md\:w-48{width:12rem}.md\:w-auto{width:auto}.md\:max-w-xl{max-width:36rem}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.md\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.md\:rounded-none{border-radius:0}.md\:rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.md\:border-0{border-width:0px}.md\:bg-transparent{background-color:transparent}.md\:p-0{padding:0}.md\:p-6{padding:1.5rem}.md\:text-5xl{font-size:3rem;line-height:1}.md\:text-6xl{font-size:3.75rem;line-height:1}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:font-medium{font-weight:500}.md\:text-blue-700{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.md\:hover\:bg-transparent:hover{background-color:transparent}.md\:hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(26 86 219 / var(--tw-text-opacity))}.md\:dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.md\:dark\:hover\:bg-transparent:hover:is(.dark *){background-color:transparent}.md\:dark\:hover\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}}@media (min-width: 1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}}@media (min-width: 1280px){.xl\:h-80{height:20rem}.xl\:w-1\/6{width:16.666667%}}@media (min-width: 1536px){.\32xl\:h-96{height:24rem}} diff --git a/web/dist/index.html b/web/dist/index.html index f36ec51c..32841e8d 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,8 +6,8 @@ LoLLMS WebUI - - + +
diff --git a/web/src/views/DiscussionsView.vue b/web/src/views/DiscussionsView.vue index a318362b..799912ed 100644 --- a/web/src/views/DiscussionsView.vue +++ b/web/src/views/DiscussionsView.vue @@ -640,125 +640,139 @@
-

Prompt examples

+

Prompt Examples

-
+
-
-
- {{ prompt }} +
+

+ {{ extractTitle(prompt) }} +

+
+ {{ getPromptContent(prompt) }}
-
-
+
Click to select
+
-
+

Fill in the placeholders

- -
-

Live Preview:

-
{{ previewPrompt }}
-
- -
-
- - - - - - - - - - - - - - - -
-
- {{ placeholder.language || 'Plain text' }} -
- + +
+ +
+

Live Preview:

+
+ {{ getPromptContent(previewPrompt) }}
+
- - + +
+
+
+ + + + + + + + + + + + + + + +
+
+ {{ placeholder.language || 'Plain text' }} +
+ +
+ + + +
+
- + +
+
diff --git a/zoos/personalities_zoo b/zoos/personalities_zoo index bb8c221f..d2bb11c2 160000 --- a/zoos/personalities_zoo +++ b/zoos/personalities_zoo @@ -1 +1 @@ -Subproject commit bb8c221f50c87febd1e60ec983bf8a513967beb5 +Subproject commit d2bb11c2c684ca7d42f6b51c019bd4553e80bd0b