From b4d8242084d4cbd8374c482e4767e8284c1d00fa Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Thu, 21 Mar 2024 22:18:58 +0100 Subject: [PATCH] new --- lollms_core | 2 +- .../{index-92deeda2.js => index-4f3ac939.js} | 358 +++++++++--------- ...{index-c09c0bda.css => index-bbf49f24.css} | 2 +- web/dist/index.html | 4 +- web/src/views/SettingsView.vue | 30 +- zoos/bindings_zoo | 2 +- zoos/models_zoo | 2 +- 7 files changed, 211 insertions(+), 189 deletions(-) rename web/dist/assets/{index-92deeda2.js => index-4f3ac939.js} (93%) rename web/dist/assets/{index-c09c0bda.css => index-bbf49f24.css} (99%) diff --git a/lollms_core b/lollms_core index 2581346c..45d9f98e 160000 --- a/lollms_core +++ b/lollms_core @@ -1 +1 @@ -Subproject commit 2581346cfa54d7ac530f90745b61f88dbc92f5e9 +Subproject commit 45d9f98e987e74aede53520f0975bedbee164046 diff --git a/web/dist/assets/index-92deeda2.js b/web/dist/assets/index-4f3ac939.js similarity index 93% rename from web/dist/assets/index-92deeda2.js rename to web/dist/assets/index-4f3ac939.js index fc799e52..e78669a9 100644 --- a/web/dist/assets/index-92deeda2.js +++ b/web/dist/assets/index-4f3ac939.js @@ -97,7 +97,7 @@ License: MIT `:"\r"}(ee,k)),U=!1,R.delimiter)O(R.delimiter)&&(R.delimiter=R.delimiter(ee),te.meta.delimiter=R.delimiter);else{var B=function(ce,ne,Ce,we,V){var _e,ie,ae,D;V=V||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var I=0;I=L)return ze(!0)}else for(z=P,P++;;){if((z=Y.indexOf(S,z+1))===-1)return re||me.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:J.length,index:P}),xe();if(z===te-1)return xe(Y.substring(P,z).replace(I,S));if(S!==G||Y[z+1]!==G){if(S===G||z===0||Y[z-1]!==G){ae!==-1&&ae=L)return ze(!0);break}me.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:J.length,index:P}),z++}}else z++}return xe();function se(ke){J.push(ke),Se=P}function Re(ke){var lt=0;if(ke!==-1){var je=Y.substring(z+1,ke);je&&je.trim()===""&&(lt=je.length)}return lt}function xe(ke){return re||(ke===void 0&&(ke=Y.substring(P)),ee.push(ke),P=te,se(ee),Ae&&st()),ze()}function De(ke){P=ke,se(ee),ee=[],D=Y.indexOf(U,P)}function ze(ke){return{data:J,errors:me,meta:{delimiter:A,linebreak:U,aborted:j,truncated:!!ke,cursor:Se+(Q||0)}}}function st(){K(ze()),J=[],me=[]}},this.abort=function(){j=!0},this.getCharIndex=function(){return P}}function v(R){var S=R.data,A=o[S.workerId],U=!1;if(S.error)A.userError(S.error,S.file);else if(S.results&&S.results.data){var F={abort:function(){U=!0,y(S.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:T,resume:T};if(O(A.userStep)){for(var K=0;Kn.text()).then(n=>{const{data:e}=Mtt.parse(n,{header:!0});console.log("Recovered data"),console.log(e),this.faqs=e}).catch(n=>{console.error("Error loading FAQs:",n)})},parseMultiline(n){return n.replace(/\n/g,"
")}}},Ws=n=>(Nr("data-v-b19a05a8"),n=n(),Or(),n),ktt={class:"container flex-row mx-auto p-4 bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-1 md:grid-cols-2 gap-4"},Ltt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"About Lord of large Language Models",-1)),Ptt={class:"mb-4"},Utt=Ws(()=>u("p",null,[Ze("Discord link: "),u("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/YgnaFMAQ"},"https://discord.gg/YgnaFMAQ")],-1)),Ftt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"Frequently Asked Questions",-1)),Btt={class:"list-disc pl-4"},Gtt={class:"text-xl font-bold mb-1"},ztt=["innerHTML"],Vtt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"Contact Us",-1)),Htt=Ws(()=>u("p",{class:"mb-4"},"If you have any further questions or need assistance, feel free to reach out to me.",-1)),qtt=Ws(()=>u("p",null,[Ze("Discord link: "),u("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/YgnaFMAQ"},"https://discord.gg/YgnaFMAQ")],-1)),Ytt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"Credits",-1)),$tt=Ws(()=>u("p",{class:"mb-4"},[Ze("This project is developed by "),u("span",{class:"font-bold"},"ParisNeo"),Ze(" With help from the community.")],-1)),Wtt=Ws(()=>u("p",{class:"mb-4"},[u("span",{class:"font-bold"},[u("a",{href:"https://github.com/ParisNeo/lollms-webui/graphs/contributors"},"Check out the full list of developers here and show them some love.")])],-1)),Ktt=["href"];function jtt(n,e,t,i,s,r){const o=ft("Card");return w(),M("div",ktt,[Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ltt,u("p",Ptt," Lollms version "+ge(r.version),1),Utt]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ftt,u("ul",Btt,[(w(!0),M($e,null,dt(s.faqs,(a,l)=>(w(),M("li",{key:l},[u("h3",Gtt,ge(a.question),1),u("p",{class:"mb-4",innerHTML:r.parseMultiline(a.answer)},null,8,ztt)]))),128))])]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Vtt,Htt,qtt]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ytt,$tt,Wtt,u("p",null,[Ze("Check out the project on "),u("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:s.githubLink,target:"_blank",rel:"noopener noreferrer"},"GitHub",8,Ktt),Ze(".")])]),_:1})])}const Qtt=bt(Dtt,[["render",jtt],["__scopeId","data-v-b19a05a8"]]);function ss(n,e=!0,t=1){const i=e?1e3:1024;if(Math.abs(n)=i&&r{qe.replace()})},executeCommand(n){this.isMenuOpen=!1,console.log("Selected"),console.log(n.value),typeof n.value=="function"&&(console.log("Command detected",n),n.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(n))},positionMenu(){var n;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClientRect(),t=window.innerHeight;n=e.bottom>t/2}else this.force_position==1?n=!0:n=!1;this.menuPosition.top=n?"auto":"calc(100% + 10px)",this.menuPosition.bottom=n?"100%":"auto"}}},mounted(){window.addEventListener("resize",this.positionMenu),this.positionMenu(),Ve(()=>{qe.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},Ztt={class:"menu-container"},Jtt=["title"],ent=["src"],tnt=["data-feather"],nnt={key:2,class:"w-5 h-5"},int={key:3,"data-feather":"menu"},snt={class:"flex-grow menu-ul"},rnt=["onClick"],ont={key:0,"data-feather":"check"},ant=["src","alt"],lnt=["data-feather"],cnt={key:3,class:"menu-icon"};function dnt(n,e,t,i,s,r){return w(),M("div",Ztt,[u("button",{onClick:e[0]||(e[0]=Te((...o)=>r.toggleMenu&&r.toggleMenu(...o),["prevent"])),title:t.title,class:Ye([t.menuIconClass,"menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer"]),ref:"menuButton"},[t.icon&&!t.icon.includes("#")&&!t.icon.includes("feather")?(w(),M("img",{key:0,src:t.icon,class:"w-5 h-5 p-0 m-0 shadow-lg bold"},null,8,ent)):t.icon&&t.icon.includes("feather")?(w(),M("i",{key:1,"data-feather":t.icon.split(":")[1],class:"w-5 h-5"},null,8,tnt)):t.icon&&t.icon.includes("#")?(w(),M("p",nnt,ge(t.icon.split("#")[1]),1)):(w(),M("i",int))],10,Jtt),Ie(ls,{name:"slide"},{default:Je(()=>[s.isMenuOpen?(w(),M("div",{key:0,class:"menu-list flex-grow",style:Jt(s.menuPosition),ref:"menu"},[u("ul",snt,[(w(!0),M($e,null,dt(t.commands,(o,a)=>(w(),M("li",{key:a,onClick:Te(l=>r.executeCommand(o),["prevent"]),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[t.selected_entry==o.name?(w(),M("i",ont)):o.icon&&!o.icon.includes("feather")&&!o.is_file?(w(),M("img",{key:1,src:o.icon,alt:o.name,class:"menu-icon"},null,8,ant)):q("",!0),o.icon&&o.icon.includes("feather")&&!o.is_file?(w(),M("i",{key:2,"data-feather":o.icon.split(":")[1],class:"mr-2"},null,8,lnt)):(w(),M("span",cnt)),u("span",null,ge(o.name),1)],8,rnt))),128))])],4)):q("",!0)]),_:1})])}const cp=bt(Xtt,[["render",dnt]]),unt={components:{InteractiveMenu:cp},props:{isInstalled:Boolean,onInstall:Function,onCancelInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,onCopyLink:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,speed:0,total_size:0,downloaded_size:0,start_time:"",installing:!1,uninstalling:!1,failedToLoad:!1,linkNotValid:!1,selected_variant:""}},async mounted(){Ve(()=>{qe.replace()})},methods:{formatFileSize(n){return n<1024?n+" bytes":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB"},computedFileSize(n){return ss(n)},getImgUrl(){return this.model.icon==null||this.model.icon==="/images/default_model.png"?Li:this.model.icon},defaultImg(n){n.target.src=Li},install(){this.onInstall(this)},uninstall(){this.isInstalled&&this.onUninstall(this)},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(n){if(console.log("event.target.tagName.toLowerCase()"),console.log(n.target.tagName.toLowerCase()),n.target.tagName.toLowerCase()==="button"||n.target.tagName.toLowerCase()==="svg"){n.stopPropagation();return}this.onSelected(this),this.model.selected=!0,Ve(()=>{qe.replace()})},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this),this.installing=!1},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{computed_classes(){return this.model.isInstalled?this.selected?"border-4 border-gray-200 bg-primary cursor-pointer":"border-0 border-primary bg-primary cursor-pointer":"border-transparent"},commandsList(){let n=[{name:this.model.isInstalled?"Install Extra":"Install",icon:"feather:settings",is_file:!1,value:this.install},{name:"Copy model info to clipboard",icon:"feather:settings",is_file:!1,value:this.toggleCopy}];return this.model.isInstalled&&n.push({name:"UnInstall",icon:"feather:settings",is_file:!1,value:this.uninstall}),this.selected&&n.push({name:"Reload",icon:"feather:refresh-ccw",is_file:!1,value:this.toggleSelected}),n},selected_computed(){return this.selected},fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const n=this.model.variants[0].size;return this.formatFileSize(n)}return null}},speed_computed(){return ss(this.speed)},total_size_computed(){return ss(this.total_size)},downloaded_size_computed(){return ss(this.downloaded_size)}},watch:{linkNotValid(){Ve(()=>{qe.replace()})}}},pnt=["title"],_nt={key:0,class:"flex flex-row"},hnt={class:"max-w-[300px] overflow-x-auto"},fnt={class:"flex gap-3 items-center grow"},mnt=["href"],gnt=["src"],bnt={class:"flex-1 overflow-hidden"},Ent={class:"font-bold font-large text-lg truncate"},vnt={key:1,class:"flex items-center flex-row gap-2 my-1"},ynt={class:"flex grow items-center"},Snt=u("i",{"data-feather":"box",class:"w-5"},null,-1),Tnt=u("span",{class:"sr-only"},"Custom model / local model",-1),xnt=[Snt,Tnt],Cnt=u("span",{class:"sr-only"},"Remove",-1),Rnt={key:2,class:"absolute z-10 -m-4 p-5 shadow-md text-center rounded-lg w-full h-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel bg-opacity-70 dark:bg-opacity-70 flex justify-center items-center"},Ant={class:"relative flex flex-col items-center justify-center flex-grow h-full"},wnt=u("div",{role:"status",class:"justify-center"},[u("svg",{"aria-hidden":"true",class:"w-24 h-24 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1),Nnt={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},Ont={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},Int={class:"flex justify-between mb-1"},Mnt=u("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),Dnt={class:"text-sm font-medium text-blue-700 dark:text-white"},knt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Lnt={class:"flex justify-between mb-1"},Pnt={class:"text-base font-medium text-blue-700 dark:text-white"},Unt={class:"text-sm font-medium text-blue-700 dark:text-white"},Fnt={class:"flex flex-grow"},Bnt={class:"flex flex-row flex-grow gap-3"},Gnt={class:"p-2 text-center grow"},znt={key:3},Vnt={class:"flex flex-row items-center gap-3"},Hnt=["src"],qnt={class:"font-bold font-large text-lg truncate"},Ynt=u("div",{class:"grow"},null,-1),$nt={class:"flex items-center flex-row-reverse gap-2 my-1"},Wnt={class:"flex flex-row items-center"},Knt={key:0,class:"text-base text-red-600 flex items-center mt-1"},jnt=u("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),Qnt=["title"],Xnt={class:""},Znt={class:"flex flex-row items-center"},Jnt=u("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),eit=u("b",null,"Card: ",-1),tit=["href","title"],nit=u("div",{class:"grow"},null,-1),iit=u("i",{"data-feather":"clipboard",class:"w-5"},null,-1),sit=[iit],rit={class:"flex items-center"},oit=u("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),ait=u("b",null,"File size: ",-1),lit={class:"flex items-center"},cit=u("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),dit=u("b",null,"License: ",-1),uit={key:0,class:"flex items-center"},pit=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),_it=u("b",null,"quantizer: ",-1),hit=["href"],fit={class:"flex items-center"},mit=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),git=u("b",null,"Model creator: ",-1),bit=["href"],Eit={class:"flex items-center"},vit=u("i",{"data-feather":"clock",class:"w-5 m-1"},null,-1),yit=u("b",null,"Release date: ",-1),Sit={class:"flex items-center"},Tit=u("i",{"data-feather":"grid",class:"w-5 m-1"},null,-1),xit=u("b",null,"Category: ",-1),Cit=["href"];function Rit(n,e,t,i,s,r){const o=ft("InteractiveMenu");return w(),M("div",{class:Ye(["relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",r.computed_classes]),title:t.model.name,onClick:e[10]||(e[10]=Te(a=>r.toggleSelected(a),["prevent"]))},[t.model.isCustomModel?(w(),M("div",_nt,[u("div",hnt,[u("div",fnt,[u("a",{href:t.model.model_creator_link,target:"_blank"},[u("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-lg object-fill"},null,40,gnt)],8,mnt),u("div",bnt,[u("h3",Ent,ge(t.model.name),1)])])])])):q("",!0),t.model.isCustomModel?(w(),M("div",vnt,[u("div",ynt,[u("button",{type:"button",title:"Custom model / local model",class:"font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",onClick:e[1]||(e[1]=Te(()=>{},["stop"]))},xnt),Ze(" Custom model ")]),u("div",null,[t.model.isInstalled?(w(),M("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=Te((...a)=>r.uninstall&&r.uninstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Ze(" Uninstall "),Cnt])):q("",!0)])])):q("",!0),s.installing?(w(),M("div",Rnt,[u("div",Ant,[wnt,u("div",Nnt,[u("div",Ont,[u("div",Int,[Mnt,u("span",Dnt,ge(Math.floor(s.progress))+"%",1)]),u("div",knt,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Jt({width:s.progress+"%"})},null,4)]),u("div",Lnt,[u("span",Pnt,"Download speed: "+ge(r.speed_computed)+"/s",1),u("span",Unt,ge(r.downloaded_size_computed)+"/"+ge(r.total_size_computed),1)])])]),u("div",Fnt,[u("div",Bnt,[u("div",Gnt,[u("button",{onClick:e[3]||(e[3]=Te((...a)=>r.toggleCancelInstall&&r.toggleCancelInstall(...a),["stop"])),type:"button",title:"Cancel download",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"}," Cancel ")])])])])])):q("",!0),t.model.isCustomModel?q("",!0):(w(),M("div",znt,[u("div",Vnt,[u("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=a=>r.defaultImg(a)),class:Ye(["w-10 h-10 rounded-lg object-fill",s.linkNotValid?"grayscale":""])},null,42,Hnt),u("h3",qnt,ge(t.model.name),1),Ynt,Ie(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),u("div",$nt,[u("div",Wnt,[s.linkNotValid?(w(),M("div",Knt,[jnt,Ze(" Link is not valid ")])):q("",!0)])]),u("div",{class:"",title:t.model.isInstalled?t.model.name:"Not installed"},[u("div",Xnt,[u("div",Znt,[Jnt,eit,u("a",{href:"https://huggingface.co/"+t.model.quantizer+"/"+t.model.name,target:"_blank",onClick:e[5]||(e[5]=Te(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:s.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," View full model card ",8,tit),nit,u("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[6]||(e[6]=Te(a=>r.toggleCopyLink(),["stop"]))},sit)]),u("div",rit,[u("div",{class:Ye(["flex flex-shrink-0 items-center",s.linkNotValid?"text-red-600":""])},[oit,ait,Ze(" "+ge(r.fileSize),1)],2)]),u("div",lit,[cit,dit,Ze(" "+ge(t.model.license),1)]),t.model.quantizer!="None"&&t.model.type!="transformers"?(w(),M("div",uit,[pit,_it,u("a",{href:"https://huggingface.co/"+t.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=Te(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},ge(t.model.quantizer),9,hit)])):q("",!0),u("div",fit,[mit,git,u("a",{href:t.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[8]||(e[8]=Te(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},ge(t.model.model_creator),9,bit)]),u("div",Eit,[vit,yit,Ze(" "+ge(t.model.last_commit_time),1)]),u("div",Sit,[Tit,xit,u("a",{href:"https://huggingface.co/"+t.model.model_creator,target:"_blank",rel:"noopener noreferrer",onClick:e[9]||(e[9]=Te(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},ge(t.model.category),9,Cit)])])],8,Qnt)]))],10,pnt)}const Ait=bt(unt,[["render",Rit]]),wit={data(){return{editMode:!1,avatar:"path/to/avatar.jpg",personalityName:"Personality Name",personalityAuthor:"Author Name",personalityDescription:"Personality Description",personalityCategory:"Category",disclaimer:"Disclaimer text",conditioningText:"Conditioning Text",aiPrefix:"AI Prefix",userPrefix:"User Prefix",antipromptsList:[{id:1,text:"Antiprompt 1"},{id:2,text:"Antiprompt 2"},{id:3,text:"Antiprompt 3"}]}},methods:{commitChanges(){console.log("Personality changes committed"),this.editMode=!1}}},Nit={class:"p-4"},Oit={class:"flex items-center mb-4"},Iit=["src"],Mit={class:"text-lg font-semibold"},Dit=u("strong",null,"Author:",-1),kit=u("strong",null,"Description:",-1),Lit=u("strong",null,"Category:",-1),Pit={key:0},Uit=u("strong",null,"Disclaimer:",-1),Fit=u("strong",null,"Conditioning Text:",-1),Bit=u("strong",null,"AI Prefix:",-1),Git=u("strong",null,"User Prefix:",-1),zit=u("strong",null,"Antiprompts:",-1);function Vit(n,e,t,i,s,r){return w(),M("div",Nit,[u("div",Oit,[u("img",{src:s.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,Iit),u("h2",Mit,ge(s.personalityName),1)]),u("p",null,[Dit,Ze(" "+ge(s.personalityAuthor),1)]),u("p",null,[kit,Ze(" "+ge(s.personalityDescription),1)]),u("p",null,[Lit,Ze(" "+ge(s.personalityCategory),1)]),s.disclaimer?(w(),M("p",Pit,[Uit,Ze(" "+ge(s.disclaimer),1)])):q("",!0),u("p",null,[Fit,Ze(" "+ge(s.conditioningText),1)]),u("p",null,[Bit,Ze(" "+ge(s.aiPrefix),1)]),u("p",null,[Git,Ze(" "+ge(s.userPrefix),1)]),u("div",null,[zit,u("ul",null,[(w(!0),M($e,null,dt(s.antipromptsList,o=>(w(),M("li",{key:o.id},ge(o.text),1))),128))])]),u("button",{onClick:e[0]||(e[0]=o=>s.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),s.editMode?(w(),M("button",{key:1,onClick:e[1]||(e[1]=(...o)=>r.commitChanges&&r.commitChanges(...o)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):q("",!0)])}const Hit=bt(wit,[["render",Vit]]),yc="/assets/logo-9d653710.svg",qit="/",Yit={props:{personality:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onCopyToCustom:Function,onEdit:Function,onReinstall:Function,onSettings:Function,onCopyPersonalityName:Function},components:{InteractiveMenu:cp},data(){return{isMounted:!1,name:this.personality.name}},computed:{commandsList(){let n=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return console.log("this.category",this.personality.category),this.personality.category=="custom_personalities"?n.push({name:"edit",icon:"feather:settings",is_file:!1,value:this.edit}):n.push({name:"Copy to custom personas folder for editing",icon:"feather:copy",is_file:!1,value:this.copyToCustom}),this.isMounted&&n.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),this.selected&&this.personality.has_scripts&&n.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),n},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,Ve(()=>{qe.replace()})},methods:{getImgUrl(){return qit+this.personality.avatar},defaultImg(n){n.target.src=yc},toggleTalk(){this.onTalk(this)},toggleCopyLink(){this.onCopyPersonalityName(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},edit(){this.onEdit(this)},copyToCustom(){this.onCopyToCustom(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this),this.isMounted=!1},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Ve(()=>{qe.replace()})}}},$it=["title"],Wit={class:"flex flex-row items-center flex-shrink-0 gap-3"},Kit=["src"],jit=u("i",{"data-feather":"clipboard",class:"w-5"},null,-1),Qit=[jit],Xit={class:""},Zit={class:""},Jit={class:"flex items-center"},est=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),tst=u("b",null,"Author: ",-1),nst={class:"flex items-center"},ist=u("i",{"data-feather":"git-commit",class:"w-5 m-1"},null,-1),sst=u("b",null,"Version: ",-1),rst={key:0,class:"flex items-center"},ost=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),ast=u("b",null,"Languages: ",-1),lst=["selected"],cst={key:1,class:"flex items-center"},dst=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),ust=u("b",null,"Language: ",-1),pst={class:"flex items-center"},_st=u("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),hst=u("b",null,"Category: ",-1),fst=u("div",{class:"flex items-center"},[u("i",{"data-feather":"info",class:"w-5 m-1"}),u("b",null,"Description: "),u("br")],-1),mst=["title","innerHTML"],gst={class:"rounded bg-blue-300"},bst=u("i",{"data-feather":"check"},null,-1),Est=u("span",{class:"sr-only"},"Select",-1),vst=[bst,Est],yst=u("i",{"data-feather":"send",class:"w-5"},null,-1),Sst=u("span",{class:"sr-only"},"Talk",-1),Tst=[yst,Sst];function xst(n,e,t,i,s,r){const o=ft("InteractiveMenu");return w(),M("div",{class:Ye(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",r.selected_computed?"border-2 border-primary-light":"border-transparent",s.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:t.personality.installed?"":"Not installed"},[u("div",{class:Ye(t.personality.installed?"":"border-red-500")},[u("div",Wit,[u("img",{onClick:e[0]||(e[0]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),ref:"imgElement",src:r.getImgUrl(),onError:e[1]||(e[1]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer"},null,40,Kit),u("h3",{onClick:e[2]||(e[2]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},ge(t.personality.name),1),u("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[3]||(e[3]=Te(a=>r.toggleCopyLink(),["stop"]))},Qit)]),u("div",Xit,[u("div",Zit,[u("div",Jit,[est,tst,Ze(" "+ge(t.personality.author),1)]),u("div",nst,[ist,sst,Ze(" "+ge(t.personality.version),1)]),t.personality.languages&&t.select_language?(w(),M("div",rst,[ost,ast,s.isMounted?q("",!0):le((w(),M("select",{key:0,id:"languages","onUpdate:modelValue":e[4]||(e[4]=a=>t.personality.language=a),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"},[(w(!0),M($e,null,dt(t.personality.languages,(a,l)=>(w(),M("option",{key:l,selected:a==t.personality.languages[0]},ge(a),9,lst))),128))],512)),[[zn,t.personality.language]])])):q("",!0),t.personality.language?(w(),M("div",cst,[dst,ust,Ze(" "+ge(t.personality.language),1)])):q("",!0),u("div",pst,[_st,hst,Ze(" "+ge(t.personality.category),1)])]),fst,u("p",{class:"mx-1 opacity-80 h-20 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",title:t.personality.description,innerHTML:t.personality.description},null,8,mst)]),u("div",gst,[s.isMounted?(w(),M("button",{key:0,type:"button",title:"Select",onClick:[e[5]||(e[5]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[6]||(e[6]=Te(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},vst)):q("",!0),s.isMounted?(w(),M("button",{key:1,type:"button",title:"Talk",onClick:[e[7]||(e[7]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[8]||(e[8]=Te(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Tst)):q("",!0),Ie(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,$it)}const gO=bt(Yit,[["render",xst]]);const Cst={props:{code:String},data(){return{evaluatedCode:"",componentKey:0}},watch:{code:{handler(n){console.log("Code changed"),this.evaluateScriptTags(n),this.componentKey++},immediate:!0}},methods:{evaluateScriptTags(n){const e=document.createElement("div");e.innerHTML=n,e.querySelectorAll("script").forEach(i=>{const s=document.createElement("script");s.textContent=i.textContent,document.body.appendChild(s),document.body.removeChild(s)}),this.evaluatedCode=e.innerHTML,console.log("evaluated code: "+this.evaluatedCode)}}},Rst=["innerHTML"];function Ast(n,e,t,i,s,r){return w(),M("div",{innerHTML:s.evaluatedCode,key:s.componentKey},null,8,Rst)}const bO=bt(Cst,[["render",Ast]]),wst="/",Nst={components:{DynamicUIRenderer:bO},props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onUnInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){Ve(()=>{qe.replace()})},methods:{getImgUrl(){return wst+this.binding.icon},defaultImg(n){n.target.src=yc},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(this)},toggleUnInstall(){this.onUnInstall(this)},toggleReinstall(){this.onReinstall(this)},toggleReloadBinding(){this.onReloadBinding(this)},toggleSettings(){this.onSettings(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}},watch:{selected(){Ve(()=>{qe.replace()})}}},Ost=["title"],Ist={class:"flex flex-row items-center gap-3"},Mst=["src"],Dst={class:"font-bold font-large text-lg truncate"},kst=u("div",{class:"grow"},null,-1),Lst={class:"flex-none gap-1"},Pst=u("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),Ust=u("span",{class:"sr-only"},"Help",-1),Fst=[Pst,Ust],Bst={class:"flex items-center flex-row-reverse gap-2 my-1"},Gst=u("span",{class:"sr-only"},"Click to install",-1),zst=u("span",{class:"sr-only"},"Reinstall",-1),Vst=u("span",{class:"sr-only"},"UnInstall",-1),Hst=u("span",{class:"sr-only"},"Settings",-1),qst={class:""},Yst={class:""},$st={class:"flex items-center"},Wst=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Kst=u("b",null,"Author: ",-1),jst={class:"flex items-center"},Qst=u("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),Xst=u("b",null,"Folder: ",-1),Zst={class:"flex items-center"},Jst=u("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),ert=u("b",null,"Version: ",-1),trt={class:"flex items-center"},nrt=u("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),irt=u("b",null,"Link: ",-1),srt=["href"],rrt=u("div",{class:"flex items-center"},[u("i",{"data-feather":"info",class:"w-5 m-1"}),u("b",null,"Description: "),u("br")],-1),ort=["title","innerHTML"];function art(n,e,t,i,s,r){const o=ft("DynamicUIRenderer");return w(),M("div",{class:Ye(["items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",t.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[7]||(e[7]=Te((...a)=>r.toggleSelected&&r.toggleSelected(...a),["stop"])),title:t.binding.installed?t.binding.name:"Not installed"},[u("div",null,[u("div",Ist,[u("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,Mst),u("h3",Dst,ge(t.binding.name),1),kst,u("div",Lst,[t.selected?(w(),M("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...a)=>r.toggleReloadBinding&&r.toggleReloadBinding(...a)),e[2]||(e[2]=Te(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Fst)):q("",!0)])]),u("div",Bst,[t.binding.installed?q("",!0):(w(),M("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=Te((...a)=>r.toggleInstall&&r.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Ze(" Install "),Gst])),t.binding.installed?(w(),M("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=Te((...a)=>r.toggleReinstall&&r.toggleReinstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-green-700 hover:bg-red-800 focus:ring-4 focus:ring-green-300 rounded-lg dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-red-900"},[Ze(" Reinstall "),zst])):q("",!0),t.binding.installed?(w(),M("button",{key:2,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=Te((...a)=>r.toggleUnInstall&&r.toggleUnInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Ze(" Uninstall "),Vst])):q("",!0),t.selected?(w(),M("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[6]||(e[6]=Te((...a)=>r.toggleSettings&&r.toggleSettings(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Ze(" Settings "),Hst])):q("",!0)]),t.binding.ui?(w(),xt(o,{key:0,class:"w-full h-full",code:t.binding.ui},null,8,["code"])):q("",!0),u("div",qst,[u("div",Yst,[u("div",$st,[Wst,Kst,Ze(" "+ge(t.binding.author),1)]),u("div",jst,[Qst,Xst,Ze(" "+ge(t.binding.folder),1)]),u("div",Zst,[Jst,ert,Ze(" "+ge(t.binding.version),1)]),u("div",trt,[nrt,irt,u("a",{href:t.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},ge(t.binding.link),9,srt)])]),rrt,u("p",{class:"mx-1 opacity-80 line-clamp-3",title:t.binding.description,innerHTML:t.binding.description},null,8,ort)])])],10,Ost)}const lrt=bt(Nst,[["render",art]]),crt="/assets/extension-59119348.png",drt={data(){return{show:!1,model_path:"",resolve:null}},methods:{cancel(){this.resolve(null)},openInputBox(){return new Promise(n=>{this.resolve=n})},hide(n){this.show=!1,this.resolve&&(this.resolve(n),this.resolve=null)},showDialog(n){return new Promise(e=>{this.model_path=n,this.show=!0,this.resolve=e})}}},urt={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},prt={class:"relative w-full max-w-md max-h-full"},_rt={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},hrt=u("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[u("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),frt=u("span",{class:"sr-only"},"Close modal",-1),mrt=[hrt,frt],grt={class:"p-4 text-center"},brt=u("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"},[u("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),Ert={class:"p-4 text-center mx-auto mb-4"},vrt=u("label",{class:"mr-2"},"Model path",-1);function yrt(n,e,t,i,s,r){return s.show?(w(),M("div",urt,[u("div",prt,[u("div",_rt,[u("button",{type:"button",onClick:e[0]||(e[0]=o=>r.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"},mrt),u("div",grt,[brt,u("div",Ert,[vrt,le(u("input",{"onUpdate:modelValue":e[1]||(e[1]=o=>s.model_path=o),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[Pe,s.model_path]])]),u("button",{onClick:e[2]||(e[2]=o=>r.hide(!0)),type:"button",class:"text-white bg-green-600 hover:bg-green-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"}," Add "),u("button",{onClick:e[3]||(e[3]=o=>r.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"},"No, cancel")])])])])):q("",!0)}const Srt=bt(drt,[["render",yrt]]);const Trt={props:{show:{type:Boolean,default:!1,required:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(n){return console.log("choice:",n),typeof n=="string"?n:n&&n.name?n.name:""},selectChoice(n){this.selectedChoice=n,this.$emit("choice-selected",n)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(n){return n<1024?n+" bytes":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB"},toggleInput(){this.showInput=!this.showInput},addNewFilename(){const n=this.newFilename.trim();n!==""&&(this.choices.push(n),this.newFilename="",this.selectChoice(n)),this.showInput=!1},removeChoice(n,e){this.choices.splice(e,1),n===this.selectedChoice&&(this.selectedChoice=null),this.$emit("choice-removed",n)}}},xrt={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50"},Crt={class:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96"},Rrt={class:"text-xl font-semibold mb-4"},Art={class:"h-48 overflow-y-auto"},wrt=["onClick"],Nrt={class:"font-bold"},Ort=u("br",null,null,-1),Irt={key:0,class:"text-xs text-gray-500"},Mrt=["onClick"],Drt={key:0,class:"mt-4"},krt={class:"flex justify-end mt-4"},Lrt=["disabled"];function Prt(n,e,t,i,s,r){return w(),xt(ls,{name:"fade"},{default:Je(()=>[t.show?(w(),M("div",xrt,[u("div",Crt,[u("h2",Rrt,ge(t.title),1),u("div",Art,[u("ul",null,[(w(!0),M($e,null,dt(t.choices,(o,a)=>(w(),M("li",{key:a,onClick:l=>r.selectChoice(o),class:Ye([{"selected-choice":o===s.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700"])},[u("span",Nrt,ge(r.displayName(o)),1),Ort,o.size?(w(),M("span",Irt,ge(r.formatSize(o.size)),1)):q("",!0),t.can_remove?(w(),M("button",{key:1,onClick:l=>r.removeChoice(o,a),class:"ml-2 text-red-500 hover:text-red-600"}," X ",8,Mrt)):q("",!0)],10,wrt))),128))])]),s.showInput?(w(),M("div",Drt,[le(u("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>s.newFilename=o),placeholder:"Enter a filename",class:"border border-gray-300 p-2 rounded-lg w-full"},null,512),[[Pe,s.newFilename]]),u("button",{onClick:e[1]||(e[1]=(...o)=>r.addNewFilename&&r.addNewFilename(...o)),class:"mt-2 py-2 px-4 bg-green-500 hover:bg-green-600 text-white rounded-lg transition duration-300"}," Add ")])):q("",!0),u("div",krt,[u("button",{onClick:e[2]||(e[2]=(...o)=>r.closeDialog&&r.closeDialog(...o)),class:"py-2 px-4 mr-2 bg-red-500 hover:bg-red-600 text-white rounded-lg transition duration-300"}," Cancel "),u("button",{onClick:e[3]||(e[3]=(...o)=>r.validateChoice&&r.validateChoice(...o)),class:Ye([{"bg-gray-400 cursor-not-allowed":!s.selectedChoice,"bg-blue-500 hover:bg-blue-600":s.selectedChoice,"text-white":s.selectedChoice,"text-gray-500":!s.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!s.selectedChoice}," Validate ",10,Lrt),u("button",{onClick:e[4]||(e[4]=(...o)=>r.toggleInput&&r.toggleInput(...o)),class:"py-2 px-4 ml-2 bg-blue-500 hover:bg-blue-600 text-white rounded-lg transition duration-300"}," Add New ")])])])):q("",!0)]),_:1})}const AE=bt(Trt,[["render",Prt]]),Urt={props:{radioOptions:{type:Array,required:!0},defaultValue:{type:String,default:0}},data(){return{selectedValue:this.defaultValue}},methods:{handleRadioChange(n){this.selectedValue!==null&&this.$emit("radio-selected",this.selectedValue,n)}}},Frt={class:"flex space-x-4"},Brt=["value","onChange"],Grt={class:"text-gray-700"};function zrt(n,e,t,i,s,r){return w(),M("div",Frt,[(w(!0),M($e,null,dt(t.radioOptions,(o,a)=>(w(),M("label",{key:o.value,class:"flex items-center space-x-2"},[le(u("input",{type:"radio",value:o.value,"onUpdate:modelValue":e[0]||(e[0]=l=>s.selectedValue=l),onChange:l=>r.handleRadioChange(a),class:"text-blue-500 focus:ring-2 focus:ring-blue-200"},null,40,Brt),[[jD,s.selectedValue]]),u("span",Grt,ge(o.label),1)]))),128))])}const Vrt=bt(Urt,[["render",zrt]]),Hrt="/",qrt={props:{extension:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onReinstall:Function,onSettings:Function},components:{InteractiveMenu:cp},data(){return{isMounted:!1,name:this.extension.name}},computed:{commandsList(){let n=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return this.isMounted&&n.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),n.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),n},selected_computed(){return this.selected}},mounted(){this.isMounted=this.extension.isMounted,Ve(()=>{qe.replace()})},methods:{getImgUrl(){return Hrt+this.extension.avatar},defaultImg(n){n.target.src=yc},toggleTalk(){this.onTalk(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this)},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Ve(()=>{qe.replace()})}}},Yrt=["title"],$rt={class:"flex flex-row items-center flex-shrink-0 gap-3"},Wrt=["src"],Krt={class:""},jrt={class:""},Qrt={class:"flex items-center"},Xrt=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Zrt=u("b",null,"Author: ",-1),Jrt={class:"flex items-center"},eot=u("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),tot=u("b",null,"Based on: ",-1),not={key:0,class:"flex items-center"},iot=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),sot=u("b",null,"Languages: ",-1),rot=["selected"],oot={key:1,class:"flex items-center"},aot=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),lot=u("b",null,"Language: ",-1),cot={class:"flex items-center"},dot=u("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),uot=u("b",null,"Category: ",-1),pot=u("div",{class:"flex items-center"},[u("i",{"data-feather":"info",class:"w-5 m-1"}),u("b",null,"Description: "),u("br")],-1),_ot=["title","innerHTML"],hot={class:"rounded bg-blue-300"},fot=u("i",{"data-feather":"check"},null,-1),mot=u("span",{class:"sr-only"},"Select",-1),got=[fot,mot],bot=u("i",{"data-feather":"send",class:"w-5"},null,-1),Eot=u("span",{class:"sr-only"},"Talk",-1),vot=[bot,Eot];function yot(n,e,t,i,s,r){const o=ft("InteractiveMenu");return w(),M("div",{class:Ye(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",r.selected_computed?"border-2 border-primary-light":"border-transparent",s.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:t.extension.installed?"":"Not installed"},[u("div",{class:Ye(t.extension.installed?"":"border-red-500")},[u("div",$rt,[u("img",{onClick:e[0]||(e[0]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),ref:"imgElement",src:r.getImgUrl(),onError:e[1]||(e[1]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer"},null,40,Wrt),u("h3",{onClick:e[2]||(e[2]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},ge(t.extension.name),1)]),u("div",Krt,[u("div",jrt,[u("div",Qrt,[Xrt,Zrt,Ze(" "+ge(t.extension.author),1)]),u("div",Jrt,[eot,tot,Ze(" "+ge(t.extension.based_on),1)]),t.extension.languages&&t.select_language?(w(),M("div",not,[iot,sot,le(u("select",{id:"languages","onUpdate:modelValue":e[3]||(e[3]=a=>t.extension.language=a),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"},[(w(!0),M($e,null,dt(t.extension.languages,(a,l)=>(w(),M("option",{key:l,selected:a==t.extension.languages[0]},ge(a),9,rot))),128))],512),[[zn,t.extension.language]])])):q("",!0),t.extension.language?(w(),M("div",oot,[aot,lot,Ze(" "+ge(t.extension.language),1)])):q("",!0),u("div",cot,[dot,uot,Ze(" "+ge(t.extension.category),1)])]),pot,u("p",{class:"mx-1 opacity-80 h-20 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",title:t.extension.description,innerHTML:t.extension.description},null,8,_ot)]),u("div",hot,[s.isMounted?(w(),M("button",{key:0,type:"button",title:"Select",onClick:[e[4]||(e[4]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[5]||(e[5]=Te(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},got)):q("",!0),s.isMounted?(w(),M("button",{key:1,type:"button",title:"Talk",onClick:[e[6]||(e[6]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[7]||(e[7]=Te(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},vot)):q("",!0),Ie(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,Yrt)}const Sot=bt(qrt,[["render",yot]]),Tot="/assets/gpu-df72bf63.svg";const xot="/";Me.defaults.baseURL="/";const Cot={components:{AddModelDialog:Srt,ModelEntry:Ait,PersonalityViewer:Hit,PersonalityEntry:gO,BindingEntry:lrt,ChoiceDialog:AE,Card:vc,RadioOptions:Vrt,ExtensionEntry:Sot},data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},defaultModelImgPlaceholder:Li,voices:[],voice_languages:{Arabic:"ar","Brazilian Portuguese":"pt",Chinese:"zh-cn",Czech:"cs",Dutch:"nl",English:"en",French:"fr",German:"de",Italian:"it",Polish:"pl",Russian:"ru",Spanish:"es",Turkish:"tr",Japanese:"ja",Korean:"ko",Hungarian:"hu",Hindi:"hi"},binding_changed:!1,SVGGPU:Tot,models_zoo:[],models_zoo_initialLoadCount:10,models_zoo_loadMoreCount:5,models_zoo_loadedEntries:[],models_zoo_scrollThreshold:200,sortOptions:[{label:"Sort by Date",value:0},{label:"Sort by Rank",value:1},{label:"Sort by Name",value:2},{label:"Sort by Maker",value:3},{label:"Sort by Quantizer",value:4}],show_only_installed_models:!1,reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",extension_category:"bound_extensions",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],extensionsFiltered:[],collapsedArr:[],all_collapsed:!0,servers_conf_collapsed:!0,minconf_collapsed:!0,bec_collapsed:!0,sort_type:0,is_loading_zoo:!1,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,ezc_collapsed:!0,mep_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,ezl_collapsed:!1,bzl_collapsed:!1,extCatgArr:[],persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:xot,searchPersonality:"",searchExtension:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchExtensionInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){Xe.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{reinstallSDService(){Me.get("install_sd").then(n=>{}).catch(n=>{console.error(n)})},startSDService(){Me.get("start_sd").then(n=>{}).catch(n=>{console.error(n)})},showSD(){Me.get("show_sd").then(n=>{}).catch(n=>{console.error(n)})},reinstallComfyUIService(){Me.get("install_comfyui").then(n=>{}).catch(n=>{console.error(n)})},startComfyUIService(){Me.get("start_comfyui").then(n=>{}).catch(n=>{console.error(n)})},showComfyui(){Me.get("show_comfyui").then(n=>{}).catch(n=>{console.error(n)})},reinstallMotionCtrlService(){Me.get("install_motion_ctrl").then(n=>{}).catch(n=>{console.error(n)})},reinstallvLLMService(){Me.get("install_vllm").then(n=>{}).catch(n=>{console.error(n)})},startvLLMService(){Me.get("start_vllm").then(n=>{}).catch(n=>{console.error(n)})},startollamaService(){Me.get("start_ollama").then(n=>{}).catch(n=>{console.error(n)})},reinstallPetalsService(){Me.get("install_petals").then(n=>{}).catch(n=>{console.error(n)})},reinstallOLLAMAService(){Me.get("install_ollama").then(n=>{}).catch(n=>{console.error(n)})},reinstallAudioService(){Me.get("install_xtts").then(n=>{}).catch(n=>{console.error(n)})},startAudioService(){Me.get("start_xtts").then(n=>{}).catch(n=>{console.error(n)})},reinstallElasticSearchService(){Me.get("install_vllm").then(n=>{}).catch(n=>{console.error(n)})},getSeviceVoices(){Me.get("list_voices").then(n=>{this.voices=n.data.voices}).catch(n=>{console.error(n)})},load_more_models(){this.models_zoo_initialLoadCount+10{qe.replace()}),this.binding_changed&&!this.mzc_collapsed&&(this.modelsZoo==null||this.modelsZoo.length==0)&&(console.log("Refreshing models"),await this.$store.dispatch("refreshConfig"),this.models_zoo=[],this.refreshModelsZoo(),this.binding_changed=!1)},async selectSortOption(n){this.$store.state.sort_type=n,this.updateModelsZoo(),console.log(`Selected sorting:${n}`),console.log(`models:${this.models_zoo}`)},handleRadioSelected(n){this.isLoading=!0,this.selectSortOption(n).then(()=>{this.isLoading=!1})},filter_installed(n){return console.log("filtering"),n.filter(e=>e.isInstalled===!0)},getVoices(){"speechSynthesis"in window&&(this.audioVoices=speechSynthesis.getVoices(),console.log("Voices:"+this.audioVoices),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let n=await this.api_get_req("check_update");this.has_updates=n.update_availability,console.log("has_updates",this.has_updates)},onVariantChoiceSelected(n){this.selected_variant=n},oncloseVariantChoiceDialog(){this.variantSelectionDialogVisible=!1},onvalidateVariantChoice(n){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let e=this.currenModelToInstall;if(e.linkNotValid){e.installing=!1,this.$store.state.toast.showToast("Link is not valid, file does not exist",4,!1);return}let t="https://huggingface.co/"+e.model.quantizer+"/"+e.model.name+"/resolve/main/"+this.selected_variant.name;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:t},console.log("installing...",this.addModel);const i=s=>{if(console.log("received something"),s.status&&s.progress<=100){if(this.addModel=s,console.log("Progress",s),e.progress=s.progress,e.speed=s.speed,e.total_size=s.total_size,e.downloaded_size=s.downloaded_size,e.start_time=s.start_time,e.installing=!0,e.progress==100){const r=this.models_zoo.findIndex(o=>o.name===e.model.name);this.models_zoo[r].isInstalled=!0,this.showProgress=!1,e.installing=!1,console.log("Received succeeded"),Xe.off("install_progress",i),console.log("Installed successfully"),this.$store.state.toast.showToast(`Model: +`);var P=0,j=!1;this.parse=function(Y,Q,re){if(typeof Y!="string")throw new Error("Input must be a string");var te=Y.length,Z=A.length,fe=U.length,ve=F.length,Ae=O(K),J=[],me=[],ee=[],Se=P=0;if(!Y)return ze();if(R.header&&!Q){var Oe=Y.split(U)[0].split(A),k=[],B={},$=!1;for(var ce in Oe){var ne=Oe[ce];O(R.transformHeader)&&(ne=R.transformHeader(ne,ce));var Ce=ne,we=B[ne]||0;for(0=L)return ze(!0)}else for(z=P,P++;;){if((z=Y.indexOf(S,z+1))===-1)return re||me.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:J.length,index:P}),xe();if(z===te-1)return xe(Y.substring(P,z).replace(I,S));if(S!==G||Y[z+1]!==G){if(S===G||z===0||Y[z-1]!==G){ae!==-1&&ae=L)return ze(!0);break}me.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:J.length,index:P}),z++}}else z++}return xe();function se(ke){J.push(ke),Se=P}function Re(ke){var lt=0;if(ke!==-1){var je=Y.substring(z+1,ke);je&&je.trim()===""&&(lt=je.length)}return lt}function xe(ke){return re||(ke===void 0&&(ke=Y.substring(P)),ee.push(ke),P=te,se(ee),Ae&&st()),ze()}function De(ke){P=ke,se(ee),ee=[],D=Y.indexOf(U,P)}function ze(ke){return{data:J,errors:me,meta:{delimiter:A,linebreak:U,aborted:j,truncated:!!ke,cursor:Se+(Q||0)}}}function st(){K(ze()),J=[],me=[]}},this.abort=function(){j=!0},this.getCharIndex=function(){return P}}function v(R){var S=R.data,A=o[S.workerId],U=!1;if(S.error)A.userError(S.error,S.file);else if(S.results&&S.results.data){var F={abort:function(){U=!0,y(S.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:T,resume:T};if(O(A.userStep)){for(var K=0;Kn.text()).then(n=>{const{data:e}=Mtt.parse(n,{header:!0});console.log("Recovered data"),console.log(e),this.faqs=e}).catch(n=>{console.error("Error loading FAQs:",n)})},parseMultiline(n){return n.replace(/\n/g,"
")}}},Ws=n=>(Nr("data-v-b19a05a8"),n=n(),Or(),n),ktt={class:"container flex-row mx-auto p-4 bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-1 md:grid-cols-2 gap-4"},Ltt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"About Lord of large Language Models",-1)),Ptt={class:"mb-4"},Utt=Ws(()=>u("p",null,[Ze("Discord link: "),u("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/YgnaFMAQ"},"https://discord.gg/YgnaFMAQ")],-1)),Ftt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"Frequently Asked Questions",-1)),Btt={class:"list-disc pl-4"},Gtt={class:"text-xl font-bold mb-1"},ztt=["innerHTML"],Vtt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"Contact Us",-1)),Htt=Ws(()=>u("p",{class:"mb-4"},"If you have any further questions or need assistance, feel free to reach out to me.",-1)),qtt=Ws(()=>u("p",null,[Ze("Discord link: "),u("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/YgnaFMAQ"},"https://discord.gg/YgnaFMAQ")],-1)),Ytt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"Credits",-1)),$tt=Ws(()=>u("p",{class:"mb-4"},[Ze("This project is developed by "),u("span",{class:"font-bold"},"ParisNeo"),Ze(" With help from the community.")],-1)),Wtt=Ws(()=>u("p",{class:"mb-4"},[u("span",{class:"font-bold"},[u("a",{href:"https://github.com/ParisNeo/lollms-webui/graphs/contributors"},"Check out the full list of developers here and show them some love.")])],-1)),Ktt=["href"];function jtt(n,e,t,i,s,r){const o=ft("Card");return w(),M("div",ktt,[Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ltt,u("p",Ptt," Lollms version "+ge(r.version),1),Utt]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ftt,u("ul",Btt,[(w(!0),M($e,null,dt(s.faqs,(a,l)=>(w(),M("li",{key:l},[u("h3",Gtt,ge(a.question),1),u("p",{class:"mb-4",innerHTML:r.parseMultiline(a.answer)},null,8,ztt)]))),128))])]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Vtt,Htt,qtt]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ytt,$tt,Wtt,u("p",null,[Ze("Check out the project on "),u("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:s.githubLink,target:"_blank",rel:"noopener noreferrer"},"GitHub",8,Ktt),Ze(".")])]),_:1})])}const Qtt=bt(Dtt,[["render",jtt],["__scopeId","data-v-b19a05a8"]]);function ss(n,e=!0,t=1){const i=e?1e3:1024;if(Math.abs(n)=i&&r{qe.replace()})},executeCommand(n){this.isMenuOpen=!1,console.log("Selected"),console.log(n.value),typeof n.value=="function"&&(console.log("Command detected",n),n.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(n))},positionMenu(){var n;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClientRect(),t=window.innerHeight;n=e.bottom>t/2}else this.force_position==1?n=!0:n=!1;this.menuPosition.top=n?"auto":"calc(100% + 10px)",this.menuPosition.bottom=n?"100%":"auto"}}},mounted(){window.addEventListener("resize",this.positionMenu),this.positionMenu(),Ve(()=>{qe.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},Ztt={class:"menu-container"},Jtt=["title"],ent=["src"],tnt=["data-feather"],nnt={key:2,class:"w-5 h-5"},int={key:3,"data-feather":"menu"},snt={class:"flex-grow menu-ul"},rnt=["onClick"],ont={key:0,"data-feather":"check"},ant=["src","alt"],lnt=["data-feather"],cnt={key:3,class:"menu-icon"};function dnt(n,e,t,i,s,r){return w(),M("div",Ztt,[u("button",{onClick:e[0]||(e[0]=Te((...o)=>r.toggleMenu&&r.toggleMenu(...o),["prevent"])),title:t.title,class:Ye([t.menuIconClass,"menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer"]),ref:"menuButton"},[t.icon&&!t.icon.includes("#")&&!t.icon.includes("feather")?(w(),M("img",{key:0,src:t.icon,class:"w-5 h-5 p-0 m-0 shadow-lg bold"},null,8,ent)):t.icon&&t.icon.includes("feather")?(w(),M("i",{key:1,"data-feather":t.icon.split(":")[1],class:"w-5 h-5"},null,8,tnt)):t.icon&&t.icon.includes("#")?(w(),M("p",nnt,ge(t.icon.split("#")[1]),1)):(w(),M("i",int))],10,Jtt),Ie(ls,{name:"slide"},{default:Je(()=>[s.isMenuOpen?(w(),M("div",{key:0,class:"menu-list flex-grow",style:Jt(s.menuPosition),ref:"menu"},[u("ul",snt,[(w(!0),M($e,null,dt(t.commands,(o,a)=>(w(),M("li",{key:a,onClick:Te(l=>r.executeCommand(o),["prevent"]),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[t.selected_entry==o.name?(w(),M("i",ont)):o.icon&&!o.icon.includes("feather")&&!o.is_file?(w(),M("img",{key:1,src:o.icon,alt:o.name,class:"menu-icon"},null,8,ant)):q("",!0),o.icon&&o.icon.includes("feather")&&!o.is_file?(w(),M("i",{key:2,"data-feather":o.icon.split(":")[1],class:"mr-2"},null,8,lnt)):(w(),M("span",cnt)),u("span",null,ge(o.name),1)],8,rnt))),128))])],4)):q("",!0)]),_:1})])}const cp=bt(Xtt,[["render",dnt]]),unt={components:{InteractiveMenu:cp},props:{isInstalled:Boolean,onInstall:Function,onCancelInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,onCopyLink:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,speed:0,total_size:0,downloaded_size:0,start_time:"",installing:!1,uninstalling:!1,failedToLoad:!1,linkNotValid:!1,selected_variant:""}},async mounted(){Ve(()=>{qe.replace()})},methods:{formatFileSize(n){return n<1024?n+" bytes":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB"},computedFileSize(n){return ss(n)},getImgUrl(){return this.model.icon==null||this.model.icon==="/images/default_model.png"?Li:this.model.icon},defaultImg(n){n.target.src=Li},install(){this.onInstall(this)},uninstall(){this.isInstalled&&this.onUninstall(this)},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(n){if(console.log("event.target.tagName.toLowerCase()"),console.log(n.target.tagName.toLowerCase()),n.target.tagName.toLowerCase()==="button"||n.target.tagName.toLowerCase()==="svg"){n.stopPropagation();return}this.onSelected(this),this.model.selected=!0,Ve(()=>{qe.replace()})},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this),this.installing=!1},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{computed_classes(){return this.model.isInstalled?this.selected?"border-4 border-gray-200 bg-primary cursor-pointer":"border-0 border-primary bg-primary cursor-pointer":"border-transparent"},commandsList(){let n=[{name:this.model.isInstalled?"Install Extra":"Install",icon:"feather:settings",is_file:!1,value:this.install},{name:"Copy model info to clipboard",icon:"feather:settings",is_file:!1,value:this.toggleCopy}];return this.model.isInstalled&&n.push({name:"UnInstall",icon:"feather:settings",is_file:!1,value:this.uninstall}),this.selected&&n.push({name:"Reload",icon:"feather:refresh-ccw",is_file:!1,value:this.toggleSelected}),n},selected_computed(){return this.selected},fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const n=this.model.variants[0].size;return this.formatFileSize(n)}return null}},speed_computed(){return ss(this.speed)},total_size_computed(){return ss(this.total_size)},downloaded_size_computed(){return ss(this.downloaded_size)}},watch:{linkNotValid(){Ve(()=>{qe.replace()})}}},pnt=["title"],_nt={key:0,class:"flex flex-row"},hnt={class:"max-w-[300px] overflow-x-auto"},fnt={class:"flex gap-3 items-center grow"},mnt=["href"],gnt=["src"],bnt={class:"flex-1 overflow-hidden"},Ent={class:"font-bold font-large text-lg truncate"},vnt={key:1,class:"flex items-center flex-row gap-2 my-1"},ynt={class:"flex grow items-center"},Snt=u("i",{"data-feather":"box",class:"w-5"},null,-1),Tnt=u("span",{class:"sr-only"},"Custom model / local model",-1),xnt=[Snt,Tnt],Cnt=u("span",{class:"sr-only"},"Remove",-1),Rnt={key:2,class:"absolute z-10 -m-4 p-5 shadow-md text-center rounded-lg w-full h-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel bg-opacity-70 dark:bg-opacity-70 flex justify-center items-center"},Ant={class:"relative flex flex-col items-center justify-center flex-grow h-full"},wnt=u("div",{role:"status",class:"justify-center"},[u("svg",{"aria-hidden":"true",class:"w-24 h-24 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1),Nnt={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},Ont={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},Int={class:"flex justify-between mb-1"},Mnt=u("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),Dnt={class:"text-sm font-medium text-blue-700 dark:text-white"},knt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Lnt={class:"flex justify-between mb-1"},Pnt={class:"text-base font-medium text-blue-700 dark:text-white"},Unt={class:"text-sm font-medium text-blue-700 dark:text-white"},Fnt={class:"flex flex-grow"},Bnt={class:"flex flex-row flex-grow gap-3"},Gnt={class:"p-2 text-center grow"},znt={key:3},Vnt={class:"flex flex-row items-center gap-3"},Hnt=["src"],qnt={class:"font-bold font-large text-lg truncate"},Ynt=u("div",{class:"grow"},null,-1),$nt={class:"flex items-center flex-row-reverse gap-2 my-1"},Wnt={class:"flex flex-row items-center"},Knt={key:0,class:"text-base text-red-600 flex items-center mt-1"},jnt=u("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),Qnt=["title"],Xnt={class:""},Znt={class:"flex flex-row items-center"},Jnt=u("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),eit=u("b",null,"Card: ",-1),tit=["href","title"],nit=u("div",{class:"grow"},null,-1),iit=u("i",{"data-feather":"clipboard",class:"w-5"},null,-1),sit=[iit],rit={class:"flex items-center"},oit=u("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),ait=u("b",null,"File size: ",-1),lit={class:"flex items-center"},cit=u("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),dit=u("b",null,"License: ",-1),uit={key:0,class:"flex items-center"},pit=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),_it=u("b",null,"quantizer: ",-1),hit=["href"],fit={class:"flex items-center"},mit=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),git=u("b",null,"Model creator: ",-1),bit=["href"],Eit={class:"flex items-center"},vit=u("i",{"data-feather":"clock",class:"w-5 m-1"},null,-1),yit=u("b",null,"Release date: ",-1),Sit={class:"flex items-center"},Tit=u("i",{"data-feather":"grid",class:"w-5 m-1"},null,-1),xit=u("b",null,"Category: ",-1),Cit=["href"];function Rit(n,e,t,i,s,r){const o=ft("InteractiveMenu");return w(),M("div",{class:Ye(["relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",r.computed_classes]),title:t.model.name,onClick:e[10]||(e[10]=Te(a=>r.toggleSelected(a),["prevent"]))},[t.model.isCustomModel?(w(),M("div",_nt,[u("div",hnt,[u("div",fnt,[u("a",{href:t.model.model_creator_link,target:"_blank"},[u("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-lg object-fill"},null,40,gnt)],8,mnt),u("div",bnt,[u("h3",Ent,ge(t.model.name),1)])])])])):q("",!0),t.model.isCustomModel?(w(),M("div",vnt,[u("div",ynt,[u("button",{type:"button",title:"Custom model / local model",class:"font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",onClick:e[1]||(e[1]=Te(()=>{},["stop"]))},xnt),Ze(" Custom model ")]),u("div",null,[t.model.isInstalled?(w(),M("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=Te((...a)=>r.uninstall&&r.uninstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Ze(" Uninstall "),Cnt])):q("",!0)])])):q("",!0),s.installing?(w(),M("div",Rnt,[u("div",Ant,[wnt,u("div",Nnt,[u("div",Ont,[u("div",Int,[Mnt,u("span",Dnt,ge(Math.floor(s.progress))+"%",1)]),u("div",knt,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Jt({width:s.progress+"%"})},null,4)]),u("div",Lnt,[u("span",Pnt,"Download speed: "+ge(r.speed_computed)+"/s",1),u("span",Unt,ge(r.downloaded_size_computed)+"/"+ge(r.total_size_computed),1)])])]),u("div",Fnt,[u("div",Bnt,[u("div",Gnt,[u("button",{onClick:e[3]||(e[3]=Te((...a)=>r.toggleCancelInstall&&r.toggleCancelInstall(...a),["stop"])),type:"button",title:"Cancel download",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"}," Cancel ")])])])])])):q("",!0),t.model.isCustomModel?q("",!0):(w(),M("div",znt,[u("div",Vnt,[u("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=a=>r.defaultImg(a)),class:Ye(["w-10 h-10 rounded-lg object-fill",s.linkNotValid?"grayscale":""])},null,42,Hnt),u("h3",qnt,ge(t.model.name),1),Ynt,Ie(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),u("div",$nt,[u("div",Wnt,[s.linkNotValid?(w(),M("div",Knt,[jnt,Ze(" Link is not valid ")])):q("",!0)])]),u("div",{class:"",title:t.model.isInstalled?t.model.name:"Not installed"},[u("div",Xnt,[u("div",Znt,[Jnt,eit,u("a",{href:"https://huggingface.co/"+t.model.quantizer+"/"+t.model.name,target:"_blank",onClick:e[5]||(e[5]=Te(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:s.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," View full model card ",8,tit),nit,u("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[6]||(e[6]=Te(a=>r.toggleCopyLink(),["stop"]))},sit)]),u("div",rit,[u("div",{class:Ye(["flex flex-shrink-0 items-center",s.linkNotValid?"text-red-600":""])},[oit,ait,Ze(" "+ge(r.fileSize),1)],2)]),u("div",lit,[cit,dit,Ze(" "+ge(t.model.license),1)]),t.model.quantizer!="None"&&t.model.type!="transformers"?(w(),M("div",uit,[pit,_it,u("a",{href:"https://huggingface.co/"+t.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=Te(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},ge(t.model.quantizer),9,hit)])):q("",!0),u("div",fit,[mit,git,u("a",{href:t.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[8]||(e[8]=Te(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},ge(t.model.model_creator),9,bit)]),u("div",Eit,[vit,yit,Ze(" "+ge(t.model.last_commit_time),1)]),u("div",Sit,[Tit,xit,u("a",{href:"https://huggingface.co/"+t.model.model_creator,target:"_blank",rel:"noopener noreferrer",onClick:e[9]||(e[9]=Te(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},ge(t.model.category),9,Cit)])])],8,Qnt)]))],10,pnt)}const Ait=bt(unt,[["render",Rit]]),wit={data(){return{editMode:!1,avatar:"path/to/avatar.jpg",personalityName:"Personality Name",personalityAuthor:"Author Name",personalityDescription:"Personality Description",personalityCategory:"Category",disclaimer:"Disclaimer text",conditioningText:"Conditioning Text",aiPrefix:"AI Prefix",userPrefix:"User Prefix",antipromptsList:[{id:1,text:"Antiprompt 1"},{id:2,text:"Antiprompt 2"},{id:3,text:"Antiprompt 3"}]}},methods:{commitChanges(){console.log("Personality changes committed"),this.editMode=!1}}},Nit={class:"p-4"},Oit={class:"flex items-center mb-4"},Iit=["src"],Mit={class:"text-lg font-semibold"},Dit=u("strong",null,"Author:",-1),kit=u("strong",null,"Description:",-1),Lit=u("strong",null,"Category:",-1),Pit={key:0},Uit=u("strong",null,"Disclaimer:",-1),Fit=u("strong",null,"Conditioning Text:",-1),Bit=u("strong",null,"AI Prefix:",-1),Git=u("strong",null,"User Prefix:",-1),zit=u("strong",null,"Antiprompts:",-1);function Vit(n,e,t,i,s,r){return w(),M("div",Nit,[u("div",Oit,[u("img",{src:s.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,Iit),u("h2",Mit,ge(s.personalityName),1)]),u("p",null,[Dit,Ze(" "+ge(s.personalityAuthor),1)]),u("p",null,[kit,Ze(" "+ge(s.personalityDescription),1)]),u("p",null,[Lit,Ze(" "+ge(s.personalityCategory),1)]),s.disclaimer?(w(),M("p",Pit,[Uit,Ze(" "+ge(s.disclaimer),1)])):q("",!0),u("p",null,[Fit,Ze(" "+ge(s.conditioningText),1)]),u("p",null,[Bit,Ze(" "+ge(s.aiPrefix),1)]),u("p",null,[Git,Ze(" "+ge(s.userPrefix),1)]),u("div",null,[zit,u("ul",null,[(w(!0),M($e,null,dt(s.antipromptsList,o=>(w(),M("li",{key:o.id},ge(o.text),1))),128))])]),u("button",{onClick:e[0]||(e[0]=o=>s.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),s.editMode?(w(),M("button",{key:1,onClick:e[1]||(e[1]=(...o)=>r.commitChanges&&r.commitChanges(...o)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):q("",!0)])}const Hit=bt(wit,[["render",Vit]]),yc="/assets/logo-9d653710.svg",qit="/",Yit={props:{personality:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onCopyToCustom:Function,onEdit:Function,onReinstall:Function,onSettings:Function,onCopyPersonalityName:Function},components:{InteractiveMenu:cp},data(){return{isMounted:!1,name:this.personality.name}},computed:{commandsList(){let n=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return console.log("this.category",this.personality.category),this.personality.category=="custom_personalities"?n.push({name:"edit",icon:"feather:settings",is_file:!1,value:this.edit}):n.push({name:"Copy to custom personas folder for editing",icon:"feather:copy",is_file:!1,value:this.copyToCustom}),this.isMounted&&n.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),this.selected&&this.personality.has_scripts&&n.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),n},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,Ve(()=>{qe.replace()})},methods:{getImgUrl(){return qit+this.personality.avatar},defaultImg(n){n.target.src=yc},toggleTalk(){this.onTalk(this)},toggleCopyLink(){this.onCopyPersonalityName(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},edit(){this.onEdit(this)},copyToCustom(){this.onCopyToCustom(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this),this.isMounted=!1},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Ve(()=>{qe.replace()})}}},$it=["title"],Wit={class:"flex flex-row items-center flex-shrink-0 gap-3"},Kit=["src"],jit=u("i",{"data-feather":"clipboard",class:"w-5"},null,-1),Qit=[jit],Xit={class:""},Zit={class:""},Jit={class:"flex items-center"},est=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),tst=u("b",null,"Author: ",-1),nst={class:"flex items-center"},ist=u("i",{"data-feather":"git-commit",class:"w-5 m-1"},null,-1),sst=u("b",null,"Version: ",-1),rst={key:0,class:"flex items-center"},ost=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),ast=u("b",null,"Languages: ",-1),lst=["selected"],cst={key:1,class:"flex items-center"},dst=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),ust=u("b",null,"Language: ",-1),pst={class:"flex items-center"},_st=u("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),hst=u("b",null,"Category: ",-1),fst=u("div",{class:"flex items-center"},[u("i",{"data-feather":"info",class:"w-5 m-1"}),u("b",null,"Description: "),u("br")],-1),mst=["title","innerHTML"],gst={class:"rounded bg-blue-300"},bst=u("i",{"data-feather":"check"},null,-1),Est=u("span",{class:"sr-only"},"Select",-1),vst=[bst,Est],yst=u("i",{"data-feather":"send",class:"w-5"},null,-1),Sst=u("span",{class:"sr-only"},"Talk",-1),Tst=[yst,Sst];function xst(n,e,t,i,s,r){const o=ft("InteractiveMenu");return w(),M("div",{class:Ye(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",r.selected_computed?"border-2 border-primary-light":"border-transparent",s.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:t.personality.installed?"":"Not installed"},[u("div",{class:Ye(t.personality.installed?"":"border-red-500")},[u("div",Wit,[u("img",{onClick:e[0]||(e[0]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),ref:"imgElement",src:r.getImgUrl(),onError:e[1]||(e[1]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer"},null,40,Kit),u("h3",{onClick:e[2]||(e[2]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},ge(t.personality.name),1),u("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[3]||(e[3]=Te(a=>r.toggleCopyLink(),["stop"]))},Qit)]),u("div",Xit,[u("div",Zit,[u("div",Jit,[est,tst,Ze(" "+ge(t.personality.author),1)]),u("div",nst,[ist,sst,Ze(" "+ge(t.personality.version),1)]),t.personality.languages&&t.select_language?(w(),M("div",rst,[ost,ast,s.isMounted?q("",!0):le((w(),M("select",{key:0,id:"languages","onUpdate:modelValue":e[4]||(e[4]=a=>t.personality.language=a),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"},[(w(!0),M($e,null,dt(t.personality.languages,(a,l)=>(w(),M("option",{key:l,selected:a==t.personality.languages[0]},ge(a),9,lst))),128))],512)),[[zn,t.personality.language]])])):q("",!0),t.personality.language?(w(),M("div",cst,[dst,ust,Ze(" "+ge(t.personality.language),1)])):q("",!0),u("div",pst,[_st,hst,Ze(" "+ge(t.personality.category),1)])]),fst,u("p",{class:"mx-1 opacity-80 h-20 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",title:t.personality.description,innerHTML:t.personality.description},null,8,mst)]),u("div",gst,[s.isMounted?(w(),M("button",{key:0,type:"button",title:"Select",onClick:[e[5]||(e[5]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[6]||(e[6]=Te(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},vst)):q("",!0),s.isMounted?(w(),M("button",{key:1,type:"button",title:"Talk",onClick:[e[7]||(e[7]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[8]||(e[8]=Te(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Tst)):q("",!0),Ie(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,$it)}const gO=bt(Yit,[["render",xst]]);const Cst={props:{code:String},data(){return{evaluatedCode:"",componentKey:0}},watch:{code:{handler(n){console.log("Code changed"),this.evaluateScriptTags(n),this.componentKey++},immediate:!0}},methods:{evaluateScriptTags(n){const e=document.createElement("div");e.innerHTML=n,e.querySelectorAll("script").forEach(i=>{const s=document.createElement("script");s.textContent=i.textContent,document.body.appendChild(s),document.body.removeChild(s)}),this.evaluatedCode=e.innerHTML,console.log("evaluated code: "+this.evaluatedCode)}}},Rst=["innerHTML"];function Ast(n,e,t,i,s,r){return w(),M("div",{innerHTML:s.evaluatedCode,key:s.componentKey},null,8,Rst)}const bO=bt(Cst,[["render",Ast]]),wst="/",Nst={components:{DynamicUIRenderer:bO},props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onUnInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){Ve(()=>{qe.replace()})},methods:{getImgUrl(){return wst+this.binding.icon},defaultImg(n){n.target.src=yc},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(this)},toggleUnInstall(){this.onUnInstall(this)},toggleReinstall(){this.onReinstall(this)},toggleReloadBinding(){this.onReloadBinding(this)},toggleSettings(){this.onSettings(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}},watch:{selected(){Ve(()=>{qe.replace()})}}},Ost=["title"],Ist={class:"flex flex-row items-center gap-3"},Mst=["src"],Dst={class:"font-bold font-large text-lg truncate"},kst=u("div",{class:"grow"},null,-1),Lst={class:"flex-none gap-1"},Pst=u("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),Ust=u("span",{class:"sr-only"},"Help",-1),Fst=[Pst,Ust],Bst={class:"flex items-center flex-row-reverse gap-2 my-1"},Gst=u("span",{class:"sr-only"},"Click to install",-1),zst=u("span",{class:"sr-only"},"Reinstall",-1),Vst=u("span",{class:"sr-only"},"UnInstall",-1),Hst=u("span",{class:"sr-only"},"Settings",-1),qst={class:""},Yst={class:""},$st={class:"flex items-center"},Wst=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Kst=u("b",null,"Author: ",-1),jst={class:"flex items-center"},Qst=u("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),Xst=u("b",null,"Folder: ",-1),Zst={class:"flex items-center"},Jst=u("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),ert=u("b",null,"Version: ",-1),trt={class:"flex items-center"},nrt=u("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),irt=u("b",null,"Link: ",-1),srt=["href"],rrt=u("div",{class:"flex items-center"},[u("i",{"data-feather":"info",class:"w-5 m-1"}),u("b",null,"Description: "),u("br")],-1),ort=["title","innerHTML"];function art(n,e,t,i,s,r){const o=ft("DynamicUIRenderer");return w(),M("div",{class:Ye(["items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",t.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[7]||(e[7]=Te((...a)=>r.toggleSelected&&r.toggleSelected(...a),["stop"])),title:t.binding.installed?t.binding.name:"Not installed"},[u("div",null,[u("div",Ist,[u("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,Mst),u("h3",Dst,ge(t.binding.name),1),kst,u("div",Lst,[t.selected?(w(),M("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...a)=>r.toggleReloadBinding&&r.toggleReloadBinding(...a)),e[2]||(e[2]=Te(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Fst)):q("",!0)])]),u("div",Bst,[t.binding.installed?q("",!0):(w(),M("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=Te((...a)=>r.toggleInstall&&r.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Ze(" Install "),Gst])),t.binding.installed?(w(),M("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=Te((...a)=>r.toggleReinstall&&r.toggleReinstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-green-700 hover:bg-red-800 focus:ring-4 focus:ring-green-300 rounded-lg dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-red-900"},[Ze(" Reinstall "),zst])):q("",!0),t.binding.installed?(w(),M("button",{key:2,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=Te((...a)=>r.toggleUnInstall&&r.toggleUnInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Ze(" Uninstall "),Vst])):q("",!0),t.selected?(w(),M("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[6]||(e[6]=Te((...a)=>r.toggleSettings&&r.toggleSettings(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Ze(" Settings "),Hst])):q("",!0)]),t.binding.ui?(w(),xt(o,{key:0,class:"w-full h-full",code:t.binding.ui},null,8,["code"])):q("",!0),u("div",qst,[u("div",Yst,[u("div",$st,[Wst,Kst,Ze(" "+ge(t.binding.author),1)]),u("div",jst,[Qst,Xst,Ze(" "+ge(t.binding.folder),1)]),u("div",Zst,[Jst,ert,Ze(" "+ge(t.binding.version),1)]),u("div",trt,[nrt,irt,u("a",{href:t.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},ge(t.binding.link),9,srt)])]),rrt,u("p",{class:"mx-1 opacity-80 line-clamp-3",title:t.binding.description,innerHTML:t.binding.description},null,8,ort)])])],10,Ost)}const lrt=bt(Nst,[["render",art]]),crt="/assets/extension-59119348.png",drt={data(){return{show:!1,model_path:"",resolve:null}},methods:{cancel(){this.resolve(null)},openInputBox(){return new Promise(n=>{this.resolve=n})},hide(n){this.show=!1,this.resolve&&(this.resolve(n),this.resolve=null)},showDialog(n){return new Promise(e=>{this.model_path=n,this.show=!0,this.resolve=e})}}},urt={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},prt={class:"relative w-full max-w-md max-h-full"},_rt={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},hrt=u("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[u("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),frt=u("span",{class:"sr-only"},"Close modal",-1),mrt=[hrt,frt],grt={class:"p-4 text-center"},brt=u("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"},[u("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),Ert={class:"p-4 text-center mx-auto mb-4"},vrt=u("label",{class:"mr-2"},"Model path",-1);function yrt(n,e,t,i,s,r){return s.show?(w(),M("div",urt,[u("div",prt,[u("div",_rt,[u("button",{type:"button",onClick:e[0]||(e[0]=o=>r.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"},mrt),u("div",grt,[brt,u("div",Ert,[vrt,le(u("input",{"onUpdate:modelValue":e[1]||(e[1]=o=>s.model_path=o),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[Pe,s.model_path]])]),u("button",{onClick:e[2]||(e[2]=o=>r.hide(!0)),type:"button",class:"text-white bg-green-600 hover:bg-green-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"}," Add "),u("button",{onClick:e[3]||(e[3]=o=>r.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"},"No, cancel")])])])])):q("",!0)}const Srt=bt(drt,[["render",yrt]]);const Trt={props:{show:{type:Boolean,default:!1,required:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(n){return console.log("choice:",n),typeof n=="string"?n:n&&n.name?n.name:""},selectChoice(n){this.selectedChoice=n,this.$emit("choice-selected",n)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(n){return n<1024?n+" bytes":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB"},toggleInput(){this.showInput=!this.showInput},addNewFilename(){const n=this.newFilename.trim();n!==""&&(this.choices.push(n),this.newFilename="",this.selectChoice(n)),this.showInput=!1},removeChoice(n,e){this.choices.splice(e,1),n===this.selectedChoice&&(this.selectedChoice=null),this.$emit("choice-removed",n)}}},xrt={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50"},Crt={class:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96"},Rrt={class:"text-xl font-semibold mb-4"},Art={class:"h-48 overflow-y-auto"},wrt=["onClick"],Nrt={class:"font-bold"},Ort=u("br",null,null,-1),Irt={key:0,class:"text-xs text-gray-500"},Mrt=["onClick"],Drt={key:0,class:"mt-4"},krt={class:"flex justify-end mt-4"},Lrt=["disabled"];function Prt(n,e,t,i,s,r){return w(),xt(ls,{name:"fade"},{default:Je(()=>[t.show?(w(),M("div",xrt,[u("div",Crt,[u("h2",Rrt,ge(t.title),1),u("div",Art,[u("ul",null,[(w(!0),M($e,null,dt(t.choices,(o,a)=>(w(),M("li",{key:a,onClick:l=>r.selectChoice(o),class:Ye([{"selected-choice":o===s.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700"])},[u("span",Nrt,ge(r.displayName(o)),1),Ort,o.size?(w(),M("span",Irt,ge(r.formatSize(o.size)),1)):q("",!0),t.can_remove?(w(),M("button",{key:1,onClick:l=>r.removeChoice(o,a),class:"ml-2 text-red-500 hover:text-red-600"}," X ",8,Mrt)):q("",!0)],10,wrt))),128))])]),s.showInput?(w(),M("div",Drt,[le(u("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>s.newFilename=o),placeholder:"Enter a filename",class:"border border-gray-300 p-2 rounded-lg w-full"},null,512),[[Pe,s.newFilename]]),u("button",{onClick:e[1]||(e[1]=(...o)=>r.addNewFilename&&r.addNewFilename(...o)),class:"mt-2 py-2 px-4 bg-green-500 hover:bg-green-600 text-white rounded-lg transition duration-300"}," Add ")])):q("",!0),u("div",krt,[u("button",{onClick:e[2]||(e[2]=(...o)=>r.closeDialog&&r.closeDialog(...o)),class:"py-2 px-4 mr-2 bg-red-500 hover:bg-red-600 text-white rounded-lg transition duration-300"}," Cancel "),u("button",{onClick:e[3]||(e[3]=(...o)=>r.validateChoice&&r.validateChoice(...o)),class:Ye([{"bg-gray-400 cursor-not-allowed":!s.selectedChoice,"bg-blue-500 hover:bg-blue-600":s.selectedChoice,"text-white":s.selectedChoice,"text-gray-500":!s.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!s.selectedChoice}," Validate ",10,Lrt),u("button",{onClick:e[4]||(e[4]=(...o)=>r.toggleInput&&r.toggleInput(...o)),class:"py-2 px-4 ml-2 bg-blue-500 hover:bg-blue-600 text-white rounded-lg transition duration-300"}," Add New ")])])])):q("",!0)]),_:1})}const AE=bt(Trt,[["render",Prt]]),Urt={props:{radioOptions:{type:Array,required:!0},defaultValue:{type:String,default:0}},data(){return{selectedValue:this.defaultValue}},methods:{handleRadioChange(n){this.selectedValue!==null&&this.$emit("radio-selected",this.selectedValue,n)}}},Frt={class:"flex space-x-4"},Brt=["value","onChange"],Grt={class:"text-gray-700"};function zrt(n,e,t,i,s,r){return w(),M("div",Frt,[(w(!0),M($e,null,dt(t.radioOptions,(o,a)=>(w(),M("label",{key:o.value,class:"flex items-center space-x-2"},[le(u("input",{type:"radio",value:o.value,"onUpdate:modelValue":e[0]||(e[0]=l=>s.selectedValue=l),onChange:l=>r.handleRadioChange(a),class:"text-blue-500 focus:ring-2 focus:ring-blue-200"},null,40,Brt),[[jD,s.selectedValue]]),u("span",Grt,ge(o.label),1)]))),128))])}const Vrt=bt(Urt,[["render",zrt]]),Hrt="/",qrt={props:{extension:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onReinstall:Function,onSettings:Function},components:{InteractiveMenu:cp},data(){return{isMounted:!1,name:this.extension.name}},computed:{commandsList(){let n=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return this.isMounted&&n.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),n.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),n},selected_computed(){return this.selected}},mounted(){this.isMounted=this.extension.isMounted,Ve(()=>{qe.replace()})},methods:{getImgUrl(){return Hrt+this.extension.avatar},defaultImg(n){n.target.src=yc},toggleTalk(){this.onTalk(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this)},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Ve(()=>{qe.replace()})}}},Yrt=["title"],$rt={class:"flex flex-row items-center flex-shrink-0 gap-3"},Wrt=["src"],Krt={class:""},jrt={class:""},Qrt={class:"flex items-center"},Xrt=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Zrt=u("b",null,"Author: ",-1),Jrt={class:"flex items-center"},eot=u("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),tot=u("b",null,"Based on: ",-1),not={key:0,class:"flex items-center"},iot=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),sot=u("b",null,"Languages: ",-1),rot=["selected"],oot={key:1,class:"flex items-center"},aot=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),lot=u("b",null,"Language: ",-1),cot={class:"flex items-center"},dot=u("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),uot=u("b",null,"Category: ",-1),pot=u("div",{class:"flex items-center"},[u("i",{"data-feather":"info",class:"w-5 m-1"}),u("b",null,"Description: "),u("br")],-1),_ot=["title","innerHTML"],hot={class:"rounded bg-blue-300"},fot=u("i",{"data-feather":"check"},null,-1),mot=u("span",{class:"sr-only"},"Select",-1),got=[fot,mot],bot=u("i",{"data-feather":"send",class:"w-5"},null,-1),Eot=u("span",{class:"sr-only"},"Talk",-1),vot=[bot,Eot];function yot(n,e,t,i,s,r){const o=ft("InteractiveMenu");return w(),M("div",{class:Ye(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",r.selected_computed?"border-2 border-primary-light":"border-transparent",s.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:t.extension.installed?"":"Not installed"},[u("div",{class:Ye(t.extension.installed?"":"border-red-500")},[u("div",$rt,[u("img",{onClick:e[0]||(e[0]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),ref:"imgElement",src:r.getImgUrl(),onError:e[1]||(e[1]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer"},null,40,Wrt),u("h3",{onClick:e[2]||(e[2]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},ge(t.extension.name),1)]),u("div",Krt,[u("div",jrt,[u("div",Qrt,[Xrt,Zrt,Ze(" "+ge(t.extension.author),1)]),u("div",Jrt,[eot,tot,Ze(" "+ge(t.extension.based_on),1)]),t.extension.languages&&t.select_language?(w(),M("div",not,[iot,sot,le(u("select",{id:"languages","onUpdate:modelValue":e[3]||(e[3]=a=>t.extension.language=a),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"},[(w(!0),M($e,null,dt(t.extension.languages,(a,l)=>(w(),M("option",{key:l,selected:a==t.extension.languages[0]},ge(a),9,rot))),128))],512),[[zn,t.extension.language]])])):q("",!0),t.extension.language?(w(),M("div",oot,[aot,lot,Ze(" "+ge(t.extension.language),1)])):q("",!0),u("div",cot,[dot,uot,Ze(" "+ge(t.extension.category),1)])]),pot,u("p",{class:"mx-1 opacity-80 h-20 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",title:t.extension.description,innerHTML:t.extension.description},null,8,_ot)]),u("div",hot,[s.isMounted?(w(),M("button",{key:0,type:"button",title:"Select",onClick:[e[4]||(e[4]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[5]||(e[5]=Te(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},got)):q("",!0),s.isMounted?(w(),M("button",{key:1,type:"button",title:"Talk",onClick:[e[6]||(e[6]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[7]||(e[7]=Te(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},vot)):q("",!0),Ie(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,Yrt)}const Sot=bt(qrt,[["render",yot]]),Tot="/assets/gpu-df72bf63.svg";const xot="/";Me.defaults.baseURL="/";const Cot={components:{AddModelDialog:Srt,ModelEntry:Ait,PersonalityViewer:Hit,PersonalityEntry:gO,BindingEntry:lrt,ChoiceDialog:AE,Card:vc,RadioOptions:Vrt,ExtensionEntry:Sot},data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},defaultModelImgPlaceholder:Li,voices:[],voice_languages:{Arabic:"ar","Brazilian Portuguese":"pt",Chinese:"zh-cn",Czech:"cs",Dutch:"nl",English:"en",French:"fr",German:"de",Italian:"it",Polish:"pl",Russian:"ru",Spanish:"es",Turkish:"tr",Japanese:"ja",Korean:"ko",Hungarian:"hu",Hindi:"hi"},binding_changed:!1,SVGGPU:Tot,models_zoo:[],models_zoo_initialLoadCount:10,models_zoo_loadMoreCount:5,models_zoo_loadedEntries:[],models_zoo_scrollThreshold:200,sortOptions:[{label:"Sort by Date",value:0},{label:"Sort by Rank",value:1},{label:"Sort by Name",value:2},{label:"Sort by Maker",value:3},{label:"Sort by Quantizer",value:4}],show_only_installed_models:!1,reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",extension_category:"bound_extensions",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],extensionsFiltered:[],collapsedArr:[],all_collapsed:!0,servers_conf_collapsed:!0,minconf_collapsed:!0,bec_collapsed:!0,sort_type:0,is_loading_zoo:!1,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,ezc_collapsed:!0,mep_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,ezl_collapsed:!1,bzl_collapsed:!1,extCatgArr:[],persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:xot,searchPersonality:"",searchExtension:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchExtensionInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){Xe.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{reinstallSDService(){Me.get("install_sd").then(n=>{}).catch(n=>{console.error(n)})},upgradeSDService(){Me.get("upgrade_sd").then(n=>{}).catch(n=>{console.error(n)})},startSDService(){Me.get("start_sd").then(n=>{}).catch(n=>{console.error(n)})},showSD(){Me.get("show_sd").then(n=>{}).catch(n=>{console.error(n)})},reinstallComfyUIService(){Me.get("install_comfyui").then(n=>{}).catch(n=>{console.error(n)})},upgradeComfyUIService(){Me.get("upgrade_comfyui").then(n=>{}).catch(n=>{console.error(n)})},startComfyUIService(){Me.get("start_comfyui").then(n=>{}).catch(n=>{console.error(n)})},showComfyui(){Me.get("show_comfyui").then(n=>{}).catch(n=>{console.error(n)})},reinstallMotionCtrlService(){Me.get("install_motion_ctrl").then(n=>{}).catch(n=>{console.error(n)})},reinstallvLLMService(){Me.get("install_vllm").then(n=>{}).catch(n=>{console.error(n)})},startvLLMService(){Me.get("start_vllm").then(n=>{}).catch(n=>{console.error(n)})},startollamaService(){Me.get("start_ollama").then(n=>{}).catch(n=>{console.error(n)})},reinstallPetalsService(){Me.get("install_petals").then(n=>{}).catch(n=>{console.error(n)})},reinstallOLLAMAService(){Me.get("install_ollama").then(n=>{}).catch(n=>{console.error(n)})},reinstallAudioService(){Me.get("install_xtts").then(n=>{}).catch(n=>{console.error(n)})},startAudioService(){Me.get("start_xtts").then(n=>{}).catch(n=>{console.error(n)})},reinstallElasticSearchService(){Me.get("install_vllm").then(n=>{}).catch(n=>{console.error(n)})},getSeviceVoices(){Me.get("list_voices").then(n=>{this.voices=n.data.voices}).catch(n=>{console.error(n)})},load_more_models(){this.models_zoo_initialLoadCount+10{qe.replace()}),this.binding_changed&&!this.mzc_collapsed&&(this.modelsZoo==null||this.modelsZoo.length==0)&&(console.log("Refreshing models"),await this.$store.dispatch("refreshConfig"),this.models_zoo=[],this.refreshModelsZoo(),this.binding_changed=!1)},async selectSortOption(n){this.$store.state.sort_type=n,this.updateModelsZoo(),console.log(`Selected sorting:${n}`),console.log(`models:${this.models_zoo}`)},handleRadioSelected(n){this.isLoading=!0,this.selectSortOption(n).then(()=>{this.isLoading=!1})},filter_installed(n){return console.log("filtering"),n.filter(e=>e.isInstalled===!0)},getVoices(){"speechSynthesis"in window&&(this.audioVoices=speechSynthesis.getVoices(),console.log("Voices:"+this.audioVoices),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let n=await this.api_get_req("check_update");this.has_updates=n.update_availability,console.log("has_updates",this.has_updates)},onVariantChoiceSelected(n){this.selected_variant=n},oncloseVariantChoiceDialog(){this.variantSelectionDialogVisible=!1},onvalidateVariantChoice(n){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let e=this.currenModelToInstall;if(e.linkNotValid){e.installing=!1,this.$store.state.toast.showToast("Link is not valid, file does not exist",4,!1);return}let t="https://huggingface.co/"+e.model.quantizer+"/"+e.model.name+"/resolve/main/"+this.selected_variant.name;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:t},console.log("installing...",this.addModel);const i=s=>{if(console.log("received something"),s.status&&s.progress<=100){if(this.addModel=s,console.log("Progress",s),e.progress=s.progress,e.speed=s.speed,e.total_size=s.total_size,e.downloaded_size=s.downloaded_size,e.start_time=s.start_time,e.installing=!0,e.progress==100){const r=this.models_zoo.findIndex(o=>o.name===e.model.name);this.models_zoo[r].isInstalled=!0,this.showProgress=!1,e.installing=!1,console.log("Received succeeded"),Xe.off("install_progress",i),console.log("Installed successfully"),this.$store.state.toast.showToast(`Model: `+e.model.name+` installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}}else Xe.off("install_progress",i),console.log("Install failed"),e.installing=!1,this.showProgress=!1,console.error("Installation failed:",s.error),this.$store.state.toast.showToast(`Model: `+e.model.name+` @@ -168,25 +168,25 @@ Response: Error: `+e.error,4,!1);this.isLoading=!1},async remountExtension(n){await this.unmountExtension(n),await this.mountExtension(n)},onExtensionReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,console.log(n),Me.post("/reinstall_extension",{name:n.extension.full_path}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_extension",e),e.data.status?this.$store.state.toast.showToast("Extension reinstalled successfully!",4,!0):this.$store.state.toast.showToast("Could not reinstall extension",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}))},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,Me.post("/reinstall_personality",{name:n.personality.path}).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}))},personalityImgPlacehodler(n){n.target.src=ga},extensionImgPlacehodler(n){n.target.src=crt},searchPersonality_func(){clearTimeout(this.searchPersonalityTimer),this.searchPersonality&&(this.searchPersonalityInProgress=!0,setTimeout(this.filterPersonalities,this.searchPersonalityTimerInterval))},searchModel_func(){this.filterModels()}},async mounted(){console.log("Getting voices"),this.getVoices(),console.log("Constructing"),this.load_everything(),this.getSeviceVoices()},activated(){},computed:{rendered_models_zoo:{get(){return this.searchModel?this.show_only_installed_models?this.modelsFiltered.filter(n=>n.isInstalled===!0):this.modelsFiltered.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)):(console.log("this.models_zoo"),console.log(this.models_zoo),console.log(this.models_zoo_initialLoadCount),this.show_only_installed_models?this.models_zoo.filter(n=>n.isInstalled===!0):this.models_zoo.slice(0,Math.min(this.models_zoo.length,this.models_zoo_initialLoadCount)))}},imgBinding:{get(){if(!this.isMounted)return Li;try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return Li}}},imgModel:{get(){try{let n=this.$store.state.modelsZoo.findIndex(e=>e.name==this.$store.state.selectedModel);return n>=0?(console.log(`model avatar : ${this.$store.state.modelsZoo[n].icon}`),this.$store.state.modelsZoo[n].icon):Li}catch{console.log("error")}if(!this.isMounted)return Li;try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(n=>n.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return Li}}},isReady:{get(){return this.$store.state.ready}},audio_out_voice:{get(){return this.$store.state.config.audio_out_voice},set(n){this.$store.state.config.audio_out_voice=n}},whisperModels(){return["base","base.en","base.fr","base.es","small","small.en","small.fr","small.es","medium","medium.en","medium.fr","medium.es","large","large.en","large.fr","large.es"]},audioLanguages(){return[{code:"en-US",name:"English (US)"},{code:"en-GB",name:"English (UK)"},{code:"es-ES",name:"Spanish (Spain)"},{code:"es-MX",name:"Spanish (Mexico)"},{code:"fr-FR",name:"French (France)"},{code:"fr-CA",name:"French (Canada)"},{code:"de-DE",name:"German (Germany)"},{code:"it-IT",name:"Italian (Italy)"},{code:"pt-BR",name:"Portuguese (Brazil)"},{code:"pt-PT",name:"Portuguese (Portugal)"},{code:"ru-RU",name:"Russian (Russia)"},{code:"zh-CN",name:"Chinese (China)"},{code:"ja-JP",name:"Japanese (Japan)"},{code:"ar-SA",name:"Arabic (Saudi Arabia)"},{code:"tr-TR",name:"Turkish (Turkey)"},{code:"ms-MY",name:"Malay (Malaysia)"},{code:"ko-KR",name:"Korean (South Korea)"},{code:"nl-NL",name:"Dutch (Netherlands)"},{code:"sv-SE",name:"Swedish (Sweden)"},{code:"da-DK",name:"Danish (Denmark)"},{code:"fi-FI",name:"Finnish (Finland)"},{code:"no-NO",name:"Norwegian (Norway)"},{code:"pl-PL",name:"Polish (Poland)"},{code:"el-GR",name:"Greek (Greece)"},{code:"hu-HU",name:"Hungarian (Hungary)"},{code:"cs-CZ",name:"Czech (Czech Republic)"},{code:"th-TH",name:"Thai (Thailand)"},{code:"hi-IN",name:"Hindi (India)"},{code:"he-IL",name:"Hebrew (Israel)"},{code:"id-ID",name:"Indonesian (Indonesia)"},{code:"vi-VN",name:"Vietnamese (Vietnam)"},{code:"uk-UA",name:"Ukrainian (Ukraine)"},{code:"ro-RO",name:"Romanian (Romania)"},{code:"bg-BG",name:"Bulgarian (Bulgaria)"},{code:"hr-HR",name:"Croatian (Croatia)"},{code:"sr-RS",name:"Serbian (Serbia)"},{code:"sk-SK",name:"Slovak (Slovakia)"},{code:"sl-SI",name:"Slovenian (Slovenia)"},{code:"et-EE",name:"Estonian (Estonia)"},{code:"lv-LV",name:"Latvian (Latvia)"},{code:"lt-LT",name:"Lithuanian (Lithuania)"},{code:"ka-GE",name:"Georgian (Georgia)"},{code:"hy-AM",name:"Armenian (Armenia)"},{code:"az-AZ",name:"Azerbaijani (Azerbaijan)"},{code:"kk-KZ",name:"Kazakh (Kazakhstan)"},{code:"uz-UZ",name:"Uzbek (Uzbekistan)"},{code:"kkj-CM",name:"Kako (Cameroon)"},{code:"my-MM",name:"Burmese (Myanmar)"},{code:"ne-NP",name:"Nepali (Nepal)"},{code:"si-LK",name:"Sinhala (Sri Lanka)"}]},configFile:{get(){return this.$store.state.config},set(n){this.$store.commit("setConfig",n)}},userName:{get(){return this.$store.state.config.user_name},set(n){this.$store.state.config.user_name=n}},user_avatar:{get(){return"/user_infos/"+this.$store.state.config.user_avatar},set(n){this.$store.state.config.user_avatar=n}},hardware_mode:{get(){return this.$store.state.config.hardware_mode},set(n){this.$store.state.config.hardware_mode=n}},auto_update:{get(){return this.$store.state.config.auto_update},set(n){this.$store.state.config.auto_update=n}},auto_speak:{get(){return this.$store.state.config.auto_speak},set(n){this.$store.state.config.auto_speak=n}},auto_read:{get(){return this.$store.state.config.auto_read},set(n){this.$store.state.config.auto_read=n}},enable_voice_service:{get(){return this.$store.state.config.enable_voice_service},set(n){this.$store.state.config.enable_voice_service=n}},current_language:{get(){return this.$store.state.config.current_language},set(n){console.log("Current voice set to ",n),this.$store.state.config.current_language=n}},current_voice:{get(){return this.$store.state.config.current_voice===null||this.$store.state.config.current_voice===void 0?(console.log("current voice",this.$store.state.config.current_voice),"main_voice"):this.$store.state.config.current_voice},set(n){n=="main_voice"||n===void 0?(console.log("Current voice set to None"),this.$store.state.config.current_voice=null):(console.log("Current voice set to ",n),this.$store.state.config.current_voice=n)}},audio_pitch:{get(){return this.$store.state.config.audio_pitch},set(n){this.$store.state.config.audio_pitch=n}},audio_in_language:{get(){return this.$store.state.config.audio_in_language},set(n){this.$store.state.config.audio_in_language=n}},use_user_name_in_discussions:{get(){return this.$store.state.config.use_user_name_in_discussions},set(n){this.$store.state.config.use_user_name_in_discussions=n}},discussion_db_name:{get(){return this.$store.state.config.discussion_db_name},set(n){this.$store.state.config.discussion_db_name=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)}},mountedExtensions:{get(){return console.log("this.$store.state.mountedExtensions:",this.$store.state.mountedExtensions),this.$store.state.mountedExtensions},set(n){this.$store.commit("setActiveExtensions",n)}},bindingsZoo:{get(){return this.$store.state.bindingsZoo},set(n){this.$store.commit("setbindingsZoo",n)}},modelsArr:{get(){return this.$store.state.modelsArr},set(n){this.$store.commit("setModelsArr",n)}},models:{get(){return this.models_zoo},set(n){this.$store.commit("setModelsZoo",n)}},installed_models:{get(){return this.models_zoo},set(n){this.$store.commit("setModelsZoo",n)}},diskUsage:{get(){return this.$store.state.diskUsage},set(n){this.$store.commit("setDiskUsage",n)}},ramUsage:{get(){return this.$store.state.ramUsage},set(n){this.$store.commit("setRamUsage",n)}},vramUsage:{get(){return this.$store.state.vramUsage},set(n){this.$store.commit("setVramUsage",n)}},disk_available_space(){return this.computedFileSize(this.diskUsage.available_space)},disk_binding_models_usage(){return console.log(`this.diskUsage : ${this.diskUsage}`),this.computedFileSize(this.diskUsage.binding_models_usage)},disk_percent_usage(){return this.diskUsage.percent_usage},disk_total_space(){return this.computedFileSize(this.diskUsage.total_space)},ram_available_space(){return this.computedFileSize(this.ramUsage.available_space)},ram_usage(){return this.computedFileSize(this.ramUsage.ram_usage)},ram_percent_usage(){return this.ramUsage.percent_usage},ram_total_space(){return this.computedFileSize(this.ramUsage.total_space)},model_name(){if(this.isMounted)return this.configFile.model_name},binding_name(){if(!this.isMounted)return;const n=this.bindingsZoo.findIndex(e=>e.folder===this.configFile.binding_name);if(n>-1)return this.bindingsZoo[n].name},active_pesonality(){if(!this.isMounted)return;const n=this.personalities.findIndex(e=>e.full_path===this.configFile.personalities[this.configFile.active_personality_id]);if(n>-1)return this.personalities[n].name},speed_computed(){return ss(this.addModel.speed)},total_size_computed(){return ss(this.addModel.total_size)},downloaded_size_computed(){return ss(this.addModel.downloaded_size)}},watch:{enable_voice_service(n){n||(this.configFile.auto_read=!1)},bec_collapsed(){Ve(()=>{qe.replace()})},pc_collapsed(){Ve(()=>{qe.replace()})},mc_collapsed(){Ve(()=>{qe.replace()})},sc_collapsed(){Ve(()=>{qe.replace()})},showConfirmation(){Ve(()=>{qe.replace()})},mzl_collapsed(){Ve(()=>{qe.replace()})},pzl_collapsed(){Ve(()=>{qe.replace()})},ezl_collapsed(){Ve(()=>{qe.replace()})},bzl_collapsed(){Ve(()=>{qe.replace()})},all_collapsed(n){this.collapseAll(n),Ve(()=>{qe.replace()})},settingsChanged(n){this.$store.state.settingsChanged=n,Ve(()=>{qe.replace()})},isLoading(){Ve(()=>{qe.replace()})},searchPersonality(n){n==""&&this.filterPersonalities()},mzdc_collapsed(){Ve(()=>{qe.replace()})}},async beforeRouteLeave(n){if(await this.$router.isReady(),this.settingsChanged)return await this.$store.state.yesNoDialog.askQuestion(`Did You forget to apply changes? -You need to apply changes before you leave, or else.`,"Apply configuration","Cancel")&&this.applyConfiguration(),!1}},ue=n=>(Nr("data-v-20db2a02"),n=n(),Or(),n),Rot={class:"container overflow-y-scroll flex flex-row shadow-lg p-10 pt-0 overflow-y-scroll w-full 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"},Aot={class:"sticky top-0 z-10 flex flex-row mb-2 p-3 gap-3 w-full rounded-b-lg bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},wot={key:0,class:"flex gap-3 flex-1 items-center duration-75"},Not=ue(()=>u("i",{"data-feather":"x"},null,-1)),Oot=[Not],Iot=ue(()=>u("i",{"data-feather":"check"},null,-1)),Mot=[Iot],Dot={key:1,class:"flex gap-3 flex-1 items-center"},kot=ue(()=>u("i",{"data-feather":"save"},null,-1)),Lot=[kot],Pot=ue(()=>u("i",{"data-feather":"refresh-ccw"},null,-1)),Uot=[Pot],Fot=ue(()=>u("i",{"data-feather":"list"},null,-1)),Bot=[Fot],Got={class:"flex gap-3 flex-1 items-center justify-end"},zot=ue(()=>u("i",{"data-feather":"trash-2"},null,-1)),Vot=[zot],Hot=ue(()=>u("i",{"data-feather":"refresh-ccw"},null,-1)),qot=[Hot],Yot=ue(()=>u("i",{"data-feather":"arrow-up-circle"},null,-1)),$ot={key:0},Wot=ue(()=>u("i",{"data-feather":"alert-circle"},null,-1)),Kot=[Wot],jot={class:"flex gap-3 items-center"},Qot={key:0,class:"flex gap-3 items-center"},Xot=ue(()=>u("p",{class:"text-red-600 font-bold"},"Apply changes:",-1)),Zot=ue(()=>u("i",{"data-feather":"check"},null,-1)),Jot=[Zot],eat={key:1,role:"status"},tat=ue(()=>u("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"},[u("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"}),u("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)),nat=ue(()=>u("span",{class:"sr-only"},"Loading...",-1)),iat={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},sat={class:"flex flex-row p-3"},rat=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),oat=[rat],aat=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),lat=[aat],cat=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),dat=ue(()=>u("div",{class:"mr-2"},"|",-1)),uat={class:"text-base font-semibold cursor-pointer select-none items-center"},pat={class:"flex gap-2 items-center"},_at={key:0},hat={class:"flex gap-2 items-center"},fat=["src"],mat={class:"font-bold font-large text-lg"},gat={key:1},bat={class:"flex gap-2 items-center"},Eat=["src"],vat={class:"font-bold font-large text-lg"},yat=ue(()=>u("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),Sat={class:"font-bold font-large text-lg"},Tat=ue(()=>u("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),xat={class:"font-bold font-large text-lg"},Cat={class:"mb-2"},Rat=ue(()=>u("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[u("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[u("path",{fill:"currentColor",d:"M17 17H7V7h10m4 4V9h-2V7a2 2 0 0 0-2-2h-2V3h-2v2h-2V3H9v2H7c-1.11 0-2 .89-2 2v2H3v2h2v2H3v2h2v2a2 2 0 0 0 2 2h2v2h2v-2h2v2h2v-2h2a2 2 0 0 0 2-2v-2h2v-2h-2v-2m-6 2h-2v-2h2m2-2H9v6h6V9Z"})]),Ze(" CPU Ram usage: ")],-1)),Aat={class:"flex flex-col mx-2"},wat=ue(()=>u("b",null,"Avaliable ram: ",-1)),Nat=ue(()=>u("b",null,"Ram usage: ",-1)),Oat={class:"p-2"},Iat={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Mat={class:"mb-2"},Dat=ue(()=>u("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[u("i",{"data-feather":"hard-drive",class:"w-5 h-5"}),Ze(" Disk usage: ")],-1)),kat={class:"flex flex-col mx-2"},Lat=ue(()=>u("b",null,"Avaliable disk space: ",-1)),Pat=ue(()=>u("b",null,"Disk usage: ",-1)),Uat={class:"p-2"},Fat={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Bat={class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Gat=["src"],zat={class:"flex flex-col mx-2"},Vat=ue(()=>u("b",null,"Model: ",-1)),Hat=ue(()=>u("b",null,"Avaliable vram: ",-1)),qat=ue(()=>u("b",null,"GPU usage: ",-1)),Yat={class:"p-2"},$at={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Wat={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Kat={class:"flex flex-row p-3"},jat=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),Qat=[jat],Xat=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Zat=[Xat],Jat=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1)),elt={class:"flex flex-col mb-2 px-3 pb-2"},tlt={class:"expand-to-fit bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block 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"},nlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"hardware_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Hardware mode:")],-1)),ilt={class:"text-center items-center"},slt={class:"flex flex-row"},rlt=ue(()=>u("option",{value:"cpu"},"CPU",-1)),olt=ue(()=>u("option",{value:"cpu-noavx"},"CPU (No AVX)",-1)),alt=ue(()=>u("option",{value:"nvidia-tensorcores"},"NVIDIA (Tensor Cores)",-1)),llt=ue(()=>u("option",{value:"nvidia"},"NVIDIA",-1)),clt=ue(()=>u("option",{value:"amd-noavx"},"AMD (No AVX)",-1)),dlt=ue(()=>u("option",{value:"amd"},"AMD",-1)),ult=ue(()=>u("option",{value:"apple-intel"},"Apple Intel",-1)),plt=ue(()=>u("option",{value:"apple-silicon"},"Apple Silicon",-1)),_lt=[rlt,olt,alt,llt,clt,dlt,ult,plt],hlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),flt={style:{width:"100%"}},mlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"copy_to_clipboard_add_all_details",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Add details to messages copied to clipboard:")],-1)),glt={class:"flex flex-row"},blt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"auto_show_browser",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto show browser:")],-1)),Elt={class:"flex flex-row"},vlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"activate_debug",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate debug mode:")],-1)),ylt={class:"flex flex-row"},Slt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"debug_log_file_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Debug file path:")],-1)),Tlt={class:"flex flex-row"},xlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"show_news_panel",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show news panel:")],-1)),Clt={class:"flex flex-row"},Rlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"auto_save",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto save:")],-1)),Alt={class:"flex flex-row"},wlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),Nlt={class:"flex flex-row"},Olt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto title:")],-1)),Ilt={class:"flex flex-row"},Mlt={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"},Dlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),klt={style:{width:"100%"}},Llt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User description:")],-1)),Plt={style:{width:"100%"}},Ult=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"use_user_informations_in_discussion",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use user description in discussion:")],-1)),Flt={style:{width:"100%"}},Blt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),Glt={style:{width:"100%"}},zlt={for:"avatar-upload"},Vlt=["src"],Hlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"use_user_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use User Name in discussions:")],-1)),qlt={class:"flex flex-row"},Ylt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"max_n_predict",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Maximum number of output tokens space (forces the model to have more space to speak):")],-1)),$lt={style:{width:"100%"}},Wlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"min_n_predict",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Minimum number of output tokens space (forces the model to have more space to speak):")],-1)),Klt={style:{width:"100%"}},jlt={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"},Qlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"turn_on_code_execution",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on code execution:")],-1)),Xlt={style:{width:"100%"}},Zlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"turn_on_code_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on code validation:")],-1)),Jlt={style:{width:"100%"}},ect={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"},tct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"activate_skills_lib",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Skills library:")],-1)),nct={class:"flex flex-row"},ict=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Skills library database name:")],-1)),sct={style:{width:"100%"}},rct={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"},oct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"use_files",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate files support:")],-1)),act={class:"flex flex-row"},lct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"activate_ltm",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Long term memory:")],-1)),cct={class:"flex flex-row"},dct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"summerize_discussion",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Continuous Learning from discussions:")],-1)),uct={class:"flex flex-row"},pct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_visualize_on_vectorization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"show vectorized data:")],-1)),_ct={class:"flex flex-row"},hct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_activate",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate data Vectorization:")],-1)),fct={class:"flex flex-row"},mct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_build_keys_words",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Build keywords when querying the vectorized database:")],-1)),gct={class:"flex flex-row"},bct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization method:")],-1)),Ect=ue(()=>u("option",{value:"tfidf_vectorizer"},"tfidf Vectorizer",-1)),vct=ue(()=>u("option",{value:"model_embedding"},"Model Embedding",-1)),yct=[Ect,vct],Sct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_visualization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data visualization method:")],-1)),Tct=ue(()=>u("option",{value:"PCA"},"PCA",-1)),xct=ue(()=>u("option",{value:"TSNE"},"TSNE",-1)),Cct=[Tct,xct],Rct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Save the new files to the database (The database wil always grow and continue to be the same over many sessions):")],-1)),Act={class:"flex flex-row"},wct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization chunk size(tokens):")],-1)),Nct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization overlap size(tokens):")],-1)),Oct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Number of chunks to use for each message:")],-1)),Ict={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"},Mct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"activate_internet_search",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate internet search:")],-1)),Dct={class:"flex flex-row"},kct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"internet_quick_search",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate quick search:")],-1)),Lct={class:"flex flex-row"},Pct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"internet_activate_search_decision",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate search decision:")],-1)),Uct={class:"flex flex-row"},Fct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"internet_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization chunk size:")],-1)),Bct={class:"flex flex-col"},Gct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"internet_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization overlap size:")],-1)),zct={class:"flex flex-col"},Vct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"internet_vectorization_nb_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization number of chunks:")],-1)),Hct={class:"flex flex-col"},qct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"internet_nb_search_pages",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet number of search pages:")],-1)),Yct={class:"flex flex-col"},$ct={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"},Wct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"pdf_latex_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"PDF LaTeX path:")],-1)),Kct={class:"flex flex-row"},jct={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"},Qct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"positive_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Positive Boost:")],-1)),Xct={class:"flex flex-row"},Zct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"negative_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative Boost:")],-1)),Jct={class:"flex flex-row"},edt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"force_output_language_to_be",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Force AI to answer in this language:")],-1)),tdt={class:"flex flex-row"},ndt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"fun_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Fun mode:")],-1)),idt={class:"flex flex-row"},sdt={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"},rdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"whisper_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Whisper model:")],-1)),odt={class:"flex flex-row"},adt=["value"],ldt={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"},cdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"activate_audio_infos",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate audio infos:")],-1)),ddt={class:"flex flex-row"},udt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"audio_auto_send_input",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Send audio input automatically:")],-1)),pdt={class:"flex flex-row"},_dt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),hdt={class:"flex flex-row"},fdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),mdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"audio_silenceTimer",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio in silence timer (ms):")],-1)),gdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"audio_in_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Input Audio Language:")],-1)),bdt=["value"],Edt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"audio_out_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Output Audio Voice:")],-1)),vdt=["value"],ydt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Sdt={class:"flex flex-row p-3"},Tdt=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),xdt=[Tdt],Cdt=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Rdt=[Cdt],Adt=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Servers configurations",-1)),wdt={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"},Ndt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Host:")],-1)),Odt={style:{width:"100%"}},Idt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Port:")],-1)),Mdt={style:{width:"100%"}},Ddt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate headless server mode (deactivates all code exectuion to protect the PC from attacks):")],-1)),kdt={style:{width:"100%"}},Ldt={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"},Pdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable sd service:")],-1)),Udt={class:"flex flex-row"},Fdt=ue(()=>u("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Bdt=[Fdt],Gdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"install_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install SD service:")],-1)),zdt={class:"flex flex-row"},Vdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"sd_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"sd base url:")],-1)),Hdt={class:"flex flex-row"},qdt={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"},Ydt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_comfyui_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable comfyui service:")],-1)),$dt={class:"flex flex-row"},Wdt=ue(()=>u("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Kdt=[Wdt],jdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"install_comfyui_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install ComfyUI service:")],-1)),Qdt={class:"flex flex-row"},Xdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"comfyui_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"comfyui base url:")],-1)),Zdt={class:"flex flex-row"},Jdt={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"},eut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable Motion Ctrl service:")],-1)),tut={class:"flex flex-row"},nut=ue(()=>u("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),iut=[nut],sut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"install_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Motion Ctrl service:")],-1)),rut={class:"flex flex-row"},out=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"sd_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"sd base url:")],-1)),aut={class:"flex flex-row"},lut={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"},cut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_ollama_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable ollama service:")],-1)),dut={class:"flex flex-row"},uut=ue(()=>u("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),put=[uut],_ut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"ollama_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Ollama service:")],-1)),hut={class:"flex flex-row"},fut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"ollama_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"ollama base url:")],-1)),mut={class:"flex flex-row"},gut={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"},but=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_vllm_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable vLLM service:")],-1)),Eut={class:"flex flex-row"},vut=ue(()=>u("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),yut=[vut],Sut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install vLLM service:")],-1)),Tut={class:"flex flex-row"},xut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm base url:")],-1)),Cut={class:"flex flex-row"},Rut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"vllm_gpu_memory_utilization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"gpu memory utilization:")],-1)),Aut={class:"flex flex-col align-bottom"},wut={class:"relative"},Nut=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"vllm_gpu_memory_utilization",class:"text-sm font-medium"}," vllm gpu memory utilization: ")],-1)),Out={class:"absolute right-0"},Iut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"vllm_max_num_seqs",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm max num seqs:")],-1)),Mut={class:"flex flex-row"},Dut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"vllm_max_model_len",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"max model len:")],-1)),kut={class:"flex flex-row"},Lut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"vllm_model_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm model path:")],-1)),Put={class:"flex flex-row"},Uut={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"},Fut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_petals_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable petals service:")],-1)),But={class:"flex flex-row"},Gut=ue(()=>u("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),zut=[Gut],Vut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"petals_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Petals service:")],-1)),Hut={class:"flex flex-row"},qut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"petals_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"petals base url:")],-1)),Yut={class:"flex flex-row"},$ut={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"},Wut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_voice_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable elastic search service:")],-1)),Kut={class:"flex flex-row"},jut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"install_elastic_search_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reinstall Elastic Search service:")],-1)),Qut={class:"flex flex-row"},Xut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"elastic_search_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"elastic search base url:")],-1)),Zut={class:"flex flex-row"},Jut={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"},ept=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_voice_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable voice service:")],-1)),tpt={class:"flex flex-row"},npt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"install_xtts_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xTTS service:")],-1)),ipt={class:"flex flex-row"},spt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"xtts_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xtts base url:")],-1)),rpt={class:"flex flex-row"},opt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current language:")],-1)),apt={class:"flex flex-row"},lpt=["disabled"],cpt=["value"],dpt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"current_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current voice:")],-1)),upt={class:"flex flex-row"},ppt=["disabled"],_pt=["value"],hpt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"auto_read",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto read:")],-1)),fpt={class:"flex flex-row"},mpt=["disabled"],gpt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},bpt={class:"flex flex-row p-3"},Ept=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),vpt=[Ept],ypt=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Spt=[ypt],Tpt=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),xpt={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Cpt=ue(()=>u("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),Rpt={key:1,class:"mr-2"},Apt={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},wpt={class:"flex gap-1 items-center"},Npt=["src"],Opt={class:"font-bold font-large text-lg line-clamp-1"},Ipt={key:0,class:"mb-2"},Mpt={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Dpt=ue(()=>u("i",{"data-feather":"chevron-up"},null,-1)),kpt=[Dpt],Lpt=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Ppt=[Lpt],Upt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Fpt={class:"flex flex-row p-3"},Bpt=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),Gpt=[Bpt],zpt=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Vpt=[zpt],Hpt=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),qpt={class:"flex flex-row items-center"},Ypt={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},$pt=ue(()=>u("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),Wpt={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Kpt=ue(()=>u("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),jpt={key:2,class:"mr-2"},Qpt={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},Xpt={class:"flex gap-1 items-center"},Zpt=["src"],Jpt={class:"font-bold font-large text-lg line-clamp-1"},e_t={class:"mx-2 mb-4"},t_t={class:"relative"},n_t={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},i_t={key:0},s_t=ue(()=>u("div",{role:"status"},[u("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1)),r_t=[s_t],o_t={key:1},a_t=ue(()=>u("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[u("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_t=[a_t],c_t=ue(()=>u("label",{for:"only_installed"},"Show only installed models",-1)),d_t=ue(()=>u("a",{href:"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard",target:"_blank",class:"mb-4 font-bold underline text-blue-500 pb-4"},"Hugging face Leaderboard",-1)),u_t={key:0,role:"status",class:"text-center w-full display: flex;align-items: center;"},p_t=ue(()=>u("svg",{"aria-hidden":"true",class:"text-center w-full display: flex;align-items: center; h-20 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("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"}),u("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)),__t=ue(()=>u("p",{class:"heartbeat-text"},"Loading models Zoo",-1)),h_t=[p_t,__t],f_t={key:1,class:"mb-2"},m_t={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},g_t=ue(()=>u("i",{"data-feather":"chevron-up"},null,-1)),b_t=[g_t],E_t=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),v_t=[E_t],y_t={class:"mb-2"},S_t={class:"p-2"},T_t={class:"mb-3"},x_t=ue(()=>u("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),C_t={key:0},R_t={class:"mb-3"},A_t=ue(()=>u("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),w_t={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},N_t=ue(()=>u("div",{role:"status",class:"justify-center"},null,-1)),O_t={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},I_t={class:"w-full p-2"},M_t={class:"flex justify-between mb-1"},D_t=zu(' Downloading Loading...',1),k_t={class:"text-sm font-medium text-blue-700 dark:text-white"},L_t=["title"],P_t={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},U_t={class:"flex justify-between mb-1"},F_t={class:"text-base font-medium text-blue-700 dark:text-white"},B_t={class:"text-sm font-medium text-blue-700 dark:text-white"},G_t={class:"flex flex-grow"},z_t={class:"flex flex-row flex-grow gap-3"},V_t={class:"p-2 text-center grow"},H_t={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},q_t={class:"flex flex-row p-3 items-center"},Y_t=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),$_t=[Y_t],W_t=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),K_t=[W_t],j_t=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),Q_t={key:0,class:"mr-2"},X_t={class:"mr-2 font-bold font-large text-lg line-clamp-1"},Z_t={key:1,class:"mr-2"},J_t={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},eht={key:0,class:"flex -space-x-4 items-center"},tht={class:"group items-center flex flex-row"},nht=["onClick"],iht=["src","title"],sht=["onClick"],rht=ue(()=>u("span",{class:"hidden group-hover:block top-0 left-7 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[u("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[u("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)),oht=[rht],aht=ue(()=>u("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[u("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)),lht=[aht],cht={class:"mx-2 mb-4"},dht=ue(()=>u("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),uht={class:"relative"},pht={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},_ht={key:0},hht=ue(()=>u("div",{role:"status"},[u("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1)),fht=[hht],mht={key:1},ght=ue(()=>u("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[u("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)),bht=[ght],Eht={key:0,class:"mx-2 mb-4"},vht={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},yht=["selected"],Sht={key:0,class:"mb-2"},Tht={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},xht=ue(()=>u("i",{"data-feather":"chevron-up"},null,-1)),Cht=[xht],Rht=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Aht=[Rht],wht={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Nht={class:"flex flex-row p-3 items-center"},Oht=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),Iht=[Oht],Mht=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Dht=[Mht],kht=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Extensions zoo",-1)),Lht={key:0,class:"mr-2"},Pht={key:1,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},Uht={key:0,class:"flex -space-x-4 items-center"},Fht={class:"group items-center flex flex-row"},Bht=["src","title"],Ght=["onClick"],zht=ue(()=>u("span",{class:"hidden group-hover:block top-0 left-7 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[u("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[u("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)),Vht=[zht],Hht={class:"mx-2 mb-4"},qht=ue(()=>u("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),Yht={class:"relative"},$ht={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},Wht={key:0},Kht=ue(()=>u("div",{role:"status"},[u("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1)),jht=[Kht],Qht={key:1},Xht=ue(()=>u("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[u("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)),Zht=[Xht],Jht={key:0,class:"mx-2 mb-4"},eft={for:"extCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},tft=["selected"],nft={key:0,class:"mb-2"},ift={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},sft=ue(()=>u("i",{"data-feather":"chevron-up"},null,-1)),rft=[sft],oft=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),aft=[oft],lft={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},cft={class:"flex flex-row p-3 items-center"},dft=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),uft=[dft],pft=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),_ft=[pft],hft=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Mounted Extensions Priority",-1)),fft={class:"flex flex-col mb-2 p-3 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},mft={class:"flex flex-row"},gft=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),bft=[gft],Eft=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),vft=[Eft],yft=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1)),Sft={class:"m-2"},Tft={class:"flex flex-row gap-2 items-center"},xft=ue(()=>u("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1)),Cft={class:"m-2"},Rft=ue(()=>u("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),Aft={class:"m-2"},wft={class:"flex flex-col align-bottom"},Nft={class:"relative"},Oft=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),Ift={class:"absolute right-0"},Mft={class:"m-2"},Dft={class:"flex flex-col align-bottom"},kft={class:"relative"},Lft=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),Pft={class:"absolute right-0"},Uft={class:"m-2"},Fft={class:"flex flex-col align-bottom"},Bft={class:"relative"},Gft=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),zft={class:"absolute right-0"},Vft={class:"m-2"},Hft={class:"flex flex-col align-bottom"},qft={class:"relative"},Yft=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),$ft={class:"absolute right-0"},Wft={class:"m-2"},Kft={class:"flex flex-col align-bottom"},jft={class:"relative"},Qft=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),Xft={class:"absolute right-0"},Zft={class:"m-2"},Jft={class:"flex flex-col align-bottom"},emt={class:"relative"},tmt=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),nmt={class:"absolute right-0"};function imt(n,e,t,i,s,r){const o=ft("Card"),a=ft("BindingEntry"),l=ft("RadioOptions"),d=ft("model-entry"),c=ft("personality-entry"),_=ft("ExtensionEntry"),f=ft("AddModelDialog"),m=ft("ChoiceDialog");return w(),M($e,null,[u("div",Rot,[u("div",Aot,[s.showConfirmation?(w(),M("div",wot,[u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=Te(h=>s.showConfirmation=!1,["stop"]))},Oot),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=Te(h=>r.save_configuration(),["stop"]))},Mot)])):q("",!0),s.showConfirmation?q("",!0):(w(),M("div",Dot,[u("button",{title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=h=>s.showConfirmation=!0)},Lot),u("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[3]||(e[3]=h=>r.reset_configuration())},Uot),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Collapse / Expand all panels",type:"button",onClick:e[4]||(e[4]=Te(h=>s.all_collapsed=!s.all_collapsed,["stop"]))},Bot)])),u("div",Got,[u("button",{title:"Clear uploads",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[5]||(e[5]=h=>r.api_get_req("clear_uploads").then(E=>{E.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},Vot),u("button",{title:"Restart program",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[6]||(e[6]=h=>r.api_get_req("restart_program").then(E=>{E.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},qot),u("button",{title:"Upgrade program ",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[7]||(e[7]=h=>r.api_get_req("update_software").then(E=>{E.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast("Success!",4,!0)}))},[Yot,s.has_updates?(w(),M("div",$ot,Kot)):q("",!0)]),u("div",jot,[s.settingsChanged?(w(),M("div",Qot,[Xot,s.isLoading?q("",!0):(w(),M("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[8]||(e[8]=Te(h=>r.applyConfiguration(),["stop"]))},Jot))])):q("",!0),s.isLoading?(w(),M("div",eat,[u("p",null,ge(s.loading_text),1),tat,nat])):q("",!0)])])]),u("div",{class:Ye(s.isLoading?"pointer-events-none opacity-30 w-full":"w-full")},[u("div",iat,[u("div",sat,[u("button",{onClick:e[9]||(e[9]=Te(h=>s.sc_collapsed=!s.sc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[le(u("div",null,oat,512),[[Mt,s.sc_collapsed]]),le(u("div",null,lat,512),[[Mt,!s.sc_collapsed]]),cat,dat,u("div",uat,[u("div",pat,[u("div",null,[r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(w(),M("div",_at,[(w(!0),M($e,null,dt(r.vramUsage.gpus,h=>(w(),M("div",hat,[u("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,fat),u("h3",mat,[u("div",null,ge(r.computedFileSize(h.used_vram))+" / "+ge(r.computedFileSize(h.total_vram))+" ("+ge(h.percentage)+"%) ",1)])]))),256))])):q("",!0),r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(w(),M("div",gat,[u("div",bat,[u("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,Eat),u("h3",vat,[u("div",null,ge(r.vramUsage.gpus.length)+"x ",1)])])])):q("",!0)]),yat,u("h3",Sat,[u("div",null,ge(r.ram_usage)+" / "+ge(r.ram_total_space)+" ("+ge(r.ram_percent_usage)+"%)",1)]),Tat,u("h3",xat,[u("div",null,ge(r.disk_binding_models_usage)+" / "+ge(r.disk_total_space)+" ("+ge(r.disk_percent_usage)+"%)",1)])])])])]),u("div",{class:Ye([{hidden:s.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",Cat,[Rat,u("div",Aat,[u("div",null,[wat,Ze(ge(r.ram_available_space),1)]),u("div",null,[Nat,Ze(" "+ge(r.ram_usage)+" / "+ge(r.ram_total_space)+" ("+ge(r.ram_percent_usage)+")% ",1)])]),u("div",Oat,[u("div",Iat,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Jt("width: "+r.ram_percent_usage+"%;")},null,4)])])]),u("div",Mat,[Dat,u("div",kat,[u("div",null,[Lat,Ze(ge(r.disk_available_space),1)]),u("div",null,[Pat,Ze(" "+ge(r.disk_binding_models_usage)+" / "+ge(r.disk_total_space)+" ("+ge(r.disk_percent_usage)+"%)",1)])]),u("div",Uat,[u("div",Fat,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Jt("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(w(!0),M($e,null,dt(r.vramUsage.gpus,h=>(w(),M("div",{class:"mb-2",key:h},[u("label",Bat,[u("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,Gat),Ze(" GPU usage: ")]),u("div",zat,[u("div",null,[Vat,Ze(ge(h.gpu_model),1)]),u("div",null,[Hat,Ze(ge(this.computedFileSize(h.available_space)),1)]),u("div",null,[qat,Ze(" "+ge(this.computedFileSize(h.used_vram))+" / "+ge(this.computedFileSize(h.total_vram))+" ("+ge(h.percentage)+"%)",1)])]),u("div",Yat,[u("div",$at,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Jt("width: "+h.percentage+"%;")},null,4)])])]))),128))],2)]),u("div",Wat,[u("div",Kat,[u("button",{onClick:e[10]||(e[10]=Te(h=>s.minconf_collapsed=!s.minconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[le(u("div",null,Qat,512),[[Mt,s.minconf_collapsed]]),le(u("div",null,Zat,512),[[Mt,!s.minconf_collapsed]]),Jat])]),u("div",{class:Ye([{hidden:s.minconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",elt,[Ie(o,{title:"General",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",tlt,[u("tr",null,[nlt,u("td",ilt,[u("div",slt,[le(u("select",{id:"hardware_mode",required:"","onUpdate:modelValue":e[11]||(e[11]=h=>r.configFile.hardware_mode=h),onChange:e[12]||(e[12]=h=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},_lt,544),[[zn,r.configFile.hardware_mode]])])])]),u("tr",null,[hlt,u("td",flt,[le(u("input",{type:"text",id:"discussion_db_name",required:"","onUpdate:modelValue":e[13]||(e[13]=h=>r.configFile.discussion_db_name=h),onChange:e[14]||(e[14]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Pe,r.configFile.discussion_db_name]])])]),u("tr",null,[mlt,u("td",null,[u("div",glt,[le(u("input",{type:"checkbox",id:"copy_to_clipboard_add_all_details",required:"","onUpdate:modelValue":e[15]||(e[15]=h=>r.configFile.copy_to_clipboard_add_all_details=h),onChange:e[16]||(e[16]=h=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.copy_to_clipboard_add_all_details]])])])]),u("tr",null,[blt,u("td",null,[u("div",Elt,[le(u("input",{type:"checkbox",id:"auto_show_browser",required:"","onUpdate:modelValue":e[17]||(e[17]=h=>r.configFile.auto_show_browser=h),onChange:e[18]||(e[18]=h=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.auto_show_browser]])])])]),u("tr",null,[vlt,u("td",null,[u("div",ylt,[le(u("input",{type:"checkbox",id:"activate_debug",required:"","onUpdate:modelValue":e[19]||(e[19]=h=>r.configFile.debug=h),onChange:e[20]||(e[20]=h=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.debug]])])])]),u("tr",null,[Slt,u("td",null,[u("div",Tlt,[le(u("input",{type:"text",id:"debug_log_file_path",required:"","onUpdate:modelValue":e[21]||(e[21]=h=>r.configFile.debug_log_file_path=h),onChange:e[22]||(e[22]=h=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.debug_log_file_path]])])])]),u("tr",null,[xlt,u("td",null,[u("div",Clt,[le(u("input",{type:"checkbox",id:"show_news_panel",required:"","onUpdate:modelValue":e[23]||(e[23]=h=>r.configFile.show_news_panel=h),onChange:e[24]||(e[24]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.show_news_panel]])])])]),u("tr",null,[Rlt,u("td",null,[u("div",Alt,[le(u("input",{type:"checkbox",id:"auto_save",required:"","onUpdate:modelValue":e[25]||(e[25]=h=>r.configFile.auto_save=h),onChange:e[26]||(e[26]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.auto_save]])])])]),u("tr",null,[wlt,u("td",null,[u("div",Nlt,[le(u("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[27]||(e[27]=h=>r.configFile.auto_update=h),onChange:e[28]||(e[28]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.auto_update]])])])]),u("tr",null,[Olt,u("td",null,[u("div",Ilt,[le(u("input",{type:"checkbox",id:"auto_title",required:"","onUpdate:modelValue":e[29]||(e[29]=h=>r.configFile.auto_title=h),onChange:e[30]||(e[30]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.auto_title]])])])])])]),_:1}),Ie(o,{title:"User",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Mlt,[u("tr",null,[Dlt,u("td",klt,[le(u("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[31]||(e[31]=h=>r.configFile.user_name=h),onChange:e[32]||(e[32]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.user_name]])])]),u("tr",null,[Llt,u("td",Plt,[le(u("textarea",{id:"user_description",required:"","onUpdate:modelValue":e[33]||(e[33]=h=>r.configFile.user_description=h),onChange:e[34]||(e[34]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.user_description]])])]),u("tr",null,[Ult,u("td",Flt,[le(u("input",{type:"checkbox",id:"use_user_informations_in_discussion",required:"","onUpdate:modelValue":e[35]||(e[35]=h=>r.configFile.use_user_informations_in_discussion=h),onChange:e[36]||(e[36]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.use_user_informations_in_discussion]])])]),u("tr",null,[Blt,u("td",Glt,[u("label",zlt,[u("img",{src:"/user_infos/"+r.configFile.user_avatar,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,Vlt)]),u("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[37]||(e[37]=(...h)=>r.uploadAvatar&&r.uploadAvatar(...h))},null,32)])]),u("tr",null,[Hlt,u("td",null,[u("div",qlt,[le(u("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[38]||(e[38]=h=>r.configFile.use_user_name_in_discussions=h),onChange:e[39]||(e[39]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.use_user_name_in_discussions]])])])]),u("tr",null,[Ylt,u("td",$lt,[le(u("input",{type:"number",id:"max_n_predict",required:"","onUpdate:modelValue":e[40]||(e[40]=h=>r.configFile.min_n_predict=h),onChange:e[41]||(e[41]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.min_n_predict]])])]),u("tr",null,[Wlt,u("td",Klt,[le(u("input",{type:"number",id:"min_n_predict",required:"","onUpdate:modelValue":e[42]||(e[42]=h=>r.configFile.min_n_predict=h),onChange:e[43]||(e[43]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.min_n_predict]])])])])]),_:1}),Ie(o,{title:"Code execution",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",jlt,[u("tr",null,[Qlt,u("td",Xlt,[le(u("input",{type:"checkbox",id:"turn_on_code_execution",required:"","onUpdate:modelValue":e[44]||(e[44]=h=>r.configFile.turn_on_code_execution=h),onChange:e[45]||(e[45]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.turn_on_code_execution]])])]),u("tr",null,[Zlt,u("td",Jlt,[le(u("input",{type:"checkbox",id:"turn_on_code_validation",required:"","onUpdate:modelValue":e[46]||(e[46]=h=>r.configFile.turn_on_code_validation=h),onChange:e[47]||(e[47]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.turn_on_code_validation]])])])])]),_:1}),Ie(o,{title:"Knowledge database",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",ect,[u("tr",null,[tct,u("td",null,[u("div",nct,[le(u("input",{type:"checkbox",id:"activate_skills_lib",required:"","onUpdate:modelValue":e[48]||(e[48]=h=>r.configFile.activate_skills_lib=h),onChange:e[49]||(e[49]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.activate_skills_lib]])])])]),u("tr",null,[ict,u("td",sct,[le(u("input",{type:"text",id:"skills_lib_database_name",required:"","onUpdate:modelValue":e[50]||(e[50]=h=>r.configFile.skills_lib_database_name=h),onChange:e[51]||(e[51]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Pe,r.configFile.skills_lib_database_name]])])])])]),_:1}),Ie(o,{title:"Data Vectorization",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",rct,[u("tr",null,[oct,u("td",null,[u("div",act,[le(u("input",{type:"checkbox",id:"use_files",required:"","onUpdate:modelValue":e[52]||(e[52]=h=>r.configFile.use_files=h),onChange:e[53]||(e[53]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.use_files]])])])]),u("tr",null,[lct,u("td",null,[u("div",cct,[le(u("input",{type:"checkbox",id:"activate_ltm",required:"","onUpdate:modelValue":e[54]||(e[54]=h=>r.configFile.activate_ltm=h),onChange:e[55]||(e[55]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.activate_ltm]])])])]),u("tr",null,[dct,u("td",null,[u("div",uct,[le(u("input",{type:"checkbox",id:"summerize_discussion",required:"","onUpdate:modelValue":e[56]||(e[56]=h=>r.configFile.summerize_discussion=h),onChange:e[57]||(e[57]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.summerize_discussion]])])])]),u("tr",null,[pct,u("td",null,[u("div",_ct,[le(u("input",{type:"checkbox",id:"data_vectorization_visualize_on_vectorization",required:"","onUpdate:modelValue":e[58]||(e[58]=h=>r.configFile.data_vectorization_visualize_on_vectorization=h),onChange:e[59]||(e[59]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.data_vectorization_visualize_on_vectorization]])])])]),u("tr",null,[hct,u("td",null,[u("div",fct,[le(u("input",{type:"checkbox",id:"data_vectorization_activate",required:"","onUpdate:modelValue":e[60]||(e[60]=h=>r.configFile.data_vectorization_activate=h),onChange:e[61]||(e[61]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.data_vectorization_activate]])])])]),u("tr",null,[mct,u("td",null,[u("div",gct,[le(u("input",{type:"checkbox",id:"data_vectorization_build_keys_words",required:"","onUpdate:modelValue":e[62]||(e[62]=h=>r.configFile.data_vectorization_build_keys_words=h),onChange:e[63]||(e[63]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.data_vectorization_build_keys_words]])])])]),u("tr",null,[bct,u("td",null,[le(u("select",{id:"data_vectorization_method",required:"","onUpdate:modelValue":e[64]||(e[64]=h=>r.configFile.data_vectorization_method=h),onChange:e[65]||(e[65]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},yct,544),[[zn,r.configFile.data_vectorization_method]])])]),u("tr",null,[Sct,u("td",null,[le(u("select",{id:"data_visualization_method",required:"","onUpdate:modelValue":e[66]||(e[66]=h=>r.configFile.data_visualization_method=h),onChange:e[67]||(e[67]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Cct,544),[[zn,r.configFile.data_visualization_method]])])]),u("tr",null,[Rct,u("td",null,[u("div",Act,[le(u("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[68]||(e[68]=h=>r.configFile.data_vectorization_save_db=h),onChange:e[69]||(e[69]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.data_vectorization_save_db]])])])]),u("tr",null,[wct,u("td",null,[le(u("input",{id:"data_vectorization_chunk_size","onUpdate:modelValue":e[70]||(e[70]=h=>r.configFile.data_vectorization_chunk_size=h),onChange:e[71]||(e[71]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.data_vectorization_chunk_size]]),le(u("input",{"onUpdate:modelValue":e[72]||(e[72]=h=>r.configFile.data_vectorization_chunk_size=h),type:"number",onChange:e[73]||(e[73]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.data_vectorization_chunk_size]])])]),u("tr",null,[Nct,u("td",null,[le(u("input",{id:"data_vectorization_overlap_size","onUpdate:modelValue":e[74]||(e[74]=h=>r.configFile.data_vectorization_overlap_size=h),onChange:e[75]||(e[75]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.data_vectorization_overlap_size]]),le(u("input",{"onUpdate:modelValue":e[76]||(e[76]=h=>r.configFile.data_vectorization_overlap_size=h),type:"number",onChange:e[77]||(e[77]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.data_vectorization_overlap_size]])])]),u("tr",null,[Oct,u("td",null,[le(u("input",{id:"data_vectorization_nb_chunks","onUpdate:modelValue":e[78]||(e[78]=h=>r.configFile.data_vectorization_nb_chunks=h),onChange:e[79]||(e[79]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"1000",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.data_vectorization_nb_chunks]]),le(u("input",{"onUpdate:modelValue":e[80]||(e[80]=h=>r.configFile.data_vectorization_nb_chunks=h),type:"number",onChange:e[81]||(e[81]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.data_vectorization_nb_chunks]])])])])]),_:1}),Ie(o,{title:"Internet search",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Ict,[u("tr",null,[Mct,u("td",null,[u("div",Dct,[le(u("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[82]||(e[82]=h=>r.configFile.activate_internet_search=h),onChange:e[83]||(e[83]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.activate_internet_search]])])])]),u("tr",null,[kct,u("td",null,[u("div",Lct,[le(u("input",{type:"checkbox",id:"internet_quick_search",required:"","onUpdate:modelValue":e[84]||(e[84]=h=>r.configFile.internet_quick_search=h),onChange:e[85]||(e[85]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.internet_quick_search]])])])]),u("tr",null,[Pct,u("td",null,[u("div",Uct,[le(u("input",{type:"checkbox",id:"internet_activate_search_decision",required:"","onUpdate:modelValue":e[86]||(e[86]=h=>r.configFile.internet_activate_search_decision=h),onChange:e[87]||(e[87]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.internet_activate_search_decision]])])])]),u("tr",null,[Fct,u("td",null,[u("div",Bct,[le(u("input",{id:"internet_vectorization_chunk_size","onUpdate:modelValue":e[88]||(e[88]=h=>r.configFile.internet_vectorization_chunk_size=h),onChange:e[89]||(e[89]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.internet_vectorization_chunk_size]]),le(u("input",{"onUpdate:modelValue":e[90]||(e[90]=h=>r.configFile.internet_vectorization_chunk_size=h),type:"number",onChange:e[91]||(e[91]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.internet_vectorization_chunk_size]])])])]),u("tr",null,[Gct,u("td",null,[u("div",zct,[le(u("input",{id:"internet_vectorization_overlap_size","onUpdate:modelValue":e[92]||(e[92]=h=>r.configFile.internet_vectorization_overlap_size=h),onChange:e[93]||(e[93]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"1000",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.internet_vectorization_overlap_size]]),le(u("input",{"onUpdate:modelValue":e[94]||(e[94]=h=>r.configFile.internet_vectorization_overlap_size=h),type:"number",onChange:e[95]||(e[95]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.internet_vectorization_overlap_size]])])])]),u("tr",null,[Vct,u("td",null,[u("div",Hct,[le(u("input",{id:"internet_vectorization_nb_chunks","onUpdate:modelValue":e[96]||(e[96]=h=>r.configFile.internet_vectorization_nb_chunks=h),onChange:e[97]||(e[97]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.internet_vectorization_nb_chunks]]),le(u("input",{"onUpdate:modelValue":e[98]||(e[98]=h=>r.configFile.internet_vectorization_nb_chunks=h),type:"number",onChange:e[99]||(e[99]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.internet_vectorization_nb_chunks]])])])]),u("tr",null,[qct,u("td",null,[u("div",Yct,[le(u("input",{id:"internet_nb_search_pages","onUpdate:modelValue":e[100]||(e[100]=h=>r.configFile.internet_nb_search_pages=h),onChange:e[101]||(e[101]=h=>s.settingsChanged=!0),type:"range",min:"1",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.internet_nb_search_pages]]),le(u("input",{"onUpdate:modelValue":e[102]||(e[102]=h=>r.configFile.internet_nb_search_pages=h),type:"number",onChange:e[103]||(e[103]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.internet_nb_search_pages]])])])])])]),_:1}),Ie(o,{title:"Latex",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",$ct,[u("tr",null,[Wct,u("td",null,[u("div",Kct,[le(u("input",{type:"text",id:"pdf_latex_path",required:"","onUpdate:modelValue":e[104]||(e[104]=h=>r.configFile.pdf_latex_path=h),onChange:e[105]||(e[105]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.pdf_latex_path]])])])])])]),_:1}),Ie(o,{title:"Boost",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",jct,[u("tr",null,[Qct,u("td",null,[u("div",Xct,[le(u("input",{type:"text",id:"positive_boost",required:"","onUpdate:modelValue":e[106]||(e[106]=h=>r.configFile.positive_boost=h),onChange:e[107]||(e[107]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.positive_boost]])])])]),u("tr",null,[Zct,u("td",null,[u("div",Jct,[le(u("input",{type:"text",id:"negative_boost",required:"","onUpdate:modelValue":e[108]||(e[108]=h=>r.configFile.negative_boost=h),onChange:e[109]||(e[109]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.negative_boost]])])])]),u("tr",null,[edt,u("td",null,[u("div",tdt,[le(u("input",{type:"text",id:"force_output_language_to_be",required:"","onUpdate:modelValue":e[110]||(e[110]=h=>r.configFile.force_output_language_to_be=h),onChange:e[111]||(e[111]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.force_output_language_to_be]])])])]),u("tr",null,[ndt,u("td",null,[u("div",idt,[le(u("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[112]||(e[112]=h=>r.configFile.fun_mode=h),onChange:e[113]||(e[113]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.fun_mode]])])])])])]),_:1}),Ie(o,{title:"Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",sdt,[u("tr",null,[rdt,u("td",null,[u("div",odt,[le(u("select",{id:"whisper_model","onUpdate:modelValue":e[114]||(e[114]=h=>r.configFile.whisper_model=h),onChange:e[115]||(e[115]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),M($e,null,dt(r.whisperModels,h=>(w(),M("option",{key:h,value:h},ge(h),9,adt))),128))],544),[[zn,r.configFile.whisper_model]])])])])])]),_:1}),Ie(o,{title:"Browser Audio",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",ldt,[u("tr",null,[cdt,u("td",null,[u("div",ddt,[le(u("input",{type:"checkbox",id:"activate_audio_infos",required:"","onUpdate:modelValue":e[116]||(e[116]=h=>r.configFile.activate_audio_infos=h),onChange:e[117]||(e[117]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.activate_audio_infos]])])])]),u("tr",null,[udt,u("td",null,[u("div",pdt,[le(u("input",{type:"checkbox",id:"audio_auto_send_input",required:"","onUpdate:modelValue":e[118]||(e[118]=h=>r.configFile.audio_auto_send_input=h),onChange:e[119]||(e[119]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.audio_auto_send_input]])])])]),u("tr",null,[_dt,u("td",null,[u("div",hdt,[le(u("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[120]||(e[120]=h=>r.configFile.auto_speak=h),onChange:e[121]||(e[121]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.auto_speak]])])])]),u("tr",null,[fdt,u("td",null,[le(u("input",{id:"audio_pitch","onUpdate:modelValue":e[122]||(e[122]=h=>r.configFile.audio_pitch=h),onChange:e[123]||(e[123]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"10",step:"0.1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.audio_pitch]]),le(u("input",{"onUpdate:modelValue":e[124]||(e[124]=h=>r.configFile.audio_pitch=h),onChange:e[125]||(e[125]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.audio_pitch]])])]),u("tr",null,[mdt,u("td",null,[le(u("input",{id:"audio_silenceTimer","onUpdate:modelValue":e[126]||(e[126]=h=>r.configFile.audio_silenceTimer=h),onChange:e[127]||(e[127]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"10000",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.audio_silenceTimer]]),le(u("input",{"onUpdate:modelValue":e[128]||(e[128]=h=>r.configFile.audio_silenceTimer=h),onChange:e[129]||(e[129]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.audio_silenceTimer]])])]),u("tr",null,[gdt,u("td",null,[le(u("select",{id:"audio_in_language","onUpdate:modelValue":e[130]||(e[130]=h=>r.configFile.audio_in_language=h),onChange:e[131]||(e[131]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),M($e,null,dt(r.audioLanguages,h=>(w(),M("option",{key:h.code,value:h.code},ge(h.name),9,bdt))),128))],544),[[zn,r.configFile.audio_in_language]])])]),u("tr",null,[Edt,u("td",null,[le(u("select",{id:"audio_out_voice","onUpdate:modelValue":e[132]||(e[132]=h=>r.configFile.audio_out_voice=h),onChange:e[133]||(e[133]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),M($e,null,dt(s.audioVoices,h=>(w(),M("option",{key:h.name,value:h.name},ge(h.name),9,vdt))),128))],544),[[zn,r.configFile.audio_out_voice]])])])])]),_:1})])],2)]),u("div",ydt,[u("div",Sdt,[u("button",{onClick:e[134]||(e[134]=Te(h=>s.servers_conf_collapsed=!s.servers_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[le(u("div",null,xdt,512),[[Mt,s.servers_conf_collapsed]]),le(u("div",null,Rdt,512),[[Mt,!s.servers_conf_collapsed]]),Adt])]),u("div",{class:Ye([{hidden:s.servers_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[Ie(o,{title:"Lollms service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",wdt,[u("tr",null,[Ndt,u("td",Odt,[le(u("input",{type:"text",id:"host",required:"","onUpdate:modelValue":e[135]||(e[135]=h=>r.configFile.host=h),onChange:e[136]||(e[136]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Pe,r.configFile.host]])])]),u("tr",null,[Idt,u("td",Mdt,[le(u("input",{type:"number",step:"1",id:"port",required:"","onUpdate:modelValue":e[137]||(e[137]=h=>r.configFile.port=h),onChange:e[138]||(e[138]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Pe,r.configFile.port]])])]),u("tr",null,[Ddt,u("td",kdt,[le(u("input",{type:"checkbox",id:"headless_server_mode",required:"","onUpdate:modelValue":e[139]||(e[139]=h=>r.configFile.headless_server_mode=h),onChange:e[140]||(e[140]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[_t,r.configFile.headless_server_mode]])])])])]),_:1}),Ie(o,{title:"Stable diffusion service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Ldt,[u("tr",null,[Pdt,u("td",null,[u("div",Udt,[le(u("input",{type:"checkbox",id:"enable_sd_service",required:"","onUpdate:modelValue":e[141]||(e[141]=h=>r.configFile.enable_sd_service=h),onChange:e[142]||(e[142]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_sd_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[143]||(e[143]=h=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},Bdt)])]),u("tr",null,[Gdt,u("td",null,[u("div",zdt,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[144]||(e[144]=(...h)=>r.reinstallSDService&&r.reinstallSDService(...h))},"install sd service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[145]||(e[145]=(...h)=>r.startSDService&&r.startSDService(...h))},"start sd service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[146]||(e[146]=(...h)=>r.showSD&&r.showSD(...h))},"show sd ui")])])]),u("tr",null,[Vdt,u("td",null,[u("div",Hdt,[le(u("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[147]||(e[147]=h=>r.configFile.sd_base_url=h),onChange:e[148]||(e[148]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.sd_base_url]])])])])])]),_:1}),Ie(o,{title:"ComfyUI service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",qdt,[u("tr",null,[Ydt,u("td",null,[u("div",$dt,[le(u("input",{type:"checkbox",id:"enable_comfyui_service",required:"","onUpdate:modelValue":e[149]||(e[149]=h=>r.configFile.enable_comfyui_service=h),onChange:e[150]||(e[150]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_comfyui_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[151]||(e[151]=h=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},Kdt)])]),u("tr",null,[jdt,u("td",null,[u("div",Qdt,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[152]||(e[152]=(...h)=>r.reinstallComfyUIService&&r.reinstallComfyUIService(...h))},"install comfyui service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[153]||(e[153]=(...h)=>r.startComfyUIService&&r.startComfyUIService(...h))},"start comfyui service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[154]||(e[154]=(...h)=>r.showComfyui&&r.showComfyui(...h))},"show comfyui")])])]),u("tr",null,[Xdt,u("td",null,[u("div",Zdt,[le(u("input",{type:"text",id:"comfyui_base_url",required:"","onUpdate:modelValue":e[155]||(e[155]=h=>r.configFile.comfyui_base_url=h),onChange:e[156]||(e[156]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.comfyui_base_url]])])])])])]),_:1}),Ie(o,{title:"Motion Ctrl service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Jdt,[u("tr",null,[eut,u("td",null,[u("div",tut,[le(u("input",{type:"checkbox",id:"enable_motion_ctrl_service",required:"","onUpdate:modelValue":e[157]||(e[157]=h=>r.configFile.enable_motion_ctrl_service=h),onChange:e[158]||(e[158]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_motion_ctrl_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[159]||(e[159]=h=>this.$store.state.messageBox.showMessage("Activates Motion ctrl service. The service will be automatically loaded at startup alowing you to use the motoin control endpoint to generate videos"))},iut)])]),u("tr",null,[sut,u("td",null,[u("div",rut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[160]||(e[160]=(...h)=>r.reinstallMotionCtrlService&&r.reinstallMotionCtrlService(...h))},"install Motion Ctrl service")])])]),u("tr",null,[out,u("td",null,[u("div",aut,[le(u("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[161]||(e[161]=h=>r.configFile.sd_base_url=h),onChange:e[162]||(e[162]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.sd_base_url]])])])])])]),_:1}),Ie(o,{title:"Ollama service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",lut,[u("tr",null,[cut,u("td",null,[u("div",dut,[le(u("input",{type:"checkbox",id:"enable_ollama_service",required:"","onUpdate:modelValue":e[163]||(e[163]=h=>r.configFile.enable_ollama_service=h),onChange:e[164]||(e[164]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_ollama_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[165]||(e[165]=h=>this.$store.state.messageBox.showMessage(`Activates ollama service. The service will be automatically loaded at startup alowing you to use the ollama binding. +You need to apply changes before you leave, or else.`,"Apply configuration","Cancel")&&this.applyConfiguration(),!1}},ue=n=>(Nr("data-v-26efbf12"),n=n(),Or(),n),Rot={class:"container overflow-y-scroll flex flex-row shadow-lg p-10 pt-0 overflow-y-scroll w-full 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"},Aot={class:"sticky top-0 z-10 flex flex-row mb-2 p-3 gap-3 w-full rounded-b-lg bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},wot={key:0,class:"flex gap-3 flex-1 items-center duration-75"},Not=ue(()=>u("i",{"data-feather":"x"},null,-1)),Oot=[Not],Iot=ue(()=>u("i",{"data-feather":"check"},null,-1)),Mot=[Iot],Dot={key:1,class:"flex gap-3 flex-1 items-center"},kot=ue(()=>u("i",{"data-feather":"save"},null,-1)),Lot=[kot],Pot=ue(()=>u("i",{"data-feather":"refresh-ccw"},null,-1)),Uot=[Pot],Fot=ue(()=>u("i",{"data-feather":"list"},null,-1)),Bot=[Fot],Got={class:"flex gap-3 flex-1 items-center justify-end"},zot=ue(()=>u("i",{"data-feather":"trash-2"},null,-1)),Vot=[zot],Hot=ue(()=>u("i",{"data-feather":"refresh-ccw"},null,-1)),qot=[Hot],Yot=ue(()=>u("i",{"data-feather":"arrow-up-circle"},null,-1)),$ot={key:0},Wot=ue(()=>u("i",{"data-feather":"alert-circle"},null,-1)),Kot=[Wot],jot={class:"flex gap-3 items-center"},Qot={key:0,class:"flex gap-3 items-center"},Xot=ue(()=>u("p",{class:"text-red-600 font-bold"},"Apply changes:",-1)),Zot=ue(()=>u("i",{"data-feather":"check"},null,-1)),Jot=[Zot],eat={key:1,role:"status"},tat=ue(()=>u("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"},[u("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"}),u("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)),nat=ue(()=>u("span",{class:"sr-only"},"Loading...",-1)),iat={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},sat={class:"flex flex-row p-3"},rat=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),oat=[rat],aat=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),lat=[aat],cat=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),dat=ue(()=>u("div",{class:"mr-2"},"|",-1)),uat={class:"text-base font-semibold cursor-pointer select-none items-center"},pat={class:"flex gap-2 items-center"},_at={key:0},hat={class:"flex gap-2 items-center"},fat=["src"],mat={class:"font-bold font-large text-lg"},gat={key:1},bat={class:"flex gap-2 items-center"},Eat=["src"],vat={class:"font-bold font-large text-lg"},yat=ue(()=>u("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),Sat={class:"font-bold font-large text-lg"},Tat=ue(()=>u("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),xat={class:"font-bold font-large text-lg"},Cat={class:"mb-2"},Rat=ue(()=>u("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[u("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[u("path",{fill:"currentColor",d:"M17 17H7V7h10m4 4V9h-2V7a2 2 0 0 0-2-2h-2V3h-2v2h-2V3H9v2H7c-1.11 0-2 .89-2 2v2H3v2h2v2H3v2h2v2a2 2 0 0 0 2 2h2v2h2v-2h2v2h2v-2h2a2 2 0 0 0 2-2v-2h2v-2h-2v-2m-6 2h-2v-2h2m2-2H9v6h6V9Z"})]),Ze(" CPU Ram usage: ")],-1)),Aat={class:"flex flex-col mx-2"},wat=ue(()=>u("b",null,"Avaliable ram: ",-1)),Nat=ue(()=>u("b",null,"Ram usage: ",-1)),Oat={class:"p-2"},Iat={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Mat={class:"mb-2"},Dat=ue(()=>u("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[u("i",{"data-feather":"hard-drive",class:"w-5 h-5"}),Ze(" Disk usage: ")],-1)),kat={class:"flex flex-col mx-2"},Lat=ue(()=>u("b",null,"Avaliable disk space: ",-1)),Pat=ue(()=>u("b",null,"Disk usage: ",-1)),Uat={class:"p-2"},Fat={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Bat={class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Gat=["src"],zat={class:"flex flex-col mx-2"},Vat=ue(()=>u("b",null,"Model: ",-1)),Hat=ue(()=>u("b",null,"Avaliable vram: ",-1)),qat=ue(()=>u("b",null,"GPU usage: ",-1)),Yat={class:"p-2"},$at={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},Wat={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Kat={class:"flex flex-row p-3"},jat=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),Qat=[jat],Xat=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Zat=[Xat],Jat=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1)),elt={class:"flex flex-col mb-2 px-3 pb-2"},tlt={class:"expand-to-fit bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block 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"},nlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"hardware_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Hardware mode:")],-1)),ilt={class:"text-center items-center"},slt={class:"flex flex-row"},rlt=ue(()=>u("option",{value:"cpu"},"CPU",-1)),olt=ue(()=>u("option",{value:"cpu-noavx"},"CPU (No AVX)",-1)),alt=ue(()=>u("option",{value:"nvidia-tensorcores"},"NVIDIA (Tensor Cores)",-1)),llt=ue(()=>u("option",{value:"nvidia"},"NVIDIA",-1)),clt=ue(()=>u("option",{value:"amd-noavx"},"AMD (No AVX)",-1)),dlt=ue(()=>u("option",{value:"amd"},"AMD",-1)),ult=ue(()=>u("option",{value:"apple-intel"},"Apple Intel",-1)),plt=ue(()=>u("option",{value:"apple-silicon"},"Apple Silicon",-1)),_lt=[rlt,olt,alt,llt,clt,dlt,ult,plt],hlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),flt={style:{width:"100%"}},mlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"copy_to_clipboard_add_all_details",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Add details to messages copied to clipboard:")],-1)),glt={class:"flex flex-row"},blt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"auto_show_browser",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto show browser:")],-1)),Elt={class:"flex flex-row"},vlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"activate_debug",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate debug mode:")],-1)),ylt={class:"flex flex-row"},Slt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"debug_log_file_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Debug file path:")],-1)),Tlt={class:"flex flex-row"},xlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"show_news_panel",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Show news panel:")],-1)),Clt={class:"flex flex-row"},Rlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"auto_save",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto save:")],-1)),Alt={class:"flex flex-row"},wlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),Nlt={class:"flex flex-row"},Olt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto title:")],-1)),Ilt={class:"flex flex-row"},Mlt={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"},Dlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),klt={style:{width:"100%"}},Llt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User description:")],-1)),Plt={style:{width:"100%"}},Ult=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"use_user_informations_in_discussion",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use user description in discussion:")],-1)),Flt={style:{width:"100%"}},Blt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),Glt={style:{width:"100%"}},zlt={for:"avatar-upload"},Vlt=["src"],Hlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"use_user_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use User Name in discussions:")],-1)),qlt={class:"flex flex-row"},Ylt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"max_n_predict",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Maximum number of output tokens space (forces the model to have more space to speak):")],-1)),$lt={style:{width:"100%"}},Wlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"min_n_predict",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Minimum number of output tokens space (forces the model to have more space to speak):")],-1)),Klt={style:{width:"100%"}},jlt={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"},Qlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"turn_on_code_execution",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on code execution:")],-1)),Xlt={style:{width:"100%"}},Zlt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"turn_on_code_validation",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"turn on code validation:")],-1)),Jlt={style:{width:"100%"}},ect={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"},tct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"activate_skills_lib",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Skills library:")],-1)),nct={class:"flex flex-row"},ict=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Skills library database name:")],-1)),sct={style:{width:"100%"}},rct={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"},oct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"use_files",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate files support:")],-1)),act={class:"flex flex-row"},lct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"activate_ltm",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Long term memory:")],-1)),cct={class:"flex flex-row"},dct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"summerize_discussion",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate Continuous Learning from discussions:")],-1)),uct={class:"flex flex-row"},pct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_visualize_on_vectorization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"show vectorized data:")],-1)),_ct={class:"flex flex-row"},hct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_activate",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate data Vectorization:")],-1)),fct={class:"flex flex-row"},mct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_build_keys_words",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Build keywords when querying the vectorized database:")],-1)),gct={class:"flex flex-row"},bct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization method:")],-1)),Ect=ue(()=>u("option",{value:"tfidf_vectorizer"},"tfidf Vectorizer",-1)),vct=ue(()=>u("option",{value:"model_embedding"},"Model Embedding",-1)),yct=[Ect,vct],Sct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_visualization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data visualization method:")],-1)),Tct=ue(()=>u("option",{value:"PCA"},"PCA",-1)),xct=ue(()=>u("option",{value:"TSNE"},"TSNE",-1)),Cct=[Tct,xct],Rct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_save_db",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Save the new files to the database (The database wil always grow and continue to be the same over many sessions):")],-1)),Act={class:"flex flex-row"},wct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization chunk size(tokens):")],-1)),Nct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization overlap size(tokens):")],-1)),Oct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Number of chunks to use for each message:")],-1)),Ict={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"},Mct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"activate_internet_search",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate internet search:")],-1)),Dct={class:"flex flex-row"},kct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"internet_quick_search",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate quick search:")],-1)),Lct={class:"flex flex-row"},Pct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"internet_activate_search_decision",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate search decision:")],-1)),Uct={class:"flex flex-row"},Fct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"internet_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization chunk size:")],-1)),Bct={class:"flex flex-col"},Gct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"internet_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization overlap size:")],-1)),zct={class:"flex flex-col"},Vct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"internet_vectorization_nb_chunks",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet vectorization number of chunks:")],-1)),Hct={class:"flex flex-col"},qct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"internet_nb_search_pages",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Internet number of search pages:")],-1)),Yct={class:"flex flex-col"},$ct={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"},Wct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"pdf_latex_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"PDF LaTeX path:")],-1)),Kct={class:"flex flex-row"},jct={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"},Qct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"positive_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Positive Boost:")],-1)),Xct={class:"flex flex-row"},Zct=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"negative_boost",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Negative Boost:")],-1)),Jct={class:"flex flex-row"},edt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"force_output_language_to_be",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Force AI to answer in this language:")],-1)),tdt={class:"flex flex-row"},ndt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"fun_mode",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Fun mode:")],-1)),idt={class:"flex flex-row"},sdt={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"},rdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"whisper_model",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Whisper model:")],-1)),odt={class:"flex flex-row"},adt=["value"],ldt={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"},cdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"activate_audio_infos",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate audio infos:")],-1)),ddt={class:"flex flex-row"},udt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"audio_auto_send_input",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Send audio input automatically:")],-1)),pdt={class:"flex flex-row"},_dt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),hdt={class:"flex flex-row"},fdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),mdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"audio_silenceTimer",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio in silence timer (ms):")],-1)),gdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"audio_in_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Input Audio Language:")],-1)),bdt=["value"],Edt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"audio_out_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Output Audio Voice:")],-1)),vdt=["value"],ydt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Sdt={class:"flex flex-row p-3"},Tdt=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),xdt=[Tdt],Cdt=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Rdt=[Cdt],Adt=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Servers configurations",-1)),wdt={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"},Ndt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Host:")],-1)),Odt={style:{width:"100%"}},Idt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Port:")],-1)),Mdt={style:{width:"100%"}},Ddt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"discussion_db_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate headless server mode (deactivates all code exectuion to protect the PC from attacks):")],-1)),kdt={style:{width:"100%"}},Ldt={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"},Pdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable sd service:")],-1)),Udt={class:"flex flex-row"},Fdt=ue(()=>u("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Bdt=[Fdt],Gdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"install_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install SD service:")],-1)),zdt={class:"flex flex-row"},Vdt=ue(()=>u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",click:"https://github.com/ParisNeo/stable-diffusion-webui/blob/master/LICENSE.txt",target:"_blank"},"automatic1111's sd licence",-1)),Hdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"sd_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"sd base url:")],-1)),qdt={class:"flex flex-row"},Ydt={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"},$dt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_comfyui_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable comfyui service:")],-1)),Wdt={class:"flex flex-row"},Kdt=ue(()=>u("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),jdt=[Kdt],Qdt=ue(()=>u("td",{style:{"min-width":"200px"}},null,-1)),Xdt={class:"flex flex-row"},Zdt=ue(()=>u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",click:"https://github.com/ParisNeo/ComfyUI/blob/master/LICENSE",target:"_blank"},"comfyui licence",-1)),Jdt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"comfyui_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"comfyui base url:")],-1)),eut={class:"flex flex-row"},tut={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"},nut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable Motion Ctrl service:")],-1)),iut={class:"flex flex-row"},sut=ue(()=>u("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),rut=[sut],out=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"install_sd_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Motion Ctrl service:")],-1)),aut={class:"flex flex-row"},lut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"sd_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"sd base url:")],-1)),cut={class:"flex flex-row"},dut={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"},uut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_ollama_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable ollama service:")],-1)),put={class:"flex flex-row"},_ut=ue(()=>u("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),hut=[_ut],fut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"ollama_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Ollama service:")],-1)),mut={class:"flex flex-row"},gut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"ollama_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"ollama base url:")],-1)),but={class:"flex flex-row"},Eut={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"},vut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_vllm_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable vLLM service:")],-1)),yut={class:"flex flex-row"},Sut=ue(()=>u("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Tut=[Sut],xut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install vLLM service:")],-1)),Cut={class:"flex flex-row"},Rut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"vllm_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm base url:")],-1)),Aut={class:"flex flex-row"},wut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"vllm_gpu_memory_utilization",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"gpu memory utilization:")],-1)),Nut={class:"flex flex-col align-bottom"},Out={class:"relative"},Iut=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"vllm_gpu_memory_utilization",class:"text-sm font-medium"}," vllm gpu memory utilization: ")],-1)),Mut={class:"absolute right-0"},Dut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"vllm_max_num_seqs",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm max num seqs:")],-1)),kut={class:"flex flex-row"},Lut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"vllm_max_model_len",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"max model len:")],-1)),Put={class:"flex flex-row"},Uut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"vllm_model_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"vllm model path:")],-1)),Fut={class:"flex flex-row"},But={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"},Gut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_petals_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable petals service:")],-1)),zut={class:"flex flex-row"},Vut=ue(()=>u("i",{"data-feather":"help-circle",class:"w-5 h-5"},null,-1)),Hut=[Vut],qut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"petals_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Install Petals service:")],-1)),Yut={class:"flex flex-row"},$ut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"petals_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"petals base url:")],-1)),Wut={class:"flex flex-row"},Kut={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"},jut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_voice_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable elastic search service:")],-1)),Qut={class:"flex flex-row"},Xut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"install_elastic_search_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Reinstall Elastic Search service:")],-1)),Zut={class:"flex flex-row"},Jut=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"elastic_search_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"elastic search base url:")],-1)),ept={class:"flex flex-row"},tpt={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"},npt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"enable_voice_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable voice service:")],-1)),ipt={class:"flex flex-row"},spt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"install_xtts_service",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xTTS service:")],-1)),rpt={class:"flex flex-row"},opt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"xtts_base_url",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"xtts base url:")],-1)),apt={class:"flex flex-row"},lpt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"current_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current language:")],-1)),cpt={class:"flex flex-row"},dpt=["disabled"],upt=["value"],ppt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"current_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Current voice:")],-1)),_pt={class:"flex flex-row"},hpt=["disabled"],fpt=["value"],mpt=ue(()=>u("td",{style:{"min-width":"200px"}},[u("label",{for:"auto_read",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto read:")],-1)),gpt={class:"flex flex-row"},bpt=["disabled"],Ept={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},vpt={class:"flex flex-row p-3"},ypt=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),Spt=[ypt],Tpt=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),xpt=[Tpt],Cpt=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),Rpt={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Apt=ue(()=>u("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),wpt={key:1,class:"mr-2"},Npt={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},Opt={class:"flex gap-1 items-center"},Ipt=["src"],Mpt={class:"font-bold font-large text-lg line-clamp-1"},Dpt={key:0,class:"mb-2"},kpt={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Lpt=ue(()=>u("i",{"data-feather":"chevron-up"},null,-1)),Ppt=[Lpt],Upt=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Fpt=[Upt],Bpt={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Gpt={class:"flex flex-row p-3"},zpt=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),Vpt=[zpt],Hpt=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),qpt=[Hpt],Ypt=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),$pt={class:"flex flex-row items-center"},Wpt={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Kpt=ue(()=>u("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),jpt={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},Qpt=ue(()=>u("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),Xpt={key:2,class:"mr-2"},Zpt={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},Jpt={class:"flex gap-1 items-center"},e_t=["src"],t_t={class:"font-bold font-large text-lg line-clamp-1"},n_t={class:"mx-2 mb-4"},i_t={class:"relative"},s_t={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},r_t={key:0},o_t=ue(()=>u("div",{role:"status"},[u("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1)),a_t=[o_t],l_t={key:1},c_t=ue(()=>u("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[u("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)),d_t=[c_t],u_t=ue(()=>u("label",{for:"only_installed"},"Show only installed models",-1)),p_t=ue(()=>u("a",{href:"https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard",target:"_blank",class:"mb-4 font-bold underline text-blue-500 pb-4"},"Hugging face Leaderboard",-1)),__t={key:0,role:"status",class:"text-center w-full display: flex;align-items: center;"},h_t=ue(()=>u("svg",{"aria-hidden":"true",class:"text-center w-full display: flex;align-items: center; h-20 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("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"}),u("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)),f_t=ue(()=>u("p",{class:"heartbeat-text"},"Loading models Zoo",-1)),m_t=[h_t,f_t],g_t={key:1,class:"mb-2"},b_t={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},E_t=ue(()=>u("i",{"data-feather":"chevron-up"},null,-1)),v_t=[E_t],y_t=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),S_t=[y_t],T_t={class:"mb-2"},x_t={class:"p-2"},C_t={class:"mb-3"},R_t=ue(()=>u("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),A_t={key:0},w_t={class:"mb-3"},N_t=ue(()=>u("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),O_t={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},I_t=ue(()=>u("div",{role:"status",class:"justify-center"},null,-1)),M_t={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},D_t={class:"w-full p-2"},k_t={class:"flex justify-between mb-1"},L_t=zu(' Downloading Loading...',1),P_t={class:"text-sm font-medium text-blue-700 dark:text-white"},U_t=["title"],F_t={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},B_t={class:"flex justify-between mb-1"},G_t={class:"text-base font-medium text-blue-700 dark:text-white"},z_t={class:"text-sm font-medium text-blue-700 dark:text-white"},V_t={class:"flex flex-grow"},H_t={class:"flex flex-row flex-grow gap-3"},q_t={class:"p-2 text-center grow"},Y_t={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},$_t={class:"flex flex-row p-3 items-center"},W_t=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),K_t=[W_t],j_t=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Q_t=[j_t],X_t=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),Z_t={key:0,class:"mr-2"},J_t={class:"mr-2 font-bold font-large text-lg line-clamp-1"},eht={key:1,class:"mr-2"},tht={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},nht={key:0,class:"flex -space-x-4 items-center"},iht={class:"group items-center flex flex-row"},sht=["onClick"],rht=["src","title"],oht=["onClick"],aht=ue(()=>u("span",{class:"hidden group-hover:block top-0 left-7 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[u("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[u("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)),lht=[aht],cht=ue(()=>u("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[u("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)),dht=[cht],uht={class:"mx-2 mb-4"},pht=ue(()=>u("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),_ht={class:"relative"},hht={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},fht={key:0},mht=ue(()=>u("div",{role:"status"},[u("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1)),ght=[mht],bht={key:1},Eht=ue(()=>u("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[u("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)),vht=[Eht],yht={key:0,class:"mx-2 mb-4"},Sht={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},Tht=["selected"],xht={key:0,class:"mb-2"},Cht={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},Rht=ue(()=>u("i",{"data-feather":"chevron-up"},null,-1)),Aht=[Rht],wht=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Nht=[wht],Oht={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Iht={class:"flex flex-row p-3 items-center"},Mht=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),Dht=[Mht],kht=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Lht=[kht],Pht=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Extensions zoo",-1)),Uht={key:0,class:"mr-2"},Fht={key:1,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},Bht={key:0,class:"flex -space-x-4 items-center"},Ght={class:"group items-center flex flex-row"},zht=["src","title"],Vht=["onClick"],Hht=ue(()=>u("span",{class:"hidden group-hover:block top-0 left-7 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[u("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[u("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)),qht=[Hht],Yht={class:"mx-2 mb-4"},$ht=ue(()=>u("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),Wht={class:"relative"},Kht={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},jht={key:0},Qht=ue(()=>u("div",{role:"status"},[u("svg",{"aria-hidden":"true",class:"inline w-4 h-4 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1)),Xht=[Qht],Zht={key:1},Jht=ue(()=>u("svg",{"aria-hidden":"true",class:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[u("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)),eft=[Jht],tft={key:0,class:"mx-2 mb-4"},nft={for:"extCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},ift=["selected"],sft={key:0,class:"mb-2"},rft={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},oft=ue(()=>u("i",{"data-feather":"chevron-up"},null,-1)),aft=[oft],lft=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),cft=[lft],dft={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},uft={class:"flex flex-row p-3 items-center"},pft=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),_ft=[pft],hft=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),fft=[hft],mft=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Mounted Extensions Priority",-1)),gft={class:"flex flex-col mb-2 p-3 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},bft={class:"flex flex-row"},Eft=ue(()=>u("i",{"data-feather":"chevron-right"},null,-1)),vft=[Eft],yft=ue(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Sft=[yft],Tft=ue(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1)),xft={class:"m-2"},Cft={class:"flex flex-row gap-2 items-center"},Rft=ue(()=>u("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1)),Aft={class:"m-2"},wft=ue(()=>u("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),Nft={class:"m-2"},Oft={class:"flex flex-col align-bottom"},Ift={class:"relative"},Mft=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),Dft={class:"absolute right-0"},kft={class:"m-2"},Lft={class:"flex flex-col align-bottom"},Pft={class:"relative"},Uft=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),Fft={class:"absolute right-0"},Bft={class:"m-2"},Gft={class:"flex flex-col align-bottom"},zft={class:"relative"},Vft=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),Hft={class:"absolute right-0"},qft={class:"m-2"},Yft={class:"flex flex-col align-bottom"},$ft={class:"relative"},Wft=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),Kft={class:"absolute right-0"},jft={class:"m-2"},Qft={class:"flex flex-col align-bottom"},Xft={class:"relative"},Zft=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),Jft={class:"absolute right-0"},emt={class:"m-2"},tmt={class:"flex flex-col align-bottom"},nmt={class:"relative"},imt=ue(()=>u("p",{class:"absolute left-0 mt-6"},[u("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),smt={class:"absolute right-0"};function rmt(n,e,t,i,s,r){const o=ft("Card"),a=ft("BindingEntry"),l=ft("RadioOptions"),d=ft("model-entry"),c=ft("personality-entry"),_=ft("ExtensionEntry"),f=ft("AddModelDialog"),m=ft("ChoiceDialog");return w(),M($e,null,[u("div",Rot,[u("div",Aot,[s.showConfirmation?(w(),M("div",wot,[u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=Te(h=>s.showConfirmation=!1,["stop"]))},Oot),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=Te(h=>r.save_configuration(),["stop"]))},Mot)])):q("",!0),s.showConfirmation?q("",!0):(w(),M("div",Dot,[u("button",{title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=h=>s.showConfirmation=!0)},Lot),u("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[3]||(e[3]=h=>r.reset_configuration())},Uot),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Collapse / Expand all panels",type:"button",onClick:e[4]||(e[4]=Te(h=>s.all_collapsed=!s.all_collapsed,["stop"]))},Bot)])),u("div",Got,[u("button",{title:"Clear uploads",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[5]||(e[5]=h=>r.api_get_req("clear_uploads").then(E=>{E.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},Vot),u("button",{title:"Restart program",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[6]||(e[6]=h=>r.api_get_req("restart_program").then(E=>{E.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast(["failed!"],4,!1)}))},qot),u("button",{title:"Upgrade program ",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[7]||(e[7]=h=>r.api_get_req("update_software").then(E=>{E.status?this.$store.state.toast.showToast("Success!",4,!0):this.$store.state.toast.showToast("Success!",4,!0)}))},[Yot,s.has_updates?(w(),M("div",$ot,Kot)):q("",!0)]),u("div",jot,[s.settingsChanged?(w(),M("div",Qot,[Xot,s.isLoading?q("",!0):(w(),M("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[8]||(e[8]=Te(h=>r.applyConfiguration(),["stop"]))},Jot))])):q("",!0),s.isLoading?(w(),M("div",eat,[u("p",null,ge(s.loading_text),1),tat,nat])):q("",!0)])])]),u("div",{class:Ye(s.isLoading?"pointer-events-none opacity-30 w-full":"w-full")},[u("div",iat,[u("div",sat,[u("button",{onClick:e[9]||(e[9]=Te(h=>s.sc_collapsed=!s.sc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[le(u("div",null,oat,512),[[Mt,s.sc_collapsed]]),le(u("div",null,lat,512),[[Mt,!s.sc_collapsed]]),cat,dat,u("div",uat,[u("div",pat,[u("div",null,[r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(w(),M("div",_at,[(w(!0),M($e,null,dt(r.vramUsage.gpus,h=>(w(),M("div",hat,[u("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,fat),u("h3",mat,[u("div",null,ge(r.computedFileSize(h.used_vram))+" / "+ge(r.computedFileSize(h.total_vram))+" ("+ge(h.percentage)+"%) ",1)])]))),256))])):q("",!0),r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(w(),M("div",gat,[u("div",bat,[u("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,Eat),u("h3",vat,[u("div",null,ge(r.vramUsage.gpus.length)+"x ",1)])])])):q("",!0)]),yat,u("h3",Sat,[u("div",null,ge(r.ram_usage)+" / "+ge(r.ram_total_space)+" ("+ge(r.ram_percent_usage)+"%)",1)]),Tat,u("h3",xat,[u("div",null,ge(r.disk_binding_models_usage)+" / "+ge(r.disk_total_space)+" ("+ge(r.disk_percent_usage)+"%)",1)])])])])]),u("div",{class:Ye([{hidden:s.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",Cat,[Rat,u("div",Aat,[u("div",null,[wat,Ze(ge(r.ram_available_space),1)]),u("div",null,[Nat,Ze(" "+ge(r.ram_usage)+" / "+ge(r.ram_total_space)+" ("+ge(r.ram_percent_usage)+")% ",1)])]),u("div",Oat,[u("div",Iat,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Jt("width: "+r.ram_percent_usage+"%;")},null,4)])])]),u("div",Mat,[Dat,u("div",kat,[u("div",null,[Lat,Ze(ge(r.disk_available_space),1)]),u("div",null,[Pat,Ze(" "+ge(r.disk_binding_models_usage)+" / "+ge(r.disk_total_space)+" ("+ge(r.disk_percent_usage)+"%)",1)])]),u("div",Uat,[u("div",Fat,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Jt("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(w(!0),M($e,null,dt(r.vramUsage.gpus,h=>(w(),M("div",{class:"mb-2",key:h},[u("label",Bat,[u("img",{src:s.SVGGPU,width:"25",height:"25"},null,8,Gat),Ze(" GPU usage: ")]),u("div",zat,[u("div",null,[Vat,Ze(ge(h.gpu_model),1)]),u("div",null,[Hat,Ze(ge(this.computedFileSize(h.available_space)),1)]),u("div",null,[qat,Ze(" "+ge(this.computedFileSize(h.used_vram))+" / "+ge(this.computedFileSize(h.total_vram))+" ("+ge(h.percentage)+"%)",1)])]),u("div",Yat,[u("div",$at,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Jt("width: "+h.percentage+"%;")},null,4)])])]))),128))],2)]),u("div",Wat,[u("div",Kat,[u("button",{onClick:e[10]||(e[10]=Te(h=>s.minconf_collapsed=!s.minconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[le(u("div",null,Qat,512),[[Mt,s.minconf_collapsed]]),le(u("div",null,Zat,512),[[Mt,!s.minconf_collapsed]]),Jat])]),u("div",{class:Ye([{hidden:s.minconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",elt,[Ie(o,{title:"General",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",tlt,[u("tr",null,[nlt,u("td",ilt,[u("div",slt,[le(u("select",{id:"hardware_mode",required:"","onUpdate:modelValue":e[11]||(e[11]=h=>r.configFile.hardware_mode=h),onChange:e[12]||(e[12]=h=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},_lt,544),[[zn,r.configFile.hardware_mode]])])])]),u("tr",null,[hlt,u("td",flt,[le(u("input",{type:"text",id:"discussion_db_name",required:"","onUpdate:modelValue":e[13]||(e[13]=h=>r.configFile.discussion_db_name=h),onChange:e[14]||(e[14]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Pe,r.configFile.discussion_db_name]])])]),u("tr",null,[mlt,u("td",null,[u("div",glt,[le(u("input",{type:"checkbox",id:"copy_to_clipboard_add_all_details",required:"","onUpdate:modelValue":e[15]||(e[15]=h=>r.configFile.copy_to_clipboard_add_all_details=h),onChange:e[16]||(e[16]=h=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.copy_to_clipboard_add_all_details]])])])]),u("tr",null,[blt,u("td",null,[u("div",Elt,[le(u("input",{type:"checkbox",id:"auto_show_browser",required:"","onUpdate:modelValue":e[17]||(e[17]=h=>r.configFile.auto_show_browser=h),onChange:e[18]||(e[18]=h=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.auto_show_browser]])])])]),u("tr",null,[vlt,u("td",null,[u("div",ylt,[le(u("input",{type:"checkbox",id:"activate_debug",required:"","onUpdate:modelValue":e[19]||(e[19]=h=>r.configFile.debug=h),onChange:e[20]||(e[20]=h=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.debug]])])])]),u("tr",null,[Slt,u("td",null,[u("div",Tlt,[le(u("input",{type:"text",id:"debug_log_file_path",required:"","onUpdate:modelValue":e[21]||(e[21]=h=>r.configFile.debug_log_file_path=h),onChange:e[22]||(e[22]=h=>s.settingsChanged=!0),class:"m-2 h-50 w-50 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.debug_log_file_path]])])])]),u("tr",null,[xlt,u("td",null,[u("div",Clt,[le(u("input",{type:"checkbox",id:"show_news_panel",required:"","onUpdate:modelValue":e[23]||(e[23]=h=>r.configFile.show_news_panel=h),onChange:e[24]||(e[24]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.show_news_panel]])])])]),u("tr",null,[Rlt,u("td",null,[u("div",Alt,[le(u("input",{type:"checkbox",id:"auto_save",required:"","onUpdate:modelValue":e[25]||(e[25]=h=>r.configFile.auto_save=h),onChange:e[26]||(e[26]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.auto_save]])])])]),u("tr",null,[wlt,u("td",null,[u("div",Nlt,[le(u("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[27]||(e[27]=h=>r.configFile.auto_update=h),onChange:e[28]||(e[28]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.auto_update]])])])]),u("tr",null,[Olt,u("td",null,[u("div",Ilt,[le(u("input",{type:"checkbox",id:"auto_title",required:"","onUpdate:modelValue":e[29]||(e[29]=h=>r.configFile.auto_title=h),onChange:e[30]||(e[30]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.auto_title]])])])])])]),_:1}),Ie(o,{title:"User",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Mlt,[u("tr",null,[Dlt,u("td",klt,[le(u("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[31]||(e[31]=h=>r.configFile.user_name=h),onChange:e[32]||(e[32]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.user_name]])])]),u("tr",null,[Llt,u("td",Plt,[le(u("textarea",{id:"user_description",required:"","onUpdate:modelValue":e[33]||(e[33]=h=>r.configFile.user_description=h),onChange:e[34]||(e[34]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.user_description]])])]),u("tr",null,[Ult,u("td",Flt,[le(u("input",{type:"checkbox",id:"use_user_informations_in_discussion",required:"","onUpdate:modelValue":e[35]||(e[35]=h=>r.configFile.use_user_informations_in_discussion=h),onChange:e[36]||(e[36]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.use_user_informations_in_discussion]])])]),u("tr",null,[Blt,u("td",Glt,[u("label",zlt,[u("img",{src:"/user_infos/"+r.configFile.user_avatar,class:"w-50 h-50 rounded-full",style:{"max-width":"50px","max-height":"50px",cursor:"pointer"}},null,8,Vlt)]),u("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[37]||(e[37]=(...h)=>r.uploadAvatar&&r.uploadAvatar(...h))},null,32)])]),u("tr",null,[Hlt,u("td",null,[u("div",qlt,[le(u("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[38]||(e[38]=h=>r.configFile.use_user_name_in_discussions=h),onChange:e[39]||(e[39]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.use_user_name_in_discussions]])])])]),u("tr",null,[Ylt,u("td",$lt,[le(u("input",{type:"number",id:"max_n_predict",required:"","onUpdate:modelValue":e[40]||(e[40]=h=>r.configFile.min_n_predict=h),onChange:e[41]||(e[41]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.min_n_predict]])])]),u("tr",null,[Wlt,u("td",Klt,[le(u("input",{type:"number",id:"min_n_predict",required:"","onUpdate:modelValue":e[42]||(e[42]=h=>r.configFile.min_n_predict=h),onChange:e[43]||(e[43]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.min_n_predict]])])])])]),_:1}),Ie(o,{title:"Code execution",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",jlt,[u("tr",null,[Qlt,u("td",Xlt,[le(u("input",{type:"checkbox",id:"turn_on_code_execution",required:"","onUpdate:modelValue":e[44]||(e[44]=h=>r.configFile.turn_on_code_execution=h),onChange:e[45]||(e[45]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.turn_on_code_execution]])])]),u("tr",null,[Zlt,u("td",Jlt,[le(u("input",{type:"checkbox",id:"turn_on_code_validation",required:"","onUpdate:modelValue":e[46]||(e[46]=h=>r.configFile.turn_on_code_validation=h),onChange:e[47]||(e[47]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.turn_on_code_validation]])])])])]),_:1}),Ie(o,{title:"Knowledge database",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",ect,[u("tr",null,[tct,u("td",null,[u("div",nct,[le(u("input",{type:"checkbox",id:"activate_skills_lib",required:"","onUpdate:modelValue":e[48]||(e[48]=h=>r.configFile.activate_skills_lib=h),onChange:e[49]||(e[49]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.activate_skills_lib]])])])]),u("tr",null,[ict,u("td",sct,[le(u("input",{type:"text",id:"skills_lib_database_name",required:"","onUpdate:modelValue":e[50]||(e[50]=h=>r.configFile.skills_lib_database_name=h),onChange:e[51]||(e[51]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Pe,r.configFile.skills_lib_database_name]])])])])]),_:1}),Ie(o,{title:"Data Vectorization",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",rct,[u("tr",null,[oct,u("td",null,[u("div",act,[le(u("input",{type:"checkbox",id:"use_files",required:"","onUpdate:modelValue":e[52]||(e[52]=h=>r.configFile.use_files=h),onChange:e[53]||(e[53]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.use_files]])])])]),u("tr",null,[lct,u("td",null,[u("div",cct,[le(u("input",{type:"checkbox",id:"activate_ltm",required:"","onUpdate:modelValue":e[54]||(e[54]=h=>r.configFile.activate_ltm=h),onChange:e[55]||(e[55]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.activate_ltm]])])])]),u("tr",null,[dct,u("td",null,[u("div",uct,[le(u("input",{type:"checkbox",id:"summerize_discussion",required:"","onUpdate:modelValue":e[56]||(e[56]=h=>r.configFile.summerize_discussion=h),onChange:e[57]||(e[57]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.summerize_discussion]])])])]),u("tr",null,[pct,u("td",null,[u("div",_ct,[le(u("input",{type:"checkbox",id:"data_vectorization_visualize_on_vectorization",required:"","onUpdate:modelValue":e[58]||(e[58]=h=>r.configFile.data_vectorization_visualize_on_vectorization=h),onChange:e[59]||(e[59]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.data_vectorization_visualize_on_vectorization]])])])]),u("tr",null,[hct,u("td",null,[u("div",fct,[le(u("input",{type:"checkbox",id:"data_vectorization_activate",required:"","onUpdate:modelValue":e[60]||(e[60]=h=>r.configFile.data_vectorization_activate=h),onChange:e[61]||(e[61]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.data_vectorization_activate]])])])]),u("tr",null,[mct,u("td",null,[u("div",gct,[le(u("input",{type:"checkbox",id:"data_vectorization_build_keys_words",required:"","onUpdate:modelValue":e[62]||(e[62]=h=>r.configFile.data_vectorization_build_keys_words=h),onChange:e[63]||(e[63]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.data_vectorization_build_keys_words]])])])]),u("tr",null,[bct,u("td",null,[le(u("select",{id:"data_vectorization_method",required:"","onUpdate:modelValue":e[64]||(e[64]=h=>r.configFile.data_vectorization_method=h),onChange:e[65]||(e[65]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},yct,544),[[zn,r.configFile.data_vectorization_method]])])]),u("tr",null,[Sct,u("td",null,[le(u("select",{id:"data_visualization_method",required:"","onUpdate:modelValue":e[66]||(e[66]=h=>r.configFile.data_visualization_method=h),onChange:e[67]||(e[67]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},Cct,544),[[zn,r.configFile.data_visualization_method]])])]),u("tr",null,[Rct,u("td",null,[u("div",Act,[le(u("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[68]||(e[68]=h=>r.configFile.data_vectorization_save_db=h),onChange:e[69]||(e[69]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.data_vectorization_save_db]])])])]),u("tr",null,[wct,u("td",null,[le(u("input",{id:"data_vectorization_chunk_size","onUpdate:modelValue":e[70]||(e[70]=h=>r.configFile.data_vectorization_chunk_size=h),onChange:e[71]||(e[71]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.data_vectorization_chunk_size]]),le(u("input",{"onUpdate:modelValue":e[72]||(e[72]=h=>r.configFile.data_vectorization_chunk_size=h),type:"number",onChange:e[73]||(e[73]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.data_vectorization_chunk_size]])])]),u("tr",null,[Nct,u("td",null,[le(u("input",{id:"data_vectorization_overlap_size","onUpdate:modelValue":e[74]||(e[74]=h=>r.configFile.data_vectorization_overlap_size=h),onChange:e[75]||(e[75]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.data_vectorization_overlap_size]]),le(u("input",{"onUpdate:modelValue":e[76]||(e[76]=h=>r.configFile.data_vectorization_overlap_size=h),type:"number",onChange:e[77]||(e[77]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.data_vectorization_overlap_size]])])]),u("tr",null,[Oct,u("td",null,[le(u("input",{id:"data_vectorization_nb_chunks","onUpdate:modelValue":e[78]||(e[78]=h=>r.configFile.data_vectorization_nb_chunks=h),onChange:e[79]||(e[79]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"1000",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.data_vectorization_nb_chunks]]),le(u("input",{"onUpdate:modelValue":e[80]||(e[80]=h=>r.configFile.data_vectorization_nb_chunks=h),type:"number",onChange:e[81]||(e[81]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.data_vectorization_nb_chunks]])])])])]),_:1}),Ie(o,{title:"Internet search",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Ict,[u("tr",null,[Mct,u("td",null,[u("div",Dct,[le(u("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[82]||(e[82]=h=>r.configFile.activate_internet_search=h),onChange:e[83]||(e[83]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.activate_internet_search]])])])]),u("tr",null,[kct,u("td",null,[u("div",Lct,[le(u("input",{type:"checkbox",id:"internet_quick_search",required:"","onUpdate:modelValue":e[84]||(e[84]=h=>r.configFile.internet_quick_search=h),onChange:e[85]||(e[85]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.internet_quick_search]])])])]),u("tr",null,[Pct,u("td",null,[u("div",Uct,[le(u("input",{type:"checkbox",id:"internet_activate_search_decision",required:"","onUpdate:modelValue":e[86]||(e[86]=h=>r.configFile.internet_activate_search_decision=h),onChange:e[87]||(e[87]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.internet_activate_search_decision]])])])]),u("tr",null,[Fct,u("td",null,[u("div",Bct,[le(u("input",{id:"internet_vectorization_chunk_size","onUpdate:modelValue":e[88]||(e[88]=h=>r.configFile.internet_vectorization_chunk_size=h),onChange:e[89]||(e[89]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"64000",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.internet_vectorization_chunk_size]]),le(u("input",{"onUpdate:modelValue":e[90]||(e[90]=h=>r.configFile.internet_vectorization_chunk_size=h),type:"number",onChange:e[91]||(e[91]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.internet_vectorization_chunk_size]])])])]),u("tr",null,[Gct,u("td",null,[u("div",zct,[le(u("input",{id:"internet_vectorization_overlap_size","onUpdate:modelValue":e[92]||(e[92]=h=>r.configFile.internet_vectorization_overlap_size=h),onChange:e[93]||(e[93]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"1000",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.internet_vectorization_overlap_size]]),le(u("input",{"onUpdate:modelValue":e[94]||(e[94]=h=>r.configFile.internet_vectorization_overlap_size=h),type:"number",onChange:e[95]||(e[95]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.internet_vectorization_overlap_size]])])])]),u("tr",null,[Vct,u("td",null,[u("div",Hct,[le(u("input",{id:"internet_vectorization_nb_chunks","onUpdate:modelValue":e[96]||(e[96]=h=>r.configFile.internet_vectorization_nb_chunks=h),onChange:e[97]||(e[97]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.internet_vectorization_nb_chunks]]),le(u("input",{"onUpdate:modelValue":e[98]||(e[98]=h=>r.configFile.internet_vectorization_nb_chunks=h),type:"number",onChange:e[99]||(e[99]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.internet_vectorization_nb_chunks]])])])]),u("tr",null,[qct,u("td",null,[u("div",Yct,[le(u("input",{id:"internet_nb_search_pages","onUpdate:modelValue":e[100]||(e[100]=h=>r.configFile.internet_nb_search_pages=h),onChange:e[101]||(e[101]=h=>s.settingsChanged=!0),type:"range",min:"1",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.internet_nb_search_pages]]),le(u("input",{"onUpdate:modelValue":e[102]||(e[102]=h=>r.configFile.internet_nb_search_pages=h),type:"number",onChange:e[103]||(e[103]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.internet_nb_search_pages]])])])])])]),_:1}),Ie(o,{title:"Latex",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",$ct,[u("tr",null,[Wct,u("td",null,[u("div",Kct,[le(u("input",{type:"text",id:"pdf_latex_path",required:"","onUpdate:modelValue":e[104]||(e[104]=h=>r.configFile.pdf_latex_path=h),onChange:e[105]||(e[105]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.pdf_latex_path]])])])])])]),_:1}),Ie(o,{title:"Boost",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",jct,[u("tr",null,[Qct,u("td",null,[u("div",Xct,[le(u("input",{type:"text",id:"positive_boost",required:"","onUpdate:modelValue":e[106]||(e[106]=h=>r.configFile.positive_boost=h),onChange:e[107]||(e[107]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.positive_boost]])])])]),u("tr",null,[Zct,u("td",null,[u("div",Jct,[le(u("input",{type:"text",id:"negative_boost",required:"","onUpdate:modelValue":e[108]||(e[108]=h=>r.configFile.negative_boost=h),onChange:e[109]||(e[109]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.negative_boost]])])])]),u("tr",null,[edt,u("td",null,[u("div",tdt,[le(u("input",{type:"text",id:"force_output_language_to_be",required:"","onUpdate:modelValue":e[110]||(e[110]=h=>r.configFile.force_output_language_to_be=h),onChange:e[111]||(e[111]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.force_output_language_to_be]])])])]),u("tr",null,[ndt,u("td",null,[u("div",idt,[le(u("input",{type:"checkbox",id:"fun_mode",required:"","onUpdate:modelValue":e[112]||(e[112]=h=>r.configFile.fun_mode=h),onChange:e[113]||(e[113]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.fun_mode]])])])])])]),_:1}),Ie(o,{title:"Whisper audio transcription",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",sdt,[u("tr",null,[rdt,u("td",null,[u("div",odt,[le(u("select",{id:"whisper_model","onUpdate:modelValue":e[114]||(e[114]=h=>r.configFile.whisper_model=h),onChange:e[115]||(e[115]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),M($e,null,dt(r.whisperModels,h=>(w(),M("option",{key:h,value:h},ge(h),9,adt))),128))],544),[[zn,r.configFile.whisper_model]])])])])])]),_:1}),Ie(o,{title:"Browser Audio",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",ldt,[u("tr",null,[cdt,u("td",null,[u("div",ddt,[le(u("input",{type:"checkbox",id:"activate_audio_infos",required:"","onUpdate:modelValue":e[116]||(e[116]=h=>r.configFile.activate_audio_infos=h),onChange:e[117]||(e[117]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.activate_audio_infos]])])])]),u("tr",null,[udt,u("td",null,[u("div",pdt,[le(u("input",{type:"checkbox",id:"audio_auto_send_input",required:"","onUpdate:modelValue":e[118]||(e[118]=h=>r.configFile.audio_auto_send_input=h),onChange:e[119]||(e[119]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.audio_auto_send_input]])])])]),u("tr",null,[_dt,u("td",null,[u("div",hdt,[le(u("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[120]||(e[120]=h=>r.configFile.auto_speak=h),onChange:e[121]||(e[121]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.auto_speak]])])])]),u("tr",null,[fdt,u("td",null,[le(u("input",{id:"audio_pitch","onUpdate:modelValue":e[122]||(e[122]=h=>r.configFile.audio_pitch=h),onChange:e[123]||(e[123]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"10",step:"0.1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.audio_pitch]]),le(u("input",{"onUpdate:modelValue":e[124]||(e[124]=h=>r.configFile.audio_pitch=h),onChange:e[125]||(e[125]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.audio_pitch]])])]),u("tr",null,[mdt,u("td",null,[le(u("input",{id:"audio_silenceTimer","onUpdate:modelValue":e[126]||(e[126]=h=>r.configFile.audio_silenceTimer=h),onChange:e[127]||(e[127]=h=>s.settingsChanged=!0),type:"range",min:"0",max:"10000",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.audio_silenceTimer]]),le(u("input",{"onUpdate:modelValue":e[128]||(e[128]=h=>r.configFile.audio_silenceTimer=h),onChange:e[129]||(e[129]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.audio_silenceTimer]])])]),u("tr",null,[gdt,u("td",null,[le(u("select",{id:"audio_in_language","onUpdate:modelValue":e[130]||(e[130]=h=>r.configFile.audio_in_language=h),onChange:e[131]||(e[131]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),M($e,null,dt(r.audioLanguages,h=>(w(),M("option",{key:h.code,value:h.code},ge(h.name),9,bdt))),128))],544),[[zn,r.configFile.audio_in_language]])])]),u("tr",null,[Edt,u("td",null,[le(u("select",{id:"audio_out_voice","onUpdate:modelValue":e[132]||(e[132]=h=>r.configFile.audio_out_voice=h),onChange:e[133]||(e[133]=h=>s.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(w(!0),M($e,null,dt(s.audioVoices,h=>(w(),M("option",{key:h.name,value:h.name},ge(h.name),9,vdt))),128))],544),[[zn,r.configFile.audio_out_voice]])])])])]),_:1})])],2)]),u("div",ydt,[u("div",Sdt,[u("button",{onClick:e[134]||(e[134]=Te(h=>s.servers_conf_collapsed=!s.servers_conf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[le(u("div",null,xdt,512),[[Mt,s.servers_conf_collapsed]]),le(u("div",null,Rdt,512),[[Mt,!s.servers_conf_collapsed]]),Adt])]),u("div",{class:Ye([{hidden:s.servers_conf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[Ie(o,{title:"Lollms service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",wdt,[u("tr",null,[Ndt,u("td",Odt,[le(u("input",{type:"text",id:"host",required:"","onUpdate:modelValue":e[135]||(e[135]=h=>r.configFile.host=h),onChange:e[136]||(e[136]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Pe,r.configFile.host]])])]),u("tr",null,[Idt,u("td",Mdt,[le(u("input",{type:"number",step:"1",id:"port",required:"","onUpdate:modelValue":e[137]||(e[137]=h=>r.configFile.port=h),onChange:e[138]||(e[138]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[Pe,r.configFile.port]])])]),u("tr",null,[Ddt,u("td",kdt,[le(u("input",{type:"checkbox",id:"headless_server_mode",required:"","onUpdate:modelValue":e[139]||(e[139]=h=>r.configFile.headless_server_mode=h),onChange:e[140]||(e[140]=h=>s.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600 dark:bg-gray-600"},null,544),[[_t,r.configFile.headless_server_mode]])])])])]),_:1}),Ie(o,{title:"Stable diffusion service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Ldt,[u("tr",null,[Pdt,u("td",null,[u("div",Udt,[le(u("input",{type:"checkbox",id:"enable_sd_service",required:"","onUpdate:modelValue":e[141]||(e[141]=h=>r.configFile.enable_sd_service=h),onChange:e[142]||(e[142]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_sd_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[143]||(e[143]=h=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},Bdt)])]),u("tr",null,[Gdt,u("td",null,[u("div",zdt,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[144]||(e[144]=(...h)=>r.reinstallSDService&&r.reinstallSDService(...h))},"install sd service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[145]||(e[145]=(...h)=>r.upgradeSDService&&r.upgradeSDService(...h))},"upgrade sd service"),Vdt,u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[146]||(e[146]=(...h)=>r.startSDService&&r.startSDService(...h))},"start sd service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[147]||(e[147]=(...h)=>r.showSD&&r.showSD(...h))},"show sd ui")])])]),u("tr",null,[Hdt,u("td",null,[u("div",qdt,[le(u("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[148]||(e[148]=h=>r.configFile.sd_base_url=h),onChange:e[149]||(e[149]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.sd_base_url]])])])])])]),_:1}),Ie(o,{title:"ComfyUI service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Ydt,[u("tr",null,[$dt,u("td",null,[u("div",Wdt,[le(u("input",{type:"checkbox",id:"enable_comfyui_service",required:"","onUpdate:modelValue":e[150]||(e[150]=h=>r.configFile.enable_comfyui_service=h),onChange:e[151]||(e[151]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_comfyui_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[152]||(e[152]=h=>this.$store.state.messageBox.showMessage("Activates Stable diffusion service. The service will be automatically loaded at startup alowing you to use the stable diffusion endpoint to generate images"))},jdt)])]),u("tr",null,[Qdt,u("td",null,[u("div",Xdt,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[153]||(e[153]=(...h)=>r.reinstallComfyUIService&&r.reinstallComfyUIService(...h))},"install comfyui service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[154]||(e[154]=(...h)=>r.upgradeComfyUIService&&r.upgradeComfyUIService(...h))},"upgrade comfyui service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[155]||(e[155]=(...h)=>r.startComfyUIService&&r.startComfyUIService(...h))},"start comfyui service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[156]||(e[156]=(...h)=>r.showComfyui&&r.showComfyui(...h))},"show comfyui"),Zdt])])]),u("tr",null,[Jdt,u("td",null,[u("div",eut,[le(u("input",{type:"text",id:"comfyui_base_url",required:"","onUpdate:modelValue":e[157]||(e[157]=h=>r.configFile.comfyui_base_url=h),onChange:e[158]||(e[158]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.comfyui_base_url]])])])])])]),_:1}),Ie(o,{title:"Motion Ctrl service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",tut,[u("tr",null,[nut,u("td",null,[u("div",iut,[le(u("input",{type:"checkbox",id:"enable_motion_ctrl_service",required:"","onUpdate:modelValue":e[159]||(e[159]=h=>r.configFile.enable_motion_ctrl_service=h),onChange:e[160]||(e[160]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_motion_ctrl_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[161]||(e[161]=h=>this.$store.state.messageBox.showMessage("Activates Motion ctrl service. The service will be automatically loaded at startup alowing you to use the motoin control endpoint to generate videos"))},rut)])]),u("tr",null,[out,u("td",null,[u("div",aut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[162]||(e[162]=(...h)=>r.reinstallMotionCtrlService&&r.reinstallMotionCtrlService(...h))},"install Motion Ctrl service")])])]),u("tr",null,[lut,u("td",null,[u("div",cut,[le(u("input",{type:"text",id:"sd_base_url",required:"","onUpdate:modelValue":e[163]||(e[163]=h=>r.configFile.sd_base_url=h),onChange:e[164]||(e[164]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.sd_base_url]])])])])])]),_:1}),Ie(o,{title:"Ollama service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",dut,[u("tr",null,[uut,u("td",null,[u("div",put,[le(u("input",{type:"checkbox",id:"enable_ollama_service",required:"","onUpdate:modelValue":e[165]||(e[165]=h=>r.configFile.enable_ollama_service=h),onChange:e[166]||(e[166]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_ollama_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[167]||(e[167]=h=>this.$store.state.messageBox.showMessage(`Activates ollama service. The service will be automatically loaded at startup alowing you to use the ollama binding. If you are using windows, this uses wsl which requires you to have it installed or at least activated. If You are using windows, this will install wsl so you need to activate it. -Here is how you can do that`))},put)])]),u("tr",null,[_ut,u("td",null,[u("div",hut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[166]||(e[166]=(...h)=>r.reinstallOLLAMAService&&r.reinstallOLLAMAService(...h))},"install ollama service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[167]||(e[167]=(...h)=>r.startollamaService&&r.startollamaService(...h))},"start ollama service")])])]),u("tr",null,[fut,u("td",null,[u("div",mut,[le(u("input",{type:"text",id:"ollama_base_url",required:"","onUpdate:modelValue":e[168]||(e[168]=h=>r.configFile.ollama_base_url=h),onChange:e[169]||(e[169]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.ollama_base_url]])])])])])]),_:1}),Ie(o,{title:"vLLM service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",gut,[u("tr",null,[but,u("td",null,[u("div",Eut,[le(u("input",{type:"checkbox",id:"enable_vllm_service",required:"","onUpdate:modelValue":e[170]||(e[170]=h=>r.configFile.enable_vllm_service=h),onChange:e[171]||(e[171]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_vllm_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[172]||(e[172]=h=>this.$store.state.messageBox.showMessage(`Activates vllm service. The service will be automatically loaded at startup alowing you to use the elf binding. +Here is how you can do that`))},hut)])]),u("tr",null,[fut,u("td",null,[u("div",mut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[168]||(e[168]=(...h)=>r.reinstallOLLAMAService&&r.reinstallOLLAMAService(...h))},"install ollama service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[169]||(e[169]=(...h)=>r.startollamaService&&r.startollamaService(...h))},"start ollama service")])])]),u("tr",null,[gut,u("td",null,[u("div",but,[le(u("input",{type:"text",id:"ollama_base_url",required:"","onUpdate:modelValue":e[170]||(e[170]=h=>r.configFile.ollama_base_url=h),onChange:e[171]||(e[171]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.ollama_base_url]])])])])])]),_:1}),Ie(o,{title:"vLLM service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Eut,[u("tr",null,[vut,u("td",null,[u("div",yut,[le(u("input",{type:"checkbox",id:"enable_vllm_service",required:"","onUpdate:modelValue":e[172]||(e[172]=h=>r.configFile.enable_vllm_service=h),onChange:e[173]||(e[173]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_vllm_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[174]||(e[174]=h=>this.$store.state.messageBox.showMessage(`Activates vllm service. The service will be automatically loaded at startup alowing you to use the elf binding. If you are using windows, this uses wsl which requires you to have it installed or at least activated. If You are using windows, this will install wsl so you need to activate it. -Here is how you can do that`))},yut)])]),u("tr",null,[Sut,u("td",null,[u("div",Tut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[173]||(e[173]=(...h)=>r.reinstallvLLMService&&r.reinstallvLLMService(...h))},"install vLLM service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[174]||(e[174]=(...h)=>r.startvLLMService&&r.startvLLMService(...h))},"start vllm service")])])]),u("tr",null,[xut,u("td",null,[u("div",Cut,[le(u("input",{type:"text",id:"vllm_url",required:"","onUpdate:modelValue":e[175]||(e[175]=h=>r.configFile.vllm_url=h),onChange:e[176]||(e[176]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.vllm_url]])])])]),u("tr",null,[Rut,u("td",null,[u("div",Aut,[u("div",wut,[Nut,u("p",Out,[le(u("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[177]||(e[177]=h=>r.configFile.vllm_gpu_memory_utilization=h),onChange:e[178]||(e[178]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.vllm_gpu_memory_utilization]])])]),le(u("input",{id:"vllm_gpu_memory_utilization",onChange:e[179]||(e[179]=h=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[180]||(e[180]=h=>r.configFile.vllm_gpu_memory_utilization=h),min:"0.10",max:"1",step:"0.01",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.vllm_gpu_memory_utilization]])])])]),u("tr",null,[Iut,u("td",null,[u("div",Mut,[le(u("input",{type:"number",id:"vllm_max_num_seqs",min:"64",max:"2048",required:"","onUpdate:modelValue":e[181]||(e[181]=h=>r.configFile.vllm_max_num_seqs=h),onChange:e[182]||(e[182]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.vllm_max_num_seqs]])])])]),u("tr",null,[Dut,u("td",null,[u("div",kut,[le(u("input",{type:"number",id:"vllm_max_model_len",min:"2048",max:"1000000",required:"","onUpdate:modelValue":e[183]||(e[183]=h=>r.configFile.vllm_max_model_len=h),onChange:e[184]||(e[184]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.vllm_max_model_len]])])])]),u("tr",null,[Lut,u("td",null,[u("div",Put,[le(u("input",{type:"text",id:"vllm_model_path",required:"","onUpdate:modelValue":e[185]||(e[185]=h=>r.configFile.vllm_model_path=h),onChange:e[186]||(e[186]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.vllm_model_path]])])])])])]),_:1}),Ie(o,{title:"Petals service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Uut,[u("tr",null,[Fut,u("td",null,[u("div",But,[le(u("input",{type:"checkbox",id:"enable_petals_service",required:"","onUpdate:modelValue":e[187]||(e[187]=h=>r.configFile.enable_petals_service=h),onChange:e[188]||(e[188]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_petals_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[189]||(e[189]=h=>this.$store.state.messageBox.showMessage(`Activates Petals service. The service will be automatically loaded at startup alowing you to use the petals endpoint to generate text in a distributed network. +Here is how you can do that`))},Tut)])]),u("tr",null,[xut,u("td",null,[u("div",Cut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[175]||(e[175]=(...h)=>r.reinstallvLLMService&&r.reinstallvLLMService(...h))},"install vLLM service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[176]||(e[176]=(...h)=>r.startvLLMService&&r.startvLLMService(...h))},"start vllm service")])])]),u("tr",null,[Rut,u("td",null,[u("div",Aut,[le(u("input",{type:"text",id:"vllm_url",required:"","onUpdate:modelValue":e[177]||(e[177]=h=>r.configFile.vllm_url=h),onChange:e[178]||(e[178]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.vllm_url]])])])]),u("tr",null,[wut,u("td",null,[u("div",Nut,[u("div",Out,[Iut,u("p",Mut,[le(u("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[179]||(e[179]=h=>r.configFile.vllm_gpu_memory_utilization=h),onChange:e[180]||(e[180]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.vllm_gpu_memory_utilization]])])]),le(u("input",{id:"vllm_gpu_memory_utilization",onChange:e[181]||(e[181]=h=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[182]||(e[182]=h=>r.configFile.vllm_gpu_memory_utilization=h),min:"0.10",max:"1",step:"0.01",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.vllm_gpu_memory_utilization]])])])]),u("tr",null,[Dut,u("td",null,[u("div",kut,[le(u("input",{type:"number",id:"vllm_max_num_seqs",min:"64",max:"2048",required:"","onUpdate:modelValue":e[183]||(e[183]=h=>r.configFile.vllm_max_num_seqs=h),onChange:e[184]||(e[184]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.vllm_max_num_seqs]])])])]),u("tr",null,[Lut,u("td",null,[u("div",Put,[le(u("input",{type:"number",id:"vllm_max_model_len",min:"2048",max:"1000000",required:"","onUpdate:modelValue":e[185]||(e[185]=h=>r.configFile.vllm_max_model_len=h),onChange:e[186]||(e[186]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.vllm_max_model_len]])])])]),u("tr",null,[Uut,u("td",null,[u("div",Fut,[le(u("input",{type:"text",id:"vllm_model_path",required:"","onUpdate:modelValue":e[187]||(e[187]=h=>r.configFile.vllm_model_path=h),onChange:e[188]||(e[188]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.vllm_model_path]])])])])])]),_:1}),Ie(o,{title:"Petals service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",But,[u("tr",null,[Gut,u("td",null,[u("div",zut,[le(u("input",{type:"checkbox",id:"enable_petals_service",required:"","onUpdate:modelValue":e[189]||(e[189]=h=>r.configFile.enable_petals_service=h),onChange:e[190]||(e[190]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_petals_service]])])]),u("td",null,[u("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary",onClick:e[191]||(e[191]=h=>this.$store.state.messageBox.showMessage(`Activates Petals service. The service will be automatically loaded at startup alowing you to use the petals endpoint to generate text in a distributed network. If You are using windows, this will install wsl so you need to activate it. -Here is how you can do that`))},zut)])]),u("tr",null,[Vut,u("td",null,[u("div",Hut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[190]||(e[190]=(...h)=>r.reinstallPetalsService&&r.reinstallPetalsService(...h))},"install petals service")])])]),u("tr",null,[qut,u("td",null,[u("div",Yut,[le(u("input",{type:"text",id:"petals_base_url",required:"","onUpdate:modelValue":e[191]||(e[191]=h=>r.configFile.petals_base_url=h),onChange:e[192]||(e[192]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.petals_base_url]])])])])])]),_:1}),Ie(o,{title:"Elastic search Service (under construction)",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",$ut,[u("tr",null,[Wut,u("td",null,[u("div",Kut,[le(u("input",{type:"checkbox",id:"elastic_search_service",required:"","onUpdate:modelValue":e[193]||(e[193]=h=>r.configFile.elastic_search_service=h),onChange:e[194]||(e[194]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.elastic_search_service]])])])]),u("tr",null,[jut,u("td",null,[u("div",Qut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[195]||(e[195]=(...h)=>r.reinstallElasticSearchService&&r.reinstallElasticSearchService(...h))},"install ElasticSearch service")])])]),u("tr",null,[Xut,u("td",null,[u("div",Zut,[le(u("input",{type:"text",id:"elastic_search_url",required:"","onUpdate:modelValue":e[196]||(e[196]=h=>r.configFile.elastic_search_url=h),onChange:e[197]||(e[197]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.elastic_search_url]])])])])])]),_:1}),Ie(o,{title:"XTTS service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Jut,[u("tr",null,[ept,u("td",null,[u("div",tpt,[le(u("input",{type:"checkbox",id:"enable_voice_service",required:"","onUpdate:modelValue":e[198]||(e[198]=h=>r.configFile.enable_voice_service=h),onChange:e[199]||(e[199]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_voice_service]])])])]),u("tr",null,[npt,u("td",null,[u("div",ipt,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[200]||(e[200]=(...h)=>r.reinstallAudioService&&r.reinstallAudioService(...h))},"install xtts service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[201]||(e[201]=(...h)=>r.startAudioService&&r.startAudioService(...h))},"start xtts service")])])]),u("tr",null,[spt,u("td",null,[u("div",rpt,[le(u("input",{type:"text",id:"xtts_base_url",required:"","onUpdate:modelValue":e[202]||(e[202]=h=>r.configFile.xtts_base_url=h),onChange:e[203]||(e[203]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.xtts_base_url]])])])]),u("tr",null,[opt,u("td",null,[u("div",apt,[le(u("select",{"onUpdate:modelValue":e[204]||(e[204]=h=>r.current_language=h),onChange:e[205]||(e[205]=h=>s.settingsChanged=!0),disabled:!r.enable_voice_service},[(w(!0),M($e,null,dt(s.voice_languages,(h,E)=>(w(),M("option",{key:E,value:h},ge(E),9,cpt))),128))],40,lpt),[[zn,r.current_language]])])])]),u("tr",null,[dpt,u("td",null,[u("div",upt,[le(u("select",{"onUpdate:modelValue":e[206]||(e[206]=h=>r.current_voice=h),onChange:e[207]||(e[207]=h=>s.settingsChanged=!0),disabled:!r.enable_voice_service},[(w(!0),M($e,null,dt(s.voices,h=>(w(),M("option",{key:h,value:h},ge(h),9,_pt))),128))],40,ppt),[[zn,r.current_voice]])])])]),u("tr",null,[hpt,u("td",null,[u("div",fpt,[le(u("input",{type:"checkbox",id:"auto_read",required:"","onUpdate:modelValue":e[208]||(e[208]=h=>r.configFile.auto_read=h),onChange:e[209]||(e[209]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:!r.enable_voice_service},null,40,mpt),[[_t,r.configFile.auto_read]])])])])])]),_:1})],2)]),u("div",gpt,[u("div",bpt,[u("button",{onClick:e[210]||(e[210]=Te(h=>s.bzc_collapsed=!s.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[le(u("div",null,vpt,512),[[Mt,s.bzc_collapsed]]),le(u("div",null,Spt,512),[[Mt,!s.bzc_collapsed]]),Tpt,r.configFile.binding_name?q("",!0):(w(),M("div",xpt,[Cpt,Ze(" No binding selected! ")])),r.configFile.binding_name?(w(),M("div",Rpt,"|")):q("",!0),r.configFile.binding_name?(w(),M("div",Apt,[u("div",wpt,[u("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,Npt),u("h3",Opt,ge(r.binding_name),1)])])):q("",!0)])]),u("div",{class:Ye([{hidden:s.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsZoo&&r.bindingsZoo.length>0?(w(),M("div",Ipt,[u("label",Mpt," Bindings: ("+ge(r.bindingsZoo.length)+") ",1),u("div",{class:Ye(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.bzl_collapsed?"":"max-h-96"])},[Ie(rs,{name:"list"},{default:Je(()=>[(w(!0),M($e,null,dt(r.bindingsZoo,(h,E)=>(w(),xt(a,{ref_for:!0,ref:"bindingZoo",key:"index-"+E+"-"+h.folder,binding:h,"on-selected":r.onBindingSelected,"on-reinstall":r.onReinstallBinding,"on-unInstall":r.onUnInstallBinding,"on-install":r.onInstallBinding,"on-settings":r.onSettingsBinding,"on-reload-binding":r.onReloadBinding,selected:h.folder===r.configFile.binding_name},null,8,["binding","on-selected","on-reinstall","on-unInstall","on-install","on-settings","on-reload-binding","selected"]))),128))]),_:1})],2)])):q("",!0),s.bzl_collapsed?(w(),M("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[211]||(e[211]=h=>s.bzl_collapsed=!s.bzl_collapsed)},kpt)):(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[212]||(e[212]=h=>s.bzl_collapsed=!s.bzl_collapsed)},Ppt))],2)]),u("div",Upt,[u("div",Fpt,[u("button",{onClick:e[213]||(e[213]=Te(h=>r.modelsZooToggleCollapse(),["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[le(u("div",null,Gpt,512),[[Mt,s.mzc_collapsed]]),le(u("div",null,Vpt,512),[[Mt,!s.mzc_collapsed]]),Hpt,u("div",qpt,[r.configFile.binding_name?q("",!0):(w(),M("div",Ypt,[$pt,Ze(" Select binding first! ")])),!r.configFile.model_name&&r.configFile.binding_name?(w(),M("div",Wpt,[Kpt,Ze(" No model selected! ")])):q("",!0),r.configFile.model_name?(w(),M("div",jpt,"|")):q("",!0),r.configFile.model_name?(w(),M("div",Qpt,[u("div",Xpt,[u("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,Zpt),u("h3",Jpt,ge(r.configFile.model_name),1)])])):q("",!0)])])]),u("div",{class:Ye([{hidden:s.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",e_t,[u("div",t_t,[u("div",n_t,[s.searchModelInProgress?(w(),M("div",i_t,r_t)):q("",!0),s.searchModelInProgress?q("",!0):(w(),M("div",o_t,l_t))]),le(u("input",{type:"search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 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",placeholder:"Search models...",required:"","onUpdate:modelValue":e[214]||(e[214]=h=>s.searchModel=h),onKeyup:e[215]||(e[215]=wr((...h)=>r.searchModel_func&&r.searchModel_func(...h),["enter"]))},null,544),[[Pe,s.searchModel]]),s.searchModel?(w(),M("button",{key:0,onClick:e[216]||(e[216]=Te(h=>s.searchModel="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):q("",!0)])]),u("div",null,[le(u("input",{"onUpdate:modelValue":e[217]||(e[217]=h=>s.show_only_installed_models=h),class:"m-2 p-2",type:"checkbox",ref:"only_installed"},null,512),[[_t,s.show_only_installed_models]]),c_t]),u("div",null,[Ie(l,{radioOptions:s.sortOptions,onRadioSelected:r.handleRadioSelected},null,8,["radioOptions","onRadioSelected"])]),d_t,s.is_loading_zoo?(w(),M("div",u_t,h_t)):q("",!0),s.models_zoo&&s.models_zoo.length>0?(w(),M("div",f_t,[u("label",m_t," Models: ("+ge(s.models_zoo.length)+") ",1),u("div",{class:Ye(["overflow-y-auto p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 overflow-y-scroll w-full 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",s.mzl_collapsed?"":"max-h-96"])},[Ie(rs,{name:"list"},{default:Je(()=>[(w(!0),M($e,null,dt(r.rendered_models_zoo,(h,E)=>(w(),xt(d,{ref_for:!0,ref:"modelZoo",key:"index-"+E+"-"+h.name,model:h,"is-installed":h.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onModelSelected,selected:h.name===r.configFile.model_name,model_type:h.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["model","is-installed","on-install","on-uninstall","on-selected","selected","model_type","on-copy","on-copy-link","on-cancel-install"]))),128)),u("button",{ref:"load_more_models",class:"relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",onClick:e[218]||(e[218]=(...h)=>r.load_more_models&&r.load_more_models(...h))},"Load more models",512)]),_:1})],2)])):q("",!0),s.mzl_collapsed?(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[219]||(e[219]=(...h)=>r.open_mzl&&r.open_mzl(...h))},b_t)):(w(),M("button",{key:3,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[220]||(e[220]=(...h)=>r.open_mzl&&r.open_mzl(...h))},v_t)),u("div",y_t,[u("div",S_t,[u("div",null,[u("div",T_t,[x_t,le(u("input",{type:"text","onUpdate:modelValue":e[221]||(e[221]=h=>s.reference_path=h),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 Path ...",required:""},null,512),[[Pe,s.reference_path]])]),u("button",{type:"button",onClick:e[222]||(e[222]=Te(h=>r.onCreateReference(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Add reference")]),s.modelDownlaodInProgress?q("",!0):(w(),M("div",C_t,[u("div",R_t,[A_t,le(u("input",{type:"text","onUpdate:modelValue":e[223]||(e[223]=h=>s.addModel.url=h),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 URL ...",required:""},null,512),[[Pe,s.addModel.url]])]),u("button",{type:"button",onClick:e[224]||(e[224]=Te(h=>r.onInstallAddModel(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Download")])),s.modelDownlaodInProgress?(w(),M("div",w_t,[N_t,u("div",O_t,[u("div",I_t,[u("div",M_t,[D_t,u("span",k_t,ge(Math.floor(s.addModel.progress))+"%",1)]),u("div",{class:"mx-1 opacity-80 line-clamp-1",title:s.addModel.url},ge(s.addModel.url),9,L_t),u("div",P_t,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Jt({width:s.addModel.progress+"%"})},null,4)]),u("div",U_t,[u("span",F_t,"Download speed: "+ge(r.speed_computed)+"/s",1),u("span",B_t,ge(r.downloaded_size_computed)+"/"+ge(r.total_size_computed),1)])])]),u("div",G_t,[u("div",z_t,[u("div",V_t,[u("button",{onClick:e[225]||(e[225]=Te((...h)=>r.onCancelInstall&&r.onCancelInstall(...h),["stop"])),type:"button",title:"Cancel download",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"}," Cancel ")])])])])):q("",!0)])])],2)]),u("div",H_t,[u("div",q_t,[u("button",{onClick:e[228]||(e[228]=Te(h=>s.pzc_collapsed=!s.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[le(u("div",null,$_t,512),[[Mt,s.pzc_collapsed]]),le(u("div",null,K_t,512),[[Mt,!s.pzc_collapsed]]),j_t,r.configFile.personalities?(w(),M("div",Q_t,"|")):q("",!0),u("div",X_t,ge(r.active_pesonality),1),r.configFile.personalities?(w(),M("div",Z_t,"|")):q("",!0),r.configFile.personalities?(w(),M("div",J_t,[r.mountedPersArr.length>0?(w(),M("div",eht,[(w(!0),M($e,null,dt(r.mountedPersArr,(h,E)=>(w(),M("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:E+"-"+h.name,ref_for:!0,ref:"mountedPersonalities"},[u("div",tht,[u("button",{onClick:Te(b=>r.onPersonalitySelected(h),["stop"])},[u("img",{src:s.bUrl+h.avatar,onError:e[226]||(e[226]=(...b)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...b)),class:Ye(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary",r.configFile.active_personality_id==r.configFile.personalities.indexOf(h.full_path)?"border-secondary":"border-transparent z-0"]),title:h.name},null,42,iht)],8,nht),u("button",{onClick:Te(b=>r.unmountPersonality(h),["stop"])},oht,8,sht)])]))),128))])):q("",!0)])):q("",!0),u("button",{onClick:e[227]||(e[227]=Te(h=>r.unmountAll(),["stop"])),class:"bg-bg-light hover:border-green-200 ml-5 dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount All"},lht)])]),u("div",{class:Ye([{hidden:s.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",cht,[dht,u("div",uht,[u("div",pht,[s.searchPersonalityInProgress?(w(),M("div",_ht,fht)):q("",!0),s.searchPersonalityInProgress?q("",!0):(w(),M("div",mht,bht))]),le(u("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 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",placeholder:"Search personality...",required:"","onUpdate:modelValue":e[229]||(e[229]=h=>s.searchPersonality=h),onKeyup:e[230]||(e[230]=Te((...h)=>r.searchPersonality_func&&r.searchPersonality_func(...h),["stop"]))},null,544),[[Pe,s.searchPersonality]]),s.searchPersonality?(w(),M("button",{key:0,onClick:e[231]||(e[231]=Te(h=>s.searchPersonality="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):q("",!0)])]),s.searchPersonality?q("",!0):(w(),M("div",Eht,[u("label",vht," Personalities Category: ("+ge(s.persCatgArr.length)+") ",1),u("select",{id:"persCat",onChange:e[232]||(e[232]=h=>r.update_personality_category(h.target.value,r.refresh)),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"},[(w(!0),M($e,null,dt(s.persCatgArr,(h,E)=>(w(),M("option",{key:E,selected:h==this.configFile.personality_category},ge(h),9,yht))),128))],32)])),u("div",null,[s.personalitiesFiltered.length>0?(w(),M("div",Sht,[u("label",Tht,ge(s.searchPersonality?"Search results":"Personalities")+": ("+ge(s.personalitiesFiltered.length)+") ",1),u("div",{class:Ye(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.pzl_collapsed?"":"max-h-96"])},[Ie(rs,{name:"bounce"},{default:Je(()=>[(w(!0),M($e,null,dt(s.personalitiesFiltered,(h,E)=>(w(),xt(c,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+E+"-"+h.name,personality:h,select_language:!0,full_path:h.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(b=>b===h.full_path||b===h.full_path+":"+h.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-edit":r.editPersonality,"on-copy-to-custom":r.copyToCustom,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality,"on-copy-personality-name":r.onCopyPersonalityName},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"]))),128))]),_:1})],2)])):q("",!0)]),s.pzl_collapsed?(w(),M("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[233]||(e[233]=h=>s.pzl_collapsed=!s.pzl_collapsed)},Cht)):(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[234]||(e[234]=h=>s.pzl_collapsed=!s.pzl_collapsed)},Aht))],2)]),u("div",wht,[u("div",Nht,[u("button",{onClick:e[236]||(e[236]=Te(h=>s.ezc_collapsed=!s.ezc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[le(u("div",null,Iht,512),[[Mt,s.ezc_collapsed]]),le(u("div",null,Dht,512),[[Mt,!s.ezc_collapsed]]),kht,r.configFile.extensions?(w(),M("div",Lht,"|")):q("",!0),r.configFile.extensions?(w(),M("div",Pht,[r.mountedExtensions.length>0?(w(),M("div",Uht,[(w(!0),M($e,null,dt(r.mountedExtensions,(h,E)=>(w(),M("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:E+"-"+h.name,ref_for:!0,ref:"mountedExtensions"},[u("div",Fht,[u("button",null,[u("img",{src:s.bUrl+h.avatar,onError:e[235]||(e[235]=(...b)=>r.extensionImgPlacehodler&&r.extensionImgPlacehodler(...b)),class:Ye(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary","border-transparent z-0"]),title:h.name},null,40,Bht)]),u("button",{onClick:Te(b=>r.unmountExtension(h),["stop"])},Vht,8,Ght)])]))),128))])):q("",!0)])):q("",!0)])]),u("div",{class:Ye([{hidden:s.ezc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",Hht,[qht,u("div",Yht,[u("div",$ht,[s.searchExtensionInProgress?(w(),M("div",Wht,jht)):q("",!0),s.searchExtensionInProgress?q("",!0):(w(),M("div",Qht,Zht))]),le(u("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 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",placeholder:"Search extension...",required:"","onUpdate:modelValue":e[237]||(e[237]=h=>s.searchExtension=h),onKeyup:e[238]||(e[238]=Te((...h)=>n.searchExtension_func&&n.searchExtension_func(...h),["stop"]))},null,544),[[Pe,s.searchExtension]]),s.searchExtension?(w(),M("button",{key:0,onClick:e[239]||(e[239]=Te(h=>s.searchExtension="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):q("",!0)])]),s.searchExtension?q("",!0):(w(),M("div",Jht,[u("label",eft," Extensions Category: ("+ge(s.extCatgArr.length)+") ",1),u("select",{id:"extCat",onChange:e[240]||(e[240]=h=>r.update_extension_category(h.target.value,r.refresh)),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"},[(w(!0),M($e,null,dt(s.extCatgArr,(h,E)=>(w(),M("option",{key:E,selected:h==this.extension_category},ge(h),9,tft))),128))],32)])),u("div",null,[s.extensionsFiltered.length>0?(w(),M("div",nft,[u("label",ift,ge(s.searchExtension?"Search results":"Personalities")+": ("+ge(s.extensionsFiltered.length)+") ",1),u("div",{class:Ye(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.ezl_collapsed?"":"max-h-96"])},[(w(!0),M($e,null,dt(s.extensionsFiltered,(h,E)=>(w(),xt(_,{ref_for:!0,ref:"extensionsZoo",key:"index-"+E+"-"+h.name,extension:h,select_language:!0,full_path:h.full_path,"on-mount":r.mountExtension,"on-un-mount":r.unmountExtension,"on-remount":r.remountExtension,"on-reinstall":r.onExtensionReinstall,"on-settings":r.onSettingsExtension},null,8,["extension","full_path","on-mount","on-un-mount","on-remount","on-reinstall","on-settings"]))),128))],2)])):q("",!0)]),s.ezc_collapsed?(w(),M("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[241]||(e[241]=h=>s.ezl_collapsed=!s.ezl_collapsed)},rft)):(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[242]||(e[242]=h=>s.ezl_collapsed=!s.ezl_collapsed)},aft))],2)]),u("div",lft,[u("div",cft,[u("button",{onClick:e[243]||(e[243]=Te(h=>s.mep_collapsed=!s.mep_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[le(u("div",null,uft,512),[[Mt,s.mep_collapsed]]),le(u("div",null,_ft,512),[[Mt,!s.mep_collapsed]]),hft])]),u("div",{class:Ye([{hidden:s.mep_collapsed},"flex flex-col mb-2 px-3 pb-0"])},null,2)]),u("div",fft,[u("div",mft,[u("button",{onClick:e[244]||(e[244]=Te(h=>s.mc_collapsed=!s.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[le(u("div",null,bft,512),[[Mt,s.mc_collapsed]]),le(u("div",null,vft,512),[[Mt,!s.mc_collapsed]]),yft])]),u("div",{class:Ye([{hidden:s.mc_collapsed},"flex flex-col mb-2 p-2"])},[u("div",Sft,[u("div",Tft,[le(u("input",{id:"override-model-parameters",type:"checkbox",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-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[245]||(e[245]=Te(()=>{},["stop"])),"onUpdate:modelValue":e[246]||(e[246]=h=>r.configFile.override_personality_model_parameters=h),onChange:e[247]||(e[247]=h=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[_t,r.configFile.override_personality_model_parameters]]),xft])]),u("div",{class:Ye(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[u("div",Cft,[Rft,le(u("input",{type:"text",id:"seed","onUpdate:modelValue":e[248]||(e[248]=h=>r.configFile.seed=h),class:"bg-gray-50 border border-gray-300 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:focus:ring-blue-500 dark:focus:border-blue-500"},null,512),[[Pe,r.configFile.seed]])]),u("div",Aft,[u("div",wft,[u("div",Nft,[Oft,u("p",Ift,[le(u("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[249]||(e[249]=h=>r.configFile.temperature=h),onChange:e[250]||(e[250]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.temperature]])])]),le(u("input",{id:"temperature",onChange:e[251]||(e[251]=h=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[252]||(e[252]=h=>r.configFile.temperature=h),min:"0",max:"5",step:"0.1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.temperature]])])]),u("div",Mft,[u("div",Dft,[u("div",kft,[Lft,u("p",Pft,[le(u("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[253]||(e[253]=h=>r.configFile.n_predict=h),onChange:e[254]||(e[254]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.n_predict]])])]),le(u("input",{id:"predict",type:"range",onChange:e[255]||(e[255]=h=>s.settingsChanged=!0),"onUpdate:modelValue":e[256]||(e[256]=h=>r.configFile.n_predict=h),min:"0",max:"2048",step:"32",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.n_predict]])])]),u("div",Uft,[u("div",Fft,[u("div",Bft,[Gft,u("p",zft,[le(u("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[257]||(e[257]=h=>r.configFile.top_k=h),onChange:e[258]||(e[258]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.top_k]])])]),le(u("input",{id:"top_k",type:"range",onChange:e[259]||(e[259]=h=>s.settingsChanged=!0),"onUpdate:modelValue":e[260]||(e[260]=h=>r.configFile.top_k=h),min:"0",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.top_k]])])]),u("div",Vft,[u("div",Hft,[u("div",qft,[Yft,u("p",$ft,[le(u("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[261]||(e[261]=h=>r.configFile.top_p=h),onChange:e[262]||(e[262]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.top_p]])])]),le(u("input",{id:"top_p",type:"range","onUpdate:modelValue":e[263]||(e[263]=h=>r.configFile.top_p=h),min:"0",max:"1",step:"0.01",onChange:e[264]||(e[264]=h=>s.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.top_p]])])]),u("div",Wft,[u("div",Kft,[u("div",jft,[Qft,u("p",Xft,[le(u("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[265]||(e[265]=h=>r.configFile.repeat_penalty=h),onChange:e[266]||(e[266]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.repeat_penalty]])])]),le(u("input",{id:"repeat_penalty",onChange:e[267]||(e[267]=h=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[268]||(e[268]=h=>r.configFile.repeat_penalty=h),min:"0",max:"2",step:"0.01",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.repeat_penalty]])])]),u("div",Zft,[u("div",Jft,[u("div",emt,[tmt,u("p",nmt,[le(u("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[269]||(e[269]=h=>r.configFile.repeat_last_n=h),onChange:e[270]||(e[270]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.repeat_last_n]])])]),le(u("input",{id:"repeat_last_n",type:"range","onUpdate:modelValue":e[271]||(e[271]=h=>r.configFile.repeat_last_n=h),min:"0",max:"100",step:"1",onChange:e[272]||(e[272]=h=>s.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),Ie(f,{ref:"addmodeldialog"},null,512),Ie(m,{class:"z-20",show:s.variantSelectionDialogVisible,choices:s.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const smt=bt(Cot,[["render",imt],["__scopeId","data-v-20db2a02"]]),rmt={components:{ClipBoardTextInput:RE,Card:vc},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const n={model_name:this.selectedModel,dataset_file:this.selectedDataset,max_length:this.max_length,batch_size:this.batch_size,lr:this.lr,num_epochs:this.num_epochs,output_dir:this.selectedFolder};Me.post("/start_training",n).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(n){const e=n.target.files;e.length>0&&(this.selectedDataset=e[0])}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}}},watch:{model_name(n){console.log("watching model_name",n),this.$refs.clipboardInput.inputValue=n}}},omt={key:0,class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},amt={class:"mb-4"},lmt=u("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),cmt=["value"],dmt={class:"mb-4"},umt=u("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),pmt={class:"mb-4"},_mt=u("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),hmt={class:"mb-4"},fmt=u("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),mmt={class:"mb-4"},gmt=u("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),bmt={class:"mb-4"},Emt=u("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),vmt={class:"mb-4"},ymt=u("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),Smt=u("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1),Tmt={key:1};function xmt(n,e,t,i,s,r){const o=ft("Card"),a=ft("ClipBoardTextInput");return r.selectedModel!==null&&r.selectedModel.toLowerCase().includes("gptq")?(w(),M("div",omt,[u("form",{onSubmit:e[2]||(e[2]=Te((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[Ie(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ie(o,{title:"Model",class:"",isHorizontal:!1},{default:Je(()=>[u("div",amt,[lmt,le(u("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>r.selectedModel=l),onChange:e[1]||(e[1]=(...l)=>n.setModel&&n.setModel(...l)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(w(!0),M($e,null,dt(r.models,l=>(w(),M("option",{key:l,value:l},ge(l),9,cmt))),128))],544),[[zn,r.selectedModel]])])]),_:1}),Ie(o,{title:"Data",isHorizontal:!1},{default:Je(()=>[u("div",dmt,[umt,Ie(a,{id:"model_path",inputType:"file",value:s.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),Ie(o,{title:"Training",isHorizontal:!1},{default:Je(()=>[u("div",pmt,[_mt,Ie(a,{id:"model_path",inputType:"integer",value:s.lr},null,8,["value"])]),u("div",hmt,[fmt,Ie(a,{id:"model_path",inputType:"integer",value:s.num_epochs},null,8,["value"])]),u("div",mmt,[gmt,Ie(a,{id:"model_path",inputType:"integer",value:s.max_length},null,8,["value"])]),u("div",bmt,[Emt,Ie(a,{id:"model_path",inputType:"integer",value:s.batch_size},null,8,["value"])])]),_:1}),Ie(o,{title:"Output",isHorizontal:!1},{default:Je(()=>[u("div",vmt,[ymt,Ie(a,{id:"model_path",inputType:"text",value:n.output_dir},null,8,["value"])])]),_:1})]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Smt]),_:1})],32)])):(w(),M("div",Tmt,[Ie(o,{title:"Info",class:"",isHorizontal:!1},{default:Je(()=>[Ze(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")]),_:1})]))}const Cmt=bt(rmt,[["render",xmt]]),Rmt={components:{ClipBoardTextInput:RE,Card:vc},data(){return{model_name:"jondurbin/airoboros-7b-gpt4",tokenizer_name:"jondurbin/airoboros-7b-gpt4",dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDatasetPath:""}},methods:{submitForm(){this.model_name,this.tokenizer_name,this.selectedDatasetPath,this.max_length,this.batch_size,this.lr,this.num_epochs,this.selectedFolder},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(n){const e=n.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},Amt={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},wmt={class:"mb-4"},Nmt=u("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),Omt={class:"mb-4"},Imt=u("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),Mmt=u("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function Dmt(n,e,t,i,s,r){const o=ft("ClipBoardTextInput"),a=ft("Card");return w(),M("div",Amt,[u("form",{onSubmit:e[0]||(e[0]=Te((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[Ie(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ie(a,{title:"Model",class:"",isHorizontal:!1},{default:Je(()=>[u("div",wmt,[Nmt,Ie(o,{id:"model_path",inputType:"text",value:s.model_name},null,8,["value"])]),u("div",Omt,[Imt,Ie(o,{id:"model_path",inputType:"text",value:s.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),Ie(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Mmt]),_:1})],32)])}const kmt=bt(Rmt,[["render",Dmt]]),Lmt={name:"Discussion",emits:["delete","select","editTitle","makeTitle","checked"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,makeTitleMode:!1,deleteMode:!1,editTitle:!1,newTitle:String,checkBoxValue_local:!1}},methods:{cancel(){this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1},deleteEvent(){this.showConfirmation=!1,this.$emit("delete")},selectEvent(){this.$emit("select")},editTitleEvent(){this.editTitle=!1,this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1,this.$emit("editTitle",{title:this.newTitle,id:this.id})},makeTitleEvent(){this.$emit("makeTitle",{id:this.id}),this.showConfirmation=!1},chnageTitle(n){this.newTitle=n},checkedChangeEvent(n,e){this.$emit("checked",n,e)}},mounted(){this.newTitle=this.title,Ve(()=>{qe.replace()})},watch:{showConfirmation(){Ve(()=>{qe.replace()})},editTitleMode(n){this.showConfirmation=n,this.editTitle=n,n&&Ve(()=>{try{this.$refs.titleBox.focus()}catch{}})},deleteMode(n){this.showConfirmation=n,n&&Ve(()=>{this.$refs.titleBox.focus()})},makeTitleMode(n){this.showConfirmation=n},checkBoxValue(n,e){this.checkBoxValue_local=n}}},Pmt=["id"],Umt={class:"flex flex-row items-center gap-2"},Fmt={key:0},Bmt=["title"],Gmt=["value"],zmt={class:"flex items-center flex-1 max-h-6"},Vmt={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},Hmt=u("i",{"data-feather":"x"},null,-1),qmt=[Hmt],Ymt=u("i",{"data-feather":"check"},null,-1),$mt=[Ymt],Wmt={key:1,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"},Kmt=u("i",{"data-feather":"type"},null,-1),jmt=[Kmt],Qmt=u("i",{"data-feather":"edit-2"},null,-1),Xmt=[Qmt],Zmt=u("i",{"data-feather":"trash"},null,-1),Jmt=[Zmt];function egt(n,e,t,i,s,r){return w(),M("div",{class:Ye([t.selected?"bg-bg-light-discussion dark:bg-bg-dark-discussion shadow-md min-w-[23rem] max-w-[23rem]":" min-w-[23rem] max-w-[23rem]","flex flex-row sm:flex-row flex-wrap flex-shrink: 0 item-center shadow-sm 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"]),id:"dis-"+t.id,onClick:e[12]||(e[12]=Te(o=>r.selectEvent(),["stop"]))},[u("div",Umt,[t.isCheckbox?(w(),M("div",Fmt,[le(u("input",{type:"checkbox",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-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[0]||(e[0]=Te(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=o=>s.checkBoxValue_local=o),onInput:e[2]||(e[2]=o=>r.checkedChangeEvent(o,t.id))},null,544),[[_t,s.checkBoxValue_local]])])):q("",!0),t.selected?(w(),M("div",{key:1,class:Ye(["min-h-full w-2 rounded-xl self-stretch",t.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):q("",!0),t.selected?q("",!0):(w(),M("div",{key:2,class:Ye(["w-2",t.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),s.editTitle?q("",!0):(w(),M("p",{key:0,title:t.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},ge(t.title?t.title==="untitled"?"New discussion":t.title:"New discussion"),9,Bmt)),s.editTitle?(w(),M("input",{key:1,type:"text",id:"title-box",ref:"titleBox",class:"bg-bg-light dark:bg-bg-dark rounded-md border-0 w-full -m-1 p-1",value:t.title,required:"",onKeydown:[e[3]||(e[3]=wr(Te(o=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=wr(Te(o=>s.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=o=>r.chnageTitle(o.target.value)),onClick:e[6]||(e[6]=Te(()=>{},["stop"]))},null,40,Gmt)):q("",!0),u("div",zmt,[s.showConfirmation?(w(),M("div",Vmt,[u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[7]||(e[7]=Te(o=>r.cancel(),["stop"]))},qmt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[8]||(e[8]=Te(o=>s.editTitleMode?r.editTitleEvent():s.deleteMode?r.deleteEvent():r.makeTitleEvent(),["stop"]))},$mt)])):q("",!0),s.showConfirmation?q("",!0):(w(),M("div",Wmt,[u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Make a title",type:"button",onClick:e[9]||(e[9]=Te(o=>s.makeTitleMode=!0,["stop"]))},jmt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[10]||(e[10]=Te(o=>s.editTitleMode=!0,["stop"]))},Xmt),u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[11]||(e[11]=Te(o=>s.deleteMode=!0,["stop"]))},Jmt)]))])],10,Pmt)}const wE=bt(Lmt,[["render",egt]]),tgt={data(){return{show:!1,prompt:"",inputText:""}},methods:{showPanel(){this.show=!0},ok(){this.show=!1,this.$emit("ok",this.inputText)},cancel(){this.show=!1,this.inputText=""}},props:{promptText:{type:String,required:!0}},watch:{promptText(n){this.prompt=n}}},ngt={key:0,class:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black bg-opacity-50"},igt={class:"bg-white p-8 rounded"},sgt={class:"text-xl font-bold mb-4"};function rgt(n,e,t,i,s,r){return w(),M("div",null,[s.show?(w(),M("div",ngt,[u("div",igt,[u("h2",sgt,ge(t.promptText),1),le(u("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=o=>s.inputText=o),class:"border border-gray-300 px-4 py-2 rounded mb-4"},null,512),[[Pe,s.inputText]]),u("button",{onClick:e[1]||(e[1]=(...o)=>r.ok&&r.ok(...o)),class:"bg-blue-500 text-white px-4 py-2 rounded mr-2"},"OK"),u("button",{onClick:e[2]||(e[2]=(...o)=>r.cancel&&r.cancel(...o)),class:"bg-gray-500 text-white px-4 py-2 rounded"},"Cancel")])])):q("",!0)])}const EO=bt(tgt,[["render",rgt]]),ogt={data(){return{id:0,loading:!1,isCheckbox:!1,isVisible:!1,categories:[],titles:[],content:"",searchQuery:""}},components:{Discussion:wE,MarkdownRenderer:ap},props:{host:{type:String,required:!1,default:"http://localhost:9600"}},methods:{showSkillsLibrary(){this.isVisible=!0,this.fetchTitles()},closeComponent(){this.isVisible=!1},fetchCategories(){Me.post("/get_skills_library_categories",{client_id:this.$store.state.client_id}).then(n=>{this.categories=n.data.categories}).catch(n=>{console.error("Error fetching categories:",n)})},fetchTitles(){console.log("Fetching categories"),Me.post("/get_skills_library_titles",{client_id:this.$store.state.client_id}).then(n=>{this.titles=n.data.titles,console.log("titles recovered")}).catch(n=>{console.error("Error fetching titles:",n)})},fetchContent(n){Me.post("/get_skills_library_content",{client_id:this.$store.state.client_id,skill_id:n}).then(e=>{const t=e.data.contents[0];this.id=t.id,this.content=t.content}).catch(e=>{console.error("Error fetching content:",e)})},deleteCategory(n){console.log("Delete category")},editCategory(n){console.log("Edit category")},checkUncheckCategory(n){console.log("Unchecked category")},deleteSkill(n){console.log("Delete skill ",n),Me.post("/delete_skill",{client_id:this.$store.state.client_id,skill_id:n}).then(()=>{this.fetchTitles()})},editTitle(n){Me.post("/edit_skill_title",{client_id:this.$store.state.client_id,skill_id:n,title:n}).then(()=>{this.fetchTitles()}),console.log("Edit title")},makeTitle(n){console.log("Make title")},checkUncheckTitle(n){},searchSkills(){}}},agt={id:"leftPanel",class:"flex flex-row h-full flex-grow shadow-lg rounded"},lgt={class:"min-w-[23rem] max-w-[23rem] z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md overflow-y-scroll no-scrollbar"},cgt={class:"search p-4"},dgt={classclass:"absolute flex flex-col no-scrollbar shadow-lg min-w-[24rem] max-w-[24rem] bg-bg-light-tone dark:bg-bg-dark-tone top-20 left-20 bottom-20 right-20 bg-bg-light shadow-lg rounded"},ugt=u("h2",{class:"text-xl font-bold m-4"},"Titles",-1),pgt={class:"z-0 flex flex-col flex-grow 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"},_gt=u("h2",{class:"text-xl font-bold m-4"},"Content",-1);function hgt(n,e,t,i,s,r){const o=ft("Discussion"),a=ft("MarkdownRenderer");return w(),M("div",{class:Ye([{hidden:!s.isVisible},"absolute flex flex-col no-scrollbar shadow-lg bg-bg-light dark:bg-bg-dark top-20 left-20 bottom-20 right-20 shadow-lg rounded"])},[u("div",agt,[u("div",lgt,[u("div",cgt,[le(u("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=l=>s.searchQuery=l),placeholder:"Search skills",class:"border border-gray-300 rounded px-2 py-1 mr-2"},null,512),[[Pe,s.searchQuery]]),u("button",{onClick:e[1]||(e[1]=(...l)=>r.searchSkills&&r.searchSkills(...l)),class:"bg-blue-500 text-white rounded px-4 py-1"},"Search")]),u("div",dgt,[ugt,s.titles.length>0?(w(),xt(rs,{key:0,name:"list"},{default:Je(()=>[(w(!0),M($e,null,dt(s.titles,l=>(w(),xt(o,{key:l.id,id:l.id,title:l.title,selected:r.fetchContent(l.id),loading:s.loading,isCheckbox:s.isCheckbox,checkBoxValue:!1,onSelect:d=>r.fetchContent(l.id),onDelete:d=>r.deleteSkill(l.id),onEditTitle:r.editTitle,onMakeTitle:r.makeTitle,onChecked:r.checkUncheckTitle},null,8,["id","title","selected","loading","isCheckbox","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):q("",!0)])]),u("div",pgt,[_gt,Ie(a,{host:t.host,"markdown-text":s.content,message_id:s.id,discussion_id:s.id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])])]),u("button",{onClick:e[2]||(e[2]=(...l)=>r.closeComponent&&r.closeComponent(...l)),class:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1 hover:bg-red-300"},"Close")],2)}const vO=bt(ogt,[["render",hgt]]),fgt={props:{htmlContent:{type:String,required:!0}}},mgt=["innerHTML"];function ggt(n,e,t,i,s,r){return w(),M("div",null,[u("div",{innerHTML:t.htmlContent},null,8,mgt)])}const bgt=bt(fgt,[["render",ggt]]);const Egt={props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Form"}},data(){return{collapsed:!0}},computed:{formattedJson(){return typeof this.jsonData=="string"?JSON.stringify(JSON.parse(this.jsonData),null," ").replace(/\n/g,"
"):JSON.stringify(this.jsonData,null," ").replace(/\n/g,"
")},isObject(){return typeof this.jsonData=="object"&&this.jsonData!==null},isContentPresent(){return this.jsonData!==null&&(typeof this.jsonData!="string"||this.jsonData.trim()!=="")}},methods:{toggleCollapsed(){this.collapsed=!this.collapsed},toggleCollapsible(){this.collapsed=!this.collapsed}}},vgt={key:0},ygt={class:"toggle-icon mr-1"},Sgt={key:0,class:"fas fa-plus-circle text-gray-600"},Tgt={key:1,class:"fas fa-minus-circle text-gray-600"},xgt={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},Cgt={key:0,class:"fas fa-plus-circle text-gray-600"},Rgt={key:1,class:"fas fa-minus-circle text-gray-600"},Agt=["innerHTML"];function wgt(n,e,t,i,s,r){return r.isContentPresent?(w(),M("div",vgt,[u("div",{class:"collapsible-section cursor-pointer mb-4 font-bold hover:text-gray-900",onClick:e[0]||(e[0]=(...o)=>r.toggleCollapsible&&r.toggleCollapsible(...o))},[u("span",ygt,[s.collapsed?(w(),M("i",Sgt)):(w(),M("i",Tgt))]),Ze(" "+ge(t.jsonFormText),1)]),le(u("div",null,[u("div",xgt,[r.isObject?(w(),M("span",{key:0,onClick:e[1]||(e[1]=(...o)=>r.toggleCollapsed&&r.toggleCollapsed(...o)),class:"toggle-icon cursor-pointer mr-1"},[s.collapsed?(w(),M("i",Cgt)):(w(),M("i",Rgt))])):q("",!0),u("pre",{innerHTML:r.formattedJson},null,8,Agt)])],512),[[Mt,!s.collapsed]])])):q("",!0)}const Ngt=bt(Egt,[["render",wgt]]),Ogt={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0},step_type:{type:String,required:!1,default:"start_end"}}},Igt={class:"flex items-start"},Mgt={class:"step flex items-center mb-4"},Dgt={key:0,class:"flex items-center justify-center w-6 h-6 mr-2"},kgt={key:0},Lgt=u("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),Pgt=[Lgt],Ugt={key:1},Fgt=u("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),Bgt=[Fgt],Ggt={key:2},zgt=u("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),Vgt=[zgt],Hgt={key:1,role:"status",class:"m-15"},qgt=u("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"},[u("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"}),u("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),Ygt=[qgt],$gt={class:"text-sm"};function Wgt(n,e,t,i,s,r){return w(),M("div",Igt,[u("div",Mgt,[t.step_type=="start_end"?(w(),M("div",Dgt,[t.done?q("",!0):(w(),M("div",kgt,Pgt)),t.done&&t.status?(w(),M("div",Ugt,Bgt)):q("",!0),t.done&&!t.status?(w(),M("div",Ggt,Vgt)):q("",!0)])):q("",!0),t.done?q("",!0):(w(),M("div",Hgt,Ygt)),u("h3",$gt,ge(t.message),1)])])}const Kgt=bt(Ogt,[["render",Wgt]]),jgt="/assets/process-61f7a21b.svg",Qgt="/assets/ok-a0b56451.svg",Xgt="/assets/failed-183609e7.svg",yO="/assets/send_globe-775ba9b7.svg";const Zgt="/",Jgt={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:ap,Step:Kgt,RenderHTMLJS:bgt,JsonViewer:Ngt,DynamicUIRenderer:bO},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:{default:""}},data(){return{isSynthesizingVoice:!1,cpp_block:uO,html5_block:pO,LaTeX_block:_O,json_block:dO,javascript_block:cO,process_svg:jgt,ok_svg:Qgt,failed_svg:Xgt,loading_svg:fO,sendGlobe:yO,code_block:aO,python_block:lO,bash_block:hO,audio_url:null,audio:null,msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode_:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){if("speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.voices=this.speechSynthesis.getVoices(),this.voices.length===0&&this.speechSynthesis.addEventListener("voiceschanged",this.onVoicesChanged)):console.error("Speech synthesis is not supported in this browser."),Ve(()=>{qe.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight}),console.log("Checking metadata"),console.log(this.message),Object.prototype.hasOwnProperty.call(this.message,"metadata")&&this.message.metadata!=null){console.log("Metadata found!"),Array.isArray(this.message.metadata)||(this.message.metadata=[]),console.log(typeof this.message.metadata),console.log(this.message.metadata);for(let n of this.message.metadata)Object.prototype.hasOwnProperty.call(n,"audio_url")&&n.audio_url!=null&&(this.audio_url=n.audio_url,console.log("Audio URL:",this.audio_url))}},methods:{insertTab(n){const e=n.target,t=e.selectionStart,i=e.selectionEnd,s=n.shiftKey;if(t===i)if(s){if(e.value.substring(t-4,t)==" "){const r=e.value.substring(0,t-4),o=e.value.substring(i),a=r+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t-4})}}else{const r=e.value.substring(0,t),o=e.value.substring(i),a=r+" "+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4})}else{const o=e.value.substring(t,i).split(` +Here is how you can do that`))},Hut)])]),u("tr",null,[qut,u("td",null,[u("div",Yut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[192]||(e[192]=(...h)=>r.reinstallPetalsService&&r.reinstallPetalsService(...h))},"install petals service")])])]),u("tr",null,[$ut,u("td",null,[u("div",Wut,[le(u("input",{type:"text",id:"petals_base_url",required:"","onUpdate:modelValue":e[193]||(e[193]=h=>r.configFile.petals_base_url=h),onChange:e[194]||(e[194]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.petals_base_url]])])])])])]),_:1}),Ie(o,{title:"Elastic search Service (under construction)",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",Kut,[u("tr",null,[jut,u("td",null,[u("div",Qut,[le(u("input",{type:"checkbox",id:"elastic_search_service",required:"","onUpdate:modelValue":e[195]||(e[195]=h=>r.configFile.elastic_search_service=h),onChange:e[196]||(e[196]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.elastic_search_service]])])])]),u("tr",null,[Xut,u("td",null,[u("div",Zut,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[197]||(e[197]=(...h)=>r.reinstallElasticSearchService&&r.reinstallElasticSearchService(...h))},"install ElasticSearch service")])])]),u("tr",null,[Jut,u("td",null,[u("div",ept,[le(u("input",{type:"text",id:"elastic_search_url",required:"","onUpdate:modelValue":e[198]||(e[198]=h=>r.configFile.elastic_search_url=h),onChange:e[199]||(e[199]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.elastic_search_url]])])])])])]),_:1}),Ie(o,{title:"XTTS service",is_subcard:!0,class:"pb-2 m-2"},{default:Je(()=>[u("table",tpt,[u("tr",null,[npt,u("td",null,[u("div",ipt,[le(u("input",{type:"checkbox",id:"enable_voice_service",required:"","onUpdate:modelValue":e[200]||(e[200]=h=>r.configFile.enable_voice_service=h),onChange:e[201]||(e[201]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[_t,r.configFile.enable_voice_service]])])])]),u("tr",null,[spt,u("td",null,[u("div",rpt,[u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[202]||(e[202]=(...h)=>r.reinstallAudioService&&r.reinstallAudioService(...h))},"install xtts service"),u("button",{class:"hover:text-primary bg-green-200 rounded-lg p-4 m-4 w-full text-center items-center",onClick:e[203]||(e[203]=(...h)=>r.startAudioService&&r.startAudioService(...h))},"start xtts service")])])]),u("tr",null,[opt,u("td",null,[u("div",apt,[le(u("input",{type:"text",id:"xtts_base_url",required:"","onUpdate:modelValue":e[204]||(e[204]=h=>r.configFile.xtts_base_url=h),onChange:e[205]||(e[205]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Pe,r.configFile.xtts_base_url]])])])]),u("tr",null,[lpt,u("td",null,[u("div",cpt,[le(u("select",{"onUpdate:modelValue":e[206]||(e[206]=h=>r.current_language=h),onChange:e[207]||(e[207]=h=>s.settingsChanged=!0),disabled:!r.enable_voice_service},[(w(!0),M($e,null,dt(s.voice_languages,(h,E)=>(w(),M("option",{key:E,value:h},ge(E),9,upt))),128))],40,dpt),[[zn,r.current_language]])])])]),u("tr",null,[ppt,u("td",null,[u("div",_pt,[le(u("select",{"onUpdate:modelValue":e[208]||(e[208]=h=>r.current_voice=h),onChange:e[209]||(e[209]=h=>s.settingsChanged=!0),disabled:!r.enable_voice_service},[(w(!0),M($e,null,dt(s.voices,h=>(w(),M("option",{key:h,value:h},ge(h),9,fpt))),128))],40,hpt),[[zn,r.current_voice]])])])]),u("tr",null,[mpt,u("td",null,[u("div",gpt,[le(u("input",{type:"checkbox",id:"auto_read",required:"","onUpdate:modelValue":e[210]||(e[210]=h=>r.configFile.auto_read=h),onChange:e[211]||(e[211]=h=>s.settingsChanged=!0),class:"mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600",disabled:!r.enable_voice_service},null,40,bpt),[[_t,r.configFile.auto_read]])])])])])]),_:1})],2)]),u("div",Ept,[u("div",vpt,[u("button",{onClick:e[212]||(e[212]=Te(h=>s.bzc_collapsed=!s.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[le(u("div",null,Spt,512),[[Mt,s.bzc_collapsed]]),le(u("div",null,xpt,512),[[Mt,!s.bzc_collapsed]]),Cpt,r.configFile.binding_name?q("",!0):(w(),M("div",Rpt,[Apt,Ze(" No binding selected! ")])),r.configFile.binding_name?(w(),M("div",wpt,"|")):q("",!0),r.configFile.binding_name?(w(),M("div",Npt,[u("div",Opt,[u("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,Ipt),u("h3",Mpt,ge(r.binding_name),1)])])):q("",!0)])]),u("div",{class:Ye([{hidden:s.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsZoo&&r.bindingsZoo.length>0?(w(),M("div",Dpt,[u("label",kpt," Bindings: ("+ge(r.bindingsZoo.length)+") ",1),u("div",{class:Ye(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.bzl_collapsed?"":"max-h-96"])},[Ie(rs,{name:"list"},{default:Je(()=>[(w(!0),M($e,null,dt(r.bindingsZoo,(h,E)=>(w(),xt(a,{ref_for:!0,ref:"bindingZoo",key:"index-"+E+"-"+h.folder,binding:h,"on-selected":r.onBindingSelected,"on-reinstall":r.onReinstallBinding,"on-unInstall":r.onUnInstallBinding,"on-install":r.onInstallBinding,"on-settings":r.onSettingsBinding,"on-reload-binding":r.onReloadBinding,selected:h.folder===r.configFile.binding_name},null,8,["binding","on-selected","on-reinstall","on-unInstall","on-install","on-settings","on-reload-binding","selected"]))),128))]),_:1})],2)])):q("",!0),s.bzl_collapsed?(w(),M("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[213]||(e[213]=h=>s.bzl_collapsed=!s.bzl_collapsed)},Ppt)):(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[214]||(e[214]=h=>s.bzl_collapsed=!s.bzl_collapsed)},Fpt))],2)]),u("div",Bpt,[u("div",Gpt,[u("button",{onClick:e[215]||(e[215]=Te(h=>r.modelsZooToggleCollapse(),["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[le(u("div",null,Vpt,512),[[Mt,s.mzc_collapsed]]),le(u("div",null,qpt,512),[[Mt,!s.mzc_collapsed]]),Ypt,u("div",$pt,[r.configFile.binding_name?q("",!0):(w(),M("div",Wpt,[Kpt,Ze(" Select binding first! ")])),!r.configFile.model_name&&r.configFile.binding_name?(w(),M("div",jpt,[Qpt,Ze(" No model selected! ")])):q("",!0),r.configFile.model_name?(w(),M("div",Xpt,"|")):q("",!0),r.configFile.model_name?(w(),M("div",Zpt,[u("div",Jpt,[u("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,e_t),u("h3",t_t,ge(r.configFile.model_name),1)])])):q("",!0)])])]),u("div",{class:Ye([{hidden:s.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",n_t,[u("div",i_t,[u("div",s_t,[s.searchModelInProgress?(w(),M("div",r_t,a_t)):q("",!0),s.searchModelInProgress?q("",!0):(w(),M("div",l_t,d_t))]),le(u("input",{type:"search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 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",placeholder:"Search models...",required:"","onUpdate:modelValue":e[216]||(e[216]=h=>s.searchModel=h),onKeyup:e[217]||(e[217]=wr((...h)=>r.searchModel_func&&r.searchModel_func(...h),["enter"]))},null,544),[[Pe,s.searchModel]]),s.searchModel?(w(),M("button",{key:0,onClick:e[218]||(e[218]=Te(h=>s.searchModel="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):q("",!0)])]),u("div",null,[le(u("input",{"onUpdate:modelValue":e[219]||(e[219]=h=>s.show_only_installed_models=h),class:"m-2 p-2",type:"checkbox",ref:"only_installed"},null,512),[[_t,s.show_only_installed_models]]),u_t]),u("div",null,[Ie(l,{radioOptions:s.sortOptions,onRadioSelected:r.handleRadioSelected},null,8,["radioOptions","onRadioSelected"])]),p_t,s.is_loading_zoo?(w(),M("div",__t,m_t)):q("",!0),s.models_zoo&&s.models_zoo.length>0?(w(),M("div",g_t,[u("label",b_t," Models: ("+ge(s.models_zoo.length)+") ",1),u("div",{class:Ye(["overflow-y-auto p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 overflow-y-scroll w-full 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",s.mzl_collapsed?"":"max-h-96"])},[Ie(rs,{name:"list"},{default:Je(()=>[(w(!0),M($e,null,dt(r.rendered_models_zoo,(h,E)=>(w(),xt(d,{ref_for:!0,ref:"modelZoo",key:"index-"+E+"-"+h.name,model:h,"is-installed":h.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onModelSelected,selected:h.name===r.configFile.model_name,model_type:h.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["model","is-installed","on-install","on-uninstall","on-selected","selected","model_type","on-copy","on-copy-link","on-cancel-install"]))),128)),u("button",{ref:"load_more_models",class:"relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",onClick:e[220]||(e[220]=(...h)=>r.load_more_models&&r.load_more_models(...h))},"Load more models",512)]),_:1})],2)])):q("",!0),s.mzl_collapsed?(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[221]||(e[221]=(...h)=>r.open_mzl&&r.open_mzl(...h))},v_t)):(w(),M("button",{key:3,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[222]||(e[222]=(...h)=>r.open_mzl&&r.open_mzl(...h))},S_t)),u("div",T_t,[u("div",x_t,[u("div",null,[u("div",C_t,[R_t,le(u("input",{type:"text","onUpdate:modelValue":e[223]||(e[223]=h=>s.reference_path=h),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 Path ...",required:""},null,512),[[Pe,s.reference_path]])]),u("button",{type:"button",onClick:e[224]||(e[224]=Te(h=>r.onCreateReference(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Add reference")]),s.modelDownlaodInProgress?q("",!0):(w(),M("div",A_t,[u("div",w_t,[N_t,le(u("input",{type:"text","onUpdate:modelValue":e[225]||(e[225]=h=>s.addModel.url=h),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 URL ...",required:""},null,512),[[Pe,s.addModel.url]])]),u("button",{type:"button",onClick:e[226]||(e[226]=Te(h=>r.onInstallAddModel(),["stop"])),class:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},"Download")])),s.modelDownlaodInProgress?(w(),M("div",O_t,[I_t,u("div",M_t,[u("div",D_t,[u("div",k_t,[L_t,u("span",P_t,ge(Math.floor(s.addModel.progress))+"%",1)]),u("div",{class:"mx-1 opacity-80 line-clamp-1",title:s.addModel.url},ge(s.addModel.url),9,U_t),u("div",F_t,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:Jt({width:s.addModel.progress+"%"})},null,4)]),u("div",B_t,[u("span",G_t,"Download speed: "+ge(r.speed_computed)+"/s",1),u("span",z_t,ge(r.downloaded_size_computed)+"/"+ge(r.total_size_computed),1)])])]),u("div",V_t,[u("div",H_t,[u("div",q_t,[u("button",{onClick:e[227]||(e[227]=Te((...h)=>r.onCancelInstall&&r.onCancelInstall(...h),["stop"])),type:"button",title:"Cancel download",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"}," Cancel ")])])])])):q("",!0)])])],2)]),u("div",Y_t,[u("div",$_t,[u("button",{onClick:e[230]||(e[230]=Te(h=>s.pzc_collapsed=!s.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[le(u("div",null,K_t,512),[[Mt,s.pzc_collapsed]]),le(u("div",null,Q_t,512),[[Mt,!s.pzc_collapsed]]),X_t,r.configFile.personalities?(w(),M("div",Z_t,"|")):q("",!0),u("div",J_t,ge(r.active_pesonality),1),r.configFile.personalities?(w(),M("div",eht,"|")):q("",!0),r.configFile.personalities?(w(),M("div",tht,[r.mountedPersArr.length>0?(w(),M("div",nht,[(w(!0),M($e,null,dt(r.mountedPersArr,(h,E)=>(w(),M("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:E+"-"+h.name,ref_for:!0,ref:"mountedPersonalities"},[u("div",iht,[u("button",{onClick:Te(b=>r.onPersonalitySelected(h),["stop"])},[u("img",{src:s.bUrl+h.avatar,onError:e[228]||(e[228]=(...b)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...b)),class:Ye(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary",r.configFile.active_personality_id==r.configFile.personalities.indexOf(h.full_path)?"border-secondary":"border-transparent z-0"]),title:h.name},null,42,rht)],8,sht),u("button",{onClick:Te(b=>r.unmountPersonality(h),["stop"])},lht,8,oht)])]))),128))])):q("",!0)])):q("",!0),u("button",{onClick:e[229]||(e[229]=Te(h=>r.unmountAll(),["stop"])),class:"bg-bg-light hover:border-green-200 ml-5 dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount All"},dht)])]),u("div",{class:Ye([{hidden:s.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",uht,[pht,u("div",_ht,[u("div",hht,[s.searchPersonalityInProgress?(w(),M("div",fht,ght)):q("",!0),s.searchPersonalityInProgress?q("",!0):(w(),M("div",bht,vht))]),le(u("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 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",placeholder:"Search personality...",required:"","onUpdate:modelValue":e[231]||(e[231]=h=>s.searchPersonality=h),onKeyup:e[232]||(e[232]=Te((...h)=>r.searchPersonality_func&&r.searchPersonality_func(...h),["stop"]))},null,544),[[Pe,s.searchPersonality]]),s.searchPersonality?(w(),M("button",{key:0,onClick:e[233]||(e[233]=Te(h=>s.searchPersonality="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):q("",!0)])]),s.searchPersonality?q("",!0):(w(),M("div",yht,[u("label",Sht," Personalities Category: ("+ge(s.persCatgArr.length)+") ",1),u("select",{id:"persCat",onChange:e[234]||(e[234]=h=>r.update_personality_category(h.target.value,r.refresh)),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"},[(w(!0),M($e,null,dt(s.persCatgArr,(h,E)=>(w(),M("option",{key:E,selected:h==this.configFile.personality_category},ge(h),9,Tht))),128))],32)])),u("div",null,[s.personalitiesFiltered.length>0?(w(),M("div",xht,[u("label",Cht,ge(s.searchPersonality?"Search results":"Personalities")+": ("+ge(s.personalitiesFiltered.length)+") ",1),u("div",{class:Ye(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.pzl_collapsed?"":"max-h-96"])},[Ie(rs,{name:"bounce"},{default:Je(()=>[(w(!0),M($e,null,dt(s.personalitiesFiltered,(h,E)=>(w(),xt(c,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+E+"-"+h.name,personality:h,select_language:!0,full_path:h.full_path,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(b=>b===h.full_path||b===h.full_path+":"+h.language),"on-selected":r.onPersonalitySelected,"on-mount":r.mountPersonality,"on-un-mount":r.unmountPersonality,"on-remount":r.remountPersonality,"on-edit":r.editPersonality,"on-copy-to-custom":r.copyToCustom,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality,"on-copy-personality-name":r.onCopyPersonalityName},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"]))),128))]),_:1})],2)])):q("",!0)]),s.pzl_collapsed?(w(),M("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[235]||(e[235]=h=>s.pzl_collapsed=!s.pzl_collapsed)},Aht)):(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[236]||(e[236]=h=>s.pzl_collapsed=!s.pzl_collapsed)},Nht))],2)]),u("div",Oht,[u("div",Iht,[u("button",{onClick:e[238]||(e[238]=Te(h=>s.ezc_collapsed=!s.ezc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[le(u("div",null,Dht,512),[[Mt,s.ezc_collapsed]]),le(u("div",null,Lht,512),[[Mt,!s.ezc_collapsed]]),Pht,r.configFile.extensions?(w(),M("div",Uht,"|")):q("",!0),r.configFile.extensions?(w(),M("div",Fht,[r.mountedExtensions.length>0?(w(),M("div",Bht,[(w(!0),M($e,null,dt(r.mountedExtensions,(h,E)=>(w(),M("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:E+"-"+h.name,ref_for:!0,ref:"mountedExtensions"},[u("div",Ght,[u("button",null,[u("img",{src:s.bUrl+h.avatar,onError:e[237]||(e[237]=(...b)=>r.extensionImgPlacehodler&&r.extensionImgPlacehodler(...b)),class:Ye(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 group-hover:border-secondary","border-transparent z-0"]),title:h.name},null,40,zht)]),u("button",{onClick:Te(b=>r.unmountExtension(h),["stop"])},qht,8,Vht)])]))),128))])):q("",!0)])):q("",!0)])]),u("div",{class:Ye([{hidden:s.ezc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[u("div",Yht,[$ht,u("div",Wht,[u("div",Kht,[s.searchExtensionInProgress?(w(),M("div",jht,Xht)):q("",!0),s.searchExtensionInProgress?q("",!0):(w(),M("div",Zht,eft))]),le(u("input",{type:"search",id:"personality-search",class:"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 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",placeholder:"Search extension...",required:"","onUpdate:modelValue":e[239]||(e[239]=h=>s.searchExtension=h),onKeyup:e[240]||(e[240]=Te((...h)=>n.searchExtension_func&&n.searchExtension_func(...h),["stop"]))},null,544),[[Pe,s.searchExtension]]),s.searchExtension?(w(),M("button",{key:0,onClick:e[241]||(e[241]=Te(h=>s.searchExtension="",["stop"])),type:"button",class:"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"}," Clear search")):q("",!0)])]),s.searchExtension?q("",!0):(w(),M("div",tft,[u("label",nft," Extensions Category: ("+ge(s.extCatgArr.length)+") ",1),u("select",{id:"extCat",onChange:e[242]||(e[242]=h=>r.update_extension_category(h.target.value,r.refresh)),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"},[(w(!0),M($e,null,dt(s.extCatgArr,(h,E)=>(w(),M("option",{key:E,selected:h==this.extension_category},ge(h),9,ift))),128))],32)])),u("div",null,[s.extensionsFiltered.length>0?(w(),M("div",sft,[u("label",rft,ge(s.searchExtension?"Search results":"Personalities")+": ("+ge(s.extensionsFiltered.length)+") ",1),u("div",{class:Ye(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",s.ezl_collapsed?"":"max-h-96"])},[(w(!0),M($e,null,dt(s.extensionsFiltered,(h,E)=>(w(),xt(_,{ref_for:!0,ref:"extensionsZoo",key:"index-"+E+"-"+h.name,extension:h,select_language:!0,full_path:h.full_path,"on-mount":r.mountExtension,"on-un-mount":r.unmountExtension,"on-remount":r.remountExtension,"on-reinstall":r.onExtensionReinstall,"on-settings":r.onSettingsExtension},null,8,["extension","full_path","on-mount","on-un-mount","on-remount","on-reinstall","on-settings"]))),128))],2)])):q("",!0)]),s.ezc_collapsed?(w(),M("button",{key:1,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Collapse",type:"button",onClick:e[243]||(e[243]=h=>s.ezl_collapsed=!s.ezl_collapsed)},aft)):(w(),M("button",{key:2,class:"text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Expand",type:"button",onClick:e[244]||(e[244]=h=>s.ezl_collapsed=!s.ezl_collapsed)},cft))],2)]),u("div",dft,[u("div",uft,[u("button",{onClick:e[245]||(e[245]=Te(h=>s.mep_collapsed=!s.mep_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[le(u("div",null,_ft,512),[[Mt,s.mep_collapsed]]),le(u("div",null,fft,512),[[Mt,!s.mep_collapsed]]),mft])]),u("div",{class:Ye([{hidden:s.mep_collapsed},"flex flex-col mb-2 px-3 pb-0"])},null,2)]),u("div",gft,[u("div",bft,[u("button",{onClick:e[246]||(e[246]=Te(h=>s.mc_collapsed=!s.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[le(u("div",null,vft,512),[[Mt,s.mc_collapsed]]),le(u("div",null,Sft,512),[[Mt,!s.mc_collapsed]]),Tft])]),u("div",{class:Ye([{hidden:s.mc_collapsed},"flex flex-col mb-2 p-2"])},[u("div",xft,[u("div",Cft,[le(u("input",{id:"override-model-parameters",type:"checkbox",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-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[247]||(e[247]=Te(()=>{},["stop"])),"onUpdate:modelValue":e[248]||(e[248]=h=>r.configFile.override_personality_model_parameters=h),onChange:e[249]||(e[249]=h=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[_t,r.configFile.override_personality_model_parameters]]),Rft])]),u("div",{class:Ye(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[u("div",Aft,[wft,le(u("input",{type:"text",id:"seed","onUpdate:modelValue":e[250]||(e[250]=h=>r.configFile.seed=h),class:"bg-gray-50 border border-gray-300 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:focus:ring-blue-500 dark:focus:border-blue-500"},null,512),[[Pe,r.configFile.seed]])]),u("div",Nft,[u("div",Oft,[u("div",Ift,[Mft,u("p",Dft,[le(u("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[251]||(e[251]=h=>r.configFile.temperature=h),onChange:e[252]||(e[252]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.temperature]])])]),le(u("input",{id:"temperature",onChange:e[253]||(e[253]=h=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[254]||(e[254]=h=>r.configFile.temperature=h),min:"0",max:"5",step:"0.1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.temperature]])])]),u("div",kft,[u("div",Lft,[u("div",Pft,[Uft,u("p",Fft,[le(u("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[255]||(e[255]=h=>r.configFile.n_predict=h),onChange:e[256]||(e[256]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.n_predict]])])]),le(u("input",{id:"predict",type:"range",onChange:e[257]||(e[257]=h=>s.settingsChanged=!0),"onUpdate:modelValue":e[258]||(e[258]=h=>r.configFile.n_predict=h),min:"0",max:"2048",step:"32",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.n_predict]])])]),u("div",Bft,[u("div",Gft,[u("div",zft,[Vft,u("p",Hft,[le(u("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[259]||(e[259]=h=>r.configFile.top_k=h),onChange:e[260]||(e[260]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.top_k]])])]),le(u("input",{id:"top_k",type:"range",onChange:e[261]||(e[261]=h=>s.settingsChanged=!0),"onUpdate:modelValue":e[262]||(e[262]=h=>r.configFile.top_k=h),min:"0",max:"100",step:"1",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.top_k]])])]),u("div",qft,[u("div",Yft,[u("div",$ft,[Wft,u("p",Kft,[le(u("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[263]||(e[263]=h=>r.configFile.top_p=h),onChange:e[264]||(e[264]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.top_p]])])]),le(u("input",{id:"top_p",type:"range","onUpdate:modelValue":e[265]||(e[265]=h=>r.configFile.top_p=h),min:"0",max:"1",step:"0.01",onChange:e[266]||(e[266]=h=>s.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.top_p]])])]),u("div",jft,[u("div",Qft,[u("div",Xft,[Zft,u("p",Jft,[le(u("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[267]||(e[267]=h=>r.configFile.repeat_penalty=h),onChange:e[268]||(e[268]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.repeat_penalty]])])]),le(u("input",{id:"repeat_penalty",onChange:e[269]||(e[269]=h=>s.settingsChanged=!0),type:"range","onUpdate:modelValue":e[270]||(e[270]=h=>r.configFile.repeat_penalty=h),min:"0",max:"2",step:"0.01",class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.repeat_penalty]])])]),u("div",emt,[u("div",tmt,[u("div",nmt,[imt,u("p",smt,[le(u("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[271]||(e[271]=h=>r.configFile.repeat_last_n=h),onChange:e[272]||(e[272]=h=>s.settingsChanged=!0),class:"mt-2 w-16 text-right p-2 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,544),[[Pe,r.configFile.repeat_last_n]])])]),le(u("input",{id:"repeat_last_n",type:"range","onUpdate:modelValue":e[273]||(e[273]=h=>r.configFile.repeat_last_n=h),min:"0",max:"100",step:"1",onChange:e[274]||(e[274]=h=>s.settingsChanged=!0),class:"flex-none h-2 mt-14 mb-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,544),[[Pe,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),Ie(f,{ref:"addmodeldialog"},null,512),Ie(m,{class:"z-20",show:s.variantSelectionDialogVisible,choices:s.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const omt=bt(Cot,[["render",rmt],["__scopeId","data-v-26efbf12"]]),amt={components:{ClipBoardTextInput:RE,Card:vc},data(){return{dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDataset:""}},methods:{submitForm(){const n={model_name:this.selectedModel,dataset_file:this.selectedDataset,max_length:this.max_length,batch_size:this.batch_size,lr:this.lr,num_epochs:this.num_epochs,output_dir:this.selectedFolder};Me.post("/start_training",n).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(n){const e=n.target.files;e.length>0&&(this.selectedDataset=e[0])}},computed:{selectedModel:{get(){return this.$store.state.selectedModel}},models:{get(){return this.$store.state.modelsArr}}},watch:{model_name(n){console.log("watching model_name",n),this.$refs.clipboardInput.inputValue=n}}},lmt={key:0,class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},cmt={class:"mb-4"},dmt=u("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),umt=["value"],pmt={class:"mb-4"},_mt=u("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),hmt={class:"mb-4"},fmt=u("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),mmt={class:"mb-4"},gmt=u("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),bmt={class:"mb-4"},Emt=u("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),vmt={class:"mb-4"},ymt=u("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),Smt={class:"mb-4"},Tmt=u("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),xmt=u("button",{class:"bg-blue-500 text-white px-4 py-2 rounded"},"Start training",-1),Cmt={key:1};function Rmt(n,e,t,i,s,r){const o=ft("Card"),a=ft("ClipBoardTextInput");return r.selectedModel!==null&&r.selectedModel.toLowerCase().includes("gptq")?(w(),M("div",lmt,[u("form",{onSubmit:e[2]||(e[2]=Te((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[Ie(o,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ie(o,{title:"Model",class:"",isHorizontal:!1},{default:Je(()=>[u("div",cmt,[dmt,le(u("select",{"onUpdate:modelValue":e[0]||(e[0]=l=>r.selectedModel=l),onChange:e[1]||(e[1]=(...l)=>n.setModel&&n.setModel(...l)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(w(!0),M($e,null,dt(r.models,l=>(w(),M("option",{key:l,value:l},ge(l),9,umt))),128))],544),[[zn,r.selectedModel]])])]),_:1}),Ie(o,{title:"Data",isHorizontal:!1},{default:Je(()=>[u("div",pmt,[_mt,Ie(a,{id:"model_path",inputType:"file",value:s.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),Ie(o,{title:"Training",isHorizontal:!1},{default:Je(()=>[u("div",hmt,[fmt,Ie(a,{id:"model_path",inputType:"integer",value:s.lr},null,8,["value"])]),u("div",mmt,[gmt,Ie(a,{id:"model_path",inputType:"integer",value:s.num_epochs},null,8,["value"])]),u("div",bmt,[Emt,Ie(a,{id:"model_path",inputType:"integer",value:s.max_length},null,8,["value"])]),u("div",vmt,[ymt,Ie(a,{id:"model_path",inputType:"integer",value:s.batch_size},null,8,["value"])])]),_:1}),Ie(o,{title:"Output",isHorizontal:!1},{default:Je(()=>[u("div",Smt,[Tmt,Ie(a,{id:"model_path",inputType:"text",value:n.output_dir},null,8,["value"])])]),_:1})]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[xmt]),_:1})],32)])):(w(),M("div",Cmt,[Ie(o,{title:"Info",class:"",isHorizontal:!1},{default:Je(()=>[Ze(" Only GPTQ models are supported for QLora fine tuning. Please select a GPTQ compatible binding. ")]),_:1})]))}const Amt=bt(amt,[["render",Rmt]]),wmt={components:{ClipBoardTextInput:RE,Card:vc},data(){return{model_name:"jondurbin/airoboros-7b-gpt4",tokenizer_name:"jondurbin/airoboros-7b-gpt4",dataset_path:"",max_length:1024,batch_size:4,lr:5e-5,num_epochs:2,selectedFolder:"",selectedDatasetPath:""}},methods:{submitForm(){this.model_name,this.tokenizer_name,this.selectedDatasetPath,this.max_length,this.batch_size,this.lr,this.num_epochs,this.selectedFolder},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(n){var t;console.log("here");const e=(t=n.target.files[0])==null?void 0:t.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(n){const e=n.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},Nmt={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone"},Omt={class:"mb-4"},Imt=u("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),Mmt={class:"mb-4"},Dmt=u("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),kmt=u("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function Lmt(n,e,t,i,s,r){const o=ft("ClipBoardTextInput"),a=ft("Card");return w(),M("div",Nmt,[u("form",{onSubmit:e[0]||(e[0]=Te((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[Ie(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[Ie(a,{title:"Model",class:"",isHorizontal:!1},{default:Je(()=>[u("div",Omt,[Imt,Ie(o,{id:"model_path",inputType:"text",value:s.model_name},null,8,["value"])]),u("div",Mmt,[Dmt,Ie(o,{id:"model_path",inputType:"text",value:s.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),Ie(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Je(()=>[kmt]),_:1})],32)])}const Pmt=bt(wmt,[["render",Lmt]]),Umt={name:"Discussion",emits:["delete","select","editTitle","makeTitle","checked"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,makeTitleMode:!1,deleteMode:!1,editTitle:!1,newTitle:String,checkBoxValue_local:!1}},methods:{cancel(){this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1},deleteEvent(){this.showConfirmation=!1,this.$emit("delete")},selectEvent(){this.$emit("select")},editTitleEvent(){this.editTitle=!1,this.editTitleMode=!1,this.makeTitleMode=!1,this.deleteMode=!1,this.showConfirmation=!1,this.$emit("editTitle",{title:this.newTitle,id:this.id})},makeTitleEvent(){this.$emit("makeTitle",{id:this.id}),this.showConfirmation=!1},chnageTitle(n){this.newTitle=n},checkedChangeEvent(n,e){this.$emit("checked",n,e)}},mounted(){this.newTitle=this.title,Ve(()=>{qe.replace()})},watch:{showConfirmation(){Ve(()=>{qe.replace()})},editTitleMode(n){this.showConfirmation=n,this.editTitle=n,n&&Ve(()=>{try{this.$refs.titleBox.focus()}catch{}})},deleteMode(n){this.showConfirmation=n,n&&Ve(()=>{this.$refs.titleBox.focus()})},makeTitleMode(n){this.showConfirmation=n},checkBoxValue(n,e){this.checkBoxValue_local=n}}},Fmt=["id"],Bmt={class:"flex flex-row items-center gap-2"},Gmt={key:0},zmt=["title"],Vmt=["value"],Hmt={class:"flex items-center flex-1 max-h-6"},qmt={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},Ymt=u("i",{"data-feather":"x"},null,-1),$mt=[Ymt],Wmt=u("i",{"data-feather":"check"},null,-1),Kmt=[Wmt],jmt={key:1,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"},Qmt=u("i",{"data-feather":"type"},null,-1),Xmt=[Qmt],Zmt=u("i",{"data-feather":"edit-2"},null,-1),Jmt=[Zmt],egt=u("i",{"data-feather":"trash"},null,-1),tgt=[egt];function ngt(n,e,t,i,s,r){return w(),M("div",{class:Ye([t.selected?"bg-bg-light-discussion dark:bg-bg-dark-discussion shadow-md min-w-[23rem] max-w-[23rem]":" min-w-[23rem] max-w-[23rem]","flex flex-row sm:flex-row flex-wrap flex-shrink: 0 item-center shadow-sm 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"]),id:"dis-"+t.id,onClick:e[12]||(e[12]=Te(o=>r.selectEvent(),["stop"]))},[u("div",Bmt,[t.isCheckbox?(w(),M("div",Gmt,[le(u("input",{type:"checkbox",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-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500",onClick:e[0]||(e[0]=Te(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=o=>s.checkBoxValue_local=o),onInput:e[2]||(e[2]=o=>r.checkedChangeEvent(o,t.id))},null,544),[[_t,s.checkBoxValue_local]])])):q("",!0),t.selected?(w(),M("div",{key:1,class:Ye(["min-h-full w-2 rounded-xl self-stretch",t.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):q("",!0),t.selected?q("",!0):(w(),M("div",{key:2,class:Ye(["w-2",t.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),s.editTitle?q("",!0):(w(),M("p",{key:0,title:t.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},ge(t.title?t.title==="untitled"?"New discussion":t.title:"New discussion"),9,zmt)),s.editTitle?(w(),M("input",{key:1,type:"text",id:"title-box",ref:"titleBox",class:"bg-bg-light dark:bg-bg-dark rounded-md border-0 w-full -m-1 p-1",value:t.title,required:"",onKeydown:[e[3]||(e[3]=wr(Te(o=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=wr(Te(o=>s.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=o=>r.chnageTitle(o.target.value)),onClick:e[6]||(e[6]=Te(()=>{},["stop"]))},null,40,Vmt)):q("",!0),u("div",Hmt,[s.showConfirmation?(w(),M("div",qmt,[u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[7]||(e[7]=Te(o=>r.cancel(),["stop"]))},$mt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[8]||(e[8]=Te(o=>s.editTitleMode?r.editTitleEvent():s.deleteMode?r.deleteEvent():r.makeTitleEvent(),["stop"]))},Kmt)])):q("",!0),s.showConfirmation?q("",!0):(w(),M("div",jmt,[u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Make a title",type:"button",onClick:e[9]||(e[9]=Te(o=>s.makeTitleMode=!0,["stop"]))},Xmt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[10]||(e[10]=Te(o=>s.editTitleMode=!0,["stop"]))},Jmt),u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[11]||(e[11]=Te(o=>s.deleteMode=!0,["stop"]))},tgt)]))])],10,Fmt)}const wE=bt(Umt,[["render",ngt]]),igt={data(){return{show:!1,prompt:"",inputText:""}},methods:{showPanel(){this.show=!0},ok(){this.show=!1,this.$emit("ok",this.inputText)},cancel(){this.show=!1,this.inputText=""}},props:{promptText:{type:String,required:!0}},watch:{promptText(n){this.prompt=n}}},sgt={key:0,class:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black bg-opacity-50"},rgt={class:"bg-white p-8 rounded"},ogt={class:"text-xl font-bold mb-4"};function agt(n,e,t,i,s,r){return w(),M("div",null,[s.show?(w(),M("div",sgt,[u("div",rgt,[u("h2",ogt,ge(t.promptText),1),le(u("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=o=>s.inputText=o),class:"border border-gray-300 px-4 py-2 rounded mb-4"},null,512),[[Pe,s.inputText]]),u("button",{onClick:e[1]||(e[1]=(...o)=>r.ok&&r.ok(...o)),class:"bg-blue-500 text-white px-4 py-2 rounded mr-2"},"OK"),u("button",{onClick:e[2]||(e[2]=(...o)=>r.cancel&&r.cancel(...o)),class:"bg-gray-500 text-white px-4 py-2 rounded"},"Cancel")])])):q("",!0)])}const EO=bt(igt,[["render",agt]]),lgt={data(){return{id:0,loading:!1,isCheckbox:!1,isVisible:!1,categories:[],titles:[],content:"",searchQuery:""}},components:{Discussion:wE,MarkdownRenderer:ap},props:{host:{type:String,required:!1,default:"http://localhost:9600"}},methods:{showSkillsLibrary(){this.isVisible=!0,this.fetchTitles()},closeComponent(){this.isVisible=!1},fetchCategories(){Me.post("/get_skills_library_categories",{client_id:this.$store.state.client_id}).then(n=>{this.categories=n.data.categories}).catch(n=>{console.error("Error fetching categories:",n)})},fetchTitles(){console.log("Fetching categories"),Me.post("/get_skills_library_titles",{client_id:this.$store.state.client_id}).then(n=>{this.titles=n.data.titles,console.log("titles recovered")}).catch(n=>{console.error("Error fetching titles:",n)})},fetchContent(n){Me.post("/get_skills_library_content",{client_id:this.$store.state.client_id,skill_id:n}).then(e=>{const t=e.data.contents[0];this.id=t.id,this.content=t.content}).catch(e=>{console.error("Error fetching content:",e)})},deleteCategory(n){console.log("Delete category")},editCategory(n){console.log("Edit category")},checkUncheckCategory(n){console.log("Unchecked category")},deleteSkill(n){console.log("Delete skill ",n),Me.post("/delete_skill",{client_id:this.$store.state.client_id,skill_id:n}).then(()=>{this.fetchTitles()})},editTitle(n){Me.post("/edit_skill_title",{client_id:this.$store.state.client_id,skill_id:n,title:n}).then(()=>{this.fetchTitles()}),console.log("Edit title")},makeTitle(n){console.log("Make title")},checkUncheckTitle(n){},searchSkills(){}}},cgt={id:"leftPanel",class:"flex flex-row h-full flex-grow shadow-lg rounded"},dgt={class:"min-w-[23rem] max-w-[23rem] z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md overflow-y-scroll no-scrollbar"},ugt={class:"search p-4"},pgt={classclass:"absolute flex flex-col no-scrollbar shadow-lg min-w-[24rem] max-w-[24rem] bg-bg-light-tone dark:bg-bg-dark-tone top-20 left-20 bottom-20 right-20 bg-bg-light shadow-lg rounded"},_gt=u("h2",{class:"text-xl font-bold m-4"},"Titles",-1),hgt={class:"z-0 flex flex-col flex-grow 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"},fgt=u("h2",{class:"text-xl font-bold m-4"},"Content",-1);function mgt(n,e,t,i,s,r){const o=ft("Discussion"),a=ft("MarkdownRenderer");return w(),M("div",{class:Ye([{hidden:!s.isVisible},"absolute flex flex-col no-scrollbar shadow-lg bg-bg-light dark:bg-bg-dark top-20 left-20 bottom-20 right-20 shadow-lg rounded"])},[u("div",cgt,[u("div",dgt,[u("div",ugt,[le(u("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=l=>s.searchQuery=l),placeholder:"Search skills",class:"border border-gray-300 rounded px-2 py-1 mr-2"},null,512),[[Pe,s.searchQuery]]),u("button",{onClick:e[1]||(e[1]=(...l)=>r.searchSkills&&r.searchSkills(...l)),class:"bg-blue-500 text-white rounded px-4 py-1"},"Search")]),u("div",pgt,[_gt,s.titles.length>0?(w(),xt(rs,{key:0,name:"list"},{default:Je(()=>[(w(!0),M($e,null,dt(s.titles,l=>(w(),xt(o,{key:l.id,id:l.id,title:l.title,selected:r.fetchContent(l.id),loading:s.loading,isCheckbox:s.isCheckbox,checkBoxValue:!1,onSelect:d=>r.fetchContent(l.id),onDelete:d=>r.deleteSkill(l.id),onEditTitle:r.editTitle,onMakeTitle:r.makeTitle,onChecked:r.checkUncheckTitle},null,8,["id","title","selected","loading","isCheckbox","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):q("",!0)])]),u("div",hgt,[fgt,Ie(a,{host:t.host,"markdown-text":s.content,message_id:s.id,discussion_id:s.id,client_id:this.$store.state.client_id},null,8,["host","markdown-text","message_id","discussion_id","client_id"])])]),u("button",{onClick:e[2]||(e[2]=(...l)=>r.closeComponent&&r.closeComponent(...l)),class:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1 hover:bg-red-300"},"Close")],2)}const vO=bt(lgt,[["render",mgt]]),ggt={props:{htmlContent:{type:String,required:!0}}},bgt=["innerHTML"];function Egt(n,e,t,i,s,r){return w(),M("div",null,[u("div",{innerHTML:t.htmlContent},null,8,bgt)])}const vgt=bt(ggt,[["render",Egt]]);const ygt={props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Form"}},data(){return{collapsed:!0}},computed:{formattedJson(){return typeof this.jsonData=="string"?JSON.stringify(JSON.parse(this.jsonData),null," ").replace(/\n/g,"
"):JSON.stringify(this.jsonData,null," ").replace(/\n/g,"
")},isObject(){return typeof this.jsonData=="object"&&this.jsonData!==null},isContentPresent(){return this.jsonData!==null&&(typeof this.jsonData!="string"||this.jsonData.trim()!=="")}},methods:{toggleCollapsed(){this.collapsed=!this.collapsed},toggleCollapsible(){this.collapsed=!this.collapsed}}},Sgt={key:0},Tgt={class:"toggle-icon mr-1"},xgt={key:0,class:"fas fa-plus-circle text-gray-600"},Cgt={key:1,class:"fas fa-minus-circle text-gray-600"},Rgt={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},Agt={key:0,class:"fas fa-plus-circle text-gray-600"},wgt={key:1,class:"fas fa-minus-circle text-gray-600"},Ngt=["innerHTML"];function Ogt(n,e,t,i,s,r){return r.isContentPresent?(w(),M("div",Sgt,[u("div",{class:"collapsible-section cursor-pointer mb-4 font-bold hover:text-gray-900",onClick:e[0]||(e[0]=(...o)=>r.toggleCollapsible&&r.toggleCollapsible(...o))},[u("span",Tgt,[s.collapsed?(w(),M("i",xgt)):(w(),M("i",Cgt))]),Ze(" "+ge(t.jsonFormText),1)]),le(u("div",null,[u("div",Rgt,[r.isObject?(w(),M("span",{key:0,onClick:e[1]||(e[1]=(...o)=>r.toggleCollapsed&&r.toggleCollapsed(...o)),class:"toggle-icon cursor-pointer mr-1"},[s.collapsed?(w(),M("i",Agt)):(w(),M("i",wgt))])):q("",!0),u("pre",{innerHTML:r.formattedJson},null,8,Ngt)])],512),[[Mt,!s.collapsed]])])):q("",!0)}const Igt=bt(ygt,[["render",Ogt]]),Mgt={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0},step_type:{type:String,required:!1,default:"start_end"}}},Dgt={class:"flex items-start"},kgt={class:"step flex items-center mb-4"},Lgt={key:0,class:"flex items-center justify-center w-6 h-6 mr-2"},Pgt={key:0},Ugt=u("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),Fgt=[Ugt],Bgt={key:1},Ggt=u("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),zgt=[Ggt],Vgt={key:2},Hgt=u("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),qgt=[Hgt],Ygt={key:1,role:"status",class:"m-15"},$gt=u("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"},[u("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"}),u("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),Wgt=[$gt],Kgt={class:"text-sm"};function jgt(n,e,t,i,s,r){return w(),M("div",Dgt,[u("div",kgt,[t.step_type=="start_end"?(w(),M("div",Lgt,[t.done?q("",!0):(w(),M("div",Pgt,Fgt)),t.done&&t.status?(w(),M("div",Bgt,zgt)):q("",!0),t.done&&!t.status?(w(),M("div",Vgt,qgt)):q("",!0)])):q("",!0),t.done?q("",!0):(w(),M("div",Ygt,Wgt)),u("h3",Kgt,ge(t.message),1)])])}const Qgt=bt(Mgt,[["render",jgt]]),Xgt="/assets/process-61f7a21b.svg",Zgt="/assets/ok-a0b56451.svg",Jgt="/assets/failed-183609e7.svg",yO="/assets/send_globe-775ba9b7.svg";const ebt="/",tbt={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:ap,Step:Qgt,RenderHTMLJS:vgt,JsonViewer:Igt,DynamicUIRenderer:bO},props:{host:{type:String,required:!1,default:"http://localhost:9600"},message:Object,avatar:{default:""}},data(){return{isSynthesizingVoice:!1,cpp_block:uO,html5_block:pO,LaTeX_block:_O,json_block:dO,javascript_block:cO,process_svg:Xgt,ok_svg:Zgt,failed_svg:Jgt,loading_svg:fO,sendGlobe:yO,code_block:aO,python_block:lO,bash_block:hO,audio_url:null,audio:null,msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode_:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){if("speechSynthesis"in window?(this.speechSynthesis=window.speechSynthesis,this.voices=this.speechSynthesis.getVoices(),this.voices.length===0&&this.speechSynthesis.addEventListener("voiceschanged",this.onVoicesChanged)):console.error("Speech synthesis is not supported in this browser."),Ve(()=>{qe.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight}),console.log("Checking metadata"),console.log(this.message),Object.prototype.hasOwnProperty.call(this.message,"metadata")&&this.message.metadata!=null){console.log("Metadata found!"),Array.isArray(this.message.metadata)||(this.message.metadata=[]),console.log(typeof this.message.metadata),console.log(this.message.metadata);for(let n of this.message.metadata)Object.prototype.hasOwnProperty.call(n,"audio_url")&&n.audio_url!=null&&(this.audio_url=n.audio_url,console.log("Audio URL:",this.audio_url))}},methods:{insertTab(n){const e=n.target,t=e.selectionStart,i=e.selectionEnd,s=n.shiftKey;if(t===i)if(s){if(e.value.substring(t-4,t)==" "){const r=e.value.substring(0,t-4),o=e.value.substring(i),a=r+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t-4})}}else{const r=e.value.substring(0,t),o=e.value.substring(i),a=r+" "+o;this.message.content=a,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4})}else{const o=e.value.substring(t,i).split(` `).map(c=>c.trim()===""?c:s?c.startsWith(" ")?c.substring(4):c:" "+c),a=e.value.substring(0,t),l=e.value.substring(i),d=a+o.join(` `)+l;this.message.content=d,this.$nextTick(()=>{e.selectionStart=t,e.selectionEnd=i+o.length*4})}n.preventDefault()},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){this.isSynthesizingVoice?(this.isSynthesizingVoice=!1,this.$refs.audio_player.pause()):(this.isSynthesizingVoice=!0,Me.post("./text2Audio",{text:this.message.content}).then(n=>{this.isSynthesizingVoice=!1;let e=n.data.url;console.log(e),this.audio_url=e,this.message.metadata||(this.message.metadata=[]);let t=!1;for(let i of this.message.metadata)Object.prototype.hasOwnProperty.call(i,"audio_url")&&(i.audio_url=this.audio_url,t=!0);t||this.message.metadata.push({audio_url:this.audio_url}),this.$emit("updateMessage",this.message.id,this.message.content,this.audio_url)}).catch(n=>{this.$store.state.toast.showToast(`Error: ${n}`,4,!1),this.isSynthesizingVoice=!1}))},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let n=0;console.log("voice on"),this.isSpeaking=!0;const e=200;this.message.content,this.msg=new SpeechSynthesisUtterance,this.msg.pitch=this.$store.state.config.audio_pitch,this.voices.length>0&&(this.msg.voice=this.voices.filter(s=>s.name===this.$store.state.config.audio_out_voice)[0]);const t=s=>{let r=this.message.content.substring(s,s+e);const o=[".","!","?",` `];let a=-1;return o.forEach(l=>{const d=r.lastIndexOf(l);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+s+1},i=()=>{if(this.message.content.includes(".")){const s=t(n),r=this.message.content.substring(n,s);this.msg.text=r,n=s+1,this.msg.onend=o=>{n{i()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",s))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{i()},1)};i()},toggleModel(){this.expanded=!this.expanded},addBlock(n){let e=this.$refs.mdTextarea.selectionStart,t=this.$refs.mdTextarea.selectionEnd;e==t?speechSynthesis==0||this.message.content[e-1]==` `?(this.message.content=this.message.content.slice(0,e)+"```"+n+"\n\n```\n"+this.message.content.slice(e),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+"\n```"+n+"\n\n```\n"+this.message.content.slice(e),e=e+3+n.length):speechSynthesis==0||this.message.content[e-1]==` `?(this.message.content=this.message.content.slice(0,e)+"```"+n+` `+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+"\n```"+n+` -`+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?Zgt+this.avatar:(console.log("No avatar found"),ga)},defaultImg(n){n.target.src=ga},parseDate(n){let e=new Date(Date.parse(n)),i=Math.floor((new Date-e)/1e3);return i<=1?"just now":i<20?i+" seconds ago":i<40?"half a minute ago":i<60?"less than a minute ago":i<=90?"one minute ago":i<=3540?Math.round(i/60)+" minutes ago":i<=5400?"1 hour ago":i<=86400?Math.round(i/3600)+" hours ago":i<=129600?"1 day ago":i<604800?Math.round(i/86400)+" days ago":i<=777600?"1 week ago":n},prettyDate(n){let e=new Date((n||"").replace(/-/g,"/").replace(/[TZ]/g," ")),t=(new Date().getTime()-e.getTime())/1e3,i=Math.floor(t/86400);if(!(isNaN(i)||i<0||i>=31))return i==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")||i==1&&"Yesterday"||i<7&&i+" days ago"||i<31&&Math.ceil(i/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.isSpeaking||this.checkForFullSentence())},"message.ui":function(n){console.log("ui changed"),console.log(this.message.ui)},showConfirmation(){Ve(()=>{qe.replace()})},deleteMsgMode(){Ve(()=>{qe.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,Ve(()=>{qe.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.created_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===n.getTime()||!e.getTime())return;let i=e.getTime()-n.getTime();const s=Math.floor(i/(1e3*60*60));i-=s*(1e3*60*60);const r=Math.floor(i/(1e3*60));i-=r*(1e3*60);const o=Math.floor(i/1e3);i-=o*1e3;function a(d){return d<10&&(d="0"+d),d}return a(s)+"h:"+a(r)+"m:"+a(o)+"s"}}},ebt={class:"relative 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 even:bg-bg-light-discussion-odd dark:even:bg-bg-dark-discussion-odd flex flex-col flex-grow flex-wrap overflow-visible p-4 pb-2"},tbt={class:"flex flex-row gap-2"},nbt={class:"flex-shrink-0"},ibt={class:"group/avatar"},sbt=["src","data-popover-target"],rbt={class:"flex flex-col w-full flex-grow-0"},obt={class:"flex flex-row flex-grow items-start"},abt={class:"flex flex-col mb-2"},lbt={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},cbt=["title"],dbt=u("div",{class:"flex-grow"},null,-1),ubt={class:"flex-row justify-end mx-2"},pbt={class:"invisible group-hover:visible flex flex-row"},_bt={key:0,class:"flex items-center duration-75"},hbt=u("i",{"data-feather":"x"},null,-1),fbt=[hbt],mbt=u("i",{"data-feather":"check"},null,-1),gbt=[mbt],bbt=u("i",{"data-feather":"edit"},null,-1),Ebt=[bbt],vbt=["src"],ybt=["src"],Sbt=["src"],Tbt=["src"],xbt=["src"],Cbt=["src"],Rbt=["src"],Abt=["src"],wbt=u("i",{"data-feather":"copy"},null,-1),Nbt=[wbt],Obt=u("i",{"data-feather":"send"},null,-1),Ibt=[Obt],Mbt=["src"],Dbt=u("i",{"data-feather":"send"},null,-1),kbt=[Dbt],Lbt=u("i",{"data-feather":"fast-forward"},null,-1),Pbt=[Lbt],Ubt={key:14,class:"flex items-center duration-75"},Fbt=u("i",{"data-feather":"x"},null,-1),Bbt=[Fbt],Gbt=u("i",{"data-feather":"check"},null,-1),zbt=[Gbt],Vbt=u("i",{"data-feather":"trash"},null,-1),Hbt=[Vbt],qbt=u("i",{"data-feather":"thumbs-up"},null,-1),Ybt=[qbt],$bt={class:"flex flex-row items-center"},Wbt=u("i",{"data-feather":"thumbs-down"},null,-1),Kbt=[Wbt],jbt={class:"flex flex-row items-center"},Qbt=u("i",{"data-feather":"volume-2"},null,-1),Xbt=[Qbt],Zbt={class:"flex flex-row items-center"},Jbt=u("i",{"data-feather":"voicemail"},null,-1),eEt=[Jbt],tEt=["src"],nEt={class:"overflow-x-auto w-full"},iEt={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 svelte-1escu1z"},sEt={class:"grid min-w-72 select-none grid-cols-[40px,1fr] items-center gap-2.5 p-2 svelte-1escu1z"},rEt={class:"relative grid aspect-square place-content-center overflow-hidden rounded-lg bg-gray-300 dark:bg-gray-200"},oEt=["src"],aEt=["src"],lEt=["src"],cEt={class:"leading-4"},dEt=u("dd",{class:"text-sm"},"Processing infos",-1),uEt={class:"flex items-center gap-1 truncate whitespace-nowrap text-[.82rem] text-gray-400"},pEt={class:"content px-5 pb-5 pt-4"},_Et={class:"list-none"},hEt=u("div",{class:"flex flex-col items-start w-full"},null,-1),fEt={class:"flex flex-col items-start w-full"},mEt=["src"],gEt={class:"text-sm text-gray-400 mt-2"},bEt={class:"flex flex-row items-center gap-2"},EEt={key:0},vEt={class:"font-thin"},yEt={key:1},SEt={class:"font-thin"},TEt={key:2},xEt={class:"font-thin"},CEt={key:3},REt=["title"];function AEt(n,e,t,i,s,r){const o=ft("Step"),a=ft("RenderHTMLJS"),l=ft("MarkdownRenderer"),d=ft("DynamicUIRenderer");return w(),M("div",ebt,[u("div",tbt,[u("div",nbt,[u("div",ibt,[u("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=c=>r.defaultImg(c)),"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,sbt)])]),u("div",rbt,[u("div",obt,[u("div",abt,[u("div",lbt,ge(t.message.sender)+" ",1),t.message.created_at?(w(),M("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},ge(r.created_at),9,cbt)):q("",!0)]),dbt,u("div",ubt,[u("div",pbt,[r.editMsgMode?(w(),M("div",_bt,[u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2",title:"Cancel edit",type:"button",onClick:e[1]||(e[1]=Te(c=>r.editMsgMode=!1,["stop"]))},fbt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Update message",type:"button",onClick:e[2]||(e[2]=Te((...c)=>r.updateMessage&&r.updateMessage(...c),["stop"]))},gbt)])):q("",!0),r.editMsgMode?q("",!0):(w(),M("div",{key:1,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Edit message",onClick:e[3]||(e[3]=Te(c=>r.editMsgMode=!0,["stop"]))},Ebt)),r.editMsgMode?(w(),M("div",{key:2,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add generic block",onClick:e[4]||(e[4]=Te(c=>r.addBlock(""),["stop"]))},[u("img",{src:s.code_block,width:"25",height:"25"},null,8,vbt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:3,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add python block",onClick:e[5]||(e[5]=Te(c=>r.addBlock("python"),["stop"]))},[u("img",{src:s.python_block,width:"25",height:"25"},null,8,ybt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:4,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add javascript block",onClick:e[6]||(e[6]=Te(c=>r.addBlock("javascript"),["stop"]))},[u("img",{src:s.javascript_block,width:"25",height:"25"},null,8,Sbt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:5,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add json block",onClick:e[7]||(e[7]=Te(c=>r.addBlock("json"),["stop"]))},[u("img",{src:s.json_block,width:"25",height:"25"},null,8,Tbt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:6,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add c++ block",onClick:e[8]||(e[8]=Te(c=>r.addBlock("c++"),["stop"]))},[u("img",{src:s.cpp_block,width:"25",height:"25"},null,8,xbt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:7,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add html block",onClick:e[9]||(e[9]=Te(c=>r.addBlock("html"),["stop"]))},[u("img",{src:s.html5_block,width:"25",height:"25"},null,8,Cbt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:8,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add LaTex block",onClick:e[10]||(e[10]=Te(c=>r.addBlock("latex"),["stop"]))},[u("img",{src:s.LaTeX_block,width:"25",height:"25"},null,8,Rbt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:9,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add bash block",onClick:e[11]||(e[11]=Te(c=>r.addBlock("bash"),["stop"]))},[u("img",{src:s.bash_block,width:"25",height:"25"},null,8,Abt)])):q("",!0),u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Copy message to clipboard",onClick:e[12]||(e[12]=Te(c=>r.copyContentToClipboard(),["stop"]))},Nbt),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(w(),M("div",{key:10,class:Ye(["text-lg text-red-500 hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",{"text-5xl":r.editMsgMode}]),title:"Resend message with full context",onClick:e[13]||(e[13]=Te(c=>r.resendMessage("full_context"),["stop"]))},Ibt,2)):q("",!0),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(w(),M("div",{key:11,class:Ye(["text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",{"text-5xl":r.editMsgMode}]),title:"Resend message without the full context",onClick:e[14]||(e[14]=Te(c=>r.resendMessage("full_context_with_internet"),["stop"]))},[u("img",{src:s.sendGlobe,width:"25",height:"25"},null,8,Mbt)],2)):q("",!0),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(w(),M("div",{key:12,class:Ye(["text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",{"text-5xl":r.editMsgMode}]),title:"Resend message without the full context",onClick:e[15]||(e[15]=Te(c=>r.resendMessage("simple_question"),["stop"]))},kbt,2)):q("",!0),!r.editMsgMode&&t.message.sender==this.$store.state.mountedPers.name?(w(),M("div",{key:13,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Resend message",onClick:e[16]||(e[16]=Te(c=>r.continueMessage(),["stop"]))},Pbt)):q("",!0),s.deleteMsgMode?(w(),M("div",Ubt,[u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Cancel removal",type:"button",onClick:e[17]||(e[17]=Te(c=>s.deleteMsgMode=!1,["stop"]))},Bbt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Confirm removal",type:"button",onClick:e[18]||(e[18]=Te(c=>r.deleteMsg(),["stop"]))},zbt)])):q("",!0),!r.editMsgMode&&!s.deleteMsgMode?(w(),M("div",{key:15,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Remove message",onClick:e[19]||(e[19]=c=>s.deleteMsgMode=!0)},Hbt)):q("",!0),u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Upvote",onClick:e[20]||(e[20]=Te(c=>r.rankUp(),["stop"]))},Ybt),u("div",$bt,[u("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Downvote",onClick:e[21]||(e[21]=Te(c=>r.rankDown(),["stop"]))},Kbt),t.message.rank!=0?(w(),M("div",{key:0,class:Ye(["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"},ge(t.message.rank),3)):q("",!0)]),u("div",jbt,[u("div",{class:Ye(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[22]||(e[22]=Te(c=>r.speak(),["stop"]))},Xbt,2)]),u("div",Zbt,[s.isSynthesizingVoice?(w(),M("img",{key:1,src:s.loading_svg},null,8,tEt)):(w(),M("div",{key:0,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"read",onClick:e[23]||(e[23]=Te(c=>r.read(),["stop"]))},eEt))])])])]),u("div",nEt,[le(u("details",iEt,[u("summary",sEt,[u("div",rEt,[t.message.status_message!="Done"&t.message.status_message!="Generation canceled"?(w(),M("img",{key:0,src:s.loading_svg,class:"absolute inset-0 text-gray-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,oEt)):q("",!0),t.message.status_message=="Generation canceled"?(w(),M("img",{key:1,src:s.failed_svg,class:"absolute inset-0 text-gray-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,aEt)):q("",!0),t.message.status_message=="Done"?(w(),M("img",{key:2,src:s.ok_svg,class:"absolute m-2 w-6 inset-0 text-geen-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,lEt)):q("",!0)]),u("dl",cEt,[dEt,u("dt",uEt,ge(t.message==null?"":t.message.status_message),1)])]),u("div",pEt,[u("ol",_Et,[(w(!0),M($e,null,dt(t.message.steps,(c,_)=>(w(),M("div",{key:"step-"+t.message.id+"-"+_,class:"group border-l pb-6 last:!border-transparent last:pb-0 dark:border-gray-800",style:Jt({backgroundColor:c.done?"transparent":"inherit"})},[Ie(o,{done:c.done,message:c.message,status:c.status,step_type:c.type},null,8,["done","message","status","step_type"])],4))),128))])])],512),[[Mt,t.message!=null&&t.message.steps!=null&&t.message.steps.length>0]]),hEt,u("div",fEt,[(w(!0),M($e,null,dt(t.message.html_js_s,(c,_)=>(w(),M("div",{key:"htmljs-"+t.message.id+"-"+_,class:"htmljs font-bold",style:Jt({backgroundColor:n.step.done?"transparent":"inherit"})},[Ie(a,{htmlContent:c},null,8,["htmlContent"])],4))),128))]),r.editMsgMode?q("",!0):(w(),xt(l,{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"])),u("div",null,[t.message.open?le((w(),M("textarea",{key:0,ref:"mdTextarea",onKeydown:e[24]||(e[24]=wr(Te((...c)=>r.insertTab&&r.insertTab(...c),["prevent"]),["tab"])),class:"block min-h-[900px] 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,style:Jt({minHeight:s.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[25]||(e[25]=c=>t.message.content=c)},`\r - `,36)),[[Pe,t.message.content]]):q("",!0)]),t.message.ui!==null&&t.message.ui!==void 0&&t.message.ui!==""?(w(),xt(d,{key:1,class:"w-full h-full",code:t.message.ui},null,8,["code"])):q("",!0),s.audio_url!=null?(w(),M("audio",{controls:"",autoplay:"",key:s.audio_url},[u("source",{src:s.audio_url,type:"audio/wav",ref:"audio_player"},null,8,mEt),Ze(" Your browser does not support the audio element. ")])):q("",!0)]),u("div",gEt,[u("div",bEt,[t.message.binding?(w(),M("p",EEt,[Ze("Binding: "),u("span",vEt,ge(t.message.binding),1)])):q("",!0),t.message.model?(w(),M("p",yEt,[Ze("Model: "),u("span",SEt,ge(t.message.model),1)])):q("",!0),t.message.seed?(w(),M("p",TEt,[Ze("Seed: "),u("span",xEt,ge(t.message.seed),1)])):q("",!0),r.time_spent?(w(),M("p",CEt,[Ze("Time spent: "),u("span",{class:"font-thin",title:"Finished generating: "+r.finished_generating_at_parsed},ge(r.time_spent),9,REt)])):q("",!0)])])])])])}const SO=bt(Jgt,[["render",AEt]]),wEt="/";Me.defaults.baseURL="/";const NEt={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{Toast:fc,UniversalForm:Ec},data(){return{bUrl:wEt,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:{onSettingsPersonality(n){try{Me.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{Me.post("/set_active_personality_settings",t).then(i=>{i&&i.data?(console.log("personality set with new settings",i.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. +`+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?ebt+this.avatar:(console.log("No avatar found"),ga)},defaultImg(n){n.target.src=ga},parseDate(n){let e=new Date(Date.parse(n)),i=Math.floor((new Date-e)/1e3);return i<=1?"just now":i<20?i+" seconds ago":i<40?"half a minute ago":i<60?"less than a minute ago":i<=90?"one minute ago":i<=3540?Math.round(i/60)+" minutes ago":i<=5400?"1 hour ago":i<=86400?Math.round(i/3600)+" hours ago":i<=129600?"1 day ago":i<604800?Math.round(i/86400)+" days ago":i<=777600?"1 week ago":n},prettyDate(n){let e=new Date((n||"").replace(/-/g,"/").replace(/[TZ]/g," ")),t=(new Date().getTime()-e.getTime())/1e3,i=Math.floor(t/86400);if(!(isNaN(i)||i<0||i>=31))return i==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")||i==1&&"Yesterday"||i<7&&i+" days ago"||i<31&&Math.ceil(i/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.isSpeaking||this.checkForFullSentence())},"message.ui":function(n){console.log("ui changed"),console.log(this.message.ui)},showConfirmation(){Ve(()=>{qe.replace()})},deleteMsgMode(){Ve(()=>{qe.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,Ve(()=>{qe.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.created_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===n.getTime()||!e.getTime())return;let i=e.getTime()-n.getTime();const s=Math.floor(i/(1e3*60*60));i-=s*(1e3*60*60);const r=Math.floor(i/(1e3*60));i-=r*(1e3*60);const o=Math.floor(i/1e3);i-=o*1e3;function a(d){return d<10&&(d="0"+d),d}return a(s)+"h:"+a(r)+"m:"+a(o)+"s"}}},nbt={class:"relative 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 even:bg-bg-light-discussion-odd dark:even:bg-bg-dark-discussion-odd flex flex-col flex-grow flex-wrap overflow-visible p-4 pb-2"},ibt={class:"flex flex-row gap-2"},sbt={class:"flex-shrink-0"},rbt={class:"group/avatar"},obt=["src","data-popover-target"],abt={class:"flex flex-col w-full flex-grow-0"},lbt={class:"flex flex-row flex-grow items-start"},cbt={class:"flex flex-col mb-2"},dbt={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},ubt=["title"],pbt=u("div",{class:"flex-grow"},null,-1),_bt={class:"flex-row justify-end mx-2"},hbt={class:"invisible group-hover:visible flex flex-row"},fbt={key:0,class:"flex items-center duration-75"},mbt=u("i",{"data-feather":"x"},null,-1),gbt=[mbt],bbt=u("i",{"data-feather":"check"},null,-1),Ebt=[bbt],vbt=u("i",{"data-feather":"edit"},null,-1),ybt=[vbt],Sbt=["src"],Tbt=["src"],xbt=["src"],Cbt=["src"],Rbt=["src"],Abt=["src"],wbt=["src"],Nbt=["src"],Obt=u("i",{"data-feather":"copy"},null,-1),Ibt=[Obt],Mbt=u("i",{"data-feather":"send"},null,-1),Dbt=[Mbt],kbt=["src"],Lbt=u("i",{"data-feather":"send"},null,-1),Pbt=[Lbt],Ubt=u("i",{"data-feather":"fast-forward"},null,-1),Fbt=[Ubt],Bbt={key:14,class:"flex items-center duration-75"},Gbt=u("i",{"data-feather":"x"},null,-1),zbt=[Gbt],Vbt=u("i",{"data-feather":"check"},null,-1),Hbt=[Vbt],qbt=u("i",{"data-feather":"trash"},null,-1),Ybt=[qbt],$bt=u("i",{"data-feather":"thumbs-up"},null,-1),Wbt=[$bt],Kbt={class:"flex flex-row items-center"},jbt=u("i",{"data-feather":"thumbs-down"},null,-1),Qbt=[jbt],Xbt={class:"flex flex-row items-center"},Zbt=u("i",{"data-feather":"volume-2"},null,-1),Jbt=[Zbt],eEt={class:"flex flex-row items-center"},tEt=u("i",{"data-feather":"voicemail"},null,-1),nEt=[tEt],iEt=["src"],sEt={class:"overflow-x-auto w-full"},rEt={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 svelte-1escu1z"},oEt={class:"grid min-w-72 select-none grid-cols-[40px,1fr] items-center gap-2.5 p-2 svelte-1escu1z"},aEt={class:"relative grid aspect-square place-content-center overflow-hidden rounded-lg bg-gray-300 dark:bg-gray-200"},lEt=["src"],cEt=["src"],dEt=["src"],uEt={class:"leading-4"},pEt=u("dd",{class:"text-sm"},"Processing infos",-1),_Et={class:"flex items-center gap-1 truncate whitespace-nowrap text-[.82rem] text-gray-400"},hEt={class:"content px-5 pb-5 pt-4"},fEt={class:"list-none"},mEt=u("div",{class:"flex flex-col items-start w-full"},null,-1),gEt={class:"flex flex-col items-start w-full"},bEt=["src"],EEt={class:"text-sm text-gray-400 mt-2"},vEt={class:"flex flex-row items-center gap-2"},yEt={key:0},SEt={class:"font-thin"},TEt={key:1},xEt={class:"font-thin"},CEt={key:2},REt={class:"font-thin"},AEt={key:3},wEt=["title"];function NEt(n,e,t,i,s,r){const o=ft("Step"),a=ft("RenderHTMLJS"),l=ft("MarkdownRenderer"),d=ft("DynamicUIRenderer");return w(),M("div",nbt,[u("div",ibt,[u("div",sbt,[u("div",rbt,[u("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=c=>r.defaultImg(c)),"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,obt)])]),u("div",abt,[u("div",lbt,[u("div",cbt,[u("div",dbt,ge(t.message.sender)+" ",1),t.message.created_at?(w(),M("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},ge(r.created_at),9,ubt)):q("",!0)]),pbt,u("div",_bt,[u("div",hbt,[r.editMsgMode?(w(),M("div",fbt,[u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2",title:"Cancel edit",type:"button",onClick:e[1]||(e[1]=Te(c=>r.editMsgMode=!1,["stop"]))},gbt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Update message",type:"button",onClick:e[2]||(e[2]=Te((...c)=>r.updateMessage&&r.updateMessage(...c),["stop"]))},Ebt)])):q("",!0),r.editMsgMode?q("",!0):(w(),M("div",{key:1,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Edit message",onClick:e[3]||(e[3]=Te(c=>r.editMsgMode=!0,["stop"]))},ybt)),r.editMsgMode?(w(),M("div",{key:2,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add generic block",onClick:e[4]||(e[4]=Te(c=>r.addBlock(""),["stop"]))},[u("img",{src:s.code_block,width:"25",height:"25"},null,8,Sbt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:3,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer hover:border-2",title:"Add python block",onClick:e[5]||(e[5]=Te(c=>r.addBlock("python"),["stop"]))},[u("img",{src:s.python_block,width:"25",height:"25"},null,8,Tbt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:4,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add javascript block",onClick:e[6]||(e[6]=Te(c=>r.addBlock("javascript"),["stop"]))},[u("img",{src:s.javascript_block,width:"25",height:"25"},null,8,xbt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:5,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add json block",onClick:e[7]||(e[7]=Te(c=>r.addBlock("json"),["stop"]))},[u("img",{src:s.json_block,width:"25",height:"25"},null,8,Cbt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:6,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add c++ block",onClick:e[8]||(e[8]=Te(c=>r.addBlock("c++"),["stop"]))},[u("img",{src:s.cpp_block,width:"25",height:"25"},null,8,Rbt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:7,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add html block",onClick:e[9]||(e[9]=Te(c=>r.addBlock("html"),["stop"]))},[u("img",{src:s.html5_block,width:"25",height:"25"},null,8,Abt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:8,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add LaTex block",onClick:e[10]||(e[10]=Te(c=>r.addBlock("latex"),["stop"]))},[u("img",{src:s.LaTeX_block,width:"25",height:"25"},null,8,wbt)])):q("",!0),r.editMsgMode?(w(),M("div",{key:9,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add bash block",onClick:e[11]||(e[11]=Te(c=>r.addBlock("bash"),["stop"]))},[u("img",{src:s.bash_block,width:"25",height:"25"},null,8,Nbt)])):q("",!0),u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Copy message to clipboard",onClick:e[12]||(e[12]=Te(c=>r.copyContentToClipboard(),["stop"]))},Ibt),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(w(),M("div",{key:10,class:Ye(["text-lg text-red-500 hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",{"text-5xl":r.editMsgMode}]),title:"Resend message with full context",onClick:e[13]||(e[13]=Te(c=>r.resendMessage("full_context"),["stop"]))},Dbt,2)):q("",!0),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(w(),M("div",{key:11,class:Ye(["text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",{"text-5xl":r.editMsgMode}]),title:"Resend message without the full context",onClick:e[14]||(e[14]=Te(c=>r.resendMessage("full_context_with_internet"),["stop"]))},[u("img",{src:s.sendGlobe,width:"25",height:"25"},null,8,kbt)],2)):q("",!0),!r.editMsgMode&&t.message.sender!=this.$store.state.mountedPers.name?(w(),M("div",{key:12,class:Ye(["text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",{"text-5xl":r.editMsgMode}]),title:"Resend message without the full context",onClick:e[15]||(e[15]=Te(c=>r.resendMessage("simple_question"),["stop"]))},Pbt,2)):q("",!0),!r.editMsgMode&&t.message.sender==this.$store.state.mountedPers.name?(w(),M("div",{key:13,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Resend message",onClick:e[16]||(e[16]=Te(c=>r.continueMessage(),["stop"]))},Fbt)):q("",!0),s.deleteMsgMode?(w(),M("div",Bbt,[u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Cancel removal",type:"button",onClick:e[17]||(e[17]=Te(c=>s.deleteMsgMode=!1,["stop"]))},zbt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Confirm removal",type:"button",onClick:e[18]||(e[18]=Te(c=>r.deleteMsg(),["stop"]))},Hbt)])):q("",!0),!r.editMsgMode&&!s.deleteMsgMode?(w(),M("div",{key:15,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Remove message",onClick:e[19]||(e[19]=c=>s.deleteMsgMode=!0)},Ybt)):q("",!0),u("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Upvote",onClick:e[20]||(e[20]=Te(c=>r.rankUp(),["stop"]))},Wbt),u("div",Kbt,[u("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"Downvote",onClick:e[21]||(e[21]=Te(c=>r.rankDown(),["stop"]))},Qbt),t.message.rank!=0?(w(),M("div",{key:0,class:Ye(["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"},ge(t.message.rank),3)):q("",!0)]),u("div",Xbt,[u("div",{class:Ye(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[22]||(e[22]=Te(c=>r.speak(),["stop"]))},Jbt,2)]),u("div",eEt,[s.isSynthesizingVoice?(w(),M("img",{key:1,src:s.loading_svg},null,8,iEt)):(w(),M("div",{key:0,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2 cursor-pointer",title:"read",onClick:e[23]||(e[23]=Te(c=>r.read(),["stop"]))},nEt))])])])]),u("div",sEt,[le(u("details",rEt,[u("summary",oEt,[u("div",aEt,[t.message.status_message!="Done"&t.message.status_message!="Generation canceled"?(w(),M("img",{key:0,src:s.loading_svg,class:"absolute inset-0 text-gray-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,lEt)):q("",!0),t.message.status_message=="Generation canceled"?(w(),M("img",{key:1,src:s.failed_svg,class:"absolute inset-0 text-gray-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,cEt)):q("",!0),t.message.status_message=="Done"?(w(),M("img",{key:2,src:s.ok_svg,class:"absolute m-2 w-6 inset-0 text-geen-100 transition-opacity dark:text-gray-800 opacity-100"},null,8,dEt)):q("",!0)]),u("dl",uEt,[pEt,u("dt",_Et,ge(t.message==null?"":t.message.status_message),1)])]),u("div",hEt,[u("ol",fEt,[(w(!0),M($e,null,dt(t.message.steps,(c,_)=>(w(),M("div",{key:"step-"+t.message.id+"-"+_,class:"group border-l pb-6 last:!border-transparent last:pb-0 dark:border-gray-800",style:Jt({backgroundColor:c.done?"transparent":"inherit"})},[Ie(o,{done:c.done,message:c.message,status:c.status,step_type:c.type},null,8,["done","message","status","step_type"])],4))),128))])])],512),[[Mt,t.message!=null&&t.message.steps!=null&&t.message.steps.length>0]]),mEt,u("div",gEt,[(w(!0),M($e,null,dt(t.message.html_js_s,(c,_)=>(w(),M("div",{key:"htmljs-"+t.message.id+"-"+_,class:"htmljs font-bold",style:Jt({backgroundColor:n.step.done?"transparent":"inherit"})},[Ie(a,{htmlContent:c},null,8,["htmlContent"])],4))),128))]),r.editMsgMode?q("",!0):(w(),xt(l,{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"])),u("div",null,[t.message.open?le((w(),M("textarea",{key:0,ref:"mdTextarea",onKeydown:e[24]||(e[24]=wr(Te((...c)=>r.insertTab&&r.insertTab(...c),["prevent"]),["tab"])),class:"block min-h-[900px] 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,style:Jt({minHeight:s.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[25]||(e[25]=c=>t.message.content=c)},`\r + `,36)),[[Pe,t.message.content]]):q("",!0)]),t.message.ui!==null&&t.message.ui!==void 0&&t.message.ui!==""?(w(),xt(d,{key:1,class:"w-full h-full",code:t.message.ui},null,8,["code"])):q("",!0),s.audio_url!=null?(w(),M("audio",{controls:"",autoplay:"",key:s.audio_url},[u("source",{src:s.audio_url,type:"audio/wav",ref:"audio_player"},null,8,bEt),Ze(" Your browser does not support the audio element. ")])):q("",!0)]),u("div",EEt,[u("div",vEt,[t.message.binding?(w(),M("p",yEt,[Ze("Binding: "),u("span",SEt,ge(t.message.binding),1)])):q("",!0),t.message.model?(w(),M("p",TEt,[Ze("Model: "),u("span",xEt,ge(t.message.model),1)])):q("",!0),t.message.seed?(w(),M("p",CEt,[Ze("Seed: "),u("span",REt,ge(t.message.seed),1)])):q("",!0),r.time_spent?(w(),M("p",AEt,[Ze("Time spent: "),u("span",{class:"font-thin",title:"Finished generating: "+r.finished_generating_at_parsed},ge(r.time_spent),9,wEt)])):q("",!0)])])])])])}const SO=bt(tbt,[["render",NEt]]),OEt="/";Me.defaults.baseURL="/";const IEt={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{Toast:fc,UniversalForm:Ec},data(){return{bUrl:OEt,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:{onSettingsPersonality(n){try{Me.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{Me.post("/set_active_personality_settings",t).then(i=>{i&&i.data?(console.log("personality set with new settings",i.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. `+i,4,!1)})}catch(i){this.$refs.toast.showToast(`Did not get Personality settings responses. - Endpoint error: `+i.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)}},toggleShowPersList(){this.onShowPersList()},async constructor(){for(Ve(()=>{qe.replace()});this.$store.state.ready===!1;)await new Promise(n=>setTimeout(n,100));this.onReady()},async api_get_req(n){try{const e=await Me.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=yc}}},OEt={class:"w-fit select-none"},IEt={key:0,class:"flex -space-x-4"},MEt=["src","title"],DEt={key:1,class:"flex -space-x-4"},kEt=["src","title"],LEt={key:2,title:"Loading personalities"},PEt=u("div",{role:"status"},[u("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"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1),UEt=[PEt];function FEt(n,e,t,i,s,r){const o=ft("UniversalForm");return w(),M($e,null,[u("div",OEt,[r.mountedPersArr.length>1?(w(),M("div",IEt,[u("img",{src:s.bUrl+r.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-secondary cursor-pointer",title:"Active personality: "+r.mountedPers.name,onClick:e[1]||(e[1]=a=>r.onSettingsPersonality(r.mountedPers))},null,40,MEt),u("div",{class:"flex items-center justify-center w-8 h-8 cursor-pointer text-xs font-medium bg-bg-light dark:bg-bg-dark border-2 hover:border-secondary rounded-full hover:bg-bg-light-tone dark:hover:bg-bg-dark-tone dark:border-gray-800 hover:z-20 hover:-translate-y-2 duration-150 active:scale-90",onClick:e[2]||(e[2]=Te((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+ge(r.mountedPersArr.length-1),1)])):q("",!0),r.mountedPersArr.length==1?(w(),M("div",DEt,[u("img",{src:s.bUrl+this.$store.state.mountedPers.avatar,onError:e[3]||(e[3]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 cursor-pointer border-secondary",title:"Active personality: "+this.$store.state.mountedPers.name,onClick:e[4]||(e[4]=Te((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"]))},null,40,kEt)])):q("",!0),r.mountedPersArr.length==0?(w(),M("div",LEt,UEt)):q("",!0)]),Ie(o,{ref:"universalForm",class:"z-20"},null,512)],64)}const BEt=bt(NEt,[["render",FEt]]);const GEt="/";Me.defaults.baseURL="/";const zEt={props:{onTalk:Function,onMounted:Function,onUnmounted:Function,onRemounted:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:gO,Toast:fc,UniversalForm:Ec},name:"MountedPersonalitiesList",data(){return{bUrl:GEt,isMounted:!1,isLoading:!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)}},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:{toggleShowPersList(){this.onShowPersList()},async constructor(){},async api_get_req(n){try{const e=await Me.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=yc},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,Me.post("/reinstall_personality",{name:n.personality.full_path}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$refs.toast.showToast("Personality reinstalled successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall personality + Endpoint error: `+i.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)}},toggleShowPersList(){this.onShowPersList()},async constructor(){for(Ve(()=>{qe.replace()});this.$store.state.ready===!1;)await new Promise(n=>setTimeout(n,100));this.onReady()},async api_get_req(n){try{const e=await Me.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=yc}}},MEt={class:"w-fit select-none"},DEt={key:0,class:"flex -space-x-4"},kEt=["src","title"],LEt={key:1,class:"flex -space-x-4"},PEt=["src","title"],UEt={key:2,title:"Loading personalities"},FEt=u("div",{role:"status"},[u("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"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1),BEt=[FEt];function GEt(n,e,t,i,s,r){const o=ft("UniversalForm");return w(),M($e,null,[u("div",MEt,[r.mountedPersArr.length>1?(w(),M("div",DEt,[u("img",{src:s.bUrl+r.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-secondary cursor-pointer",title:"Active personality: "+r.mountedPers.name,onClick:e[1]||(e[1]=a=>r.onSettingsPersonality(r.mountedPers))},null,40,kEt),u("div",{class:"flex items-center justify-center w-8 h-8 cursor-pointer text-xs font-medium bg-bg-light dark:bg-bg-dark border-2 hover:border-secondary rounded-full hover:bg-bg-light-tone dark:hover:bg-bg-dark-tone dark:border-gray-800 hover:z-20 hover:-translate-y-2 duration-150 active:scale-90",onClick:e[2]||(e[2]=Te((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+ge(r.mountedPersArr.length-1),1)])):q("",!0),r.mountedPersArr.length==1?(w(),M("div",LEt,[u("img",{src:s.bUrl+this.$store.state.mountedPers.avatar,onError:e[3]||(e[3]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 cursor-pointer border-secondary",title:"Active personality: "+this.$store.state.mountedPers.name,onClick:e[4]||(e[4]=Te((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"]))},null,40,PEt)])):q("",!0),r.mountedPersArr.length==0?(w(),M("div",UEt,BEt)):q("",!0)]),Ie(o,{ref:"universalForm",class:"z-20"},null,512)],64)}const zEt=bt(IEt,[["render",GEt]]);const VEt="/";Me.defaults.baseURL="/";const HEt={props:{onTalk:Function,onMounted:Function,onUnmounted:Function,onRemounted:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:gO,Toast:fc,UniversalForm:Ec},name:"MountedPersonalitiesList",data(){return{bUrl:VEt,isMounted:!1,isLoading:!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)}},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:{toggleShowPersList(){this.onShowPersList()},async constructor(){},async api_get_req(n){try{const e=await Me.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(n){n.target.src=yc},onPersonalityReinstall(n){console.log("on reinstall ",n),this.isLoading=!0,Me.post("/reinstall_personality",{name:n.personality.full_path}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$refs.toast.showToast("Personality reinstalled successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall personality `+e.message,4,!1),{status:!1}))},editPersonality(n){n=n.personality,Me.post("/get_personality_config",{category:n.category,name:n.folder}).then(e=>{const t=e.data;console.log("Done"),t.status?(this.$store.state.currentPersonConfig=t.config,this.$store.state.showPersonalityEditor=!0,this.$store.state.personality_editor.showPanel(),this.$store.state.selectedPersonality=n):console.error(t.error)}).catch(e=>{console.error(e)})},onPersonalityMounted(n){this.mountPersonality(n)},onPersonalityUnMounted(n){this.unmountPersonality(n)},onPersonalityRemount(n){this.reMountPersonality(n)},async handleOnTalk(n){if(qe.replace(),console.log("ppa",n),n){if(n.isMounted){const e=await this.select_personality(n);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality: `+n.name,4,!0))}else this.onPersonalityMounted(n);this.onTalk(n)}},async onPersonalitySelected(n){if(qe.replace(),console.log("Selected personality : ",JSON.stringify(n.personality)),n){if(n.selected){this.$refs.toast.showToast("Personality already selected",4,!0);return}if(n.isMounted){const e=await this.select_personality(n);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality: `+n.name,4,!0))}else this.onPersonalityMounted(n)}},onSettingsPersonality(n){try{Me.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.personality.name,"Save changes","Cancel").then(t=>{try{Me.post("/set_active_personality_settings",t).then(i=>{i&&i.data?(console.log("personality set with new settings",i.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. @@ -196,15 +196,15 @@ If You are using windows, this will install wsl so you need to activate it. Error: `+e.error,4,!1))},async reMountPersonality(n){if(console.log("remount pers",n),!n)return;if(!this.configFile.personalities.includes(n.personality.full_path)){this.$refs.toast.showToast("Personality not mounted",4,!1);return}const e=await this.remount_personality(n.personality);console.log("remount_personality res",e),e.status?(this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality remounted",4,!0),n.isMounted=!0,this.onMounted(this),(await this.select_personality(n.personality)).status&&this.$refs.toast.showToast(`Selected personality: `+n.personality.name,4,!0),this.getMountedPersonalities()):(n.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality Error: `+e.error,4,!1))},async unmountPersonality(n){if(!n)return;console.log(`Unmounting ${JSON.stringify(n.personality)}`);const e=await this.unmount_personality(n.personality);if(e.status){console.log("unmount response",e),this.configFile.active_personality_id=e.active_personality_id,this.configFile.personalities=e.personalities;const t=this.configFile.personalities[this.configFile.active_personality_id],i=this.personalities.findIndex(a=>a.full_path==t),s=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==n.full_path),r=this.personalities[i];r.isMounted=!1,r.selected=!0,this.$refs.personalitiesZoo[s].isMounted=!1,this.getMountedPersonalities(),(await this.select_personality(r)).status&&qe.replace(),this.$refs.toast.showToast("Personality unmounted",4,!0),this.onUnMounted(this)}else this.$refs.toast.showToast(`Could not unmount personality -Error: `+e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let n=[];console.log(this.configFile.personalities.length);for(let e=0;er.full_path==t),s=this.personalities[i];if(s)console.log("adding from config"),n.push(s);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),o=this.personalities[r];n.push(o)}}if(this.mountedPersArr=[],this.mountedPersArr=n,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;es.full_path==t);if(console.log("discussionPersonalities -includes",i),console.log("discussionPersonalities -mounted list",this.mountedPersArr),i==-1){const s=this.personalities.findIndex(o=>o.full_path==t),r=this.personalities[s];console.log("adding discucc121",r,t),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},NE=n=>(Nr("data-v-c50eee06"),n=n(),Or(),n),VEt={class:"text-left overflow-visible text-base font-semibold cursor-pointer select-none items-center flex flex-col flex-grow w-full overflow-x-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"},HEt={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},qEt=NE(()=>u("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"},[u("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"}),u("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)),YEt=NE(()=>u("span",{class:"sr-only"},"Loading...",-1)),$Et=[qEt,YEt],WEt=NE(()=>u("i",{"data-feather":"chevron-down"},null,-1)),KEt=[WEt],jEt={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},QEt={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function XEt(n,e,t,i,s,r){const o=ft("personality-entry"),a=ft("Toast"),l=ft("UniversalForm");return w(),M("div",VEt,[s.isLoading?(w(),M("div",HEt,$Et)):q("",!0),u("div",null,[r.mountedPersArr.length>0?(w(),M("div",{key:0,class:Ye(s.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[u("button",{class:"mt-0 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:"Close personality list",type:"button",onClick:e[0]||(e[0]=Te((...d)=>r.toggleShowPersList&&r.toggleShowPersList(...d),["stop"]))},KEt),u("label",jEt," Mounted Personalities: ("+ge(r.mountedPersArr.length)+") ",1),u("div",QEt,[Ie(rs,{name:"bounce"},{default:Je(()=>[(w(!0),M($e,null,dt(this.$store.state.mountedPersArr,(d,c)=>(w(),xt(o,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+c+"-"+d.name,personality:d,full_path:d.full_path,select_language:!1,selected:r.configFile.personalities[r.configFile.active_personality_id]===d.full_path||r.configFile.personalities[r.configFile.active_personality_id]===d.full_path+":"+d.language,"on-selected":r.onPersonalitySelected,"on-mount":r.onPersonalityMounted,"on-edit":r.editPersonality,"on-un-mount":r.onPersonalityUnMounted,"on-remount":r.onPersonalityRemount,"on-settings":r.onSettingsPersonality,"on-reinstall":r.onPersonalityReinstall,"on-talk":r.handleOnTalk},null,8,["personality","full_path","selected","on-selected","on-mount","on-edit","on-un-mount","on-remount","on-settings","on-reinstall","on-talk"]))),128))]),_:1})])],2)):q("",!0)]),Ie(a,{ref:"toast"},null,512),Ie(l,{ref:"universalForm",class:"z-20"},null,512)])}const ZEt=bt(zEt,[["render",XEt],["__scopeId","data-v-c50eee06"]]);const JEt={components:{InteractiveMenu:cp},props:{commandsList:{type:Array,required:!0},sendCommand:Function,onShowToastMessage:Function},data(){return{loading:!1,selectedFile:null,showMenu:!1,showHelpText:!1,helpText:"",commands:[]}},async mounted(){nextTick(()=>{qe.replace()})},methods:{isHTML(n){const t=new DOMParser().parseFromString(n,"text/html");return Array.from(t.body.childNodes).some(i=>i.nodeType===Node.ELEMENT_NODE)},selectFile(n,e){const t=document.createElement("input");t.type="file",t.accept=n,t.onchange=i=>{this.selectedFile=i.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};Xe.on("file_received",i=>{i.status?this.onShowToastMessage("File uploaded successfully",4,!0):this.onShowToastMessage(`Couldn't upload file -`+i.error,4,!1),this.loading=!1,Xe.off("file_received")}),Xe.emit("send_file",t)},e.readAsDataURL(this.selectedFile)},async constructor(){nextTick(()=>{qe.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)}},mounted(){this.commands=this.commandsList,document.addEventListener("click",this.handleClickOutside)},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},evt=n=>(Nr("data-v-52cfa09c"),n=n(),Or(),n),tvt={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},nvt=evt(()=>u("div",{role:"status"},[u("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"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1)),ivt=[nvt];function svt(n,e,t,i,s,r){const o=ft("InteractiveMenu");return s.loading?(w(),M("div",tvt,ivt)):(w(),xt(o,{key:1,commands:t.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const rvt=bt(JEt,[["render",svt],["__scopeId","data-v-52cfa09c"]]),ovt="/assets/loader_v0-16906488.svg";console.log("modelImgPlaceholder:",Li);const avt="/",lvt={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},components:{UniversalForm:Ec,MountedPersonalities:BEt,MountedPersonalitiesList:ZEt,PersonalitiesCommands:rvt},setup(){},data(){return{loader_v0:ovt,sendGlobe:yO,modelImgPlaceholder:Li,bUrl:avt,message:"",selecting_model:!1,selectedModel:"",isLesteningToVoice:!1,filesList:[],isFileSentList:[],totalSize:0,showfilesList:!0,showPersonalities:!1,personalities_ready:!1,models_menu_icon:""}},computed:{currentModel(){if(this.$store.state.currentModel!=null)return console.log("Model found"),this.$store.state.currentModel;{console.log("No model found");let n={};return n.name="unknown",n}},installedModels(){return this.$store.state.installedModels},model_name(){return this.$store.state.config.model_name},config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},allDiscussionPersonalities(){if(this.discussionList.length>0){let n=[];for(let e=0;e{this.isLoading=!1,n.data.status?(this.$store.state.config.activate_internet_search?this.$store.state.toast.showToast("Websearch activated.",4,!0):this.$store.state.toast.showToast("Websearch deactivated.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Ve(()=>{qe.replace()})})},showModelConfig(){try{this.isLoading=!0,Me.get("/get_active_binding_settings").then(n=>{this.isLoading=!1,n&&(console.log("binding sett",n),n.data&&Object.keys(n.data).length>0?this.$refs.universalForm.showForm(n.data,"Binding settings ","Save changes","Cancel").then(e=>{try{Me.post("/set_active_binding_settings",e).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. +Error: `+e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let n=[];console.log(this.configFile.personalities.length);for(let e=0;er.full_path==t),s=this.personalities[i];if(s)console.log("adding from config"),n.push(s);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),o=this.personalities[r];n.push(o)}}if(this.mountedPersArr=[],this.mountedPersArr=n,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;es.full_path==t);if(console.log("discussionPersonalities -includes",i),console.log("discussionPersonalities -mounted list",this.mountedPersArr),i==-1){const s=this.personalities.findIndex(o=>o.full_path==t),r=this.personalities[s];console.log("adding discucc121",r,t),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},NE=n=>(Nr("data-v-c50eee06"),n=n(),Or(),n),qEt={class:"text-left overflow-visible text-base font-semibold cursor-pointer select-none items-center flex flex-col flex-grow w-full overflow-x-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"},YEt={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},$Et=NE(()=>u("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"},[u("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"}),u("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)),WEt=NE(()=>u("span",{class:"sr-only"},"Loading...",-1)),KEt=[$Et,WEt],jEt=NE(()=>u("i",{"data-feather":"chevron-down"},null,-1)),QEt=[jEt],XEt={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},ZEt={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function JEt(n,e,t,i,s,r){const o=ft("personality-entry"),a=ft("Toast"),l=ft("UniversalForm");return w(),M("div",qEt,[s.isLoading?(w(),M("div",YEt,KEt)):q("",!0),u("div",null,[r.mountedPersArr.length>0?(w(),M("div",{key:0,class:Ye(s.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[u("button",{class:"mt-0 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:"Close personality list",type:"button",onClick:e[0]||(e[0]=Te((...d)=>r.toggleShowPersList&&r.toggleShowPersList(...d),["stop"]))},QEt),u("label",XEt," Mounted Personalities: ("+ge(r.mountedPersArr.length)+") ",1),u("div",ZEt,[Ie(rs,{name:"bounce"},{default:Je(()=>[(w(!0),M($e,null,dt(this.$store.state.mountedPersArr,(d,c)=>(w(),xt(o,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+c+"-"+d.name,personality:d,full_path:d.full_path,select_language:!1,selected:r.configFile.personalities[r.configFile.active_personality_id]===d.full_path||r.configFile.personalities[r.configFile.active_personality_id]===d.full_path+":"+d.language,"on-selected":r.onPersonalitySelected,"on-mount":r.onPersonalityMounted,"on-edit":r.editPersonality,"on-un-mount":r.onPersonalityUnMounted,"on-remount":r.onPersonalityRemount,"on-settings":r.onSettingsPersonality,"on-reinstall":r.onPersonalityReinstall,"on-talk":r.handleOnTalk},null,8,["personality","full_path","selected","on-selected","on-mount","on-edit","on-un-mount","on-remount","on-settings","on-reinstall","on-talk"]))),128))]),_:1})])],2)):q("",!0)]),Ie(a,{ref:"toast"},null,512),Ie(l,{ref:"universalForm",class:"z-20"},null,512)])}const evt=bt(HEt,[["render",JEt],["__scopeId","data-v-c50eee06"]]);const tvt={components:{InteractiveMenu:cp},props:{commandsList:{type:Array,required:!0},sendCommand:Function,onShowToastMessage:Function},data(){return{loading:!1,selectedFile:null,showMenu:!1,showHelpText:!1,helpText:"",commands:[]}},async mounted(){nextTick(()=>{qe.replace()})},methods:{isHTML(n){const t=new DOMParser().parseFromString(n,"text/html");return Array.from(t.body.childNodes).some(i=>i.nodeType===Node.ELEMENT_NODE)},selectFile(n,e){const t=document.createElement("input");t.type="file",t.accept=n,t.onchange=i=>{this.selectedFile=i.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};Xe.on("file_received",i=>{i.status?this.onShowToastMessage("File uploaded successfully",4,!0):this.onShowToastMessage(`Couldn't upload file +`+i.error,4,!1),this.loading=!1,Xe.off("file_received")}),Xe.emit("send_file",t)},e.readAsDataURL(this.selectedFile)},async constructor(){nextTick(()=>{qe.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)}},mounted(){this.commands=this.commandsList,document.addEventListener("click",this.handleClickOutside)},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},nvt=n=>(Nr("data-v-52cfa09c"),n=n(),Or(),n),ivt={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},svt=nvt(()=>u("div",{role:"status"},[u("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"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1)),rvt=[svt];function ovt(n,e,t,i,s,r){const o=ft("InteractiveMenu");return s.loading?(w(),M("div",ivt,rvt)):(w(),xt(o,{key:1,commands:t.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const avt=bt(tvt,[["render",ovt],["__scopeId","data-v-52cfa09c"]]),lvt="/assets/loader_v0-16906488.svg";console.log("modelImgPlaceholder:",Li);const cvt="/",dvt={name:"ChatBox",emits:["messageSentEvent","sendCMDEvent","stopGenerating","loaded","createEmptyUserMessage","createEmptyAIMessage","personalitySelected","addWebLink"],props:{onTalk:Function,discussionList:Array,loading:{default:!1},onShowToastMessage:Function},components:{UniversalForm:Ec,MountedPersonalities:zEt,MountedPersonalitiesList:evt,PersonalitiesCommands:avt},setup(){},data(){return{loader_v0:lvt,sendGlobe:yO,modelImgPlaceholder:Li,bUrl:cvt,message:"",selecting_model:!1,selectedModel:"",isLesteningToVoice:!1,filesList:[],isFileSentList:[],totalSize:0,showfilesList:!0,showPersonalities:!1,personalities_ready:!1,models_menu_icon:""}},computed:{currentModel(){if(this.$store.state.currentModel!=null)return console.log("Model found"),this.$store.state.currentModel;{console.log("No model found");let n={};return n.name="unknown",n}},installedModels(){return this.$store.state.installedModels},model_name(){return this.$store.state.config.model_name},config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},allDiscussionPersonalities(){if(this.discussionList.length>0){let n=[];for(let e=0;e{this.isLoading=!1,n.data.status?(this.$store.state.config.activate_internet_search?this.$store.state.toast.showToast("Websearch activated.",4,!0):this.$store.state.toast.showToast("Websearch deactivated.",4,!0),this.settingsChanged=!1):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Ve(()=>{qe.replace()})})},showModelConfig(){try{this.isLoading=!0,Me.get("/get_active_binding_settings").then(n=>{this.isLoading=!1,n&&(console.log("binding sett",n),n.data&&Object.keys(n.data).length>0?this.$refs.universalForm.showForm(n.data,"Binding settings ","Save changes","Cancel").then(e=>{try{Me.post("/set_active_binding_settings",e).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. `+t,4,!1),this.isLoading=!1)})}catch(t){this.$store.state.toast.showToast(`Did not get binding settings responses. Endpoint error: `+t.message,4,!1),this.isLoading=!1}}):(this.$store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(n){this.isLoading=!1,this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: "+n.message,4,!1)}},async unmountPersonality(n){if(this.loading=!0,!n)return;const e=await this.unmount_personality(n.personality||n);if(e.status){this.$store.state.config.personalities=e.personalities,this.$store.state.toast.showToast("Personality unmounted",4,!0),this.$store.dispatch("refreshMountedPersonalities");const t=this.$store.state.mountedPersArr[this.$store.state.mountedPersArr.length-1];console.log(t,this.$store.state.mountedPersArr.length),(await this.select_personality(n.personality)).status&&this.$store.state.toast.showToast(`Selected personality: `+t.name,4,!0)}else this.$store.state.toast.showToast(`Could not unmount personality Error: `+e.error,4,!1);this.loading=!1},async unmount_personality(n){if(!n)return{status:!1,error:"no personality - unmount_personality"};const e={language:n.language,category:n.category,folder:n.folder};try{const t=await Me.post("/unmount_personality",e);if(t)return t.data}catch(t){console.log(t.message,"unmount_personality - settings");return}},async onPersonalitySelected(n){if(console.log("on pers",n),console.log("selecting ",n),n){if(n.selected){this.$store.state.toast.showToast("Personality already selected",4,!0);return}const e=n.language===null?n.full_path:n.full_path+":"+n.language;if(console.log("pers_path",e),console.log("this.$store.state.config.personalities",this.$store.state.config.personalities),this.$store.state.config.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)}else console.log("mounting pers");this.$emit("personalitySelected"),Ve(()=>{qe.replace()})}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};const e=n.language===null?n.full_path:n.full_path+":"+n.language;console.log("Selecting personality ",e);const i={id:this.$store.state.config.personalities.findIndex(s=>s===e)};try{const s=await Me.post("/select_personality",i);if(s)return this.$store.dispatch("refreshConfig").then(()=>{this.$store.dispatch("refreshPersonalitiesZoo").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),s.data}catch(s){console.log(s.message,"select_personality - settings");return}},emitloaded(){this.$emit("loaded")},showModels(n){n.preventDefault();const e=this.$refs.modelsSelectionList;console.log(e);const t=new MouseEvent("click");e.dispatchEvent(t)},setModel(n){console.log("Setting model to "+n.name),this.selecting_model=!0,this.selectedModel=n,Me.post("/update_setting",{setting_name:"model_name",setting_value:n.name}).then(async e=>{console.log("UPDATED"),console.log(e),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshModels"),this.$store.state.toast.showToast(`Model changed to ${this.currentModel.name}`,4,!0),this.selecting_model=!1}).catch(e=>{this.$store.state.toast.showToast(`Error ${e}`,4,!0),this.selecting_model=!1})},download_files(){Me.get("/download_files")},remove_file(n){Me.get("/remove_file",{name:n}).then(e=>{console.log(e)})},clear_files(){Me.get("/clear_personality_files_list").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,i=24*1024;let s=0,r=0;t.onloadend=()=>{if(t.error){console.error("Error reading file:",t.error);return}const a=t.result,l=s+a.byteLength>=n.size;Xe.emit("send_file_chunk",{filename:n.name,chunk:a,offset:s,isLastChunk:l,chunkIndex:r}),s+=a.byteLength,r++,l?(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(s,s+i);t.readAsArrayBuffer(a)}console.log("Uploading file"),o()},makeAnEmptyUserMessage(){this.$emit("createEmptyUserMessage",this.message),this.message=""},makeAnEmptyAIMessage(){this.$emit("createEmptyAIMessage")},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.isLesteningToVoice=!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.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer),this.submit()},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")},onPersonalitiesReadyFun(){this.personalities_ready=!0},onShowPersListFun(n){this.showPersonalities=!this.showPersonalities},handleOnTalk(n){this.showPersonalities=!1,this.onTalk(n)},onMountFun(n){console.log("Mounting personality"),this.$refs.mountedPers.constructor()},onUnmountFun(n){console.log("Unmounting personality"),this.$refs.mountedPers.constructor()},onRemount(n){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(n){return Ve(()=>{qe.replace()}),ss(n)},removeItem(n){console.log(n),Me.post("/remove_file",{file:n}).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)},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(){Xe.emit("take_picture"),Xe.on("picture_taken",()=>{Me.get("/get_current_personality_files_list").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 i=()=>{if(t>=e.length){console.log(`Files_list: ${this.filesList}`);return}const s=e[t];this.filesList.push(s),this.isFileSentList.push(!1),this.send_file(s,()=>{t++,i()})};i()}},watch:{installedModels:{immediate:!0,handler(n){this.$nextTick(()=>{this.installedModels=n})}},model_name:{immediate:!0,handler(n){this.$nextTick(()=>{this.model_name=n})}},showfilesList(){Ve(()=>{qe.replace()})},loading(n,e){Ve(()=>{qe.replace()})},filesList:{handler(n,e){let t=0;if(n.length>0)for(let i=0;i{qe.replace()})},activated(){Ve(()=>{qe.replace()})}},zt=n=>(Nr("data-v-3d2d8162"),n=n(),Or(),n),cvt={class:"absolute bottom-0 left-0 w-fit min-w-96 w-full justify-center text-center p-4"},dvt={key:0,class:"items-center gap-2 rounded-lg border bg-bg-light-tone dark:bg-bg-dark-tone p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 w-fit"},uvt={class:"flex"},pvt=["title"],_vt=zt(()=>u("i",{"data-feather":"list"},null,-1)),hvt=[_vt],fvt={key:0},mvt={class:"flex flex-col max-h-64"},gvt=["title"],bvt={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"},Evt={key:0,filesList:"",role:"status"},vvt=zt(()=>u("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"},[u("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"}),u("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)),yvt=zt(()=>u("span",{class:"sr-only"},"Loading...",-1)),Svt=[vvt,yvt],Tvt=zt(()=>u("div",null,[u("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),xvt=zt(()=>u("div",{class:"grow"},null,-1)),Cvt={class:"flex flex-row items-center"},Rvt={class:"whitespace-nowrap"},Avt=["onClick"],wvt=zt(()=>u("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)),Nvt=[wvt],Ovt={key:1,class:"flex mx-1 w-500"},Ivt={class:"whitespace-nowrap flex flex-row gap-2"},Mvt=zt(()=>u("p",{class:"font-bold"}," Total size: ",-1)),Dvt=zt(()=>u("div",{class:"grow"},null,-1)),kvt=zt(()=>u("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)),Lvt=[kvt],Pvt=zt(()=>u("i",{"data-feather":"download-cloud",class:"w-5 h-5"},null,-1)),Uvt=[Pvt],Fvt={key:2,class:"mx-1"},Bvt={key:1,title:"Selecting model",class:"flex flex-row flex-grow justify-end bg-primary"},Gvt={role:"status"},zvt=["src"],Vvt=zt(()=>u("span",{class:"sr-only"},"Selecting model...",-1)),Hvt={class:"flex w-fit pb-3 relative grow w-full"},qvt={class:"relative grow flex h-12.5 cursor-pointer select-none items-center gap-2 rounded-lg border bg-bg-light-tone dark:bg-bg-dark-tone p-1 shadow-sm hover:shadow-none dark:border-gray-800",tabindex:"0"},Yvt={key:0,title:"Waiting for reply"},$vt=["src"],Wvt=zt(()=>u("div",{role:"status"},[u("span",{class:"sr-only"},"Loading...")],-1)),Kvt={key:1,class:"w-fit group relative"},jvt={class:"group w-full inline-flex absolute opacity-0 group-hover:opacity-100 transform group-hover:-translate-y-10 group-hover:translate-x-15 transition-all duration-300"},Qvt={key:0,class:"group items-center flex flex-row"},Xvt=["onClick"],Zvt=["src","title"],Jvt={class:"group items-center flex flex-row"},eyt=["src","title"],tyt={class:"w-fit group relative"},nyt={class:"group w-full inline-flex absolute opacity-0 group-hover:opacity-100 transform group-hover:-translate-y-10 group-hover:translate-x-15 transition-all duration-300"},iyt={key:0,class:"group items-center flex flex-row"},syt=["onClick"],ryt=["src","title"],oyt=["onClick"],ayt=zt(()=>u("span",{class:"hidden hover:block top-3 left-9 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[u("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[u("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)),lyt=[ayt],cyt={class:"w-fit"},dyt={class:"relative grow"},uyt={class:"group relative w-max"},pyt=zt(()=>u("i",{"data-feather":"send"},null,-1)),_yt=[pyt],hyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Sends your message to the AI.")],-1)),fyt={class:"group relative w-max"},myt=["src"],gyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Sends your message to the AI with internet search.")],-1)),byt={class:"group relative w-max"},Eyt=zt(()=>u("i",{"data-feather":"mic"},null,-1)),vyt=[Eyt],yyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Press and talk.")],-1)),Syt={key:3,class:"group relative w-max"},Tyt=zt(()=>u("i",{"data-feather":"file-plus"},null,-1)),xyt=[Tyt],Cyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Send File to the AI.")],-1)),Ryt={class:"group relative w-max"},Ayt=zt(()=>u("i",{"data-feather":"camera"},null,-1)),wyt=[Ayt],Nyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Take a shot from webcam.")],-1)),Oyt={class:"group relative w-max"},Iyt=zt(()=>u("i",{"data-feather":"globe"},null,-1)),Myt=[Iyt],Dyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Add a weblink to the discussion.")],-1)),kyt={class:"group relative w-max"},Lyt=zt(()=>u("i",{"data-feather":"message-square"},null,-1)),Pyt=[Lyt],Uyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"New empty User message.")],-1)),Fyt={class:"group relative w-max"},Byt=zt(()=>u("i",{"data-feather":"message-square"},null,-1)),Gyt=[Byt],zyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"New empty ai message.")],-1)),Vyt=zt(()=>u("div",{class:"ml-auto gap-2"},null,-1));function Hyt(n,e,t,i,s,r){const o=ft("MountedPersonalitiesList"),a=ft("MountedPersonalities"),l=ft("PersonalitiesCommands"),d=ft("UniversalForm");return w(),M($e,null,[u("form",null,[u("div",cvt,[s.filesList.length>0||s.showPersonalities?(w(),M("div",dvt,[u("div",uvt,[u("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:s.showfilesList?"Hide file list":"Show file list",type:"button",onClick:e[0]||(e[0]=Te(c=>s.showfilesList=!s.showfilesList,["stop"]))},hvt,8,pvt)]),s.filesList.length>0&&s.showfilesList==!0?(w(),M("div",fvt,[u("div",mvt,[Ie(rs,{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:Je(()=>[(w(!0),M($e,null,dt(s.filesList,(c,_)=>(w(),M("div",{key:_+"-"+c.name},[u("div",{class:"m-1",title:c.name},[u("div",bvt,[s.isFileSentList[_]?q("",!0):(w(),M("div",Evt,Svt)),Tvt,u("div",{class:Ye(["line-clamp-1 w-3/5",s.isFileSentList[_]?"text-green-500":"text-red-200"])},ge(c.name),3),xvt,u("div",Cvt,[u("p",Rvt,ge(r.computedFileSize(c.size)),1),u("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:f=>r.removeItem(c)},Nvt,8,Avt)])])],8,gvt)]))),128))]),_:1})])])):q("",!0),s.filesList.length>0?(w(),M("div",Ovt,[u("div",Ivt,[Mvt,Ze(" "+ge(s.totalSize)+" ("+ge(s.filesList.length)+") ",1)]),Dvt,u("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)=>r.clear_files&&r.clear_files(...c))},Lvt),u("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)=>r.download_files&&r.download_files(...c))},Uvt)])):q("",!0),s.showPersonalities?(w(),M("div",Fvt,[Ie(o,{ref:"mountedPersList",onShowPersList:r.onShowPersListFun,"on-mounted":r.onMountFun,"on-un-mounted":r.onUnmountFun,"on-remounted":n.onRemountFun,"on-talk":r.handleOnTalk,discussionPersonalities:r.allDiscussionPersonalities},null,8,["onShowPersList","on-mounted","on-un-mounted","on-remounted","on-talk","discussionPersonalities"])])):q("",!0)])):q("",!0),s.selecting_model?(w(),M("div",Bvt,[u("div",Gvt,[u("img",{src:s.loader_v0,class:"w-50 h-50"},null,8,zvt),Vvt])])):q("",!0),u("div",Hvt,[u("div",qvt,[t.loading?(w(),M("div",Yvt,[u("img",{src:s.loader_v0},null,8,$vt),Wvt])):q("",!0),t.loading?q("",!0):(w(),M("div",Kvt,[u("div",jvt,[(w(!0),M($e,null,dt(r.installedModels,(c,_)=>(w(),M("div",{class:"w-full",key:_+"-"+c.name,ref_for:!0,ref:"installedModels"},[c.name!=r.model_name?(w(),M("div",Qvt,[u("button",{onClick:Te(f=>r.setModel(c),["prevent"]),class:"w-8 h-8"},[u("img",{src:c.icon?c.icon:s.modelImgPlaceholder,class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary",title:c.name},null,8,Zvt)],8,Xvt)])):q("",!0)]))),128))]),u("div",Jvt,[u("button",{onClick:e[3]||(e[3]=Te(c=>r.showModelConfig(),["prevent"])),class:"w-8 h-8"},[u("img",{src:r.currentModel.icon?r.currentModel.icon:s.modelImgPlaceholder,class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary",title:r.currentModel?r.currentModel.name:"unknown"},null,8,eyt)])])])),u("div",tyt,[u("div",nyt,[(w(!0),M($e,null,dt(this.$store.state.mountedPersArr,(c,_)=>(w(),M("div",{class:"w-full",key:_+"-"+c.name,ref_for:!0,ref:"mountedPersonalities"},[_!=this.$store.state.config.active_personality_id?(w(),M("div",iyt,[u("button",{onClick:Te(f=>r.onPersonalitySelected(c),["prevent"]),class:"w-8 h-8"},[u("img",{src:s.bUrl+c.avatar,onError:e[4]||(e[4]=(...f)=>n.personalityImgPlacehodler&&n.personalityImgPlacehodler(...f)),class:Ye(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary",this.$store.state.active_personality_id==this.$store.state.personalities.indexOf(c.full_path)?"border-secondary":"border-transparent z-0"]),title:c.name},null,42,ryt)],8,syt),u("button",{onClick:Te(f=>r.unmountPersonality(c),["prevent"])},lyt,8,oyt)])):q("",!0)]))),128))]),Ie(a,{ref:"mountedPers",onShowPersList:r.onShowPersListFun,onReady:r.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])]),u("div",cyt,[s.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(w(),xt(l,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:r.sendCMDEvent,"on-show-toast-message":t.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):q("",!0)]),u("div",dyt,[le(u("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[5]||(e[5]=c=>s.message=c),title:"Hold SHIFT + ENTER to add new line",class:"inline-block no-scrollbar p-2.5 w-full text-sm text-gray-900 bg-bg-light rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-bg-dark dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Send message...",onKeydown:e[6]||(e[6]=wr(Te(c=>r.submitOnEnter(c),["exact"]),["enter"]))},`\r - `,544),[[Pe,s.message]])]),t.loading?(w(),M("button",{key:2,type:"button",class:"bg-red-500 dark:bg-red-800 hover:bg-red-600 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:hover:bg-bg-dark-tone focus:outline-none dark:focus:ring-blue-800",onClick:e[7]||(e[7]=Te((...c)=>r.stopGenerating&&r.stopGenerating(...c),["stop"]))}," Stop generating ")):q("",!0),u("div",uyt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[8]||(e[8]=(...c)=>r.submit&&r.submit(...c)),title:"Send",class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},_yt)),hyt]),u("div",fyt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[9]||(e[9]=(...c)=>r.submitWithInternetSearch&&r.submitWithInternetSearch(...c)),title:"Send With internet",class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},[u("img",{src:s.sendGlobe,width:"50",height:"50"},null,8,myt)])),gyt]),u("div",byt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[10]||(e[10]=(...c)=>r.startSpeechRecognition&&r.startSpeechRecognition(...c)),class:Ye([{"text-red-500":s.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"])},vyt,2)),yyt]),t.loading?q("",!0):(w(),M("div",Syt,[u("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:e[11]||(e[11]=(...c)=>r.addFiles&&r.addFiles(...c)),multiple:""},null,544),u("button",{type:"button",onClick:e[12]||(e[12]=Te((...c)=>r.add_file&&r.add_file(...c),["prevent"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},xyt),Cyt])),u("div",Ryt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[13]||(e[13]=Te((...c)=>r.takePicture&&r.takePicture(...c),["stop"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},wyt)),Nyt]),u("div",Oyt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[14]||(e[14]=Te((...c)=>r.addWebLink&&r.addWebLink(...c),["stop"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},Myt)),Dyt]),u("div",kyt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[15]||(e[15]=Te((...c)=>r.makeAnEmptyUserMessage&&r.makeAnEmptyUserMessage(...c),["stop"])),class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},Pyt)),Uyt]),u("div",Fyt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[16]||(e[16]=Te((...c)=>r.makeAnEmptyAIMessage&&r.makeAnEmptyAIMessage(...c),["stop"])),class:"w-6 text-red-400 hover:text-secondary duration-75 active:scale-90"},Gyt)),zyt])]),Vyt])])]),Ie(d,{ref:"universalForm",class:"z-20"},null,512)],64)}const TO=bt(lvt,[["render",Hyt],["__scopeId","data-v-3d2d8162"]]),qyt={name:"WelcomeComponent",setup(){return{}}},Yyt={class:"flex flex-col text-center"},$yt=zu('
Logo

LoLLMS

One tool to rule them all


Welcome

Please create a new discussion or select existing one to start

',1),Wyt=[$yt];function Kyt(n,e,t,i,s,r){return w(),M("div",Yyt,Wyt)}const xO=bt(qyt,[["render",Kyt]]);var jyt=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=globalThis&&globalThis.__assign||function(){return ou=Object.assign||function(n){for(var e,t=1,i=arguments.length;t"u")return!1;var e=ai(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function lSt(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},s=e.attributes[t]||{},r=e.elements[t];!xi(r)||!ds(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function cSt(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var s=e.elements[i],r=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(l,d){return l[d]="",l},{});!xi(s)||!ds(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const dSt={name:"applyStyles",enabled:!0,phase:"write",fn:lSt,effect:cSt,requires:["computeStyles"]};function os(n){return n.split("-")[0]}var ao=Math.max,du=Math.min,ya=Math.round;function ib(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function IO(){return!/^((?!chrome|android).)*safari/i.test(ib())}function Sa(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=n.getBoundingClientRect(),s=1,r=1;e&&xi(n)&&(s=n.offsetWidth>0&&ya(i.width)/n.offsetWidth||1,r=n.offsetHeight>0&&ya(i.height)/n.offsetHeight||1);var o=mo(n)?ai(n):window,a=o.visualViewport,l=!IO()&&t,d=(i.left+(l&&a?a.offsetLeft:0))/s,c=(i.top+(l&&a?a.offsetTop:0))/r,_=i.width/s,f=i.height/r;return{width:_,height:f,top:c,right:d+_,bottom:c+f,left:d,x:d,y:c}}function PE(n){var e=Sa(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function MO(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&LE(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function zs(n){return ai(n).getComputedStyle(n)}function uSt(n){return["table","td","th"].indexOf(ds(n))>=0}function Mr(n){return((mo(n)?n.ownerDocument:n.document)||window.document).documentElement}function dp(n){return ds(n)==="html"?n:n.assignedSlot||n.parentNode||(LE(n)?n.host:null)||Mr(n)}function kC(n){return!xi(n)||zs(n).position==="fixed"?null:n.offsetParent}function pSt(n){var e=/firefox/i.test(ib()),t=/Trident/i.test(ib());if(t&&xi(n)){var i=zs(n);if(i.position==="fixed")return null}var s=dp(n);for(LE(s)&&(s=s.host);xi(s)&&["html","body"].indexOf(ds(s))<0;){var r=zs(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function Tc(n){for(var e=ai(n),t=kC(n);t&&uSt(t)&&zs(t).position==="static";)t=kC(t);return t&&(ds(t)==="html"||ds(t)==="body"&&zs(t).position==="static")?e:t||pSt(n)||e}function UE(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Ll(n,e,t){return ao(n,du(e,t))}function _St(n,e,t){var i=Ll(n,e,t);return i>t?t:i}function DO(){return{top:0,right:0,bottom:0,left:0}}function kO(n){return Object.assign({},DO(),n)}function LO(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var hSt=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,kO(typeof e!="number"?e:LO(e,Sc))};function fSt(n){var e,t=n.state,i=n.name,s=n.options,r=t.elements.arrow,o=t.modifiersData.popperOffsets,a=os(t.placement),l=UE(a),d=[Xn,wi].indexOf(a)>=0,c=d?"height":"width";if(!(!r||!o)){var _=hSt(s.padding,t),f=PE(r),m=l==="y"?Qn:Xn,h=l==="y"?Ai:wi,E=t.rects.reference[c]+t.rects.reference[l]-o[l]-t.rects.popper[c],b=o[l]-t.rects.reference[l],g=Tc(r),v=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,y=E/2-b/2,T=_[m],C=v-f[c]-_[h],x=v/2-f[c]/2+y,O=Ll(T,x,C),R=l;t.modifiersData[i]=(e={},e[R]=O,e.centerOffset=O-x,e)}}function mSt(n){var e=n.state,t=n.options,i=t.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||MO(e.elements.popper,s)&&(e.elements.arrow=s))}const gSt={name:"arrow",enabled:!0,phase:"main",fn:fSt,effect:mSt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ta(n){return n.split("-")[1]}var bSt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ESt(n,e){var t=n.x,i=n.y,s=e.devicePixelRatio||1;return{x:ya(t*s)/s||0,y:ya(i*s)/s||0}}function LC(n){var e,t=n.popper,i=n.popperRect,s=n.placement,r=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,d=n.adaptive,c=n.roundOffsets,_=n.isFixed,f=o.x,m=f===void 0?0:f,h=o.y,E=h===void 0?0:h,b=typeof c=="function"?c({x:m,y:E}):{x:m,y:E};m=b.x,E=b.y;var g=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),y=Xn,T=Qn,C=window;if(d){var x=Tc(t),O="clientHeight",R="clientWidth";if(x===ai(t)&&(x=Mr(t),zs(x).position!=="static"&&a==="absolute"&&(O="scrollHeight",R="scrollWidth")),x=x,s===Qn||(s===Xn||s===wi)&&r===sc){T=Ai;var S=_&&x===C&&C.visualViewport?C.visualViewport.height:x[O];E-=S-i.height,E*=l?1:-1}if(s===Xn||(s===Qn||s===Ai)&&r===sc){y=wi;var A=_&&x===C&&C.visualViewport?C.visualViewport.width:x[R];m-=A-i.width,m*=l?1:-1}}var U=Object.assign({position:a},d&&bSt),F=c===!0?ESt({x:m,y:E},ai(t)):{x:m,y:E};if(m=F.x,E=F.y,l){var K;return Object.assign({},U,(K={},K[T]=v?"0":"",K[y]=g?"0":"",K.transform=(C.devicePixelRatio||1)<=1?"translate("+m+"px, "+E+"px)":"translate3d("+m+"px, "+E+"px, 0)",K))}return Object.assign({},U,(e={},e[T]=v?E+"px":"",e[y]=g?m+"px":"",e.transform="",e))}function vSt(n){var e=n.state,t=n.options,i=t.gpuAcceleration,s=i===void 0?!0:i,r=t.adaptive,o=r===void 0?!0:r,a=t.roundOffsets,l=a===void 0?!0:a,d={placement:os(e.placement),variation:Ta(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,LC(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,LC(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const ySt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:vSt,data:{}};var Wc={passive:!0};function SSt(n){var e=n.state,t=n.instance,i=n.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=ai(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&d.forEach(function(c){c.addEventListener("scroll",t.update,Wc)}),a&&l.addEventListener("resize",t.update,Wc),function(){r&&d.forEach(function(c){c.removeEventListener("scroll",t.update,Wc)}),a&&l.removeEventListener("resize",t.update,Wc)}}const TSt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:SSt,data:{}};var xSt={left:"right",right:"left",bottom:"top",top:"bottom"};function zd(n){return n.replace(/left|right|bottom|top/g,function(e){return xSt[e]})}var CSt={start:"end",end:"start"};function PC(n){return n.replace(/start|end/g,function(e){return CSt[e]})}function FE(n){var e=ai(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function BE(n){return Sa(Mr(n)).left+FE(n).scrollLeft}function RSt(n,e){var t=ai(n),i=Mr(n),s=t.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var d=IO();(d||!d&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+BE(n),y:l}}function ASt(n){var e,t=Mr(n),i=FE(n),s=(e=n.ownerDocument)==null?void 0:e.body,r=ao(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=ao(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+BE(n),l=-i.scrollTop;return zs(s||t).direction==="rtl"&&(a+=ao(t.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function GE(n){var e=zs(n),t=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+i)}function PO(n){return["html","body","#document"].indexOf(ds(n))>=0?n.ownerDocument.body:xi(n)&&GE(n)?n:PO(dp(n))}function Pl(n,e){var t;e===void 0&&(e=[]);var i=PO(n),s=i===((t=n.ownerDocument)==null?void 0:t.body),r=ai(i),o=s?[r].concat(r.visualViewport||[],GE(i)?i:[]):i,a=e.concat(o);return s?a:a.concat(Pl(dp(o)))}function sb(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function wSt(n,e){var t=Sa(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function UC(n,e,t){return e===NO?sb(RSt(n,t)):mo(e)?wSt(e,t):sb(ASt(Mr(n)))}function NSt(n){var e=Pl(dp(n)),t=["absolute","fixed"].indexOf(zs(n).position)>=0,i=t&&xi(n)?Tc(n):n;return mo(i)?e.filter(function(s){return mo(s)&&MO(s,i)&&ds(s)!=="body"}):[]}function OSt(n,e,t,i){var s=e==="clippingParents"?NSt(n):[].concat(e),r=[].concat(s,[t]),o=r[0],a=r.reduce(function(l,d){var c=UC(n,d,i);return l.top=ao(c.top,l.top),l.right=du(c.right,l.right),l.bottom=du(c.bottom,l.bottom),l.left=ao(c.left,l.left),l},UC(n,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function UO(n){var e=n.reference,t=n.element,i=n.placement,s=i?os(i):null,r=i?Ta(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(s){case Qn:l={x:o,y:e.y-t.height};break;case Ai:l={x:o,y:e.y+e.height};break;case wi:l={x:e.x+e.width,y:a};break;case Xn:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var d=s?UE(s):null;if(d!=null){var c=d==="y"?"height":"width";switch(r){case va:l[d]=l[d]-(e[c]/2-t[c]/2);break;case sc:l[d]=l[d]+(e[c]/2-t[c]/2);break}}return l}function rc(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=i===void 0?n.placement:i,r=t.strategy,o=r===void 0?n.strategy:r,a=t.boundary,l=a===void 0?Qyt:a,d=t.rootBoundary,c=d===void 0?NO:d,_=t.elementContext,f=_===void 0?fl:_,m=t.altBoundary,h=m===void 0?!1:m,E=t.padding,b=E===void 0?0:E,g=kO(typeof b!="number"?b:LO(b,Sc)),v=f===fl?Xyt:fl,y=n.rects.popper,T=n.elements[h?v:f],C=OSt(mo(T)?T:T.contextElement||Mr(n.elements.popper),l,c,o),x=Sa(n.elements.reference),O=UO({reference:x,element:y,strategy:"absolute",placement:s}),R=sb(Object.assign({},y,O)),S=f===fl?R:x,A={top:C.top-S.top+g.top,bottom:S.bottom-C.bottom+g.bottom,left:C.left-S.left+g.left,right:S.right-C.right+g.right},U=n.modifiersData.offset;if(f===fl&&U){var F=U[s];Object.keys(A).forEach(function(K){var L=[wi,Ai].indexOf(K)>=0?1:-1,H=[Qn,Ai].indexOf(K)>=0?"y":"x";A[K]+=F[H]*L})}return A}function ISt(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=t.boundary,r=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,d=l===void 0?OO:l,c=Ta(i),_=c?a?DC:DC.filter(function(h){return Ta(h)===c}):Sc,f=_.filter(function(h){return d.indexOf(h)>=0});f.length===0&&(f=_);var m=f.reduce(function(h,E){return h[E]=rc(n,{placement:E,boundary:s,rootBoundary:r,padding:o})[os(E)],h},{});return Object.keys(m).sort(function(h,E){return m[h]-m[E]})}function MSt(n){if(os(n)===kE)return[];var e=zd(n);return[PC(n),e,PC(e)]}function DSt(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var s=t.mainAxis,r=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,d=t.padding,c=t.boundary,_=t.rootBoundary,f=t.altBoundary,m=t.flipVariations,h=m===void 0?!0:m,E=t.allowedAutoPlacements,b=e.options.placement,g=os(b),v=g===b,y=l||(v||!h?[zd(b)]:MSt(b)),T=[b].concat(y).reduce(function(fe,ve){return fe.concat(os(ve)===kE?ISt(e,{placement:ve,boundary:c,rootBoundary:_,padding:d,flipVariations:h,allowedAutoPlacements:E}):ve)},[]),C=e.rects.reference,x=e.rects.popper,O=new Map,R=!0,S=T[0],A=0;A=0,H=L?"width":"height",G=rc(e,{placement:U,boundary:c,rootBoundary:_,altBoundary:f,padding:d}),P=L?K?wi:Xn:K?Ai:Qn;C[H]>x[H]&&(P=zd(P));var j=zd(P),Y=[];if(r&&Y.push(G[F]<=0),a&&Y.push(G[P]<=0,G[j]<=0),Y.every(function(fe){return fe})){S=U,R=!1;break}O.set(U,Y)}if(R)for(var Q=h?3:1,re=function(ve){var Ae=T.find(function(J){var me=O.get(J);if(me)return me.slice(0,ve).every(function(ee){return ee})});if(Ae)return S=Ae,"break"},te=Q;te>0;te--){var Z=re(te);if(Z==="break")break}e.placement!==S&&(e.modifiersData[i]._skip=!0,e.placement=S,e.reset=!0)}}const kSt={name:"flip",enabled:!0,phase:"main",fn:DSt,requiresIfExists:["offset"],data:{_skip:!1}};function FC(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function BC(n){return[Qn,wi,Ai,Xn].some(function(e){return n[e]>=0})}function LSt(n){var e=n.state,t=n.name,i=e.rects.reference,s=e.rects.popper,r=e.modifiersData.preventOverflow,o=rc(e,{elementContext:"reference"}),a=rc(e,{altBoundary:!0}),l=FC(o,i),d=FC(a,s,r),c=BC(l),_=BC(d);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:c,hasPopperEscaped:_},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":_})}const PSt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:LSt};function USt(n,e,t){var i=os(n),s=[Xn,Qn].indexOf(i)>=0?-1:1,r=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[Xn,wi].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function FSt(n){var e=n.state,t=n.options,i=n.name,s=t.offset,r=s===void 0?[0,0]:s,o=OO.reduce(function(c,_){return c[_]=USt(_,e.rects,r),c},{}),a=o[e.placement],l=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=d),e.modifiersData[i]=o}const BSt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:FSt};function GSt(n){var e=n.state,t=n.name;e.modifiersData[t]=UO({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const zSt={name:"popperOffsets",enabled:!0,phase:"read",fn:GSt,data:{}};function VSt(n){return n==="x"?"y":"x"}function HSt(n){var e=n.state,t=n.options,i=n.name,s=t.mainAxis,r=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,d=t.rootBoundary,c=t.altBoundary,_=t.padding,f=t.tether,m=f===void 0?!0:f,h=t.tetherOffset,E=h===void 0?0:h,b=rc(e,{boundary:l,rootBoundary:d,padding:_,altBoundary:c}),g=os(e.placement),v=Ta(e.placement),y=!v,T=UE(g),C=VSt(T),x=e.modifiersData.popperOffsets,O=e.rects.reference,R=e.rects.popper,S=typeof E=="function"?E(Object.assign({},e.rects,{placement:e.placement})):E,A=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),U=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,F={x:0,y:0};if(x){if(r){var K,L=T==="y"?Qn:Xn,H=T==="y"?Ai:wi,G=T==="y"?"height":"width",P=x[T],j=P+b[L],Y=P-b[H],Q=m?-R[G]/2:0,re=v===va?O[G]:R[G],te=v===va?-R[G]:-O[G],Z=e.elements.arrow,fe=m&&Z?PE(Z):{width:0,height:0},ve=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:DO(),Ae=ve[L],J=ve[H],me=Ll(0,O[G],fe[G]),ee=y?O[G]/2-Q-me-Ae-A.mainAxis:re-me-Ae-A.mainAxis,Se=y?-O[G]/2+Q+me+J+A.mainAxis:te+me+J+A.mainAxis,Oe=e.elements.arrow&&Tc(e.elements.arrow),k=Oe?T==="y"?Oe.clientTop||0:Oe.clientLeft||0:0,B=(K=U==null?void 0:U[T])!=null?K:0,$=P+ee-B-k,ce=P+Se-B,ne=Ll(m?du(j,$):j,P,m?ao(Y,ce):Y);x[T]=ne,F[T]=ne-P}if(a){var Ce,we=T==="x"?Qn:Xn,V=T==="x"?Ai:wi,_e=x[C],ie=C==="y"?"height":"width",ae=_e+b[we],D=_e-b[V],I=[Qn,Xn].indexOf(g)!==-1,z=(Ce=U==null?void 0:U[C])!=null?Ce:0,he=I?ae:_e-O[ie]-R[ie]-z+A.altAxis,X=I?_e+O[ie]+R[ie]-z-A.altAxis:D,se=m&&I?_St(he,_e,X):Ll(m?he:ae,_e,m?X:D);x[C]=se,F[C]=se-_e}e.modifiersData[i]=F}}const qSt={name:"preventOverflow",enabled:!0,phase:"main",fn:HSt,requiresIfExists:["offset"]};function YSt(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function $St(n){return n===ai(n)||!xi(n)?FE(n):YSt(n)}function WSt(n){var e=n.getBoundingClientRect(),t=ya(e.width)/n.offsetWidth||1,i=ya(e.height)/n.offsetHeight||1;return t!==1||i!==1}function KSt(n,e,t){t===void 0&&(t=!1);var i=xi(e),s=xi(e)&&WSt(e),r=Mr(e),o=Sa(n,s,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((ds(e)!=="body"||GE(r))&&(a=$St(e)),xi(e)?(l=Sa(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=BE(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function jSt(n){var e=new Map,t=new Set,i=[];n.forEach(function(r){e.set(r.name,r)});function s(r){t.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&s(l)}}),i.push(r)}return n.forEach(function(r){t.has(r.name)||s(r)}),i}function QSt(n){var e=jSt(n);return aSt.reduce(function(t,i){return t.concat(e.filter(function(s){return s.phase===i}))},[])}function XSt(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function ZSt(n){var e=n.reduce(function(t,i){var s=t[i.name];return t[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var GC={placement:"bottom",modifiers:[],strategy:"absolute"};function zC(){for(var n=arguments.length,e=new Array(n),t=0;t(Nr("data-v-46f45c62"),n=n(),Or(),n),n0t={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center"},i0t={class:"flex flex-col text-center"},s0t={class:"flex flex-col text-center items-center"},r0t={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},o0t=Vt(()=>u("img",{class:"w-24 animate-bounce",title:"LoLLMS WebUI",src:ga,alt:"Logo"},null,-1)),a0t={class:"flex flex-col items-start"},l0t={class:"text-2xl"},c0t=Vt(()=>u("p",{class:"text-gray-400 text-base"},"One tool to rule them all",-1)),d0t=Vt(()=>u("p",{class:"text-gray-400 text-base"},"by ParisNeo",-1)),u0t=Vt(()=>u("hr",{class:"mt-1 w-96 h-1 mx-auto my-2 md:my-2 dark:bg-bg-dark-tone-panel bg-bg-light-tone-panel border-0 rounded"},null,-1)),p0t=Vt(()=>u("p",{class:"text-2xl mb-10"},"Welcome",-1)),_0t={role:"status",class:"text-center w-full display: flex; flex-row align-items: center;"},h0t={class:"text-2xl animate-pulse mt-2"},f0t=Vt(()=>u("i",{"data-feather":"chevron-right"},null,-1)),m0t=[f0t],g0t=Vt(()=>u("i",{"data-feather":"chevron-left"},null,-1)),b0t=[g0t],E0t={key:0,class:"relative flex flex-col no-scrollbar shadow-lg min-w-[24rem] max-w-[24rem] bg-bg-light-tone dark:bg-bg-dark-tone"},v0t={class:"sticky z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md"},y0t={class:"flex-row p-4 flex items-center gap-3 flex-0"},S0t=Vt(()=>u("i",{"data-feather":"plus"},null,-1)),T0t=[S0t],x0t=Vt(()=>u("i",{"data-feather":"check-square"},null,-1)),C0t=[x0t],R0t=Vt(()=>u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Reset database, remove all discussions"},[u("i",{"data-feather":"refresh-ccw"})],-1)),A0t=Vt(()=>u("i",{"data-feather":"database"},null,-1)),w0t=[A0t],N0t=Vt(()=>u("i",{"data-feather":"log-in"},null,-1)),O0t=[N0t],I0t={key:0,class:"dropdown"},M0t=Vt(()=>u("i",{"data-feather":"search"},null,-1)),D0t=[M0t],k0t=Vt(()=>u("i",{"data-feather":"save"},null,-1)),L0t=[k0t],P0t={key:2,class:"flex gap-3 flex-1 items-center duration-75"},U0t=Vt(()=>u("i",{"data-feather":"x"},null,-1)),F0t=[U0t],B0t=Vt(()=>u("i",{"data-feather":"check"},null,-1)),G0t=[B0t],z0t=["src"],V0t=["src"],H0t=["src"],q0t=["src"],Y0t={key:7,title:"Loading..",class:"flex flex-row flex-grow justify-end"},$0t=Vt(()=>u("div",{role:"status"},[u("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"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1)),W0t=[$0t],K0t={key:0,class:"flex-row items-center gap-3 flex-0 w-full"},j0t={class:"p-4 pt-2"},Q0t={class:"relative"},X0t=Vt(()=>u("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[u("div",{class:"scale-75"},[u("i",{"data-feather":"search"})])],-1)),Z0t={class:"absolute inset-y-0 right-0 flex items-center pr-3"},J0t=Vt(()=>u("i",{"data-feather":"x"},null,-1)),eTt=[J0t],tTt={key:1,class:"h-px bg-bg-light p-0 mb-4 px-4 mx-4 border-0 dark:bg-bg-dark"},nTt={key:2,class:"flex flex-row flex-grow p-4 pt-0 items-center"},iTt={class:"flex flex-row flex-grow"},sTt={key:0},rTt={class:"flex flex-row"},oTt={key:0,class:"flex gap-3"},aTt=Vt(()=>u("i",{"data-feather":"trash"},null,-1)),lTt=[aTt],cTt={key:1,class:"flex gap-3 mx-3 flex-1 items-center justify-end group-hover:visible duration-75"},dTt=Vt(()=>u("i",{"data-feather":"check"},null,-1)),uTt=[dTt],pTt=Vt(()=>u("i",{"data-feather":"x"},null,-1)),_Tt=[pTt],hTt={class:"flex gap-3"},fTt=Vt(()=>u("i",{"data-feather":"log-out"},null,-1)),mTt=[fTt],gTt=Vt(()=>u("i",{"data-feather":"bookmark"},null,-1)),bTt=[gTt],ETt=Vt(()=>u("i",{"data-feather":"list"},null,-1)),vTt=[ETt],yTt={class:"relative flex flex-row flex-grow mb-10 z-0 w-full"},STt={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"},TTt=Vt(()=>u("p",{class:"px-3"},"No discussions are found",-1)),xTt=[TTt],CTt=Vt(()=>u("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)),RTt={class:"ml-2"},ATt={key:1,class:"relative flex flex-col flex-grow w-full"},wTt={class:"container pt-4 pb-50 mb-50 w-full"},NTt=Vt(()=>u("div",null,[u("br"),u("br"),u("br"),u("br"),u("br"),u("br"),u("br")],-1)),OTt=Vt(()=>u("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)),ITt={key:0,class:"bottom-0 flex flex-row items-center justify-center"},MTt={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"},DTt={class:"text-2xl animate-pulse mt-2 text-white"},kTt={setup(){},data(){return{memory_icon:YO,active_skills:$O,inactive_skills:WO,skillsRegistry:KO,posts_headers:{accept:"application/json","Content-Type":"application/json"},host:"",progress_visibility_val:!0,progress_value:0,msgTypes:{MSG_TYPE_CHUNK:0,MSG_TYPE_FULL:1,MSG_TYPE_FULL_INVISIBLE_TO_AI:2,MSG_TYPE_FULL_INVISIBLE_TO_USER:3,MSG_TYPE_EXCEPTION:4,MSG_TYPE_WARNING:5,MSG_TYPE_INFO:6,MSG_TYPE_STEP:7,MSG_TYPE_STEP_START:8,MSG_TYPE_STEP_PROGRESS:9,MSG_TYPE_STEP_END:10,MSG_TYPE_JSON_INFOS:11,MSG_TYPE_REF:12,MSG_TYPE_CODE:13,MSG_TYPE_UI:14,MSG_TYPE_NEW_MESSAGE:15,MSG_TYPE_FINISHED_MESSAGE:17},senderTypes:{SENDER_TYPES_USER:0,SENDER_TYPES_AI:1,SENDER_TYPES_SYSTEM:2},list:[],tempList:[],currentDiscussion:{},discussionArr:[],loading:!1,filterTitle:"",filterInProgress:!1,isCreated:!1,isCheckbox:!1,isSelectAll:!1,showSaveConfirmation:!1,showBrainConfirmation:!1,showConfirmation:!1,chime:new Audio("chime_aud.wav"),showToast:!1,isSearch:!1,isDiscussionBottom:!1,personalityAvatars:[],fileList:[],database_selectorDialogVisible:!1,isDragOverDiscussion:!1,isDragOverChat:!1,panelCollapsed:!1,isOpen:!1,discussion_id:0}},methods:{add_webpage(){console.log("addWebLink received"),this.$refs.web_url_input_box.showPanel()},addWebpage(){Me.post("/add_webpage",{client_id:this.client_id,url:this.$refs.web_url_input_box.inputText},{headers:this.posts_headers}).then(n=>{n&&n.status&&(console.log("Done"),this.recoverFiles())})},show_progress(n){this.progress_visibility_val=!0},hide_progress(n){this.progress_visibility_val=!1},update_progress(n){console.log("Progress update"),this.progress_value=n.value},onSettingsBinding(){try{this.isLoading=!0,Me.get("/get_active_binding_settings").then(n=>{this.isLoading=!1,n&&(n.data&&Object.keys(n.data).length>0?this.$store.state.universalForm.showForm(n.data,"Binding settings - "+bindingEntry.binding.name,"Save changes","Cancel").then(e=>{try{Me.post("/set_active_binding_settings",e).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. +`+n.name,4,!1)}else console.log("mounting pers");this.$emit("personalitySelected"),Ve(()=>{qe.replace()})}},async select_personality(n){if(!n)return{status:!1,error:"no personality - select_personality"};const e=n.language===null?n.full_path:n.full_path+":"+n.language;console.log("Selecting personality ",e);const i={id:this.$store.state.config.personalities.findIndex(s=>s===e)};try{const s=await Me.post("/select_personality",i);if(s)return this.$store.dispatch("refreshConfig").then(()=>{this.$store.dispatch("refreshPersonalitiesZoo").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),s.data}catch(s){console.log(s.message,"select_personality - settings");return}},emitloaded(){this.$emit("loaded")},showModels(n){n.preventDefault();const e=this.$refs.modelsSelectionList;console.log(e);const t=new MouseEvent("click");e.dispatchEvent(t)},setModel(n){console.log("Setting model to "+n.name),this.selecting_model=!0,this.selectedModel=n,Me.post("/update_setting",{setting_name:"model_name",setting_value:n.name}).then(async e=>{console.log("UPDATED"),console.log(e),await this.$store.dispatch("refreshConfig"),await this.$store.dispatch("refreshModels"),this.$store.state.toast.showToast(`Model changed to ${this.currentModel.name}`,4,!0),this.selecting_model=!1}).catch(e=>{this.$store.state.toast.showToast(`Error ${e}`,4,!0),this.selecting_model=!1})},download_files(){Me.get("/download_files")},remove_file(n){Me.get("/remove_file",{name:n}).then(e=>{console.log(e)})},clear_files(){Me.get("/clear_personality_files_list").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,i=24*1024;let s=0,r=0;t.onloadend=()=>{if(t.error){console.error("Error reading file:",t.error);return}const a=t.result,l=s+a.byteLength>=n.size;Xe.emit("send_file_chunk",{filename:n.name,chunk:a,offset:s,isLastChunk:l,chunkIndex:r}),s+=a.byteLength,r++,l?(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(s,s+i);t.readAsArrayBuffer(a)}console.log("Uploading file"),o()},makeAnEmptyUserMessage(){this.$emit("createEmptyUserMessage",this.message),this.message=""},makeAnEmptyAIMessage(){this.$emit("createEmptyAIMessage")},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.isLesteningToVoice=!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.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer),this.submit()},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")},onPersonalitiesReadyFun(){this.personalities_ready=!0},onShowPersListFun(n){this.showPersonalities=!this.showPersonalities},handleOnTalk(n){this.showPersonalities=!1,this.onTalk(n)},onMountFun(n){console.log("Mounting personality"),this.$refs.mountedPers.constructor()},onUnmountFun(n){console.log("Unmounting personality"),this.$refs.mountedPers.constructor()},onRemount(n){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(n){return Ve(()=>{qe.replace()}),ss(n)},removeItem(n){console.log(n),Me.post("/remove_file",{file:n}).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)},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(){Xe.emit("take_picture"),Xe.on("picture_taken",()=>{Me.get("/get_current_personality_files_list").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 i=()=>{if(t>=e.length){console.log(`Files_list: ${this.filesList}`);return}const s=e[t];this.filesList.push(s),this.isFileSentList.push(!1),this.send_file(s,()=>{t++,i()})};i()}},watch:{installedModels:{immediate:!0,handler(n){this.$nextTick(()=>{this.installedModels=n})}},model_name:{immediate:!0,handler(n){this.$nextTick(()=>{this.model_name=n})}},showfilesList(){Ve(()=>{qe.replace()})},loading(n,e){Ve(()=>{qe.replace()})},filesList:{handler(n,e){let t=0;if(n.length>0)for(let i=0;i{qe.replace()})},activated(){Ve(()=>{qe.replace()})}},zt=n=>(Nr("data-v-3d2d8162"),n=n(),Or(),n),uvt={class:"absolute bottom-0 left-0 w-fit min-w-96 w-full justify-center text-center p-4"},pvt={key:0,class:"items-center gap-2 rounded-lg border bg-bg-light-tone dark:bg-bg-dark-tone p-1.5 shadow-sm hover:shadow-none dark:border-gray-800 w-fit"},_vt={class:"flex"},hvt=["title"],fvt=zt(()=>u("i",{"data-feather":"list"},null,-1)),mvt=[fvt],gvt={key:0},bvt={class:"flex flex-col max-h-64"},Evt=["title"],vvt={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"},yvt={key:0,filesList:"",role:"status"},Svt=zt(()=>u("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"},[u("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"}),u("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)),Tvt=zt(()=>u("span",{class:"sr-only"},"Loading...",-1)),xvt=[Svt,Tvt],Cvt=zt(()=>u("div",null,[u("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),Rvt=zt(()=>u("div",{class:"grow"},null,-1)),Avt={class:"flex flex-row items-center"},wvt={class:"whitespace-nowrap"},Nvt=["onClick"],Ovt=zt(()=>u("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)),Ivt=[Ovt],Mvt={key:1,class:"flex mx-1 w-500"},Dvt={class:"whitespace-nowrap flex flex-row gap-2"},kvt=zt(()=>u("p",{class:"font-bold"}," Total size: ",-1)),Lvt=zt(()=>u("div",{class:"grow"},null,-1)),Pvt=zt(()=>u("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)),Uvt=[Pvt],Fvt=zt(()=>u("i",{"data-feather":"download-cloud",class:"w-5 h-5"},null,-1)),Bvt=[Fvt],Gvt={key:2,class:"mx-1"},zvt={key:1,title:"Selecting model",class:"flex flex-row flex-grow justify-end bg-primary"},Vvt={role:"status"},Hvt=["src"],qvt=zt(()=>u("span",{class:"sr-only"},"Selecting model...",-1)),Yvt={class:"flex w-fit pb-3 relative grow w-full"},$vt={class:"relative grow flex h-12.5 cursor-pointer select-none items-center gap-2 rounded-lg border bg-bg-light-tone dark:bg-bg-dark-tone p-1 shadow-sm hover:shadow-none dark:border-gray-800",tabindex:"0"},Wvt={key:0,title:"Waiting for reply"},Kvt=["src"],jvt=zt(()=>u("div",{role:"status"},[u("span",{class:"sr-only"},"Loading...")],-1)),Qvt={key:1,class:"w-fit group relative"},Xvt={class:"group w-full inline-flex absolute opacity-0 group-hover:opacity-100 transform group-hover:-translate-y-10 group-hover:translate-x-15 transition-all duration-300"},Zvt={key:0,class:"group items-center flex flex-row"},Jvt=["onClick"],eyt=["src","title"],tyt={class:"group items-center flex flex-row"},nyt=["src","title"],iyt={class:"w-fit group relative"},syt={class:"group w-full inline-flex absolute opacity-0 group-hover:opacity-100 transform group-hover:-translate-y-10 group-hover:translate-x-15 transition-all duration-300"},ryt={key:0,class:"group items-center flex flex-row"},oyt=["onClick"],ayt=["src","title"],lyt=["onClick"],cyt=zt(()=>u("span",{class:"hidden hover:block top-3 left-9 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2 border-transparent",title:"Unmount personality"},[u("svg",{"aria-hidden":"true",class:"w-4 h-4 text-red-600 hover:text-red-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[u("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)),dyt=[cyt],uyt={class:"w-fit"},pyt={class:"relative grow"},_yt={class:"group relative w-max"},hyt=zt(()=>u("i",{"data-feather":"send"},null,-1)),fyt=[hyt],myt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Sends your message to the AI.")],-1)),gyt={class:"group relative w-max"},byt=["src"],Eyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Sends your message to the AI with internet search.")],-1)),vyt={class:"group relative w-max"},yyt=zt(()=>u("i",{"data-feather":"mic"},null,-1)),Syt=[yyt],Tyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Press and talk.")],-1)),xyt={key:3,class:"group relative w-max"},Cyt=zt(()=>u("i",{"data-feather":"file-plus"},null,-1)),Ryt=[Cyt],Ayt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Send File to the AI.")],-1)),wyt={class:"group relative w-max"},Nyt=zt(()=>u("i",{"data-feather":"camera"},null,-1)),Oyt=[Nyt],Iyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Take a shot from webcam.")],-1)),Myt={class:"group relative w-max"},Dyt=zt(()=>u("i",{"data-feather":"globe"},null,-1)),kyt=[Dyt],Lyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"Add a weblink to the discussion.")],-1)),Pyt={class:"group relative w-max"},Uyt=zt(()=>u("i",{"data-feather":"message-square"},null,-1)),Fyt=[Uyt],Byt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"New empty User message.")],-1)),Gyt={class:"group relative w-max"},zyt=zt(()=>u("i",{"data-feather":"message-square"},null,-1)),Vyt=[zyt],Hyt=zt(()=>u("div",{class:"pointer-events-none absolute -top-20 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"},[u("p",{class:"max-w-sm text-sm text-gray-800 dark:text-gray-200"},"New empty ai message.")],-1)),qyt=zt(()=>u("div",{class:"ml-auto gap-2"},null,-1));function Yyt(n,e,t,i,s,r){const o=ft("MountedPersonalitiesList"),a=ft("MountedPersonalities"),l=ft("PersonalitiesCommands"),d=ft("UniversalForm");return w(),M($e,null,[u("form",null,[u("div",uvt,[s.filesList.length>0||s.showPersonalities?(w(),M("div",pvt,[u("div",_vt,[u("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:s.showfilesList?"Hide file list":"Show file list",type:"button",onClick:e[0]||(e[0]=Te(c=>s.showfilesList=!s.showfilesList,["stop"]))},mvt,8,hvt)]),s.filesList.length>0&&s.showfilesList==!0?(w(),M("div",gvt,[u("div",bvt,[Ie(rs,{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:Je(()=>[(w(!0),M($e,null,dt(s.filesList,(c,_)=>(w(),M("div",{key:_+"-"+c.name},[u("div",{class:"m-1",title:c.name},[u("div",vvt,[s.isFileSentList[_]?q("",!0):(w(),M("div",yvt,xvt)),Cvt,u("div",{class:Ye(["line-clamp-1 w-3/5",s.isFileSentList[_]?"text-green-500":"text-red-200"])},ge(c.name),3),Rvt,u("div",Avt,[u("p",wvt,ge(r.computedFileSize(c.size)),1),u("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:f=>r.removeItem(c)},Ivt,8,Nvt)])])],8,Evt)]))),128))]),_:1})])])):q("",!0),s.filesList.length>0?(w(),M("div",Mvt,[u("div",Dvt,[kvt,Ze(" "+ge(s.totalSize)+" ("+ge(s.filesList.length)+") ",1)]),Lvt,u("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)=>r.clear_files&&r.clear_files(...c))},Uvt),u("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)=>r.download_files&&r.download_files(...c))},Bvt)])):q("",!0),s.showPersonalities?(w(),M("div",Gvt,[Ie(o,{ref:"mountedPersList",onShowPersList:r.onShowPersListFun,"on-mounted":r.onMountFun,"on-un-mounted":r.onUnmountFun,"on-remounted":n.onRemountFun,"on-talk":r.handleOnTalk,discussionPersonalities:r.allDiscussionPersonalities},null,8,["onShowPersList","on-mounted","on-un-mounted","on-remounted","on-talk","discussionPersonalities"])])):q("",!0)])):q("",!0),s.selecting_model?(w(),M("div",zvt,[u("div",Vvt,[u("img",{src:s.loader_v0,class:"w-50 h-50"},null,8,Hvt),qvt])])):q("",!0),u("div",Yvt,[u("div",$vt,[t.loading?(w(),M("div",Wvt,[u("img",{src:s.loader_v0},null,8,Kvt),jvt])):q("",!0),t.loading?q("",!0):(w(),M("div",Qvt,[u("div",Xvt,[(w(!0),M($e,null,dt(r.installedModels,(c,_)=>(w(),M("div",{class:"w-full",key:_+"-"+c.name,ref_for:!0,ref:"installedModels"},[c.name!=r.model_name?(w(),M("div",Zvt,[u("button",{onClick:Te(f=>r.setModel(c),["prevent"]),class:"w-8 h-8"},[u("img",{src:c.icon?c.icon:s.modelImgPlaceholder,class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary",title:c.name},null,8,eyt)],8,Jvt)])):q("",!0)]))),128))]),u("div",tyt,[u("button",{onClick:e[3]||(e[3]=Te(c=>r.showModelConfig(),["prevent"])),class:"w-8 h-8"},[u("img",{src:r.currentModel.icon?r.currentModel.icon:s.modelImgPlaceholder,class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary",title:r.currentModel?r.currentModel.name:"unknown"},null,8,nyt)])])])),u("div",iyt,[u("div",syt,[(w(!0),M($e,null,dt(this.$store.state.mountedPersArr,(c,_)=>(w(),M("div",{class:"w-full",key:_+"-"+c.name,ref_for:!0,ref:"mountedPersonalities"},[_!=this.$store.state.config.active_personality_id?(w(),M("div",ryt,[u("button",{onClick:Te(f=>r.onPersonalitySelected(c),["prevent"]),class:"w-8 h-8"},[u("img",{src:s.bUrl+c.avatar,onError:e[4]||(e[4]=(...f)=>n.personalityImgPlacehodler&&n.personalityImgPlacehodler(...f)),class:Ye(["w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:border-secondary",this.$store.state.active_personality_id==this.$store.state.personalities.indexOf(c.full_path)?"border-secondary":"border-transparent z-0"]),title:c.name},null,42,ayt)],8,oyt),u("button",{onClick:Te(f=>r.unmountPersonality(c),["prevent"])},dyt,8,lyt)])):q("",!0)]))),128))]),Ie(a,{ref:"mountedPers",onShowPersList:r.onShowPersListFun,onReady:r.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])]),u("div",uyt,[s.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(w(),xt(l,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:r.sendCMDEvent,"on-show-toast-message":t.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):q("",!0)]),u("div",pyt,[le(u("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[5]||(e[5]=c=>s.message=c),title:"Hold SHIFT + ENTER to add new line",class:"inline-block no-scrollbar p-2.5 w-full text-sm text-gray-900 bg-bg-light rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-bg-dark dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Send message...",onKeydown:e[6]||(e[6]=wr(Te(c=>r.submitOnEnter(c),["exact"]),["enter"]))},`\r + `,544),[[Pe,s.message]])]),t.loading?(w(),M("button",{key:2,type:"button",class:"bg-red-500 dark:bg-red-800 hover:bg-red-600 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:hover:bg-bg-dark-tone focus:outline-none dark:focus:ring-blue-800",onClick:e[7]||(e[7]=Te((...c)=>r.stopGenerating&&r.stopGenerating(...c),["stop"]))}," Stop generating ")):q("",!0),u("div",_yt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[8]||(e[8]=(...c)=>r.submit&&r.submit(...c)),title:"Send",class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},fyt)),myt]),u("div",gyt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[9]||(e[9]=(...c)=>r.submitWithInternetSearch&&r.submitWithInternetSearch(...c)),title:"Send With internet",class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},[u("img",{src:s.sendGlobe,width:"50",height:"50"},null,8,byt)])),Eyt]),u("div",vyt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[10]||(e[10]=(...c)=>r.startSpeechRecognition&&r.startSpeechRecognition(...c)),class:Ye([{"text-red-500":s.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"])},Syt,2)),Tyt]),t.loading?q("",!0):(w(),M("div",xyt,[u("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:e[11]||(e[11]=(...c)=>r.addFiles&&r.addFiles(...c)),multiple:""},null,544),u("button",{type:"button",onClick:e[12]||(e[12]=Te((...c)=>r.add_file&&r.add_file(...c),["prevent"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},Ryt),Ayt])),u("div",wyt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[13]||(e[13]=Te((...c)=>r.takePicture&&r.takePicture(...c),["stop"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},Oyt)),Iyt]),u("div",Myt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[14]||(e[14]=Te((...c)=>r.addWebLink&&r.addWebLink(...c),["stop"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer transform transition-transform hover:translate-y-[-5px] active:scale-90"},kyt)),Lyt]),u("div",Pyt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[15]||(e[15]=Te((...c)=>r.makeAnEmptyUserMessage&&r.makeAnEmptyUserMessage(...c),["stop"])),class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},Fyt)),Byt]),u("div",Gyt,[t.loading?q("",!0):(w(),M("button",{key:0,type:"button",onClick:e[16]||(e[16]=Te((...c)=>r.makeAnEmptyAIMessage&&r.makeAnEmptyAIMessage(...c),["stop"])),class:"w-6 text-red-400 hover:text-secondary duration-75 active:scale-90"},Vyt)),Hyt])]),qyt])])]),Ie(d,{ref:"universalForm",class:"z-20"},null,512)],64)}const TO=bt(dvt,[["render",Yyt],["__scopeId","data-v-3d2d8162"]]),$yt={name:"WelcomeComponent",setup(){return{}}},Wyt={class:"flex flex-col text-center"},Kyt=zu('
Logo

LoLLMS

One tool to rule them all


Welcome

Please create a new discussion or select existing one to start

',1),jyt=[Kyt];function Qyt(n,e,t,i,s,r){return w(),M("div",Wyt,jyt)}const xO=bt($yt,[["render",Qyt]]);var Xyt=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=globalThis&&globalThis.__assign||function(){return ou=Object.assign||function(n){for(var e,t=1,i=arguments.length;t"u")return!1;var e=ai(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function dSt(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},s=e.attributes[t]||{},r=e.elements[t];!xi(r)||!ds(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function uSt(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var s=e.elements[i],r=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(l,d){return l[d]="",l},{});!xi(s)||!ds(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const pSt={name:"applyStyles",enabled:!0,phase:"write",fn:dSt,effect:uSt,requires:["computeStyles"]};function os(n){return n.split("-")[0]}var ao=Math.max,du=Math.min,ya=Math.round;function ib(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function IO(){return!/^((?!chrome|android).)*safari/i.test(ib())}function Sa(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=n.getBoundingClientRect(),s=1,r=1;e&&xi(n)&&(s=n.offsetWidth>0&&ya(i.width)/n.offsetWidth||1,r=n.offsetHeight>0&&ya(i.height)/n.offsetHeight||1);var o=mo(n)?ai(n):window,a=o.visualViewport,l=!IO()&&t,d=(i.left+(l&&a?a.offsetLeft:0))/s,c=(i.top+(l&&a?a.offsetTop:0))/r,_=i.width/s,f=i.height/r;return{width:_,height:f,top:c,right:d+_,bottom:c+f,left:d,x:d,y:c}}function PE(n){var e=Sa(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function MO(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&LE(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function zs(n){return ai(n).getComputedStyle(n)}function _St(n){return["table","td","th"].indexOf(ds(n))>=0}function Mr(n){return((mo(n)?n.ownerDocument:n.document)||window.document).documentElement}function dp(n){return ds(n)==="html"?n:n.assignedSlot||n.parentNode||(LE(n)?n.host:null)||Mr(n)}function kC(n){return!xi(n)||zs(n).position==="fixed"?null:n.offsetParent}function hSt(n){var e=/firefox/i.test(ib()),t=/Trident/i.test(ib());if(t&&xi(n)){var i=zs(n);if(i.position==="fixed")return null}var s=dp(n);for(LE(s)&&(s=s.host);xi(s)&&["html","body"].indexOf(ds(s))<0;){var r=zs(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function Tc(n){for(var e=ai(n),t=kC(n);t&&_St(t)&&zs(t).position==="static";)t=kC(t);return t&&(ds(t)==="html"||ds(t)==="body"&&zs(t).position==="static")?e:t||hSt(n)||e}function UE(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Ll(n,e,t){return ao(n,du(e,t))}function fSt(n,e,t){var i=Ll(n,e,t);return i>t?t:i}function DO(){return{top:0,right:0,bottom:0,left:0}}function kO(n){return Object.assign({},DO(),n)}function LO(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var mSt=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,kO(typeof e!="number"?e:LO(e,Sc))};function gSt(n){var e,t=n.state,i=n.name,s=n.options,r=t.elements.arrow,o=t.modifiersData.popperOffsets,a=os(t.placement),l=UE(a),d=[Xn,wi].indexOf(a)>=0,c=d?"height":"width";if(!(!r||!o)){var _=mSt(s.padding,t),f=PE(r),m=l==="y"?Qn:Xn,h=l==="y"?Ai:wi,E=t.rects.reference[c]+t.rects.reference[l]-o[l]-t.rects.popper[c],b=o[l]-t.rects.reference[l],g=Tc(r),v=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,y=E/2-b/2,T=_[m],C=v-f[c]-_[h],x=v/2-f[c]/2+y,O=Ll(T,x,C),R=l;t.modifiersData[i]=(e={},e[R]=O,e.centerOffset=O-x,e)}}function bSt(n){var e=n.state,t=n.options,i=t.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||MO(e.elements.popper,s)&&(e.elements.arrow=s))}const ESt={name:"arrow",enabled:!0,phase:"main",fn:gSt,effect:bSt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ta(n){return n.split("-")[1]}var vSt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ySt(n,e){var t=n.x,i=n.y,s=e.devicePixelRatio||1;return{x:ya(t*s)/s||0,y:ya(i*s)/s||0}}function LC(n){var e,t=n.popper,i=n.popperRect,s=n.placement,r=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,d=n.adaptive,c=n.roundOffsets,_=n.isFixed,f=o.x,m=f===void 0?0:f,h=o.y,E=h===void 0?0:h,b=typeof c=="function"?c({x:m,y:E}):{x:m,y:E};m=b.x,E=b.y;var g=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),y=Xn,T=Qn,C=window;if(d){var x=Tc(t),O="clientHeight",R="clientWidth";if(x===ai(t)&&(x=Mr(t),zs(x).position!=="static"&&a==="absolute"&&(O="scrollHeight",R="scrollWidth")),x=x,s===Qn||(s===Xn||s===wi)&&r===sc){T=Ai;var S=_&&x===C&&C.visualViewport?C.visualViewport.height:x[O];E-=S-i.height,E*=l?1:-1}if(s===Xn||(s===Qn||s===Ai)&&r===sc){y=wi;var A=_&&x===C&&C.visualViewport?C.visualViewport.width:x[R];m-=A-i.width,m*=l?1:-1}}var U=Object.assign({position:a},d&&vSt),F=c===!0?ySt({x:m,y:E},ai(t)):{x:m,y:E};if(m=F.x,E=F.y,l){var K;return Object.assign({},U,(K={},K[T]=v?"0":"",K[y]=g?"0":"",K.transform=(C.devicePixelRatio||1)<=1?"translate("+m+"px, "+E+"px)":"translate3d("+m+"px, "+E+"px, 0)",K))}return Object.assign({},U,(e={},e[T]=v?E+"px":"",e[y]=g?m+"px":"",e.transform="",e))}function SSt(n){var e=n.state,t=n.options,i=t.gpuAcceleration,s=i===void 0?!0:i,r=t.adaptive,o=r===void 0?!0:r,a=t.roundOffsets,l=a===void 0?!0:a,d={placement:os(e.placement),variation:Ta(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,LC(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,LC(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const TSt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:SSt,data:{}};var Wc={passive:!0};function xSt(n){var e=n.state,t=n.instance,i=n.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=ai(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&d.forEach(function(c){c.addEventListener("scroll",t.update,Wc)}),a&&l.addEventListener("resize",t.update,Wc),function(){r&&d.forEach(function(c){c.removeEventListener("scroll",t.update,Wc)}),a&&l.removeEventListener("resize",t.update,Wc)}}const CSt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:xSt,data:{}};var RSt={left:"right",right:"left",bottom:"top",top:"bottom"};function zd(n){return n.replace(/left|right|bottom|top/g,function(e){return RSt[e]})}var ASt={start:"end",end:"start"};function PC(n){return n.replace(/start|end/g,function(e){return ASt[e]})}function FE(n){var e=ai(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function BE(n){return Sa(Mr(n)).left+FE(n).scrollLeft}function wSt(n,e){var t=ai(n),i=Mr(n),s=t.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var d=IO();(d||!d&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+BE(n),y:l}}function NSt(n){var e,t=Mr(n),i=FE(n),s=(e=n.ownerDocument)==null?void 0:e.body,r=ao(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=ao(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+BE(n),l=-i.scrollTop;return zs(s||t).direction==="rtl"&&(a+=ao(t.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function GE(n){var e=zs(n),t=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+i)}function PO(n){return["html","body","#document"].indexOf(ds(n))>=0?n.ownerDocument.body:xi(n)&&GE(n)?n:PO(dp(n))}function Pl(n,e){var t;e===void 0&&(e=[]);var i=PO(n),s=i===((t=n.ownerDocument)==null?void 0:t.body),r=ai(i),o=s?[r].concat(r.visualViewport||[],GE(i)?i:[]):i,a=e.concat(o);return s?a:a.concat(Pl(dp(o)))}function sb(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function OSt(n,e){var t=Sa(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function UC(n,e,t){return e===NO?sb(wSt(n,t)):mo(e)?OSt(e,t):sb(NSt(Mr(n)))}function ISt(n){var e=Pl(dp(n)),t=["absolute","fixed"].indexOf(zs(n).position)>=0,i=t&&xi(n)?Tc(n):n;return mo(i)?e.filter(function(s){return mo(s)&&MO(s,i)&&ds(s)!=="body"}):[]}function MSt(n,e,t,i){var s=e==="clippingParents"?ISt(n):[].concat(e),r=[].concat(s,[t]),o=r[0],a=r.reduce(function(l,d){var c=UC(n,d,i);return l.top=ao(c.top,l.top),l.right=du(c.right,l.right),l.bottom=du(c.bottom,l.bottom),l.left=ao(c.left,l.left),l},UC(n,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function UO(n){var e=n.reference,t=n.element,i=n.placement,s=i?os(i):null,r=i?Ta(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(s){case Qn:l={x:o,y:e.y-t.height};break;case Ai:l={x:o,y:e.y+e.height};break;case wi:l={x:e.x+e.width,y:a};break;case Xn:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var d=s?UE(s):null;if(d!=null){var c=d==="y"?"height":"width";switch(r){case va:l[d]=l[d]-(e[c]/2-t[c]/2);break;case sc:l[d]=l[d]+(e[c]/2-t[c]/2);break}}return l}function rc(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=i===void 0?n.placement:i,r=t.strategy,o=r===void 0?n.strategy:r,a=t.boundary,l=a===void 0?Zyt:a,d=t.rootBoundary,c=d===void 0?NO:d,_=t.elementContext,f=_===void 0?fl:_,m=t.altBoundary,h=m===void 0?!1:m,E=t.padding,b=E===void 0?0:E,g=kO(typeof b!="number"?b:LO(b,Sc)),v=f===fl?Jyt:fl,y=n.rects.popper,T=n.elements[h?v:f],C=MSt(mo(T)?T:T.contextElement||Mr(n.elements.popper),l,c,o),x=Sa(n.elements.reference),O=UO({reference:x,element:y,strategy:"absolute",placement:s}),R=sb(Object.assign({},y,O)),S=f===fl?R:x,A={top:C.top-S.top+g.top,bottom:S.bottom-C.bottom+g.bottom,left:C.left-S.left+g.left,right:S.right-C.right+g.right},U=n.modifiersData.offset;if(f===fl&&U){var F=U[s];Object.keys(A).forEach(function(K){var L=[wi,Ai].indexOf(K)>=0?1:-1,H=[Qn,Ai].indexOf(K)>=0?"y":"x";A[K]+=F[H]*L})}return A}function DSt(n,e){e===void 0&&(e={});var t=e,i=t.placement,s=t.boundary,r=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,d=l===void 0?OO:l,c=Ta(i),_=c?a?DC:DC.filter(function(h){return Ta(h)===c}):Sc,f=_.filter(function(h){return d.indexOf(h)>=0});f.length===0&&(f=_);var m=f.reduce(function(h,E){return h[E]=rc(n,{placement:E,boundary:s,rootBoundary:r,padding:o})[os(E)],h},{});return Object.keys(m).sort(function(h,E){return m[h]-m[E]})}function kSt(n){if(os(n)===kE)return[];var e=zd(n);return[PC(n),e,PC(e)]}function LSt(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var s=t.mainAxis,r=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,d=t.padding,c=t.boundary,_=t.rootBoundary,f=t.altBoundary,m=t.flipVariations,h=m===void 0?!0:m,E=t.allowedAutoPlacements,b=e.options.placement,g=os(b),v=g===b,y=l||(v||!h?[zd(b)]:kSt(b)),T=[b].concat(y).reduce(function(fe,ve){return fe.concat(os(ve)===kE?DSt(e,{placement:ve,boundary:c,rootBoundary:_,padding:d,flipVariations:h,allowedAutoPlacements:E}):ve)},[]),C=e.rects.reference,x=e.rects.popper,O=new Map,R=!0,S=T[0],A=0;A=0,H=L?"width":"height",G=rc(e,{placement:U,boundary:c,rootBoundary:_,altBoundary:f,padding:d}),P=L?K?wi:Xn:K?Ai:Qn;C[H]>x[H]&&(P=zd(P));var j=zd(P),Y=[];if(r&&Y.push(G[F]<=0),a&&Y.push(G[P]<=0,G[j]<=0),Y.every(function(fe){return fe})){S=U,R=!1;break}O.set(U,Y)}if(R)for(var Q=h?3:1,re=function(ve){var Ae=T.find(function(J){var me=O.get(J);if(me)return me.slice(0,ve).every(function(ee){return ee})});if(Ae)return S=Ae,"break"},te=Q;te>0;te--){var Z=re(te);if(Z==="break")break}e.placement!==S&&(e.modifiersData[i]._skip=!0,e.placement=S,e.reset=!0)}}const PSt={name:"flip",enabled:!0,phase:"main",fn:LSt,requiresIfExists:["offset"],data:{_skip:!1}};function FC(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function BC(n){return[Qn,wi,Ai,Xn].some(function(e){return n[e]>=0})}function USt(n){var e=n.state,t=n.name,i=e.rects.reference,s=e.rects.popper,r=e.modifiersData.preventOverflow,o=rc(e,{elementContext:"reference"}),a=rc(e,{altBoundary:!0}),l=FC(o,i),d=FC(a,s,r),c=BC(l),_=BC(d);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:c,hasPopperEscaped:_},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":_})}const FSt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:USt};function BSt(n,e,t){var i=os(n),s=[Xn,Qn].indexOf(i)>=0?-1:1,r=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[Xn,wi].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function GSt(n){var e=n.state,t=n.options,i=n.name,s=t.offset,r=s===void 0?[0,0]:s,o=OO.reduce(function(c,_){return c[_]=BSt(_,e.rects,r),c},{}),a=o[e.placement],l=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=d),e.modifiersData[i]=o}const zSt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:GSt};function VSt(n){var e=n.state,t=n.name;e.modifiersData[t]=UO({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const HSt={name:"popperOffsets",enabled:!0,phase:"read",fn:VSt,data:{}};function qSt(n){return n==="x"?"y":"x"}function YSt(n){var e=n.state,t=n.options,i=n.name,s=t.mainAxis,r=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,d=t.rootBoundary,c=t.altBoundary,_=t.padding,f=t.tether,m=f===void 0?!0:f,h=t.tetherOffset,E=h===void 0?0:h,b=rc(e,{boundary:l,rootBoundary:d,padding:_,altBoundary:c}),g=os(e.placement),v=Ta(e.placement),y=!v,T=UE(g),C=qSt(T),x=e.modifiersData.popperOffsets,O=e.rects.reference,R=e.rects.popper,S=typeof E=="function"?E(Object.assign({},e.rects,{placement:e.placement})):E,A=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),U=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,F={x:0,y:0};if(x){if(r){var K,L=T==="y"?Qn:Xn,H=T==="y"?Ai:wi,G=T==="y"?"height":"width",P=x[T],j=P+b[L],Y=P-b[H],Q=m?-R[G]/2:0,re=v===va?O[G]:R[G],te=v===va?-R[G]:-O[G],Z=e.elements.arrow,fe=m&&Z?PE(Z):{width:0,height:0},ve=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:DO(),Ae=ve[L],J=ve[H],me=Ll(0,O[G],fe[G]),ee=y?O[G]/2-Q-me-Ae-A.mainAxis:re-me-Ae-A.mainAxis,Se=y?-O[G]/2+Q+me+J+A.mainAxis:te+me+J+A.mainAxis,Oe=e.elements.arrow&&Tc(e.elements.arrow),k=Oe?T==="y"?Oe.clientTop||0:Oe.clientLeft||0:0,B=(K=U==null?void 0:U[T])!=null?K:0,$=P+ee-B-k,ce=P+Se-B,ne=Ll(m?du(j,$):j,P,m?ao(Y,ce):Y);x[T]=ne,F[T]=ne-P}if(a){var Ce,we=T==="x"?Qn:Xn,V=T==="x"?Ai:wi,_e=x[C],ie=C==="y"?"height":"width",ae=_e+b[we],D=_e-b[V],I=[Qn,Xn].indexOf(g)!==-1,z=(Ce=U==null?void 0:U[C])!=null?Ce:0,he=I?ae:_e-O[ie]-R[ie]-z+A.altAxis,X=I?_e+O[ie]+R[ie]-z-A.altAxis:D,se=m&&I?fSt(he,_e,X):Ll(m?he:ae,_e,m?X:D);x[C]=se,F[C]=se-_e}e.modifiersData[i]=F}}const $St={name:"preventOverflow",enabled:!0,phase:"main",fn:YSt,requiresIfExists:["offset"]};function WSt(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function KSt(n){return n===ai(n)||!xi(n)?FE(n):WSt(n)}function jSt(n){var e=n.getBoundingClientRect(),t=ya(e.width)/n.offsetWidth||1,i=ya(e.height)/n.offsetHeight||1;return t!==1||i!==1}function QSt(n,e,t){t===void 0&&(t=!1);var i=xi(e),s=xi(e)&&jSt(e),r=Mr(e),o=Sa(n,s,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((ds(e)!=="body"||GE(r))&&(a=KSt(e)),xi(e)?(l=Sa(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=BE(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function XSt(n){var e=new Map,t=new Set,i=[];n.forEach(function(r){e.set(r.name,r)});function s(r){t.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&s(l)}}),i.push(r)}return n.forEach(function(r){t.has(r.name)||s(r)}),i}function ZSt(n){var e=XSt(n);return cSt.reduce(function(t,i){return t.concat(e.filter(function(s){return s.phase===i}))},[])}function JSt(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function e0t(n){var e=n.reduce(function(t,i){var s=t[i.name];return t[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var GC={placement:"bottom",modifiers:[],strategy:"absolute"};function zC(){for(var n=arguments.length,e=new Array(n),t=0;t(Nr("data-v-46f45c62"),n=n(),Or(),n),s0t={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center"},r0t={class:"flex flex-col text-center"},o0t={class:"flex flex-col text-center items-center"},a0t={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},l0t=Vt(()=>u("img",{class:"w-24 animate-bounce",title:"LoLLMS WebUI",src:ga,alt:"Logo"},null,-1)),c0t={class:"flex flex-col items-start"},d0t={class:"text-2xl"},u0t=Vt(()=>u("p",{class:"text-gray-400 text-base"},"One tool to rule them all",-1)),p0t=Vt(()=>u("p",{class:"text-gray-400 text-base"},"by ParisNeo",-1)),_0t=Vt(()=>u("hr",{class:"mt-1 w-96 h-1 mx-auto my-2 md:my-2 dark:bg-bg-dark-tone-panel bg-bg-light-tone-panel border-0 rounded"},null,-1)),h0t=Vt(()=>u("p",{class:"text-2xl mb-10"},"Welcome",-1)),f0t={role:"status",class:"text-center w-full display: flex; flex-row align-items: center;"},m0t={class:"text-2xl animate-pulse mt-2"},g0t=Vt(()=>u("i",{"data-feather":"chevron-right"},null,-1)),b0t=[g0t],E0t=Vt(()=>u("i",{"data-feather":"chevron-left"},null,-1)),v0t=[E0t],y0t={key:0,class:"relative flex flex-col no-scrollbar shadow-lg min-w-[24rem] max-w-[24rem] bg-bg-light-tone dark:bg-bg-dark-tone"},S0t={class:"sticky z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md"},T0t={class:"flex-row p-4 flex items-center gap-3 flex-0"},x0t=Vt(()=>u("i",{"data-feather":"plus"},null,-1)),C0t=[x0t],R0t=Vt(()=>u("i",{"data-feather":"check-square"},null,-1)),A0t=[R0t],w0t=Vt(()=>u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Reset database, remove all discussions"},[u("i",{"data-feather":"refresh-ccw"})],-1)),N0t=Vt(()=>u("i",{"data-feather":"database"},null,-1)),O0t=[N0t],I0t=Vt(()=>u("i",{"data-feather":"log-in"},null,-1)),M0t=[I0t],D0t={key:0,class:"dropdown"},k0t=Vt(()=>u("i",{"data-feather":"search"},null,-1)),L0t=[k0t],P0t=Vt(()=>u("i",{"data-feather":"save"},null,-1)),U0t=[P0t],F0t={key:2,class:"flex gap-3 flex-1 items-center duration-75"},B0t=Vt(()=>u("i",{"data-feather":"x"},null,-1)),G0t=[B0t],z0t=Vt(()=>u("i",{"data-feather":"check"},null,-1)),V0t=[z0t],H0t=["src"],q0t=["src"],Y0t=["src"],$0t=["src"],W0t={key:7,title:"Loading..",class:"flex flex-row flex-grow justify-end"},K0t=Vt(()=>u("div",{role:"status"},[u("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"},[u("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"}),u("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"})]),u("span",{class:"sr-only"},"Loading...")],-1)),j0t=[K0t],Q0t={key:0,class:"flex-row items-center gap-3 flex-0 w-full"},X0t={class:"p-4 pt-2"},Z0t={class:"relative"},J0t=Vt(()=>u("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[u("div",{class:"scale-75"},[u("i",{"data-feather":"search"})])],-1)),eTt={class:"absolute inset-y-0 right-0 flex items-center pr-3"},tTt=Vt(()=>u("i",{"data-feather":"x"},null,-1)),nTt=[tTt],iTt={key:1,class:"h-px bg-bg-light p-0 mb-4 px-4 mx-4 border-0 dark:bg-bg-dark"},sTt={key:2,class:"flex flex-row flex-grow p-4 pt-0 items-center"},rTt={class:"flex flex-row flex-grow"},oTt={key:0},aTt={class:"flex flex-row"},lTt={key:0,class:"flex gap-3"},cTt=Vt(()=>u("i",{"data-feather":"trash"},null,-1)),dTt=[cTt],uTt={key:1,class:"flex gap-3 mx-3 flex-1 items-center justify-end group-hover:visible duration-75"},pTt=Vt(()=>u("i",{"data-feather":"check"},null,-1)),_Tt=[pTt],hTt=Vt(()=>u("i",{"data-feather":"x"},null,-1)),fTt=[hTt],mTt={class:"flex gap-3"},gTt=Vt(()=>u("i",{"data-feather":"log-out"},null,-1)),bTt=[gTt],ETt=Vt(()=>u("i",{"data-feather":"bookmark"},null,-1)),vTt=[ETt],yTt=Vt(()=>u("i",{"data-feather":"list"},null,-1)),STt=[yTt],TTt={class:"relative flex flex-row flex-grow mb-10 z-0 w-full"},xTt={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"},CTt=Vt(()=>u("p",{class:"px-3"},"No discussions are found",-1)),RTt=[CTt],ATt=Vt(()=>u("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)),wTt={class:"ml-2"},NTt={key:1,class:"relative flex flex-col flex-grow w-full"},OTt={class:"container pt-4 pb-50 mb-50 w-full"},ITt=Vt(()=>u("div",null,[u("br"),u("br"),u("br"),u("br"),u("br"),u("br"),u("br")],-1)),MTt=Vt(()=>u("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)),DTt={key:0,class:"bottom-0 flex flex-row items-center justify-center"},kTt={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"},LTt={class:"text-2xl animate-pulse mt-2 text-white"},PTt={setup(){},data(){return{memory_icon:YO,active_skills:$O,inactive_skills:WO,skillsRegistry:KO,posts_headers:{accept:"application/json","Content-Type":"application/json"},host:"",progress_visibility_val:!0,progress_value:0,msgTypes:{MSG_TYPE_CHUNK:0,MSG_TYPE_FULL:1,MSG_TYPE_FULL_INVISIBLE_TO_AI:2,MSG_TYPE_FULL_INVISIBLE_TO_USER:3,MSG_TYPE_EXCEPTION:4,MSG_TYPE_WARNING:5,MSG_TYPE_INFO:6,MSG_TYPE_STEP:7,MSG_TYPE_STEP_START:8,MSG_TYPE_STEP_PROGRESS:9,MSG_TYPE_STEP_END:10,MSG_TYPE_JSON_INFOS:11,MSG_TYPE_REF:12,MSG_TYPE_CODE:13,MSG_TYPE_UI:14,MSG_TYPE_NEW_MESSAGE:15,MSG_TYPE_FINISHED_MESSAGE:17},senderTypes:{SENDER_TYPES_USER:0,SENDER_TYPES_AI:1,SENDER_TYPES_SYSTEM:2},list:[],tempList:[],currentDiscussion:{},discussionArr:[],loading:!1,filterTitle:"",filterInProgress:!1,isCreated:!1,isCheckbox:!1,isSelectAll:!1,showSaveConfirmation:!1,showBrainConfirmation:!1,showConfirmation:!1,chime:new Audio("chime_aud.wav"),showToast:!1,isSearch:!1,isDiscussionBottom:!1,personalityAvatars:[],fileList:[],database_selectorDialogVisible:!1,isDragOverDiscussion:!1,isDragOverChat:!1,panelCollapsed:!1,isOpen:!1,discussion_id:0}},methods:{add_webpage(){console.log("addWebLink received"),this.$refs.web_url_input_box.showPanel()},addWebpage(){Me.post("/add_webpage",{client_id:this.client_id,url:this.$refs.web_url_input_box.inputText},{headers:this.posts_headers}).then(n=>{n&&n.status&&(console.log("Done"),this.recoverFiles())})},show_progress(n){this.progress_visibility_val=!0},hide_progress(n){this.progress_visibility_val=!1},update_progress(n){console.log("Progress update"),this.progress_value=n.value},onSettingsBinding(){try{this.isLoading=!0,Me.get("/get_active_binding_settings").then(n=>{this.isLoading=!1,n&&(n.data&&Object.keys(n.data).length>0?this.$store.state.universalForm.showForm(n.data,"Binding settings - "+bindingEntry.binding.name,"Save changes","Cancel").then(e=>{try{Me.post("/set_active_binding_settings",e).then(t=>{t&&t.data?(console.log("binding set with new settings",t.data),this.$store.state.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$store.state.toast.showToast(`Did not get binding settings responses. `+t,4,!1),this.isLoading=!1)})}catch(t){this.$store.state.toast.showToast(`Did not get binding settings responses. Endpoint error: `+t.message,4,!1),this.isLoading=!1}}):(this.$store.state.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(n){this.isLoading=!1,this.$store.state.toast.showToast("Could not open binding settings. Endpoint error: "+n.message,4,!1)}},showDatabaseSelector(){this.database_selectorDialogVisible=!0},async ondatabase_selectorDialogSelected(n){console.log("Selected:",n)},onclosedatabase_selectorDialog(){this.database_selectorDialogVisible=!1},async onvalidatedatabase_selectorChoice(n){if(this.database_selectorDialogVisible=!1,(await Me.post("/select_database",{client_id:this.client_id,name:n},{headers:this.posts_headers})).status){console.log("Selected database"),this.$store.state.config=await Me.get("/get_config"),console.log("new config loaded :",this.$store.state.config);let t=await Me.get("/list_databases").data;console.log("New list of database: ",t),this.$store.state.databases=t,console.log("New list of database: ",this.$store.state.databases),location.reload()}},async addDiscussion2SkillsLibrary(){(await Me.post("/add_discussion_to_skills_library",{client_id:this.client_id},{headers:this.posts_headers})).status&&console.log("done")},async toggleSkillsLib(){this.$store.state.config.activate_skills_lib=!this.$store.state.config.activate_skills_lib,await this.applyConfiguration()},async showSkillsLib(){this.$refs.skills_lib.showSkillsLibrary()},async applyConfiguration(){this.loading=!0;const n=await Me.post("/apply_settings",{config:this.$store.state.config});this.loading=!1,n.data.status?this.$store.state.toast.showToast("Configuration changed successfully.",4,!0):this.$store.state.toast.showToast("Configuration change failed.",4,!1),Ve(()=>{qe.replace()})},save_configuration(){this.showConfirmation=!1,Me.post("/save_settings",{}).then(n=>{if(n)return n.status?this.$store.state.toast.showToast("Settings saved!",4,!0):this.$store.state.messageBox.showMessage("Error: Couldn't save settings!"),n.data}).catch(n=>(console.log(n.message,"save_configuration"),this.$store.state.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},showToastMessage(n,e,t){console.log("sending",n),this.$store.state.toast.showToast(n,e,t)},togglePanel(){this.panelCollapsed=!this.panelCollapsed},toggleDropdown(){this.isOpen=!this.isOpen},importChatGPT(){},async api_get_req(n){try{const e=await Me.get("/"+n);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},async list_discussions(){try{const n=await Me.get("/list_discussions");if(n)return this.createDiscussionList(n.data),n.data}catch(n){return console.log("Error: Could not list discussions",n.message),[]}},load_discussion(n,e){n&&(console.log("Loading discussion",n),this.loading=!0,this.discussionArr=[],this.setDiscussionLoading(n,this.loading),Xe.on("discussion",t=>{console.log("Discussion recovered"),this.loading=!1,this.setDiscussionLoading(n,this.loading),t&&(this.discussionArr=t.filter(i=>i.message_type==this.msgTypes.MSG_TYPE_CHUNK||i.message_type==this.msgTypes.MSG_TYPE_FULL||i.message_type==this.msgTypes.MSG_TYPE_FULL_INVISIBLE_TO_AI||i.message_type==this.msgTypes.MSG_TYPE_CODE||i.message_type==this.msgTypes.MSG_TYPE_JSON_INFOS||i.message_type==this.msgTypes.MSG_TYPE_UI),console.log("this.discussionArr"),console.log(this.discussionArr),e&&e()),Xe.off("discussion")}),Xe.emit("load_discussion",{id:n}),console.log("here"))},recoverFiles(){console.log("Recovering files"),Me.get("/get_current_personality_files_list").then(n=>{this.$refs.chatBox.filesList=n.data.files,this.$refs.chatBox.isFileSentList=n.data.files.map(e=>!0),console.log(`Files recovered: ${this.$refs.chatBox.filesList}`)})},new_discussion(n){try{this.loading=!0,Xe.on("discussion_created",e=>{Xe.off("discussion_created"),this.list_discussions().then(()=>{const t=this.list.findIndex(s=>s.id==e.id),i=this.list[t];this.selectDiscussion(i),this.load_discussion(e.id,()=>{this.loading=!1,this.recoverFiles(),Ve(()=>{const s=document.getElementById("dis-"+e.id);this.scrollToElement(s),console.log("Scrolling tp "+s)})})})}),console.log("new_discussion ",n),Xe.emit("new_discussion",{title:n})}catch(e){return console.log("Error: Could not create new discussion",e.message),{}}},async delete_discussion(n){try{n&&(this.loading=!0,this.setDiscussionLoading(n,this.loading),await Me.post("/delete_discussion",{client_id:this.client_id,id:n},{headers:this.posts_headers}),this.loading=!1,this.setDiscussionLoading(n,this.loading))}catch(e){console.log("Error: Could not delete discussion",e.message),this.loading=!1,this.setDiscussionLoading(n,this.loading)}},async edit_title(n,e){try{if(n){this.loading=!0,this.setDiscussionLoading(n,this.loading);const t=await Me.post("/edit_title",{client_id:this.client_id,id:n,title:e},{headers:this.posts_headers});if(this.loading=!1,this.setDiscussionLoading(n,this.loading),t.status==200){const i=this.list.findIndex(r=>r.id==n),s=this.list[i];s.title=e,this.tempList=this.list}}}catch(t){console.log("Error: Could not edit title",t.message),this.loading=!1,this.setDiscussionLoading(n,this.loading)}},async make_title(n){try{if(n){this.loading=!0,this.setDiscussionLoading(n,this.loading);const e=await Me.post("/make_title",{client_id:this.client_id,id:n},{headers:this.posts_headers});if(console.log("Making title:",e),this.loading=!1,this.setDiscussionLoading(n,this.loading),e.status==200){const t=this.list.findIndex(s=>s.id==n),i=this.list[t];i.title=e.data.title,this.tempList=this.list}}}catch(e){console.log("Error: Could not edit title",e.message),this.loading=!1,this.setDiscussionLoading(n,this.loading)}},async delete_message(n){try{console.log(typeof n),console.log(typeof this.client_id),console.log(n),console.log(this.client_id);const e=await Me.post("/delete_message",{client_id:this.client_id,id:n},{headers:this.posts_headers});if(e)return e.data}catch(e){return console.log("Error: Could delete message",e.message),{}}},async stop_gen(){try{if(this.discussionArr.length>0){const n=this.discussionArr[this.discussionArr.length-1];n.status_message="Generation canceled"}if(Xe.emit("cancel_generation"),res)return res.data}catch(n){return console.log("Error: Could not stop generating",n.message),{}}},async message_rank_up(n){try{const e=await Me.post("/message_rank_up",{client_id:this.client_id,id:n},{headers:this.posts_headers});if(e)return e.data}catch(e){return console.log("Error: Could not rank up message",e.message),{}}},async message_rank_down(n){try{const e=await Me.post("/message_rank_down",{client_id:this.client_id,id:n},{headers:this.posts_headers});if(e)return e.data}catch(e){return console.log("Error: Could not rank down message",e.message),{}}},async edit_message(n,e,t){try{console.log(typeof this.client_id),console.log(typeof n),console.log(typeof e),console.log(typeof{audio_url:t});const i=await Me.post("/edit_message",{client_id:this.client_id,id:n,message:e,metadata:[{audio_url:t}]},{headers:this.posts_headers});if(i)return i.data}catch(i){return console.log("Error: Could not update message",i.message),{}}},async export_multiple_discussions(n,e){try{if(n.length>0){const t=await Me.post("/export_multiple_discussions",{discussion_ids:n,export_format:e},{headers:this.posts_headers});if(t)return t.data}}catch(t){return console.log("Error: Could not export multiple discussions",t.message),{}}},async import_multiple_discussions(n){try{if(n.length>0){console.log("sending import",n);const e=await Me.post("/import_multiple_discussions",{jArray:n},{headers:this.posts_headers});if(e)return console.log("import response",e.data),e.data}}catch(e){console.log("Error: Could not import multiple discussions",e.message);return}},filterDiscussions(){this.filterInProgress||(this.filterInProgress=!0,setTimeout(()=>{this.filterTitle?this.list=this.tempList.filter(n=>n.title&&n.title.includes(this.filterTitle)):this.list=this.tempList,this.filterInProgress=!1},100))},async selectDiscussion(n){if(this.isGenerating){this.$store.state.toast.showToast("You are currently generating a text. Please wait for text generation to finish or stop it before trying to select another discussion",4,!1);return}n&&(this.currentDiscussion===void 0?(this.currentDiscussion=n,this.setPageTitle(n),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(n.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)})):this.currentDiscussion.id!=n.id&&(console.log("item",n),console.log("this.currentDiscussion",this.currentDiscussion),this.currentDiscussion=n,console.log("this.currentDiscussion",this.currentDiscussion),this.setPageTitle(n),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(n.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)})),Ve(()=>{const e=document.getElementById("dis-"+this.currentDiscussion.id);this.scrollToElementInContainer(e,"leftPanel");const t=document.getElementById("messages-list");this.scrollBottom(t)}))},scrollToElement(n){n?n.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}):console.log("Error: scrollToElement")},scrollToElementInContainer(n,e){try{const t=n.offsetTop;document.getElementById(e).scrollTo({top:t,behavior:"smooth"})}catch{console.log("error")}},scrollBottom(n){n?n.scrollTo({top:n.scrollHeight,behavior:"smooth"}):console.log("Error: scrollBottom")},scrollTop(n){n?n.scrollTo({top:0,behavior:"smooth"}):console.log("Error: scrollTop")},createUserMsg(n){let e={content:n.message,id:n.id,rank:0,sender:n.user,created_at:n.created_at,steps:[],html_js_s:[],status_message:"Warming up"};this.discussionArr.push(e),Ve(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},updateLastUserMsg(n){const e=this.discussionArr.indexOf(i=>i.id=n.user_id),t={binding:n.binding,content:n.message,created_at:n.created_at,type:n.type,finished_generating_at:n.finished_generating_at,id:n.user_id,model:n.model,personality:n.personality,sender:n.user,steps:[]};e!==-1&&(this.discussionArr[e]=t)},socketIOConnected(){return console.log("socketIOConnected"),this.$store.state.isConnected=!0,this.$store.state.client_id=Xe.id,!0},socketIODisconnected(){return console.log("socketIOConnected"),this.currentDiscussion=null,this.$store.dispatch("refreshModels"),this.$store.state.isConnected=!1,!0},new_message(n){n.sender_type==this.SENDER_TYPES_AI&&(this.isGenerating=!0),console.log("Making a new message"),console.log("New message",n);let e={sender:n.sender,message_type:n.message_type,sender_type:n.sender_type,content:n.content,id:n.id,discussion_id:n.discussion_id,parent_id:n.parent_id,binding:n.binding,model:n.model,personality:n.personality,created_at:n.created_at,finished_generating_at:n.finished_generating_at,rank:0,ui:n.ui,steps:[],parameters:n.parameters,metadata:n.metadata,open:n.open};e.status_message="Warming up",console.log(e),this.discussionArr.push(e),(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,n.message),console.log("infos",n)},talk(n){this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Me.get("/get_generation_status",{}).then(e=>{e&&(e.data.status?console.log("Already generating"):(console.log("Generating message from ",e.data.status),Xe.emit("generate_msg_from",{id:-1}),this.discussionArr.length>0&&Number(this.discussionArr[this.discussionArr.length-1].id)+1))}).catch(e=>{console.log("Error: Could not get generation status",e)})},createEmptyUserMessage(n){Xe.emit("create_empty_message",{type:0,message:n})},createEmptyAIMessage(){Xe.emit("create_empty_message",{type:1})},sendMsg(n,e){if(!n){this.$store.state.toast.showToast("Message contains no content!",4,!1);return}this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Me.get("/get_generation_status",{}).then(t=>{if(t)if(t.data.status)console.log("Already generating");else{e=="internet"?Xe.emit("generate_msg_with_internet",{prompt:n}):Xe.emit("generate_msg",{prompt:n});let i=0;this.discussionArr.length>0&&(i=Number(this.discussionArr[this.discussionArr.length-1].id)+1);let s={message:n,id:i,rank:0,user:this.$store.state.config.user_name,created_at:new Date().toLocaleString(),sender:this.$store.state.config.user_name,message_type:this.msgTypes.MSG_TYPE_FULL,sender_type:this.senderTypes.SENDER_TYPES_USER,content:n,id:i,discussion_id:this.discussion_id,parent_id:i,binding:"",model:"",personality:"",created_at:new Date().toLocaleString(),finished_generating_at:new Date().toLocaleString(),rank:0,steps:[],parameters:null,metadata:[],ui:null};this.createUserMsg(s)}}).catch(t=>{console.log("Error: Could not get generation status",t)})},sendCmd(n){this.isGenerating=!0,Xe.emit("execute_command",{command:n,parameters:[]})},notify(n){self.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Ve(()=>{const e=document.getElementById("messages-list");this.scrollBottom(e)}),n.display_type==0?this.$store.state.toast.showToast(n.content,n.duration,n.notification_type):n.display_type==1?this.$store.state.messageBox.showMessage(n.content):n.display_type==2?(this.$store.state.messageBox.hideMessage(),this.$store.state.yesNoDialog.askQuestion(n.content,"Yes","No").then(e=>{Xe.emit("yesNoRes",{yesRes:e})})):n.display_type==3?this.$store.state.messageBox.showBlockingMessage(n.content):n.display_type==4&&this.$store.state.messageBox.hideMessage(),this.chime.play()},streamMessageContent(n){if(this.discussion_id=n.discussion_id,this.setDiscussionLoading(this.discussion_id,!0),this.currentDiscussion.id==this.discussion_id){const e=this.discussionArr.findIndex(i=>i.id==n.id),t=this.discussionArr[e];if(t&&(n.message_type==this.msgTypes.MSG_TYPE_FULL||n.message_type==this.msgTypes.MSG_TYPE_FULL_INVISIBLE_TO_AI))t.content=n.content,t.finished_generating_at=n.finished_generating_at;else if(t&&n.message_type==this.msgTypes.MSG_TYPE_CHUNK)this.isGenerating=!0,t.content+=n.content;else if(n.message_type==this.msgTypes.MSG_TYPE_STEP)t.status_message=n.content,t.steps.push({message:n.content,done:!0,status:!0,type:"instantanious"});else if(n.message_type==this.msgTypes.MSG_TYPE_STEP_START)t.status_message=n.content,t.steps.push({message:n.content,done:!1,status:!0,type:"start_end"});else if(n.message_type==this.msgTypes.MSG_TYPE_STEP_END){console.log("received step end",n);try{const i=t.steps.find(s=>s.message===n.content);if(i){i.done=!0;try{console.log(n.parameters);const s=n.parameters;s!=null&&(i.status=s.status,console.log(s))}catch(s){console.error("Error parsing JSON:",s.message)}}}catch{console.log("error")}}else n.message_type==this.msgTypes.MSG_TYPE_JSON_INFOS?(console.log("JSON message"),console.log(n.metadata),t.metadata=n.metadata):n.message_type==this.msgTypes.MSG_TYPE_UI?(console.log("UI message"),t.ui=n.ui,console.log(t.ui)):n.message_type==this.msgTypes.MSG_TYPE_EXCEPTION&&this.$store.state.toast.showToast(n.content,5,!1)}this.$nextTick(()=>{qe.replace()})},async changeTitleUsingUserMSG(n,e){const t=this.list.findIndex(s=>s.id==n),i=this.list[t];e&&(i.title=e,this.tempList=this.list,await this.edit_title(n,e))},async createNewDiscussion(){this.new_discussion(null)},loadLastUsedDiscussion(){console.log("Loading last discussion");const n=localStorage.getItem("selected_discussion");if(console.log("Last discussion id: ",n),n){const e=this.list.findIndex(i=>i.id==n),t=this.list[e];t&&this.selectDiscussion(t)}},onCopyPersonalityName(n){this.$store.state.toast.showToast("Copied name to clipboard!",4,!0),navigator.clipboard.writeText(n.name)},async deleteDiscussion(n){await this.delete_discussion(n),this.currentDiscussion.id==n&&(this.currentDiscussion={},this.discussionArr=[],this.setPageTitle()),this.list.splice(this.list.findIndex(e=>e.id==n),1),this.createDiscussionList(this.list)},async deleteDiscussionMulti(){const n=this.selectedDiscussions;for(let e=0;ei.id==t.id),1)}this.tempList=this.list,this.isCheckbox=!1,this.$store.state.toast.showToast("Removed ("+n.length+") items",4,!0),this.showConfirmation=!1,console.log("Multi delete done")},async deleteMessage(n){await this.delete_message(n).then(()=>{this.discussionArr.splice(this.discussionArr.findIndex(e=>e.id==n),1)}).catch(()=>{this.$store.state.toast.showToast("Could not remove message",4,!1),console.log("Error: Could not delete message")})},async editTitle(n){const e=this.list.findIndex(i=>i.id==n.id),t=this.list[e];t.title=n.title,t.loading=!0,await this.edit_title(n.id,n.title),t.loading=!1},async makeTitle(n){this.list.findIndex(e=>e.id==n.id),await this.make_title(n.id)},checkUncheckDiscussion(n,e){const t=this.list.findIndex(s=>s.id==e),i=this.list[t];i.checkBoxValue=n.target.checked,this.tempList=this.list},selectAllDiscussions(){this.isSelectAll=!this.tempList.filter(n=>n.checkBoxValue==!1).length>0;for(let n=0;n({id:t.id,title:t.title,selected:!1,loading:!1,checkBoxValue:!1})).sort(function(t,i){return i.id-t.id});this.list=e,this.tempList=e}},setDiscussionLoading(n,e){try{const t=this.list.findIndex(s=>s.id==n),i=this.list[t];i.loading=e}catch{console.log("Error setting discussion loading")}},setPageTitle(n){if(n)if(n.id){const e=n.title?n.title==="untitled"?"New discussion":n.title:"New discussion";document.title="LoLLMS WebUI - "+e}else{const e=n||"Welcome";document.title="LoLLMS WebUI - "+e}else{const e=n||"Welcome";document.title="LoLLMS WebUI - "+e}},async rankUpMessage(n){await this.message_rank_up(n).then(e=>{const t=this.discussionArr[this.discussionArr.findIndex(i=>i.id==n)];t.rank=e.new_rank}).catch(()=>{this.$store.state.toast.showToast("Could not rank up message",4,!1),console.log("Error: Could not rank up message")})},async rankDownMessage(n){await this.message_rank_down(n).then(e=>{const t=this.discussionArr[this.discussionArr.findIndex(i=>i.id==n)];t.rank=e.new_rank}).catch(()=>{this.$store.state.toast.showToast("Could not rank down message",4,!1),console.log("Error: Could not rank down message")})},async updateMessage(n,e,t){await this.edit_message(n,e,t).then(()=>{const i=this.discussionArr[this.discussionArr.findIndex(s=>s.id==n)];i.content=e}).catch(()=>{this.$store.state.toast.showToast("Could not update message",4,!1),console.log("Error: Could not update message")})},resendMessage(n,e,t){Ve(()=>{qe.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Me.get("/get_generation_status",{}).then(i=>{i&&(i.data.status?(this.$store.state.toast.showToast("The server is busy. Wait",4,!1),console.log("Already generating")):Xe.emit("generate_msg_from",{prompt:e,id:n,msg_type:t}))}).catch(i=>{console.log("Error: Could not get generation status",i)})},continueMessage(n,e){Ve(()=>{qe.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),Me.get("/get_generation_status",{}).then(t=>{t&&(t.data.status?console.log("Already generating"):Xe.emit("continue_generate_msg_from",{prompt:e,id:n}))}).catch(t=>{console.log("Error: Could not get generation status",t)})},stopGenerating(){this.stop_gen(),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),console.log("Stopped generating"),Ve(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)})},finalMsgEvent(n){if(console.log("final",n),this.discussion_id=n.discussion_id,this.currentDiscussion.id==this.discussion_id){const i=this.discussionArr.findIndex(s=>s.id==n.id);this.discussionArr[i].content=n.content,this.discussionArr[i].finished_generating_at=n.finished_generating_at}Ve(()=>{const i=document.getElementById("messages-list");this.scrollBottom(i)}),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),this.chime.play();const e=this.discussionArr.findIndex(i=>i.id==n.id),t=this.discussionArr[e];t.status_message="Done"},copyToClipBoard(n){let e="";if(n.message.content&&(e=n.message.content),this.$store.state.config.copy_to_clipboard_add_all_details){let t="";n.message.binding&&(t=`Binding: ${n.message.binding}`);let i="";n.message.personality&&(i=` Personality: ${n.message.personality}`);let s="";n.created_at_parsed&&(s=` @@ -215,15 +215,15 @@ ${e} ${l}`;navigator.clipboard.writeText(d)}else navigator.clipboard.writeText(e);this.$store.state.toast.showToast("Copied to clipboard successfully",4,!0),Ve(()=>{qe.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 i=new FileReader;i.onload=s=>e(this.parseJsonObj(s.target.result)),i.onerror=s=>t(s),i.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(),i=(e.getMonth()+1).toString().padStart(2,"0"),s=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),d="discussions_export_"+(t+"."+i+"."+s+"."+r+o+a)+".md";this.loading=!0;const c=await this.export_multiple_discussions(n,"markdown");c?(this.saveMarkdowntoFile(c,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 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(),i=(e.getMonth()+1).toString().padStart(2,"0"),s=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),o=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),d="discussions_export_"+(t+"."+i+"."+s+"."+r+o+a)+".json";this.loading=!0;const c=await this.export_multiple_discussions(n,"json");c?(this.saveJSONtoFile(c,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 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(i=>i.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(){const e=(await Me.get("/get_versionID")).data.versionId;for(this.versionId!==e&&(this.$store.commit("updateVersionId",e),window.location.reload(!0)),this.$nextTick(()=>{qe.replace()}),Xe.on("disucssion_renamed",t=>{console.log("Received new title",t.discussion_id,t.title);const i=this.list.findIndex(r=>r.id==t.discussion_id),s=this.list[i];s.title=t.title}),Xe.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},Xe.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}),Xe.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),Xe.disconnect()},Xe.on("connected",this.socketIOConnected),Xe.on("disconnected",this.socketIODisconnected),console.log("Added events"),console.log("Waiting to be ready");this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100)),console.log(this.$store.state.ready);console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),Xe.on("show_progress",this.show_progress),Xe.on("hide_progress",this.hide_progress),Xe.on("update_progress",this.update_progress),Xe.on("notification",this.notify),Xe.on("new_message",this.new_message),Xe.on("update_message",this.streamMessageContent),Xe.on("close_message",this.finalMsgEvent),Xe.onopen=()=>{console.log("WebSocket connection established."),this.currentDiscussion!=null&&(this.setPageTitle(item),localStorage.setItem("selected_discussion",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.isCreated=!0},async mounted(){Xe.on("refresh_files",()=>{this.recoverFiles()}),this.$nextTick(()=>{qe.replace()})},async activated(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&Ve(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)}),this.$store.state.config.show_news_panel&&this.$store.state.news.show()},components:{Discussion:wE,Message:SO,ChatBox:TO,WelcomeComponent:xO,ChoiceDialog:AE,ProgressBar:ic,InputBox:EO,SkillsLibraryViewer:vO},watch:{progress_visibility_val(n){console.log("progress_visibility changed")},filterTitle(n){n==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(n){Ve(()=>{qe.replace()}),n||(this.isSelectAll=!1)},socketConnected(n){console.log("Websocket connected (watch)",n)},showConfirmation(){Ve(()=>{qe.replace()})},isSearch(){Ve(()=>{qe.replace()})}},computed:{...wk({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"?" v"+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}},formatted_database_name(){return this.$store.state.config.discussion_db_name},UseDiscussionHistory(){return this.$store.state.config.activate_skills_lib},isReady:{get(){return this.$store.state.ready}},databases(){return this.$store.state.databases},client_id(){return Xe.id},isReady(){return console.log("verify ready",this.isCreated),this.isCreated},showPanel(){return this.$store.state.ready&&!this.panelCollapsed},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 Ve(()=>{qe.replace()}),this.list.filter(n=>n.checkBoxValue==!0)}}},LTt=Object.assign(kTt,{__name:"DiscussionsView",setup(n){return qs(()=>{qO()}),Me.defaults.baseURL="/",(e,t)=>(w(),M($e,null,[Ie(ls,{name:"fade-and-fly"},{default:Je(()=>[e.isReady?q("",!0):(w(),M("div",n0t,[u("div",i0t,[u("div",s0t,[u("div",r0t,[o0t,u("div",a0t,[u("p",l0t,"LoLLMS "+ge(e.version_info),1),c0t,d0t])]),u0t,p0t,u("div",_0t,[Ie(ic,{ref:"loading_progress",progress:e.loading_progress},null,8,["progress"]),u("p",h0t,ge(e.loading_infos)+" ...",1)])])])]))]),_:1}),e.isReady?(w(),M("button",{key:0,onClick:t[0]||(t[0]=(...i)=>e.togglePanel&&e.togglePanel(...i)),class:"absolute top-0 left-0 z-50 p-2 m-2 bg-white rounded-full shadow-md bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-primary-light dark:hover:bg-primary"},[le(u("div",null,m0t,512),[[Mt,e.panelCollapsed]]),le(u("div",null,b0t,512),[[Mt,!e.panelCollapsed]])])):q("",!0),Ie(ls,{name:"slide-right"},{default:Je(()=>[e.showPanel?(w(),M("div",E0t,[u("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:t[25]||(t[25]=Te(i=>e.setDropZoneDiscussion(),["stop","prevent"]))},[u("div",v0t,[u("div",y0t,[u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:t[1]||(t[1]=i=>e.createNewDiscussion())},T0t),u("button",{class:Ye(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:t[2]||(t[2]=i=>e.isCheckbox=!e.isCheckbox)},C0t,2),R0t,u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Export database",type:"button",onClick:t[3]||(t[3]=Te(i=>e.database_selectorDialogVisible=!0,["stop"]))},w0t),u("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:t[4]||(t[4]=(...i)=>e.importDiscussions&&e.importDiscussions(...i))},null,544),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:t[5]||(t[5]=Te(i=>e.$refs.fileDialog.click(),["stop"]))},O0t),e.isOpen?(w(),M("div",I0t,[u("button",{onClick:t[6]||(t[6]=(...i)=>e.importDiscussions&&e.importDiscussions(...i))},"LOLLMS"),u("button",{onClick:t[7]||(t[7]=(...i)=>e.importChatGPT&&e.importChatGPT(...i))},"ChatGPT")])):q("",!0),u("button",{class:Ye(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isSearch?"text-secondary":""]),title:"Filter discussions",type:"button",onClick:t[8]||(t[8]=i=>e.isSearch=!e.isSearch)},D0t,2),e.showSaveConfirmation?q("",!0):(w(),M("button",{key:1,title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:t[9]||(t[9]=i=>e.showSaveConfirmation=!0)},L0t)),e.showSaveConfirmation?(w(),M("div",P0t,[u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:t[10]||(t[10]=Te(i=>e.showSaveConfirmation=!1,["stop"]))},F0t),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:t[11]||(t[11]=Te(i=>e.save_configuration(),["stop"]))},G0t)])):q("",!0),e.loading?q("",!0):(w(),M("button",{key:3,type:"button",onClick:t[12]||(t[12]=Te((...i)=>e.addDiscussion2SkillsLibrary&&e.addDiscussion2SkillsLibrary(...i),["stop"])),title:"Add this discussion content to skills database",class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},[u("img",{src:vt(YO)},null,8,z0t)])),!e.loading&&e.$store.state.config.activate_skills_lib?(w(),M("button",{key:4,type:"button",onClick:t[13]||(t[13]=Te((...i)=>e.toggleSkillsLib&&e.toggleSkillsLib(...i),["stop"])),title:"Skills database is activated",class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},[u("img",{src:vt($O)},null,8,V0t)])):q("",!0),!e.loading&&!e.$store.state.config.activate_skills_lib?(w(),M("button",{key:5,type:"button",onClick:t[14]||(t[14]=Te((...i)=>e.toggleSkillsLib&&e.toggleSkillsLib(...i),["stop"])),title:"Skills database is deactivated",class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},[u("img",{src:vt(WO)},null,8,H0t)])):q("",!0),e.loading?q("",!0):(w(),M("button",{key:6,type:"button",onClick:t[15]||(t[15]=Te((...i)=>e.showSkillsLib&&e.showSkillsLib(...i),["stop"])),title:"Skills database is deactivated",class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},[u("img",{src:vt(KO)},null,8,q0t)])),e.loading?(w(),M("div",Y0t,W0t)):q("",!0)]),e.isSearch?(w(),M("div",K0t,[u("div",j0t,[u("div",Q0t,[X0t,u("div",Z0t,[u("div",{class:Ye(["hover:text-secondary duration-75 active:scale-90",e.filterTitle?"visible":"invisible"]),title:"Clear",onClick:t[16]||(t[16]=i=>e.filterTitle="")},eTt,2)]),le(u("input",{type:"search",id:"default-search",class:"block w-full p-2 pl-10 pr-10 text-sm border border-gray-300 rounded-lg bg-bg-light 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",placeholder:"Search...",title:"Filter discussions by title","onUpdate:modelValue":t[17]||(t[17]=i=>e.filterTitle=i),onInput:t[18]||(t[18]=i=>e.filterDiscussions())},null,544),[[Pe,e.filterTitle]])])])])):q("",!0),e.isCheckbox?(w(),M("hr",tTt)):q("",!0),e.isCheckbox?(w(),M("div",nTt,[u("div",iTt,[e.selectedDiscussions.length>0?(w(),M("p",sTt,"Selected: "+ge(e.selectedDiscussions.length),1)):q("",!0)]),u("div",rTt,[e.selectedDiscussions.length>0?(w(),M("div",oTt,[e.showConfirmation?q("",!0):(w(),M("button",{key:0,class:"flex mx-3 flex-1 text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove selected",type:"button",onClick:t[19]||(t[19]=Te(i=>e.showConfirmation=!0,["stop"]))},lTt)),e.showConfirmation?(w(),M("div",cTt,[u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:t[20]||(t[20]=Te((...i)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...i),["stop"]))},uTt),u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:t[21]||(t[21]=Te(i=>e.showConfirmation=!1,["stop"]))},_Tt)])):q("",!0)])):q("",!0),u("div",hTt,[u("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[22]||(t[22]=Te((...i)=>e.exportDiscussionsAsJson&&e.exportDiscussionsAsJson(...i),["stop"]))},mTt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a martkdown file",type:"button",onClick:t[23]||(t[23]=Te((...i)=>e.exportDiscussionsAsMarkdown&&e.exportDiscussionsAsMarkdown(...i),["stop"]))},bTt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:t[24]||(t[24]=Te((...i)=>e.selectAllDiscussions&&e.selectAllDiscussions(...i),["stop"]))},vTt)])])])):q("",!0)]),u("div",yTt,[u("div",{class:Ye(["mx-4 flex flex-col flex-grow w-full",e.isDragOverDiscussion?"pointer-events-none":""])},[u("div",{id:"dis-list",class:Ye([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full"])},[e.list.length>0?(w(),xt(rs,{key:0,name:"list"},{default:Je(()=>[(w(!0),M($e,null,dt(e.list,(i,s)=>(w(),xt(wE,{key:i.id,id:i.id,title:i.title,selected:e.currentDiscussion.id==i.id,loading:i.loading,isCheckbox:e.isCheckbox,checkBoxValue:i.checkBoxValue,onSelect:r=>e.selectDiscussion(i),onDelete:r=>e.deleteDiscussion(i.id),onEditTitle:e.editTitle,onMakeTitle:e.makeTitle,onChecked:e.checkUncheckDiscussion},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):q("",!0),e.list.length<1?(w(),M("div",STt,xTt)):q("",!0),CTt],2)],2)])],32),u("div",{class:"absolute bottom-0 left-0 w-full bg-blue-200 dark:bg-blue-800 text-white py-2 cursor-pointer hover:text-green-500",onClick:t[26]||(t[26]=(...i)=>e.showDatabaseSelector&&e.showDatabaseSelector(...i))},[u("p",RTt,"Current database: "+ge(e.formatted_database_name),1)])])):q("",!0)]),_:1}),e.isReady?(w(),M("div",ATt,[u("div",{id:"messages-list",class:Ye(["w-full z-0 flex flex-col flex-grow 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",e.isDragOverChat?"pointer-events-none":""])},[u("div",wTt,[e.discussionArr.length>0?(w(),xt(rs,{key:0,name:"list"},{default:Je(()=>[(w(!0),M($e,null,dt(e.discussionArr,(i,s)=>(w(),xt(SO,{key:i.id,message:i,id:"msg-"+i.id,host:e.host,ref_for:!0,ref:"messages",onCopy:e.copyToClipBoard,onDelete:e.deleteMessage,onRankUp:e.rankUpMessage,onRankDown:e.rankDownMessage,onUpdateMessage:e.updateMessage,onResendMessage:e.resendMessage,onContinueMessage:e.continueMessage,avatar:e.getAvatar(i.sender)},null,8,["message","id","host","onCopy","onDelete","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","avatar"]))),128))]),_:1})):q("",!0),e.currentDiscussion.id?q("",!0):(w(),xt(xO,{key:1})),NTt]),OTt,e.currentDiscussion.id?(w(),M("div",ITt,[Ie(TO,{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"])])):q("",!0)],2)])):q("",!0),Ie(AE,{reference:"database_selector",class:"z-20",show:e.database_selectorDialogVisible,choices:e.databases,onChoiceSelected:e.ondatabase_selectorDialogSelected,onCloseDialog:e.onclosedatabase_selectorDialog,onChoiceValidated:e.onvalidatedatabase_selectorChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"]),le(u("div",MTt,[Ie(ic,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),u("p",DTt,ge(e.loading_infos)+" ...",1)],512),[[Mt,e.progress_visibility]]),Ie(EO,{"prompt-text":"Enter the url to the page to use as discussion support",onOk:e.addWebpage,ref:"web_url_input_box"},null,8,["onOk"]),Ie(vO,{ref:"skills_lib"},null,512)],64))}}),PTt=bt(LTt,[["__scopeId","data-v-46f45c62"]]);/** +`+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(){const e=(await Me.get("/get_versionID")).data.versionId;for(this.versionId!==e&&(this.$store.commit("updateVersionId",e),window.location.reload(!0)),this.$nextTick(()=>{qe.replace()}),Xe.on("disucssion_renamed",t=>{console.log("Received new title",t.discussion_id,t.title);const i=this.list.findIndex(r=>r.id==t.discussion_id),s=this.list[i];s.title=t.title}),Xe.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},Xe.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}),Xe.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),Xe.disconnect()},Xe.on("connected",this.socketIOConnected),Xe.on("disconnected",this.socketIODisconnected),console.log("Added events"),console.log("Waiting to be ready");this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100)),console.log(this.$store.state.ready);console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),Xe.on("show_progress",this.show_progress),Xe.on("hide_progress",this.hide_progress),Xe.on("update_progress",this.update_progress),Xe.on("notification",this.notify),Xe.on("new_message",this.new_message),Xe.on("update_message",this.streamMessageContent),Xe.on("close_message",this.finalMsgEvent),Xe.onopen=()=>{console.log("WebSocket connection established."),this.currentDiscussion!=null&&(this.setPageTitle(item),localStorage.setItem("selected_discussion",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.isCreated=!0},async mounted(){Xe.on("refresh_files",()=>{this.recoverFiles()}),this.$nextTick(()=>{qe.replace()})},async activated(){for(;this.isReady===!1;)await new Promise(n=>setTimeout(n,100));await this.getPersonalityAvatars(),console.log("Avatars found:",this.personalityAvatars),this.isCreated&&Ve(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)}),this.$store.state.config.show_news_panel&&this.$store.state.news.show()},components:{Discussion:wE,Message:SO,ChatBox:TO,WelcomeComponent:xO,ChoiceDialog:AE,ProgressBar:ic,InputBox:EO,SkillsLibraryViewer:vO},watch:{progress_visibility_val(n){console.log("progress_visibility changed")},filterTitle(n){n==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(n){Ve(()=>{qe.replace()}),n||(this.isSelectAll=!1)},socketConnected(n){console.log("Websocket connected (watch)",n)},showConfirmation(){Ve(()=>{qe.replace()})},isSearch(){Ve(()=>{qe.replace()})}},computed:{...wk({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"?" v"+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}},formatted_database_name(){return this.$store.state.config.discussion_db_name},UseDiscussionHistory(){return this.$store.state.config.activate_skills_lib},isReady:{get(){return this.$store.state.ready}},databases(){return this.$store.state.databases},client_id(){return Xe.id},isReady(){return console.log("verify ready",this.isCreated),this.isCreated},showPanel(){return this.$store.state.ready&&!this.panelCollapsed},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 Ve(()=>{qe.replace()}),this.list.filter(n=>n.checkBoxValue==!0)}}},UTt=Object.assign(PTt,{__name:"DiscussionsView",setup(n){return qs(()=>{qO()}),Me.defaults.baseURL="/",(e,t)=>(w(),M($e,null,[Ie(ls,{name:"fade-and-fly"},{default:Je(()=>[e.isReady?q("",!0):(w(),M("div",s0t,[u("div",r0t,[u("div",o0t,[u("div",a0t,[l0t,u("div",c0t,[u("p",d0t,"LoLLMS "+ge(e.version_info),1),u0t,p0t])]),_0t,h0t,u("div",f0t,[Ie(ic,{ref:"loading_progress",progress:e.loading_progress},null,8,["progress"]),u("p",m0t,ge(e.loading_infos)+" ...",1)])])])]))]),_:1}),e.isReady?(w(),M("button",{key:0,onClick:t[0]||(t[0]=(...i)=>e.togglePanel&&e.togglePanel(...i)),class:"absolute top-0 left-0 z-50 p-2 m-2 bg-white rounded-full shadow-md bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-primary-light dark:hover:bg-primary"},[le(u("div",null,b0t,512),[[Mt,e.panelCollapsed]]),le(u("div",null,v0t,512),[[Mt,!e.panelCollapsed]])])):q("",!0),Ie(ls,{name:"slide-right"},{default:Je(()=>[e.showPanel?(w(),M("div",y0t,[u("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:t[25]||(t[25]=Te(i=>e.setDropZoneDiscussion(),["stop","prevent"]))},[u("div",S0t,[u("div",T0t,[u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:t[1]||(t[1]=i=>e.createNewDiscussion())},C0t),u("button",{class:Ye(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:t[2]||(t[2]=i=>e.isCheckbox=!e.isCheckbox)},A0t,2),w0t,u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Export database",type:"button",onClick:t[3]||(t[3]=Te(i=>e.database_selectorDialogVisible=!0,["stop"]))},O0t),u("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:t[4]||(t[4]=(...i)=>e.importDiscussions&&e.importDiscussions(...i))},null,544),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:t[5]||(t[5]=Te(i=>e.$refs.fileDialog.click(),["stop"]))},M0t),e.isOpen?(w(),M("div",D0t,[u("button",{onClick:t[6]||(t[6]=(...i)=>e.importDiscussions&&e.importDiscussions(...i))},"LOLLMS"),u("button",{onClick:t[7]||(t[7]=(...i)=>e.importChatGPT&&e.importChatGPT(...i))},"ChatGPT")])):q("",!0),u("button",{class:Ye(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isSearch?"text-secondary":""]),title:"Filter discussions",type:"button",onClick:t[8]||(t[8]=i=>e.isSearch=!e.isSearch)},L0t,2),e.showSaveConfirmation?q("",!0):(w(),M("button",{key:1,title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:t[9]||(t[9]=i=>e.showSaveConfirmation=!0)},U0t)),e.showSaveConfirmation?(w(),M("div",F0t,[u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:t[10]||(t[10]=Te(i=>e.showSaveConfirmation=!1,["stop"]))},G0t),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:t[11]||(t[11]=Te(i=>e.save_configuration(),["stop"]))},V0t)])):q("",!0),e.loading?q("",!0):(w(),M("button",{key:3,type:"button",onClick:t[12]||(t[12]=Te((...i)=>e.addDiscussion2SkillsLibrary&&e.addDiscussion2SkillsLibrary(...i),["stop"])),title:"Add this discussion content to skills database",class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},[u("img",{src:vt(YO)},null,8,H0t)])),!e.loading&&e.$store.state.config.activate_skills_lib?(w(),M("button",{key:4,type:"button",onClick:t[13]||(t[13]=Te((...i)=>e.toggleSkillsLib&&e.toggleSkillsLib(...i),["stop"])),title:"Skills database is activated",class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},[u("img",{src:vt($O)},null,8,q0t)])):q("",!0),!e.loading&&!e.$store.state.config.activate_skills_lib?(w(),M("button",{key:5,type:"button",onClick:t[14]||(t[14]=Te((...i)=>e.toggleSkillsLib&&e.toggleSkillsLib(...i),["stop"])),title:"Skills database is deactivated",class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},[u("img",{src:vt(WO)},null,8,Y0t)])):q("",!0),e.loading?q("",!0):(w(),M("button",{key:6,type:"button",onClick:t[15]||(t[15]=Te((...i)=>e.showSkillsLib&&e.showSkillsLib(...i),["stop"])),title:"Skills database is deactivated",class:"w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90"},[u("img",{src:vt(KO)},null,8,$0t)])),e.loading?(w(),M("div",W0t,j0t)):q("",!0)]),e.isSearch?(w(),M("div",Q0t,[u("div",X0t,[u("div",Z0t,[J0t,u("div",eTt,[u("div",{class:Ye(["hover:text-secondary duration-75 active:scale-90",e.filterTitle?"visible":"invisible"]),title:"Clear",onClick:t[16]||(t[16]=i=>e.filterTitle="")},nTt,2)]),le(u("input",{type:"search",id:"default-search",class:"block w-full p-2 pl-10 pr-10 text-sm border border-gray-300 rounded-lg bg-bg-light 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",placeholder:"Search...",title:"Filter discussions by title","onUpdate:modelValue":t[17]||(t[17]=i=>e.filterTitle=i),onInput:t[18]||(t[18]=i=>e.filterDiscussions())},null,544),[[Pe,e.filterTitle]])])])])):q("",!0),e.isCheckbox?(w(),M("hr",iTt)):q("",!0),e.isCheckbox?(w(),M("div",sTt,[u("div",rTt,[e.selectedDiscussions.length>0?(w(),M("p",oTt,"Selected: "+ge(e.selectedDiscussions.length),1)):q("",!0)]),u("div",aTt,[e.selectedDiscussions.length>0?(w(),M("div",lTt,[e.showConfirmation?q("",!0):(w(),M("button",{key:0,class:"flex mx-3 flex-1 text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove selected",type:"button",onClick:t[19]||(t[19]=Te(i=>e.showConfirmation=!0,["stop"]))},dTt)),e.showConfirmation?(w(),M("div",uTt,[u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:t[20]||(t[20]=Te((...i)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...i),["stop"]))},_Tt),u("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:t[21]||(t[21]=Te(i=>e.showConfirmation=!1,["stop"]))},fTt)])):q("",!0)])):q("",!0),u("div",mTt,[u("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[22]||(t[22]=Te((...i)=>e.exportDiscussionsAsJson&&e.exportDiscussionsAsJson(...i),["stop"]))},bTt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a martkdown file",type:"button",onClick:t[23]||(t[23]=Te((...i)=>e.exportDiscussionsAsMarkdown&&e.exportDiscussionsAsMarkdown(...i),["stop"]))},vTt),u("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:t[24]||(t[24]=Te((...i)=>e.selectAllDiscussions&&e.selectAllDiscussions(...i),["stop"]))},STt)])])])):q("",!0)]),u("div",TTt,[u("div",{class:Ye(["mx-4 flex flex-col flex-grow w-full",e.isDragOverDiscussion?"pointer-events-none":""])},[u("div",{id:"dis-list",class:Ye([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow w-full"])},[e.list.length>0?(w(),xt(rs,{key:0,name:"list"},{default:Je(()=>[(w(!0),M($e,null,dt(e.list,(i,s)=>(w(),xt(wE,{key:i.id,id:i.id,title:i.title,selected:e.currentDiscussion.id==i.id,loading:i.loading,isCheckbox:e.isCheckbox,checkBoxValue:i.checkBoxValue,onSelect:r=>e.selectDiscussion(i),onDelete:r=>e.deleteDiscussion(i.id),onEditTitle:e.editTitle,onMakeTitle:e.makeTitle,onChecked:e.checkUncheckDiscussion},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","onSelect","onDelete","onEditTitle","onMakeTitle","onChecked"]))),128))]),_:1})):q("",!0),e.list.length<1?(w(),M("div",xTt,RTt)):q("",!0),ATt],2)],2)])],32),u("div",{class:"absolute bottom-0 left-0 w-full bg-blue-200 dark:bg-blue-800 text-white py-2 cursor-pointer hover:text-green-500",onClick:t[26]||(t[26]=(...i)=>e.showDatabaseSelector&&e.showDatabaseSelector(...i))},[u("p",wTt,"Current database: "+ge(e.formatted_database_name),1)])])):q("",!0)]),_:1}),e.isReady?(w(),M("div",NTt,[u("div",{id:"messages-list",class:Ye(["w-full z-0 flex flex-col flex-grow 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",e.isDragOverChat?"pointer-events-none":""])},[u("div",OTt,[e.discussionArr.length>0?(w(),xt(rs,{key:0,name:"list"},{default:Je(()=>[(w(!0),M($e,null,dt(e.discussionArr,(i,s)=>(w(),xt(SO,{key:i.id,message:i,id:"msg-"+i.id,host:e.host,ref_for:!0,ref:"messages",onCopy:e.copyToClipBoard,onDelete:e.deleteMessage,onRankUp:e.rankUpMessage,onRankDown:e.rankDownMessage,onUpdateMessage:e.updateMessage,onResendMessage:e.resendMessage,onContinueMessage:e.continueMessage,avatar:e.getAvatar(i.sender)},null,8,["message","id","host","onCopy","onDelete","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","avatar"]))),128))]),_:1})):q("",!0),e.currentDiscussion.id?q("",!0):(w(),xt(xO,{key:1})),ITt]),MTt,e.currentDiscussion.id?(w(),M("div",DTt,[Ie(TO,{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"])])):q("",!0)],2)])):q("",!0),Ie(AE,{reference:"database_selector",class:"z-20",show:e.database_selectorDialogVisible,choices:e.databases,onChoiceSelected:e.ondatabase_selectorDialogSelected,onCloseDialog:e.onclosedatabase_selectorDialog,onChoiceValidated:e.onvalidatedatabase_selectorChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"]),le(u("div",kTt,[Ie(ic,{ref:"progress",progress:e.progress_value,class:"w-full h-4"},null,8,["progress"]),u("p",LTt,ge(e.loading_infos)+" ...",1)],512),[[Mt,e.progress_visibility]]),Ie(EO,{"prompt-text":"Enter the url to the page to use as discussion support",onOk:e.addWebpage,ref:"web_url_input_box"},null,8,["onOk"]),Ie(vO,{ref:"skills_lib"},null,512)],64))}}),FTt=bt(UTt,[["__scopeId","data-v-46f45c62"]]);/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT - */const jE="159",UTt=0,HC=1,FTt=2,jO=1,BTt=2,Is=3,Vs=0,Zn=1,Ji=2,Sr=0,aa=1,qC=2,YC=3,$C=4,GTt=5,Jr=100,zTt=101,VTt=102,WC=103,KC=104,HTt=200,qTt=201,YTt=202,$Tt=203,ab=204,lb=205,WTt=206,KTt=207,jTt=208,QTt=209,XTt=210,ZTt=211,JTt=212,ext=213,txt=214,nxt=0,ixt=1,sxt=2,mu=3,rxt=4,oxt=5,axt=6,lxt=7,QE=0,cxt=1,dxt=2,Tr=0,uxt=1,pxt=2,_xt=3,hxt=4,fxt=5,jC="attached",mxt="detached",QO=300,xa=301,Ca=302,cb=303,db=304,up=306,Ra=1e3,gi=1001,gu=1002,En=1003,ub=1004,Vd=1005,jn=1006,XO=1007,go=1008,xr=1009,gxt=1010,bxt=1011,XE=1012,ZO=1013,br=1014,ks=1015,oc=1016,JO=1017,eI=1018,lo=1020,Ext=1021,bi=1023,vxt=1024,yxt=1025,co=1026,Aa=1027,Sxt=1028,tI=1029,Txt=1030,nI=1031,iI=1033,Bm=33776,Gm=33777,zm=33778,Vm=33779,QC=35840,XC=35841,ZC=35842,JC=35843,sI=36196,e1=37492,t1=37496,n1=37808,i1=37809,s1=37810,r1=37811,o1=37812,a1=37813,l1=37814,c1=37815,d1=37816,u1=37817,p1=37818,_1=37819,h1=37820,f1=37821,Hm=36492,m1=36494,g1=36495,xxt=36283,b1=36284,E1=36285,v1=36286,ac=2300,wa=2301,qm=2302,y1=2400,S1=2401,T1=2402,Cxt=2500,Rxt=0,rI=1,pb=2,oI=3e3,uo=3001,Axt=3200,wxt=3201,ZE=0,Nxt=1,Ei="",rn="srgb",Nn="srgb-linear",JE="display-p3",pp="display-p3-linear",bu="linear",Xt="srgb",Eu="rec709",vu="p3",Oo=7680,x1=519,Oxt=512,Ixt=513,Mxt=514,aI=515,Dxt=516,kxt=517,Lxt=518,Pxt=519,_b=35044,C1="300 es",hb=1035,Ls=2e3,yu=2001;class ja{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const s=this._listeners[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const s=i.slice(0);for(let r=0,o=s.length;r>8&255]+In[n>>16&255]+In[n>>24&255]+"-"+In[e&255]+In[e>>8&255]+"-"+In[e>>16&15|64]+In[e>>24&255]+"-"+In[t&63|128]+In[t>>8&255]+"-"+In[t>>16&255]+In[t>>24&255]+In[i&255]+In[i>>8&255]+In[i>>16&255]+In[i>>24&255]).toLowerCase()}function kn(n,e,t){return Math.max(e,Math.min(t,n))}function ev(n,e){return(n%e+e)%e}function Uxt(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function Fxt(n,e,t){return n!==e?(t-n)/(e-n):0}function Bl(n,e,t){return(1-t)*n+t*e}function Bxt(n,e,t,i){return Bl(n,e,1-Math.exp(-t*i))}function Gxt(n,e=1){return e-Math.abs(ev(n,e*2)-e)}function zxt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Vxt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Hxt(n,e){return n+Math.floor(Math.random()*(e-n+1))}function qxt(n,e){return n+Math.random()*(e-n)}function Yxt(n){return n*(.5-Math.random())}function $xt(n){n!==void 0&&(R1=n);let e=R1+=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 Wxt(n){return n*Fl}function Kxt(n){return n*Na}function fb(n){return(n&n-1)===0&&n!==0}function jxt(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 Qxt(n,e,t,i,s){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),d=r((e+i)/2),c=o((e+i)/2),_=r((e-i)/2),f=o((e-i)/2),m=r((i-e)/2),h=o((i-e)/2);switch(s){case"XYX":n.set(a*c,l*_,l*f,a*d);break;case"YZY":n.set(l*f,a*c,l*_,a*d);break;case"ZXZ":n.set(l*_,l*f,a*c,a*d);break;case"XZX":n.set(a*c,l*h,l*m,a*d);break;case"YXY":n.set(l*m,a*c,l*h,a*d);break;case"ZYZ":n.set(l*h,l*m,a*c,a*d);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function es(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 Ht(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 Xxt={DEG2RAD:Fl,RAD2DEG:Na,generateUUID:zi,clamp:kn,euclideanModulo:ev,mapLinear:Uxt,inverseLerp:Fxt,lerp:Bl,damp:Bxt,pingpong:Gxt,smoothstep:zxt,smootherstep:Vxt,randInt:Hxt,randFloat:qxt,randFloatSpread:Yxt,seededRandom:$xt,degToRad:Wxt,radToDeg:Kxt,isPowerOfTwo:fb,ceilPowerOfTwo:jxt,floorPowerOfTwo:Su,setQuaternionFromProperEuler:Qxt,normalize:Ht,denormalize:es};class It{constructor(e=0,t=0){It.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,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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 i=this.dot(e)/t;return Math.acos(kn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,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 i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Rt{constructor(e,t,i,s,r,o,a,l,d){Rt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,d)}set(e,t,i,s,r,o,a,l,d){const c=this.elements;return c[0]=e,c[1]=s,c[2]=a,c[3]=t,c[4]=r,c[5]=l,c[6]=i,c[7]=o,c[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.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 i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[3],l=i[6],d=i[1],c=i[4],_=i[7],f=i[2],m=i[5],h=i[8],E=s[0],b=s[3],g=s[6],v=s[1],y=s[4],T=s[7],C=s[2],x=s[5],O=s[8];return r[0]=o*E+a*v+l*C,r[3]=o*b+a*y+l*x,r[6]=o*g+a*T+l*O,r[1]=d*E+c*v+_*C,r[4]=d*b+c*y+_*x,r[7]=d*g+c*T+_*O,r[2]=f*E+m*v+h*C,r[5]=f*b+m*y+h*x,r[8]=f*g+m*T+h*O,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],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],d=e[7],c=e[8];return t*o*c-t*a*d-i*r*c+i*a*l+s*r*d-s*o*l}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],d=e[7],c=e[8],_=c*o-a*d,f=a*l-c*r,m=d*r-o*l,h=t*_+i*f+s*m;if(h===0)return this.set(0,0,0,0,0,0,0,0,0);const E=1/h;return e[0]=_*E,e[1]=(s*d-c*i)*E,e[2]=(a*i-s*o)*E,e[3]=f*E,e[4]=(c*t-s*l)*E,e[5]=(s*r-a*t)*E,e[6]=m*E,e[7]=(i*l-d*t)*E,e[8]=(o*t-i*r)*E,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,i,s,r,o,a){const l=Math.cos(r),d=Math.sin(r);return this.set(i*l,i*d,-i*(l*o+d*a)+o+e,-s*d,s*l,-s*(-d*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Ym.makeScale(e,t)),this}rotate(e){return this.premultiply(Ym.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ym.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),i=Math.sin(e);return this.set(t,-i,0,i,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,i=e.elements;for(let s=0;s<9;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Ym=new Rt;function lI(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function lc(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Zxt(){const n=lc("canvas");return n.style.display="block",n}const A1={};function Gl(n){n in A1||(A1[n]=!0,console.warn(n))}const w1=new Rt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),N1=new Rt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Jc={[Nn]:{transfer:bu,primaries:Eu,toReference:n=>n,fromReference:n=>n},[rn]:{transfer:Xt,primaries:Eu,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[pp]:{transfer:bu,primaries:vu,toReference:n=>n.applyMatrix3(N1),fromReference:n=>n.applyMatrix3(w1)},[JE]:{transfer:Xt,primaries:vu,toReference:n=>n.convertSRGBToLinear().applyMatrix3(N1),fromReference:n=>n.applyMatrix3(w1).convertLinearToSRGB()}},Jxt=new Set([Nn,pp]),Ft={enabled:!0,_workingColorSpace:Nn,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(!Jxt.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 i=Jc[e].toReference,s=Jc[t].fromReference;return s(i(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 Jc[n].primaries},getTransfer:function(n){return n===Ei?bu:Jc[n].transfer}};function la(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function $m(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Io;class cI{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Io===void 0&&(Io=lc("canvas")),Io.width=e.width,Io.height=e.height;const i=Io.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Io}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=lc("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==QO)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ra:e.x=e.x-Math.floor(e.x);break;case gi: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 Ra:e.y=e.y-Math.floor(e.y);break;case gi: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 Gl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===rn?uo:oI}set encoding(e){Gl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===uo?rn:Ei}}wn.DEFAULT_IMAGE=null;wn.DEFAULT_MAPPING=QO;wn.DEFAULT_ANISOTROPY=1;class Wt{constructor(e=0,t=0,i=0,s=1){Wt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=s}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,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,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,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,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,i,s,r;const l=e.elements,d=l[0],c=l[4],_=l[8],f=l[1],m=l[5],h=l[9],E=l[2],b=l[6],g=l[10];if(Math.abs(c-f)<.01&&Math.abs(_-E)<.01&&Math.abs(h-b)<.01){if(Math.abs(c+f)<.1&&Math.abs(_+E)<.1&&Math.abs(h+b)<.1&&Math.abs(d+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const y=(d+1)/2,T=(m+1)/2,C=(g+1)/2,x=(c+f)/4,O=(_+E)/4,R=(h+b)/4;return y>T&&y>C?y<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(y),s=x/i,r=O/i):T>C?T<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(T),i=x/s,r=R/s):C<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(C),i=O/r,s=R/r),this.set(i,s,r,t),this}let v=Math.sqrt((b-h)*(b-h)+(_-E)*(_-E)+(f-c)*(f-c));return Math.abs(v)<.001&&(v=1),this.x=(b-h)/v,this.y=(_-E)/v,this.z=(f-c)/v,this.w=Math.acos((d+m+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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,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 nCt extends ja{constructor(e=1,t=1,i={}){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 s={width:e,height:t,depth:1};i.encoding!==void 0&&(Gl("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===uo?rn:Ei),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:jn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new wn(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps,this.texture.internalFormat=i.internalFormat,this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,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 dI(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 bo extends nCt{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class uI extends wn{constructor(e=null,t=1,i=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=En,this.minFilter=En,this.wrapR=gi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class iCt extends wn{constructor(e=null,t=1,i=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=En,this.minFilter=En,this.wrapR=gi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Dr{constructor(e=0,t=0,i=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=s}static slerpFlat(e,t,i,s,r,o,a){let l=i[s+0],d=i[s+1],c=i[s+2],_=i[s+3];const f=r[o+0],m=r[o+1],h=r[o+2],E=r[o+3];if(a===0){e[t+0]=l,e[t+1]=d,e[t+2]=c,e[t+3]=_;return}if(a===1){e[t+0]=f,e[t+1]=m,e[t+2]=h,e[t+3]=E;return}if(_!==E||l!==f||d!==m||c!==h){let b=1-a;const g=l*f+d*m+c*h+_*E,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){const C=Math.sqrt(y),x=Math.atan2(C,g*v);b=Math.sin(b*x)/C,a=Math.sin(a*x)/C}const T=a*v;if(l=l*b+f*T,d=d*b+m*T,c=c*b+h*T,_=_*b+E*T,b===1-a){const C=1/Math.sqrt(l*l+d*d+c*c+_*_);l*=C,d*=C,c*=C,_*=C}}e[t]=l,e[t+1]=d,e[t+2]=c,e[t+3]=_}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],d=i[s+2],c=i[s+3],_=r[o],f=r[o+1],m=r[o+2],h=r[o+3];return e[t]=a*h+c*_+l*m-d*f,e[t+1]=l*h+c*f+d*_-a*m,e[t+2]=d*h+c*m+a*f-l*_,e[t+3]=c*h-a*_-l*f-d*m,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,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,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 i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,d=a(i/2),c=a(s/2),_=a(r/2),f=l(i/2),m=l(s/2),h=l(r/2);switch(o){case"XYZ":this._x=f*c*_+d*m*h,this._y=d*m*_-f*c*h,this._z=d*c*h+f*m*_,this._w=d*c*_-f*m*h;break;case"YXZ":this._x=f*c*_+d*m*h,this._y=d*m*_-f*c*h,this._z=d*c*h-f*m*_,this._w=d*c*_+f*m*h;break;case"ZXY":this._x=f*c*_-d*m*h,this._y=d*m*_+f*c*h,this._z=d*c*h+f*m*_,this._w=d*c*_-f*m*h;break;case"ZYX":this._x=f*c*_-d*m*h,this._y=d*m*_+f*c*h,this._z=d*c*h-f*m*_,this._w=d*c*_+f*m*h;break;case"YZX":this._x=f*c*_+d*m*h,this._y=d*m*_+f*c*h,this._z=d*c*h-f*m*_,this._w=d*c*_-f*m*h;break;case"XZY":this._x=f*c*_-d*m*h,this._y=d*m*_-f*c*h,this._z=d*c*h+f*m*_,this._w=d*c*_+f*m*h;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],l=t[9],d=t[2],c=t[6],_=t[10],f=i+a+_;if(f>0){const m=.5/Math.sqrt(f+1);this._w=.25/m,this._x=(c-l)*m,this._y=(r-d)*m,this._z=(o-s)*m}else if(i>a&&i>_){const m=2*Math.sqrt(1+i-a-_);this._w=(c-l)/m,this._x=.25*m,this._y=(s+o)/m,this._z=(r+d)/m}else if(a>_){const m=2*Math.sqrt(1+a-i-_);this._w=(r-d)/m,this._x=(s+o)/m,this._y=.25*m,this._z=(l+c)/m}else{const m=2*Math.sqrt(1+_-i-a);this._w=(o-s)/m,this._x=(r+d)/m,this._y=(l+c)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(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=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(kn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),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 i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,d=t._z,c=t._w;return this._x=i*c+o*a+s*d-r*l,this._y=s*c+o*l+r*a-i*d,this._z=r*c+o*d+i*l-s*a,this._w=o*c-i*a-s*l-r*d,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*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=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*s+t*this._y,this._z=m*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const d=Math.sqrt(l),c=Math.atan2(d,a),_=Math.sin((1-t)*c)/d,f=Math.sin(t*c)/d;return this._w=o*_+this._w*f,this._x=i*_+this._x*f,this._y=s*_+this._y*f,this._z=r*_+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(s),i*Math.sin(r),i*Math.cos(r),t*Math.sin(s))}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 be{constructor(e=0,t=0,i=0){be.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,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(O1.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(O1.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,d=2*(o*s-a*i),c=2*(a*t-r*s),_=2*(r*i-o*t);return this.x=t+l*d+o*_-a*c,this.y=i+l*c+a*d-r*_,this.z=s+l*_+r*c-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,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Km.copy(this).projectOnVector(e),this.sub(Km)}reflect(e){return this.sub(Km.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 i=this.dot(e)/t;return Math.acos(kn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}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,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,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(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,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,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Km=new be,O1=new Dr;class Ks{constructor(e=new be(1/0,1/0,1/0),t=new be(-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,i=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,Ii),Ii.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ml),td.subVectors(this.max,ml),Mo.subVectors(e.a,ml),Do.subVectors(e.b,ml),ko.subVectors(e.c,ml),er.subVectors(Do,Mo),tr.subVectors(ko,Do),Gr.subVectors(Mo,ko);let t=[0,-er.z,er.y,0,-tr.z,tr.y,0,-Gr.z,Gr.y,er.z,0,-er.x,tr.z,0,-tr.x,Gr.z,0,-Gr.x,-er.y,er.x,0,-tr.y,tr.x,0,-Gr.y,Gr.x,0];return!jm(t,Mo,Do,ko,td)||(t=[1,0,0,0,1,0,0,0,1],!jm(t,Mo,Do,ko,td))?!1:(nd.crossVectors(er,tr),t=[nd.x,nd.y,nd.z],jm(t,Mo,Do,ko,td))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ii).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ii).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:(xs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),xs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),xs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),xs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),xs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),xs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),xs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),xs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(xs),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 xs=[new be,new be,new be,new be,new be,new be,new be,new be],Ii=new be,ed=new Ks,Mo=new be,Do=new be,ko=new be,er=new be,tr=new be,Gr=new be,ml=new be,td=new be,nd=new be,zr=new be;function jm(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){zr.fromArray(n,r);const a=s.x*Math.abs(zr.x)+s.y*Math.abs(zr.y)+s.z*Math.abs(zr.z),l=e.dot(zr),d=t.dot(zr),c=i.dot(zr);if(Math.max(-Math.max(l,d,c),Math.min(l,d,c))>a)return!1}return!0}const sCt=new Ks,gl=new be,Qm=new be;class hs{constructor(e=new be,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):sCt.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.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;gl.subVectors(e,this.center);const t=gl.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(gl,s/i),this.radius+=s}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):(Qm.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(gl.copy(e.center).add(Qm)),this.expandByPoint(gl.copy(e.center).sub(Qm))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Cs=new be,Xm=new be,id=new be,nr=new be,Zm=new be,sd=new be,Jm=new be;class _p{constructor(e=new be,t=new be(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,Cs)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Cs.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cs.copy(this.origin).addScaledVector(this.direction,t),Cs.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){Xm.copy(e).add(t).multiplyScalar(.5),id.copy(t).sub(e).normalize(),nr.copy(this.origin).sub(Xm);const r=e.distanceTo(t)*.5,o=-this.direction.dot(id),a=nr.dot(this.direction),l=-nr.dot(id),d=nr.lengthSq(),c=Math.abs(1-o*o);let _,f,m,h;if(c>0)if(_=o*l-a,f=o*a-l,h=r*c,_>=0)if(f>=-h)if(f<=h){const E=1/c;_*=E,f*=E,m=_*(_+o*f+2*a)+f*(o*_+f+2*l)+d}else f=r,_=Math.max(0,-(o*f+a)),m=-_*_+f*(f+2*l)+d;else f=-r,_=Math.max(0,-(o*f+a)),m=-_*_+f*(f+2*l)+d;else f<=-h?(_=Math.max(0,-(-o*r+a)),f=_>0?-r:Math.min(Math.max(-r,-l),r),m=-_*_+f*(f+2*l)+d):f<=h?(_=0,f=Math.min(Math.max(-r,-l),r),m=f*(f+2*l)+d):(_=Math.max(0,-(o*r+a)),f=_>0?r:Math.min(Math.max(-r,-l),r),m=-_*_+f*(f+2*l)+d);else f=o>0?-r:r,_=Math.max(0,-(o*f+a)),m=-_*_+f*(f+2*l)+d;return i&&i.copy(this.origin).addScaledVector(this.direction,_),s&&s.copy(Xm).addScaledVector(id,f),m}intersectSphere(e,t){Cs.subVectors(e.center,this.origin);const i=Cs.dot(this.direction),s=Cs.dot(Cs)-i*i,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,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 i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,s,r,o,a,l;const d=1/this.direction.x,c=1/this.direction.y,_=1/this.direction.z,f=this.origin;return d>=0?(i=(e.min.x-f.x)*d,s=(e.max.x-f.x)*d):(i=(e.max.x-f.x)*d,s=(e.min.x-f.x)*d),c>=0?(r=(e.min.y-f.y)*c,o=(e.max.y-f.y)*c):(r=(e.max.y-f.y)*c,o=(e.min.y-f.y)*c),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-f.z)*_,l=(e.max.z-f.z)*_):(a=(e.max.z-f.z)*_,l=(e.min.z-f.z)*_),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,Cs)!==null}intersectTriangle(e,t,i,s,r){Zm.subVectors(t,e),sd.subVectors(i,e),Jm.crossVectors(Zm,sd);let o=this.direction.dot(Jm),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;nr.subVectors(this.origin,e);const l=a*this.direction.dot(sd.crossVectors(nr,sd));if(l<0)return null;const d=a*this.direction.dot(Zm.cross(nr));if(d<0||l+d>o)return null;const c=-a*nr.dot(Jm);return c<0?null:this.at(c/o,r)}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 At{constructor(e,t,i,s,r,o,a,l,d,c,_,f,m,h,E,b){At.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,i,s,r,o,a,l,d,c,_,f,m,h,E,b)}set(e,t,i,s,r,o,a,l,d,c,_,f,m,h,E,b){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=s,g[1]=r,g[5]=o,g[9]=a,g[13]=l,g[2]=d,g[6]=c,g[10]=_,g[14]=f,g[3]=m,g[7]=h,g[11]=E,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 At().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[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,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,s=1/Lo.setFromMatrixColumn(e,0).length(),r=1/Lo.setFromMatrixColumn(e,1).length(),o=1/Lo.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),d=Math.sin(s),c=Math.cos(r),_=Math.sin(r);if(e.order==="XYZ"){const f=o*c,m=o*_,h=a*c,E=a*_;t[0]=l*c,t[4]=-l*_,t[8]=d,t[1]=m+h*d,t[5]=f-E*d,t[9]=-a*l,t[2]=E-f*d,t[6]=h+m*d,t[10]=o*l}else if(e.order==="YXZ"){const f=l*c,m=l*_,h=d*c,E=d*_;t[0]=f+E*a,t[4]=h*a-m,t[8]=o*d,t[1]=o*_,t[5]=o*c,t[9]=-a,t[2]=m*a-h,t[6]=E+f*a,t[10]=o*l}else if(e.order==="ZXY"){const f=l*c,m=l*_,h=d*c,E=d*_;t[0]=f-E*a,t[4]=-o*_,t[8]=h+m*a,t[1]=m+h*a,t[5]=o*c,t[9]=E-f*a,t[2]=-o*d,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const f=o*c,m=o*_,h=a*c,E=a*_;t[0]=l*c,t[4]=h*d-m,t[8]=f*d+E,t[1]=l*_,t[5]=E*d+f,t[9]=m*d-h,t[2]=-d,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const f=o*l,m=o*d,h=a*l,E=a*d;t[0]=l*c,t[4]=E-f*_,t[8]=h*_+m,t[1]=_,t[5]=o*c,t[9]=-a*c,t[2]=-d*c,t[6]=m*_+h,t[10]=f-E*_}else if(e.order==="XZY"){const f=o*l,m=o*d,h=a*l,E=a*d;t[0]=l*c,t[4]=-_,t[8]=d*c,t[1]=f*_+E,t[5]=o*c,t[9]=m*_-h,t[2]=h*_-m,t[6]=a*c,t[10]=E*_+f}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(rCt,e,oCt)}lookAt(e,t,i){const s=this.elements;return ii.subVectors(e,t),ii.lengthSq()===0&&(ii.z=1),ii.normalize(),ir.crossVectors(i,ii),ir.lengthSq()===0&&(Math.abs(i.z)===1?ii.x+=1e-4:ii.z+=1e-4,ii.normalize(),ir.crossVectors(i,ii)),ir.normalize(),rd.crossVectors(ii,ir),s[0]=ir.x,s[4]=rd.x,s[8]=ii.x,s[1]=ir.y,s[5]=rd.y,s[9]=ii.y,s[2]=ir.z,s[6]=rd.z,s[10]=ii.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],l=i[8],d=i[12],c=i[1],_=i[5],f=i[9],m=i[13],h=i[2],E=i[6],b=i[10],g=i[14],v=i[3],y=i[7],T=i[11],C=i[15],x=s[0],O=s[4],R=s[8],S=s[12],A=s[1],U=s[5],F=s[9],K=s[13],L=s[2],H=s[6],G=s[10],P=s[14],j=s[3],Y=s[7],Q=s[11],re=s[15];return r[0]=o*x+a*A+l*L+d*j,r[4]=o*O+a*U+l*H+d*Y,r[8]=o*R+a*F+l*G+d*Q,r[12]=o*S+a*K+l*P+d*re,r[1]=c*x+_*A+f*L+m*j,r[5]=c*O+_*U+f*H+m*Y,r[9]=c*R+_*F+f*G+m*Q,r[13]=c*S+_*K+f*P+m*re,r[2]=h*x+E*A+b*L+g*j,r[6]=h*O+E*U+b*H+g*Y,r[10]=h*R+E*F+b*G+g*Q,r[14]=h*S+E*K+b*P+g*re,r[3]=v*x+y*A+T*L+C*j,r[7]=v*O+y*U+T*H+C*Y,r[11]=v*R+y*F+T*G+C*Q,r[15]=v*S+y*K+T*P+C*re,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],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],d=e[13],c=e[2],_=e[6],f=e[10],m=e[14],h=e[3],E=e[7],b=e[11],g=e[15];return h*(+r*l*_-s*d*_-r*a*f+i*d*f+s*a*m-i*l*m)+E*(+t*l*m-t*d*f+r*o*f-s*o*m+s*d*c-r*l*c)+b*(+t*d*_-t*a*m-r*o*_+i*o*m+r*a*c-i*d*c)+g*(-s*a*c-t*l*_+t*a*f+s*o*_-i*o*f+i*l*c)}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,i){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],d=e[7],c=e[8],_=e[9],f=e[10],m=e[11],h=e[12],E=e[13],b=e[14],g=e[15],v=_*b*d-E*f*d+E*l*m-a*b*m-_*l*g+a*f*g,y=h*f*d-c*b*d-h*l*m+o*b*m+c*l*g-o*f*g,T=c*E*d-h*_*d+h*a*m-o*E*m-c*a*g+o*_*g,C=h*_*l-c*E*l-h*a*f+o*E*f+c*a*b-o*_*b,x=t*v+i*y+s*T+r*C;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const O=1/x;return e[0]=v*O,e[1]=(E*f*r-_*b*r-E*s*m+i*b*m+_*s*g-i*f*g)*O,e[2]=(a*b*r-E*l*r+E*s*d-i*b*d-a*s*g+i*l*g)*O,e[3]=(_*l*r-a*f*r-_*s*d+i*f*d+a*s*m-i*l*m)*O,e[4]=y*O,e[5]=(c*b*r-h*f*r+h*s*m-t*b*m-c*s*g+t*f*g)*O,e[6]=(h*l*r-o*b*r-h*s*d+t*b*d+o*s*g-t*l*g)*O,e[7]=(o*f*r-c*l*r+c*s*d-t*f*d-o*s*m+t*l*m)*O,e[8]=T*O,e[9]=(h*_*r-c*E*r-h*i*m+t*E*m+c*i*g-t*_*g)*O,e[10]=(o*E*r-h*a*r+h*i*d-t*E*d-o*i*g+t*a*g)*O,e[11]=(c*a*r-o*_*r-c*i*d+t*_*d+o*i*m-t*a*m)*O,e[12]=C*O,e[13]=(c*E*s-h*_*s+h*i*f-t*E*f-c*i*b+t*_*b)*O,e[14]=(h*a*s-o*E*s-h*i*l+t*E*l+o*i*b-t*a*b)*O,e[15]=(o*_*s-c*a*s+c*i*l-t*_*l-o*i*f+t*a*f)*O,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}makeTranslation(e,t,i){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,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),s=Math.sin(t),r=1-i,o=e.x,a=e.y,l=e.z,d=r*o,c=r*a;return this.set(d*o+i,d*a-s*l,d*l+s*a,0,d*a+s*l,c*a+i,c*l-s*o,0,d*l-s*a,c*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,l=t._w,d=r+r,c=o+o,_=a+a,f=r*d,m=r*c,h=r*_,E=o*c,b=o*_,g=a*_,v=l*d,y=l*c,T=l*_,C=i.x,x=i.y,O=i.z;return s[0]=(1-(E+g))*C,s[1]=(m+T)*C,s[2]=(h-y)*C,s[3]=0,s[4]=(m-T)*x,s[5]=(1-(f+g))*x,s[6]=(b+v)*x,s[7]=0,s[8]=(h+y)*O,s[9]=(b-v)*O,s[10]=(1-(f+E))*O,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=Lo.set(s[0],s[1],s[2]).length();const o=Lo.set(s[4],s[5],s[6]).length(),a=Lo.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],Mi.copy(this);const d=1/r,c=1/o,_=1/a;return Mi.elements[0]*=d,Mi.elements[1]*=d,Mi.elements[2]*=d,Mi.elements[4]*=c,Mi.elements[5]*=c,Mi.elements[6]*=c,Mi.elements[8]*=_,Mi.elements[9]*=_,Mi.elements[10]*=_,t.setFromRotationMatrix(Mi),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o,a=Ls){const l=this.elements,d=2*r/(t-e),c=2*r/(i-s),_=(t+e)/(t-e),f=(i+s)/(i-s);let m,h;if(a===Ls)m=-(o+r)/(o-r),h=-2*o*r/(o-r);else if(a===yu)m=-o/(o-r),h=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=d,l[4]=0,l[8]=_,l[12]=0,l[1]=0,l[5]=c,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=h,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,s,r,o,a=Ls){const l=this.elements,d=1/(t-e),c=1/(i-s),_=1/(o-r),f=(t+e)*d,m=(i+s)*c;let h,E;if(a===Ls)h=(o+r)*_,E=-2*_;else if(a===yu)h=r*_,E=-1*_;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*d,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=E,l[14]=-h,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Lo=new be,Mi=new At,rCt=new be(0,0,0),oCt=new be(1,1,1),ir=new be,rd=new be,ii=new be,I1=new At,M1=new Dr;class hp{constructor(e=0,t=0,i=0,s=hp.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=s}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,i,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,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,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],d=s[5],c=s[9],_=s[2],f=s[6],m=s[10];switch(t){case"XYZ":this._y=Math.asin(kn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,m),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(f,d),this._z=0);break;case"YXZ":this._x=Math.asin(-kn(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,d)):(this._y=Math.atan2(-_,r),this._z=0);break;case"ZXY":this._x=Math.asin(kn(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-_,m),this._z=Math.atan2(-o,d)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-kn(_,-1,1)),Math.abs(_)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,d));break;case"YZX":this._z=Math.asin(kn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,d),this._y=Math.atan2(-_,r)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-kn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,d),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-c,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return I1.makeRotationFromQuaternion(e),this.setFromRotationMatrix(I1,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return M1.setFromEuler(this),this.setFromQuaternion(M1,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}}hp.DEFAULT_ORDER="XYZ";class pI{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.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()})),s.maxGeometryCount=this._maxGeometryCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let d=0,c=l.length;d0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),d.length>0&&(i.textures=d),c.length>0&&(i.images=c),_.length>0&&(i.shapes=_),f.length>0&&(i.skeletons=f),m.length>0&&(i.animations=m),h.length>0&&(i.nodes=h)}return i.object=s,i;function o(a){const l=[];for(const d in a){const c=a[d];delete c.metadata,l.push(c)}return l}}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 i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){Di.subVectors(s,t),As.subVectors(i,t),eg.subVectors(e,t);const o=Di.dot(Di),a=Di.dot(As),l=Di.dot(eg),d=As.dot(As),c=As.dot(eg),_=o*d-a*a;if(_===0)return r.set(-2,-1,-1);const f=1/_,m=(d*l-a*c)*f,h=(o*c-a*l)*f;return r.set(1-m-h,h,m)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,ws),ws.x>=0&&ws.y>=0&&ws.x+ws.y<=1}static getUV(e,t,i,s,r,o,a,l){return ad===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),ad=!0),this.getInterpolation(e,t,i,s,r,o,a,l)}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,ws),l.setScalar(0),l.addScaledVector(r,ws.x),l.addScaledVector(o,ws.y),l.addScaledVector(a,ws.z),l}static isFrontFacing(e,t,i,s){return Di.subVectors(i,t),As.subVectors(e,t),Di.cross(As).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),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 Di.subVectors(this.c,this.b),As.subVectors(this.a,this.b),Di.cross(As).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Pi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Pi.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,s,r){return ad===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),ad=!0),Pi.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}getInterpolation(e,t,i,s,r){return Pi.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return Pi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Pi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;Uo.subVectors(s,i),Fo.subVectors(r,i),tg.subVectors(e,i);const l=Uo.dot(tg),d=Fo.dot(tg);if(l<=0&&d<=0)return t.copy(i);ng.subVectors(e,s);const c=Uo.dot(ng),_=Fo.dot(ng);if(c>=0&&_<=c)return t.copy(s);const f=l*_-c*d;if(f<=0&&l>=0&&c<=0)return o=l/(l-c),t.copy(i).addScaledVector(Uo,o);ig.subVectors(e,r);const m=Uo.dot(ig),h=Fo.dot(ig);if(h>=0&&m<=h)return t.copy(r);const E=m*d-l*h;if(E<=0&&d>=0&&h<=0)return a=d/(d-h),t.copy(i).addScaledVector(Fo,a);const b=c*h-m*_;if(b<=0&&_-c>=0&&m-h>=0)return U1.subVectors(r,s),a=(_-c)/(_-c+(m-h)),t.copy(s).addScaledVector(U1,a);const g=1/(b+E+f);return o=E*g,a=f*g,t.copy(i).addScaledVector(Uo,o).addScaledVector(Fo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const _I={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},sr={h:0,s:0,l:0},ld={h:0,s:0,l:0};function sg(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 gt{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=rn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ft.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=Ft.workingColorSpace){return this.r=e,this.g=t,this.b=i,Ft.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=Ft.workingColorSpace){if(e=ev(e,1),t=kn(t,0,1),i=kn(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=sg(o,r,e+1/3),this.g=sg(o,r,e),this.b=sg(o,r,e-1/3)}return Ft.toWorkingColorSpace(this,s),this}setStyle(e,t=rn){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,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=rn){const i=_I[e.toLowerCase()];return i!==void 0?this.setHex(i,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=la(e.r),this.g=la(e.g),this.b=la(e.b),this}copyLinearToSRGB(e){return this.r=$m(e.r),this.g=$m(e.g),this.b=$m(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=rn){return Ft.fromWorkingColorSpace(Mn.copy(this),e),Math.round(kn(Mn.r*255,0,255))*65536+Math.round(kn(Mn.g*255,0,255))*256+Math.round(kn(Mn.b*255,0,255))}getHexString(e=rn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ft.workingColorSpace){Ft.fromWorkingColorSpace(Mn.copy(this),t);const i=Mn.r,s=Mn.g,r=Mn.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,d;const c=(a+o)/2;if(a===o)l=0,d=0;else{const _=o-a;switch(d=c<=.5?_/(o+a):_/(2-o-a),o){case i:l=(s-r)/_+(s0!=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 i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==aa&&(i.blending=this.blending),this.side!==Vs&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==ab&&(i.blendSrc=this.blendSrc),this.blendDst!==lb&&(i.blendDst=this.blendDst),this.blendEquation!==Jr&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==mu&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==x1&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Oo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Oo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Oo&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}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 i=null;if(t!==null){const s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,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 Er extends Vi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new gt(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=QE,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 cn=new be,cd=new It;class Yn{constructor(e,t,i=!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=i,this.usage=_b,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=ks,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,i){e*=this.itemSize,i*=t.itemSize;for(let s=0,r=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const d in l)l[d]!==void 0&&(e[d]=l[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 i=this.attributes;for(const l in i){const d=i[l];e.data.attributes[l]=d.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const d=this.morphAttributes[l],c=[];for(let _=0,f=d.length;_0&&(s[l]=c,r=!0)}r&&(e.data.morphAttributes=s,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 i=e.index;i!==null&&this.setIndex(i.clone(t));const s=e.attributes;for(const d in s){const c=s[d];this.setAttribute(d,c.clone(t))}const r=e.morphAttributes;for(const d in r){const c=[],_=r[d];for(let f=0,m=_.length;f0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(F1.copy(r).invert(),Vr.copy(e.ray).applyMatrix4(F1),!(i.boundingBox!==null&&Vr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Vr)))}_computeIntersections(e,t,i){let s;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,d=r.attributes.uv,c=r.attributes.uv1,_=r.attributes.normal,f=r.groups,m=r.drawRange;if(a!==null)if(Array.isArray(o))for(let h=0,E=f.length;ht.far?null:{distance:d,point:md.clone(),object:n}}function gd(n,e,t,i,s,r,o,a,l,d){n.getVertexPosition(a,Go),n.getVertexPosition(l,zo),n.getVertexPosition(d,Vo);const c=hCt(n,e,t,i,Go,zo,Vo,fd);if(c){s&&(pd.fromBufferAttribute(s,a),_d.fromBufferAttribute(s,l),hd.fromBufferAttribute(s,d),c.uv=Pi.getInterpolation(fd,Go,zo,Vo,pd,_d,hd,new It)),r&&(pd.fromBufferAttribute(r,a),_d.fromBufferAttribute(r,l),hd.fromBufferAttribute(r,d),c.uv1=Pi.getInterpolation(fd,Go,zo,Vo,pd,_d,hd,new It),c.uv2=c.uv1),o&&(G1.fromBufferAttribute(o,a),z1.fromBufferAttribute(o,l),V1.fromBufferAttribute(o,d),c.normal=Pi.getInterpolation(fd,Go,zo,Vo,G1,z1,V1,new be),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));const _={a,b:l,c:d,normal:new be,materialIndex:0};Pi.getNormal(Go,zo,Vo,_.normal),c.face=_}return c}class Cr extends fs{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],d=[],c=[],_=[];let f=0,m=0;h("z","y","x",-1,-1,i,t,e,o,r,0),h("z","y","x",1,-1,i,t,-e,o,r,1),h("x","z","y",1,1,e,i,t,s,o,2),h("x","z","y",1,-1,e,i,-t,s,o,3),h("x","y","z",1,-1,e,t,i,s,r,4),h("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new Us(d,3)),this.setAttribute("normal",new Us(c,3)),this.setAttribute("uv",new Us(_,2));function h(E,b,g,v,y,T,C,x,O,R,S){const A=T/O,U=C/R,F=T/2,K=C/2,L=x/2,H=O+1,G=R+1;let P=0,j=0;const Y=new be;for(let Q=0;Q0?1:-1,c.push(Y.x,Y.y,Y.z),_.push(te/O),_.push(1-Q/R),P+=1}}for(let Q=0;Q>8&255]+In[n>>16&255]+In[n>>24&255]+"-"+In[e&255]+In[e>>8&255]+"-"+In[e>>16&15|64]+In[e>>24&255]+"-"+In[t&63|128]+In[t>>8&255]+"-"+In[t>>16&255]+In[t>>24&255]+In[i&255]+In[i>>8&255]+In[i>>16&255]+In[i>>24&255]).toLowerCase()}function kn(n,e,t){return Math.max(e,Math.min(t,n))}function ev(n,e){return(n%e+e)%e}function Bxt(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function Gxt(n,e,t){return n!==e?(t-n)/(e-n):0}function Bl(n,e,t){return(1-t)*n+t*e}function zxt(n,e,t,i){return Bl(n,e,1-Math.exp(-t*i))}function Vxt(n,e=1){return e-Math.abs(ev(n,e*2)-e)}function Hxt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function qxt(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Yxt(n,e){return n+Math.floor(Math.random()*(e-n+1))}function $xt(n,e){return n+Math.random()*(e-n)}function Wxt(n){return n*(.5-Math.random())}function Kxt(n){n!==void 0&&(R1=n);let e=R1+=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 jxt(n){return n*Fl}function Qxt(n){return n*Na}function fb(n){return(n&n-1)===0&&n!==0}function Xxt(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 Zxt(n,e,t,i,s){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),d=r((e+i)/2),c=o((e+i)/2),_=r((e-i)/2),f=o((e-i)/2),m=r((i-e)/2),h=o((i-e)/2);switch(s){case"XYX":n.set(a*c,l*_,l*f,a*d);break;case"YZY":n.set(l*f,a*c,l*_,a*d);break;case"ZXZ":n.set(l*_,l*f,a*c,a*d);break;case"XZX":n.set(a*c,l*h,l*m,a*d);break;case"YXY":n.set(l*m,a*c,l*h,a*d);break;case"ZYZ":n.set(l*h,l*m,a*c,a*d);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function es(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 Ht(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 Jxt={DEG2RAD:Fl,RAD2DEG:Na,generateUUID:zi,clamp:kn,euclideanModulo:ev,mapLinear:Bxt,inverseLerp:Gxt,lerp:Bl,damp:zxt,pingpong:Vxt,smoothstep:Hxt,smootherstep:qxt,randInt:Yxt,randFloat:$xt,randFloatSpread:Wxt,seededRandom:Kxt,degToRad:jxt,radToDeg:Qxt,isPowerOfTwo:fb,ceilPowerOfTwo:Xxt,floorPowerOfTwo:Su,setQuaternionFromProperEuler:Zxt,normalize:Ht,denormalize:es};class It{constructor(e=0,t=0){It.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,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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 i=this.dot(e)/t;return Math.acos(kn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,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 i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Rt{constructor(e,t,i,s,r,o,a,l,d){Rt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,d)}set(e,t,i,s,r,o,a,l,d){const c=this.elements;return c[0]=e,c[1]=s,c[2]=a,c[3]=t,c[4]=r,c[5]=l,c[6]=i,c[7]=o,c[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.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 i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[3],l=i[6],d=i[1],c=i[4],_=i[7],f=i[2],m=i[5],h=i[8],E=s[0],b=s[3],g=s[6],v=s[1],y=s[4],T=s[7],C=s[2],x=s[5],O=s[8];return r[0]=o*E+a*v+l*C,r[3]=o*b+a*y+l*x,r[6]=o*g+a*T+l*O,r[1]=d*E+c*v+_*C,r[4]=d*b+c*y+_*x,r[7]=d*g+c*T+_*O,r[2]=f*E+m*v+h*C,r[5]=f*b+m*y+h*x,r[8]=f*g+m*T+h*O,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],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],d=e[7],c=e[8];return t*o*c-t*a*d-i*r*c+i*a*l+s*r*d-s*o*l}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],d=e[7],c=e[8],_=c*o-a*d,f=a*l-c*r,m=d*r-o*l,h=t*_+i*f+s*m;if(h===0)return this.set(0,0,0,0,0,0,0,0,0);const E=1/h;return e[0]=_*E,e[1]=(s*d-c*i)*E,e[2]=(a*i-s*o)*E,e[3]=f*E,e[4]=(c*t-s*l)*E,e[5]=(s*r-a*t)*E,e[6]=m*E,e[7]=(i*l-d*t)*E,e[8]=(o*t-i*r)*E,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,i,s,r,o,a){const l=Math.cos(r),d=Math.sin(r);return this.set(i*l,i*d,-i*(l*o+d*a)+o+e,-s*d,s*l,-s*(-d*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Ym.makeScale(e,t)),this}rotate(e){return this.premultiply(Ym.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ym.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),i=Math.sin(e);return this.set(t,-i,0,i,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,i=e.elements;for(let s=0;s<9;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Ym=new Rt;function lI(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function lc(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function eCt(){const n=lc("canvas");return n.style.display="block",n}const A1={};function Gl(n){n in A1||(A1[n]=!0,console.warn(n))}const w1=new Rt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),N1=new Rt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Jc={[Nn]:{transfer:bu,primaries:Eu,toReference:n=>n,fromReference:n=>n},[rn]:{transfer:Xt,primaries:Eu,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[pp]:{transfer:bu,primaries:vu,toReference:n=>n.applyMatrix3(N1),fromReference:n=>n.applyMatrix3(w1)},[JE]:{transfer:Xt,primaries:vu,toReference:n=>n.convertSRGBToLinear().applyMatrix3(N1),fromReference:n=>n.applyMatrix3(w1).convertLinearToSRGB()}},tCt=new Set([Nn,pp]),Ft={enabled:!0,_workingColorSpace:Nn,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(!tCt.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 i=Jc[e].toReference,s=Jc[t].fromReference;return s(i(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 Jc[n].primaries},getTransfer:function(n){return n===Ei?bu:Jc[n].transfer}};function la(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function $m(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Io;class cI{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Io===void 0&&(Io=lc("canvas")),Io.width=e.width,Io.height=e.height;const i=Io.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Io}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=lc("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==QO)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ra:e.x=e.x-Math.floor(e.x);break;case gi: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 Ra:e.y=e.y-Math.floor(e.y);break;case gi: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 Gl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===rn?uo:oI}set encoding(e){Gl("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===uo?rn:Ei}}wn.DEFAULT_IMAGE=null;wn.DEFAULT_MAPPING=QO;wn.DEFAULT_ANISOTROPY=1;class Wt{constructor(e=0,t=0,i=0,s=1){Wt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=s}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,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,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,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,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,i,s,r;const l=e.elements,d=l[0],c=l[4],_=l[8],f=l[1],m=l[5],h=l[9],E=l[2],b=l[6],g=l[10];if(Math.abs(c-f)<.01&&Math.abs(_-E)<.01&&Math.abs(h-b)<.01){if(Math.abs(c+f)<.1&&Math.abs(_+E)<.1&&Math.abs(h+b)<.1&&Math.abs(d+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const y=(d+1)/2,T=(m+1)/2,C=(g+1)/2,x=(c+f)/4,O=(_+E)/4,R=(h+b)/4;return y>T&&y>C?y<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(y),s=x/i,r=O/i):T>C?T<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(T),i=x/s,r=R/s):C<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(C),i=O/r,s=R/r),this.set(i,s,r,t),this}let v=Math.sqrt((b-h)*(b-h)+(_-E)*(_-E)+(f-c)*(f-c));return Math.abs(v)<.001&&(v=1),this.x=(b-h)/v,this.y=(_-E)/v,this.z=(f-c)/v,this.w=Math.acos((d+m+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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,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 sCt extends ja{constructor(e=1,t=1,i={}){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 s={width:e,height:t,depth:1};i.encoding!==void 0&&(Gl("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===uo?rn:Ei),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:jn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},i),this.texture=new wn(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps,this.texture.internalFormat=i.internalFormat,this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,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 dI(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 bo extends sCt{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class uI extends wn{constructor(e=null,t=1,i=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=En,this.minFilter=En,this.wrapR=gi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class rCt extends wn{constructor(e=null,t=1,i=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:s},this.magFilter=En,this.minFilter=En,this.wrapR=gi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Dr{constructor(e=0,t=0,i=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=s}static slerpFlat(e,t,i,s,r,o,a){let l=i[s+0],d=i[s+1],c=i[s+2],_=i[s+3];const f=r[o+0],m=r[o+1],h=r[o+2],E=r[o+3];if(a===0){e[t+0]=l,e[t+1]=d,e[t+2]=c,e[t+3]=_;return}if(a===1){e[t+0]=f,e[t+1]=m,e[t+2]=h,e[t+3]=E;return}if(_!==E||l!==f||d!==m||c!==h){let b=1-a;const g=l*f+d*m+c*h+_*E,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){const C=Math.sqrt(y),x=Math.atan2(C,g*v);b=Math.sin(b*x)/C,a=Math.sin(a*x)/C}const T=a*v;if(l=l*b+f*T,d=d*b+m*T,c=c*b+h*T,_=_*b+E*T,b===1-a){const C=1/Math.sqrt(l*l+d*d+c*c+_*_);l*=C,d*=C,c*=C,_*=C}}e[t]=l,e[t+1]=d,e[t+2]=c,e[t+3]=_}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],d=i[s+2],c=i[s+3],_=r[o],f=r[o+1],m=r[o+2],h=r[o+3];return e[t]=a*h+c*_+l*m-d*f,e[t+1]=l*h+c*f+d*_-a*m,e[t+2]=d*h+c*m+a*f-l*_,e[t+3]=c*h-a*_-l*f-d*m,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,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,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 i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,d=a(i/2),c=a(s/2),_=a(r/2),f=l(i/2),m=l(s/2),h=l(r/2);switch(o){case"XYZ":this._x=f*c*_+d*m*h,this._y=d*m*_-f*c*h,this._z=d*c*h+f*m*_,this._w=d*c*_-f*m*h;break;case"YXZ":this._x=f*c*_+d*m*h,this._y=d*m*_-f*c*h,this._z=d*c*h-f*m*_,this._w=d*c*_+f*m*h;break;case"ZXY":this._x=f*c*_-d*m*h,this._y=d*m*_+f*c*h,this._z=d*c*h+f*m*_,this._w=d*c*_-f*m*h;break;case"ZYX":this._x=f*c*_-d*m*h,this._y=d*m*_+f*c*h,this._z=d*c*h-f*m*_,this._w=d*c*_+f*m*h;break;case"YZX":this._x=f*c*_+d*m*h,this._y=d*m*_+f*c*h,this._z=d*c*h-f*m*_,this._w=d*c*_-f*m*h;break;case"XZY":this._x=f*c*_-d*m*h,this._y=d*m*_-f*c*h,this._z=d*c*h+f*m*_,this._w=d*c*_+f*m*h;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],l=t[9],d=t[2],c=t[6],_=t[10],f=i+a+_;if(f>0){const m=.5/Math.sqrt(f+1);this._w=.25/m,this._x=(c-l)*m,this._y=(r-d)*m,this._z=(o-s)*m}else if(i>a&&i>_){const m=2*Math.sqrt(1+i-a-_);this._w=(c-l)/m,this._x=.25*m,this._y=(s+o)/m,this._z=(r+d)/m}else if(a>_){const m=2*Math.sqrt(1+a-i-_);this._w=(r-d)/m,this._x=(s+o)/m,this._y=.25*m,this._z=(l+c)/m}else{const m=2*Math.sqrt(1+_-i-a);this._w=(o-s)/m,this._x=(r+d)/m,this._y=(l+c)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(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=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(kn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),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 i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,d=t._z,c=t._w;return this._x=i*c+o*a+s*d-r*l,this._y=s*c+o*l+r*a-i*d,this._z=r*c+o*d+i*l-s*a,this._w=o*c-i*a-s*l-r*d,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*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=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*s+t*this._y,this._z=m*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const d=Math.sqrt(l),c=Math.atan2(d,a),_=Math.sin((1-t)*c)/d,f=Math.sin(t*c)/d;return this._w=o*_+this._w*f,this._x=i*_+this._x*f,this._y=s*_+this._y*f,this._z=r*_+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),s=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(t*Math.cos(s),i*Math.sin(r),i*Math.cos(r),t*Math.sin(s))}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 be{constructor(e=0,t=0,i=0){be.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,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(O1.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(O1.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,d=2*(o*s-a*i),c=2*(a*t-r*s),_=2*(r*i-o*t);return this.x=t+l*d+o*_-a*c,this.y=i+l*c+a*d-r*_,this.z=s+l*_+r*c-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,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Km.copy(this).projectOnVector(e),this.sub(Km)}reflect(e){return this.sub(Km.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 i=this.dot(e)/t;return Math.acos(kn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}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,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,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(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,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,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Km=new be,O1=new Dr;class Ks{constructor(e=new be(1/0,1/0,1/0),t=new be(-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,i=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,Ii),Ii.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ml),td.subVectors(this.max,ml),Mo.subVectors(e.a,ml),Do.subVectors(e.b,ml),ko.subVectors(e.c,ml),er.subVectors(Do,Mo),tr.subVectors(ko,Do),Gr.subVectors(Mo,ko);let t=[0,-er.z,er.y,0,-tr.z,tr.y,0,-Gr.z,Gr.y,er.z,0,-er.x,tr.z,0,-tr.x,Gr.z,0,-Gr.x,-er.y,er.x,0,-tr.y,tr.x,0,-Gr.y,Gr.x,0];return!jm(t,Mo,Do,ko,td)||(t=[1,0,0,0,1,0,0,0,1],!jm(t,Mo,Do,ko,td))?!1:(nd.crossVectors(er,tr),t=[nd.x,nd.y,nd.z],jm(t,Mo,Do,ko,td))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ii).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ii).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:(xs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),xs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),xs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),xs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),xs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),xs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),xs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),xs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(xs),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 xs=[new be,new be,new be,new be,new be,new be,new be,new be],Ii=new be,ed=new Ks,Mo=new be,Do=new be,ko=new be,er=new be,tr=new be,Gr=new be,ml=new be,td=new be,nd=new be,zr=new be;function jm(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){zr.fromArray(n,r);const a=s.x*Math.abs(zr.x)+s.y*Math.abs(zr.y)+s.z*Math.abs(zr.z),l=e.dot(zr),d=t.dot(zr),c=i.dot(zr);if(Math.max(-Math.max(l,d,c),Math.min(l,d,c))>a)return!1}return!0}const oCt=new Ks,gl=new be,Qm=new be;class hs{constructor(e=new be,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):oCt.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.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;gl.subVectors(e,this.center);const t=gl.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(gl,s/i),this.radius+=s}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):(Qm.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(gl.copy(e.center).add(Qm)),this.expandByPoint(gl.copy(e.center).sub(Qm))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Cs=new be,Xm=new be,id=new be,nr=new be,Zm=new be,sd=new be,Jm=new be;class _p{constructor(e=new be,t=new be(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,Cs)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Cs.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Cs.copy(this.origin).addScaledVector(this.direction,t),Cs.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){Xm.copy(e).add(t).multiplyScalar(.5),id.copy(t).sub(e).normalize(),nr.copy(this.origin).sub(Xm);const r=e.distanceTo(t)*.5,o=-this.direction.dot(id),a=nr.dot(this.direction),l=-nr.dot(id),d=nr.lengthSq(),c=Math.abs(1-o*o);let _,f,m,h;if(c>0)if(_=o*l-a,f=o*a-l,h=r*c,_>=0)if(f>=-h)if(f<=h){const E=1/c;_*=E,f*=E,m=_*(_+o*f+2*a)+f*(o*_+f+2*l)+d}else f=r,_=Math.max(0,-(o*f+a)),m=-_*_+f*(f+2*l)+d;else f=-r,_=Math.max(0,-(o*f+a)),m=-_*_+f*(f+2*l)+d;else f<=-h?(_=Math.max(0,-(-o*r+a)),f=_>0?-r:Math.min(Math.max(-r,-l),r),m=-_*_+f*(f+2*l)+d):f<=h?(_=0,f=Math.min(Math.max(-r,-l),r),m=f*(f+2*l)+d):(_=Math.max(0,-(o*r+a)),f=_>0?r:Math.min(Math.max(-r,-l),r),m=-_*_+f*(f+2*l)+d);else f=o>0?-r:r,_=Math.max(0,-(o*f+a)),m=-_*_+f*(f+2*l)+d;return i&&i.copy(this.origin).addScaledVector(this.direction,_),s&&s.copy(Xm).addScaledVector(id,f),m}intersectSphere(e,t){Cs.subVectors(e.center,this.origin);const i=Cs.dot(this.direction),s=Cs.dot(Cs)-i*i,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,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 i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,s,r,o,a,l;const d=1/this.direction.x,c=1/this.direction.y,_=1/this.direction.z,f=this.origin;return d>=0?(i=(e.min.x-f.x)*d,s=(e.max.x-f.x)*d):(i=(e.max.x-f.x)*d,s=(e.min.x-f.x)*d),c>=0?(r=(e.min.y-f.y)*c,o=(e.max.y-f.y)*c):(r=(e.max.y-f.y)*c,o=(e.min.y-f.y)*c),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-f.z)*_,l=(e.max.z-f.z)*_):(a=(e.max.z-f.z)*_,l=(e.min.z-f.z)*_),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,Cs)!==null}intersectTriangle(e,t,i,s,r){Zm.subVectors(t,e),sd.subVectors(i,e),Jm.crossVectors(Zm,sd);let o=this.direction.dot(Jm),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;nr.subVectors(this.origin,e);const l=a*this.direction.dot(sd.crossVectors(nr,sd));if(l<0)return null;const d=a*this.direction.dot(Zm.cross(nr));if(d<0||l+d>o)return null;const c=-a*nr.dot(Jm);return c<0?null:this.at(c/o,r)}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 At{constructor(e,t,i,s,r,o,a,l,d,c,_,f,m,h,E,b){At.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,i,s,r,o,a,l,d,c,_,f,m,h,E,b)}set(e,t,i,s,r,o,a,l,d,c,_,f,m,h,E,b){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=s,g[1]=r,g[5]=o,g[9]=a,g[13]=l,g[2]=d,g[6]=c,g[10]=_,g[14]=f,g[3]=m,g[7]=h,g[11]=E,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 At().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[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,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,s=1/Lo.setFromMatrixColumn(e,0).length(),r=1/Lo.setFromMatrixColumn(e,1).length(),o=1/Lo.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),d=Math.sin(s),c=Math.cos(r),_=Math.sin(r);if(e.order==="XYZ"){const f=o*c,m=o*_,h=a*c,E=a*_;t[0]=l*c,t[4]=-l*_,t[8]=d,t[1]=m+h*d,t[5]=f-E*d,t[9]=-a*l,t[2]=E-f*d,t[6]=h+m*d,t[10]=o*l}else if(e.order==="YXZ"){const f=l*c,m=l*_,h=d*c,E=d*_;t[0]=f+E*a,t[4]=h*a-m,t[8]=o*d,t[1]=o*_,t[5]=o*c,t[9]=-a,t[2]=m*a-h,t[6]=E+f*a,t[10]=o*l}else if(e.order==="ZXY"){const f=l*c,m=l*_,h=d*c,E=d*_;t[0]=f-E*a,t[4]=-o*_,t[8]=h+m*a,t[1]=m+h*a,t[5]=o*c,t[9]=E-f*a,t[2]=-o*d,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const f=o*c,m=o*_,h=a*c,E=a*_;t[0]=l*c,t[4]=h*d-m,t[8]=f*d+E,t[1]=l*_,t[5]=E*d+f,t[9]=m*d-h,t[2]=-d,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const f=o*l,m=o*d,h=a*l,E=a*d;t[0]=l*c,t[4]=E-f*_,t[8]=h*_+m,t[1]=_,t[5]=o*c,t[9]=-a*c,t[2]=-d*c,t[6]=m*_+h,t[10]=f-E*_}else if(e.order==="XZY"){const f=o*l,m=o*d,h=a*l,E=a*d;t[0]=l*c,t[4]=-_,t[8]=d*c,t[1]=f*_+E,t[5]=o*c,t[9]=m*_-h,t[2]=h*_-m,t[6]=a*c,t[10]=E*_+f}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(aCt,e,lCt)}lookAt(e,t,i){const s=this.elements;return ii.subVectors(e,t),ii.lengthSq()===0&&(ii.z=1),ii.normalize(),ir.crossVectors(i,ii),ir.lengthSq()===0&&(Math.abs(i.z)===1?ii.x+=1e-4:ii.z+=1e-4,ii.normalize(),ir.crossVectors(i,ii)),ir.normalize(),rd.crossVectors(ii,ir),s[0]=ir.x,s[4]=rd.x,s[8]=ii.x,s[1]=ir.y,s[5]=rd.y,s[9]=ii.y,s[2]=ir.z,s[6]=rd.z,s[10]=ii.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],l=i[8],d=i[12],c=i[1],_=i[5],f=i[9],m=i[13],h=i[2],E=i[6],b=i[10],g=i[14],v=i[3],y=i[7],T=i[11],C=i[15],x=s[0],O=s[4],R=s[8],S=s[12],A=s[1],U=s[5],F=s[9],K=s[13],L=s[2],H=s[6],G=s[10],P=s[14],j=s[3],Y=s[7],Q=s[11],re=s[15];return r[0]=o*x+a*A+l*L+d*j,r[4]=o*O+a*U+l*H+d*Y,r[8]=o*R+a*F+l*G+d*Q,r[12]=o*S+a*K+l*P+d*re,r[1]=c*x+_*A+f*L+m*j,r[5]=c*O+_*U+f*H+m*Y,r[9]=c*R+_*F+f*G+m*Q,r[13]=c*S+_*K+f*P+m*re,r[2]=h*x+E*A+b*L+g*j,r[6]=h*O+E*U+b*H+g*Y,r[10]=h*R+E*F+b*G+g*Q,r[14]=h*S+E*K+b*P+g*re,r[3]=v*x+y*A+T*L+C*j,r[7]=v*O+y*U+T*H+C*Y,r[11]=v*R+y*F+T*G+C*Q,r[15]=v*S+y*K+T*P+C*re,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],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],d=e[13],c=e[2],_=e[6],f=e[10],m=e[14],h=e[3],E=e[7],b=e[11],g=e[15];return h*(+r*l*_-s*d*_-r*a*f+i*d*f+s*a*m-i*l*m)+E*(+t*l*m-t*d*f+r*o*f-s*o*m+s*d*c-r*l*c)+b*(+t*d*_-t*a*m-r*o*_+i*o*m+r*a*c-i*d*c)+g*(-s*a*c-t*l*_+t*a*f+s*o*_-i*o*f+i*l*c)}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,i){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],d=e[7],c=e[8],_=e[9],f=e[10],m=e[11],h=e[12],E=e[13],b=e[14],g=e[15],v=_*b*d-E*f*d+E*l*m-a*b*m-_*l*g+a*f*g,y=h*f*d-c*b*d-h*l*m+o*b*m+c*l*g-o*f*g,T=c*E*d-h*_*d+h*a*m-o*E*m-c*a*g+o*_*g,C=h*_*l-c*E*l-h*a*f+o*E*f+c*a*b-o*_*b,x=t*v+i*y+s*T+r*C;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const O=1/x;return e[0]=v*O,e[1]=(E*f*r-_*b*r-E*s*m+i*b*m+_*s*g-i*f*g)*O,e[2]=(a*b*r-E*l*r+E*s*d-i*b*d-a*s*g+i*l*g)*O,e[3]=(_*l*r-a*f*r-_*s*d+i*f*d+a*s*m-i*l*m)*O,e[4]=y*O,e[5]=(c*b*r-h*f*r+h*s*m-t*b*m-c*s*g+t*f*g)*O,e[6]=(h*l*r-o*b*r-h*s*d+t*b*d+o*s*g-t*l*g)*O,e[7]=(o*f*r-c*l*r+c*s*d-t*f*d-o*s*m+t*l*m)*O,e[8]=T*O,e[9]=(h*_*r-c*E*r-h*i*m+t*E*m+c*i*g-t*_*g)*O,e[10]=(o*E*r-h*a*r+h*i*d-t*E*d-o*i*g+t*a*g)*O,e[11]=(c*a*r-o*_*r-c*i*d+t*_*d+o*i*m-t*a*m)*O,e[12]=C*O,e[13]=(c*E*s-h*_*s+h*i*f-t*E*f-c*i*b+t*_*b)*O,e[14]=(h*a*s-o*E*s-h*i*l+t*E*l+o*i*b-t*a*b)*O,e[15]=(o*_*s-c*a*s+c*i*l-t*_*l-o*i*f+t*a*f)*O,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}makeTranslation(e,t,i){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,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),s=Math.sin(t),r=1-i,o=e.x,a=e.y,l=e.z,d=r*o,c=r*a;return this.set(d*o+i,d*a-s*l,d*l+s*a,0,d*a+s*l,c*a+i,c*l-s*o,0,d*l-s*a,c*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,l=t._w,d=r+r,c=o+o,_=a+a,f=r*d,m=r*c,h=r*_,E=o*c,b=o*_,g=a*_,v=l*d,y=l*c,T=l*_,C=i.x,x=i.y,O=i.z;return s[0]=(1-(E+g))*C,s[1]=(m+T)*C,s[2]=(h-y)*C,s[3]=0,s[4]=(m-T)*x,s[5]=(1-(f+g))*x,s[6]=(b+v)*x,s[7]=0,s[8]=(h+y)*O,s[9]=(b-v)*O,s[10]=(1-(f+E))*O,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=Lo.set(s[0],s[1],s[2]).length();const o=Lo.set(s[4],s[5],s[6]).length(),a=Lo.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],Mi.copy(this);const d=1/r,c=1/o,_=1/a;return Mi.elements[0]*=d,Mi.elements[1]*=d,Mi.elements[2]*=d,Mi.elements[4]*=c,Mi.elements[5]*=c,Mi.elements[6]*=c,Mi.elements[8]*=_,Mi.elements[9]*=_,Mi.elements[10]*=_,t.setFromRotationMatrix(Mi),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o,a=Ls){const l=this.elements,d=2*r/(t-e),c=2*r/(i-s),_=(t+e)/(t-e),f=(i+s)/(i-s);let m,h;if(a===Ls)m=-(o+r)/(o-r),h=-2*o*r/(o-r);else if(a===yu)m=-o/(o-r),h=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=d,l[4]=0,l[8]=_,l[12]=0,l[1]=0,l[5]=c,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=h,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,s,r,o,a=Ls){const l=this.elements,d=1/(t-e),c=1/(i-s),_=1/(o-r),f=(t+e)*d,m=(i+s)*c;let h,E;if(a===Ls)h=(o+r)*_,E=-2*_;else if(a===yu)h=r*_,E=-1*_;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*d,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=E,l[14]=-h,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Lo=new be,Mi=new At,aCt=new be(0,0,0),lCt=new be(1,1,1),ir=new be,rd=new be,ii=new be,I1=new At,M1=new Dr;class hp{constructor(e=0,t=0,i=0,s=hp.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=s}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,i,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,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,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],d=s[5],c=s[9],_=s[2],f=s[6],m=s[10];switch(t){case"XYZ":this._y=Math.asin(kn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,m),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(f,d),this._z=0);break;case"YXZ":this._x=Math.asin(-kn(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,d)):(this._y=Math.atan2(-_,r),this._z=0);break;case"ZXY":this._x=Math.asin(kn(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-_,m),this._z=Math.atan2(-o,d)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-kn(_,-1,1)),Math.abs(_)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,d));break;case"YZX":this._z=Math.asin(kn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,d),this._y=Math.atan2(-_,r)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-kn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,d),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-c,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return I1.makeRotationFromQuaternion(e),this.setFromRotationMatrix(I1,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return M1.setFromEuler(this),this.setFromQuaternion(M1,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}}hp.DEFAULT_ORDER="XYZ";class pI{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.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()})),s.maxGeometryCount=this._maxGeometryCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let d=0,c=l.length;d0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),d.length>0&&(i.textures=d),c.length>0&&(i.images=c),_.length>0&&(i.shapes=_),f.length>0&&(i.skeletons=f),m.length>0&&(i.animations=m),h.length>0&&(i.nodes=h)}return i.object=s,i;function o(a){const l=[];for(const d in a){const c=a[d];delete c.metadata,l.push(c)}return l}}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 i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){Di.subVectors(s,t),As.subVectors(i,t),eg.subVectors(e,t);const o=Di.dot(Di),a=Di.dot(As),l=Di.dot(eg),d=As.dot(As),c=As.dot(eg),_=o*d-a*a;if(_===0)return r.set(-2,-1,-1);const f=1/_,m=(d*l-a*c)*f,h=(o*c-a*l)*f;return r.set(1-m-h,h,m)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,ws),ws.x>=0&&ws.y>=0&&ws.x+ws.y<=1}static getUV(e,t,i,s,r,o,a,l){return ad===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),ad=!0),this.getInterpolation(e,t,i,s,r,o,a,l)}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,ws),l.setScalar(0),l.addScaledVector(r,ws.x),l.addScaledVector(o,ws.y),l.addScaledVector(a,ws.z),l}static isFrontFacing(e,t,i,s){return Di.subVectors(i,t),As.subVectors(e,t),Di.cross(As).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),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 Di.subVectors(this.c,this.b),As.subVectors(this.a,this.b),Di.cross(As).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Pi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Pi.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,s,r){return ad===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),ad=!0),Pi.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}getInterpolation(e,t,i,s,r){return Pi.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return Pi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Pi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;Uo.subVectors(s,i),Fo.subVectors(r,i),tg.subVectors(e,i);const l=Uo.dot(tg),d=Fo.dot(tg);if(l<=0&&d<=0)return t.copy(i);ng.subVectors(e,s);const c=Uo.dot(ng),_=Fo.dot(ng);if(c>=0&&_<=c)return t.copy(s);const f=l*_-c*d;if(f<=0&&l>=0&&c<=0)return o=l/(l-c),t.copy(i).addScaledVector(Uo,o);ig.subVectors(e,r);const m=Uo.dot(ig),h=Fo.dot(ig);if(h>=0&&m<=h)return t.copy(r);const E=m*d-l*h;if(E<=0&&d>=0&&h<=0)return a=d/(d-h),t.copy(i).addScaledVector(Fo,a);const b=c*h-m*_;if(b<=0&&_-c>=0&&m-h>=0)return U1.subVectors(r,s),a=(_-c)/(_-c+(m-h)),t.copy(s).addScaledVector(U1,a);const g=1/(b+E+f);return o=E*g,a=f*g,t.copy(i).addScaledVector(Uo,o).addScaledVector(Fo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const _I={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},sr={h:0,s:0,l:0},ld={h:0,s:0,l:0};function sg(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 gt{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=rn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ft.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=Ft.workingColorSpace){return this.r=e,this.g=t,this.b=i,Ft.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=Ft.workingColorSpace){if(e=ev(e,1),t=kn(t,0,1),i=kn(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=sg(o,r,e+1/3),this.g=sg(o,r,e),this.b=sg(o,r,e-1/3)}return Ft.toWorkingColorSpace(this,s),this}setStyle(e,t=rn){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,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=rn){const i=_I[e.toLowerCase()];return i!==void 0?this.setHex(i,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=la(e.r),this.g=la(e.g),this.b=la(e.b),this}copyLinearToSRGB(e){return this.r=$m(e.r),this.g=$m(e.g),this.b=$m(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=rn){return Ft.fromWorkingColorSpace(Mn.copy(this),e),Math.round(kn(Mn.r*255,0,255))*65536+Math.round(kn(Mn.g*255,0,255))*256+Math.round(kn(Mn.b*255,0,255))}getHexString(e=rn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ft.workingColorSpace){Ft.fromWorkingColorSpace(Mn.copy(this),t);const i=Mn.r,s=Mn.g,r=Mn.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,d;const c=(a+o)/2;if(a===o)l=0,d=0;else{const _=o-a;switch(d=c<=.5?_/(o+a):_/(2-o-a),o){case i:l=(s-r)/_+(s0!=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 i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==aa&&(i.blending=this.blending),this.side!==Vs&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==ab&&(i.blendSrc=this.blendSrc),this.blendDst!==lb&&(i.blendDst=this.blendDst),this.blendEquation!==Jr&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==mu&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==x1&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Oo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Oo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Oo&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}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 i=null;if(t!==null){const s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,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 Er extends Vi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new gt(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=QE,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 cn=new be,cd=new It;class Yn{constructor(e,t,i=!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=i,this.usage=_b,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=ks,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,i){e*=this.itemSize,i*=t.itemSize;for(let s=0,r=this.itemSize;s0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const d in l)l[d]!==void 0&&(e[d]=l[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 i=this.attributes;for(const l in i){const d=i[l];e.data.attributes[l]=d.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const d=this.morphAttributes[l],c=[];for(let _=0,f=d.length;_0&&(s[l]=c,r=!0)}r&&(e.data.morphAttributes=s,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 i=e.index;i!==null&&this.setIndex(i.clone(t));const s=e.attributes;for(const d in s){const c=s[d];this.setAttribute(d,c.clone(t))}const r=e.morphAttributes;for(const d in r){const c=[],_=r[d];for(let f=0,m=_.length;f0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(F1.copy(r).invert(),Vr.copy(e.ray).applyMatrix4(F1),!(i.boundingBox!==null&&Vr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Vr)))}_computeIntersections(e,t,i){let s;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,d=r.attributes.uv,c=r.attributes.uv1,_=r.attributes.normal,f=r.groups,m=r.drawRange;if(a!==null)if(Array.isArray(o))for(let h=0,E=f.length;ht.far?null:{distance:d,point:md.clone(),object:n}}function gd(n,e,t,i,s,r,o,a,l,d){n.getVertexPosition(a,Go),n.getVertexPosition(l,zo),n.getVertexPosition(d,Vo);const c=mCt(n,e,t,i,Go,zo,Vo,fd);if(c){s&&(pd.fromBufferAttribute(s,a),_d.fromBufferAttribute(s,l),hd.fromBufferAttribute(s,d),c.uv=Pi.getInterpolation(fd,Go,zo,Vo,pd,_d,hd,new It)),r&&(pd.fromBufferAttribute(r,a),_d.fromBufferAttribute(r,l),hd.fromBufferAttribute(r,d),c.uv1=Pi.getInterpolation(fd,Go,zo,Vo,pd,_d,hd,new It),c.uv2=c.uv1),o&&(G1.fromBufferAttribute(o,a),z1.fromBufferAttribute(o,l),V1.fromBufferAttribute(o,d),c.normal=Pi.getInterpolation(fd,Go,zo,Vo,G1,z1,V1,new be),c.normal.dot(i.direction)>0&&c.normal.multiplyScalar(-1));const _={a,b:l,c:d,normal:new be,materialIndex:0};Pi.getNormal(Go,zo,Vo,_.normal),c.face=_}return c}class Cr extends fs{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],d=[],c=[],_=[];let f=0,m=0;h("z","y","x",-1,-1,i,t,e,o,r,0),h("z","y","x",1,-1,i,t,-e,o,r,1),h("x","z","y",1,1,e,i,t,s,o,2),h("x","z","y",1,-1,e,i,-t,s,o,3),h("x","y","z",1,-1,e,t,i,s,r,4),h("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new Us(d,3)),this.setAttribute("normal",new Us(c,3)),this.setAttribute("uv",new Us(_,2));function h(E,b,g,v,y,T,C,x,O,R,S){const A=T/O,U=C/R,F=T/2,K=C/2,L=x/2,H=O+1,G=R+1;let P=0,j=0;const Y=new be;for(let Q=0;Q0?1:-1,c.push(Y.x,Y.y,Y.z),_.push(te/O),_.push(1-Q/R),P+=1}}for(let Q=0;Q0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class gI extends sn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new At,this.projectionMatrix=new At,this.projectionMatrixInverse=new At,this.coordinateSystem=Ls}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 Vn extends gI{constructor(e=50,t=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,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=Na*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Fl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Na*2*Math.atan(Math.tan(Fl*.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,i,s,r,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=i,this.view.offsetY=s,this.view.width=r,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(Fl*.5*this.fov)/this.zoom,i=2*t,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,d=o.fullHeight;r+=o.offsetX*s/l,t-=o.offsetY*i/d,s*=o.width/l,i*=o.height/d}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-i,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 Ho=-90,qo=1;class ECt extends sn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Vn(Ho,qo,e,t);s.layers=this.layers,this.add(s);const r=new Vn(Ho,qo,e,t);r.layers=this.layers,this.add(r);const o=new Vn(Ho,qo,e,t);o.layers=this.layers,this.add(o);const a=new Vn(Ho,qo,e,t);a.layers=this.layers,this.add(a);const l=new Vn(Ho,qo,e,t);l.layers=this.layers,this.add(l);const d=new Vn(Ho,qo,e,t);d.layers=this.layers,this.add(d)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,s,r,o,a,l]=t;for(const d of t)this.remove(d);if(e===Ls)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.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),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===yu)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.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),l.up.set(0,-1,0),l.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:i,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,d,c]=this.children,_=e.getRenderTarget(),f=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),h=e.xr.enabled;e.xr.enabled=!1;const E=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,s),e.render(t,r),e.setRenderTarget(i,1,s),e.render(t,o),e.setRenderTarget(i,2,s),e.render(t,a),e.setRenderTarget(i,3,s),e.render(t,l),e.setRenderTarget(i,4,s),e.render(t,d),i.texture.generateMipmaps=E,e.setRenderTarget(i,5,s),e.render(t,c),e.setRenderTarget(_,f,m),e.xr.enabled=h,i.texture.needsPMREMUpdate=!0}}class bI extends wn{constructor(e,t,i,s,r,o,a,l,d,c){e=e!==void 0?e:[],t=t!==void 0?t:xa,super(e,t,i,s,r,o,a,l,d,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class vCt extends bo{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];t.encoding!==void 0&&(Gl("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===uo?rn:Ei),this.texture=new bI(s,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:jn}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 i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class Eo extends Vi{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=ECt,this.fragmentShader=vCt,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=Oa(e.uniforms),this.uniformsGroups=gCt(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 s in this.uniforms){const o=this.uniforms[s].value;o&&o.isTexture?t.uniforms[s]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[s]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[s]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[s]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[s]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[s]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[s]={type:"m4",value:o.toArray()}:t.uniforms[s]={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 i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class gI extends sn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new At,this.projectionMatrix=new At,this.projectionMatrixInverse=new At,this.coordinateSystem=Ls}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 Vn extends gI{constructor(e=50,t=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,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=Na*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Fl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Na*2*Math.atan(Math.tan(Fl*.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,i,s,r,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=i,this.view.offsetY=s,this.view.width=r,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(Fl*.5*this.fov)/this.zoom,i=2*t,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,d=o.fullHeight;r+=o.offsetX*s/l,t-=o.offsetY*i/d,s*=o.width/l,i*=o.height/d}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-i,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 Ho=-90,qo=1;class yCt extends sn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Vn(Ho,qo,e,t);s.layers=this.layers,this.add(s);const r=new Vn(Ho,qo,e,t);r.layers=this.layers,this.add(r);const o=new Vn(Ho,qo,e,t);o.layers=this.layers,this.add(o);const a=new Vn(Ho,qo,e,t);a.layers=this.layers,this.add(a);const l=new Vn(Ho,qo,e,t);l.layers=this.layers,this.add(l);const d=new Vn(Ho,qo,e,t);d.layers=this.layers,this.add(d)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,s,r,o,a,l]=t;for(const d of t)this.remove(d);if(e===Ls)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.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),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===yu)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.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),l.up.set(0,-1,0),l.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:i,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,d,c]=this.children,_=e.getRenderTarget(),f=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),h=e.xr.enabled;e.xr.enabled=!1;const E=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,s),e.render(t,r),e.setRenderTarget(i,1,s),e.render(t,o),e.setRenderTarget(i,2,s),e.render(t,a),e.setRenderTarget(i,3,s),e.render(t,l),e.setRenderTarget(i,4,s),e.render(t,d),i.texture.generateMipmaps=E,e.setRenderTarget(i,5,s),e.render(t,c),e.setRenderTarget(_,f,m),e.xr.enabled=h,i.texture.needsPMREMUpdate=!0}}class bI extends wn{constructor(e,t,i,s,r,o,a,l,d,c){e=e!==void 0?e:[],t=t!==void 0?t:xa,super(e,t,i,s,r,o,a,l,d,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class SCt extends bo{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];t.encoding!==void 0&&(Gl("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===uo?rn:Ei),this.texture=new bI(s,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:jn}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 i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -258,9 +258,9 @@ ${l}`;navigator.clipboard.writeText(d)}else navigator.clipboard.writeText(e);thi gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},s=new Cr(5,5,5),r=new Eo({name:"CubemapFromEquirect",uniforms:Oa(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Zn,blending:Sr});r.uniforms.tEquirect.value=t;const o=new Hn(s,r),a=t.minFilter;return t.minFilter===go&&(t.minFilter=jn),new ECt(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,s){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,s);e.setRenderTarget(r)}}const ag=new be,yCt=new be,SCt=new Rt;class Wr{constructor(e=new be(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,i,s){return this.normal.set(e,t,i),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const s=ag.subVectors(i,t).cross(yCt.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,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 i=e.delta(ag),s=this.normal.dot(i);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/s;return r<0||r>1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<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 i=t||SCt.getNormalMatrix(e),s=this.coplanarPoint(ag).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),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 Hr=new hs,bd=new be;class tv{constructor(e=new Wr,t=new Wr,i=new Wr,s=new Wr,r=new Wr,o=new Wr){this.planes=[e,t,i,s,r,o]}set(e,t,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Ls){const i=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],d=s[4],c=s[5],_=s[6],f=s[7],m=s[8],h=s[9],E=s[10],b=s[11],g=s[12],v=s[13],y=s[14],T=s[15];if(i[0].setComponents(l-r,f-d,b-m,T-g).normalize(),i[1].setComponents(l+r,f+d,b+m,T+g).normalize(),i[2].setComponents(l+o,f+c,b+h,T+v).normalize(),i[3].setComponents(l-o,f-c,b-h,T-v).normalize(),i[4].setComponents(l-a,f-_,b-E,T-y).normalize(),t===Ls)i[5].setComponents(l+a,f+_,b+E,T+y).normalize();else if(t===yu)i[5].setComponents(a,_,E,y).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(),Hr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Hr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Hr)}intersectsSprite(e){return Hr.center.set(0,0,0),Hr.radius=.7071067811865476,Hr.applyMatrix4(e.matrixWorld),this.intersectsSphere(Hr)}intersectsSphere(e){const t=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,bd.y=s.normal.y>0?e.max.y:e.min.y,bd.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(bd)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function EI(){let n=null,e=!1,t=null,i=null;function s(r,o){t(r,o),i=n.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(s),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function TCt(n,e){const t=e.isWebGL2,i=new WeakMap;function s(d,c){const _=d.array,f=d.usage,m=_.byteLength,h=n.createBuffer();n.bindBuffer(c,h),n.bufferData(c,_,f),d.onUploadCallback();let E;if(_ instanceof Float32Array)E=n.FLOAT;else if(_ instanceof Uint16Array)if(d.isFloat16BufferAttribute)if(t)E=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else E=n.UNSIGNED_SHORT;else if(_ instanceof Int16Array)E=n.SHORT;else if(_ instanceof Uint32Array)E=n.UNSIGNED_INT;else if(_ instanceof Int32Array)E=n.INT;else if(_ instanceof Int8Array)E=n.BYTE;else if(_ instanceof Uint8Array)E=n.UNSIGNED_BYTE;else if(_ instanceof Uint8ClampedArray)E=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+_);return{buffer:h,type:E,bytesPerElement:_.BYTES_PER_ELEMENT,version:d.version,size:m}}function r(d,c,_){const f=c.array,m=c._updateRange,h=c.updateRanges;if(n.bindBuffer(_,d),m.count===-1&&h.length===0&&n.bufferSubData(_,0,f),h.length!==0){for(let E=0,b=h.length;E1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<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 i=t||xCt.getNormalMatrix(e),s=this.coplanarPoint(ag).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),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 Hr=new hs,bd=new be;class tv{constructor(e=new Wr,t=new Wr,i=new Wr,s=new Wr,r=new Wr,o=new Wr){this.planes=[e,t,i,s,r,o]}set(e,t,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Ls){const i=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],d=s[4],c=s[5],_=s[6],f=s[7],m=s[8],h=s[9],E=s[10],b=s[11],g=s[12],v=s[13],y=s[14],T=s[15];if(i[0].setComponents(l-r,f-d,b-m,T-g).normalize(),i[1].setComponents(l+r,f+d,b+m,T+g).normalize(),i[2].setComponents(l+o,f+c,b+h,T+v).normalize(),i[3].setComponents(l-o,f-c,b-h,T-v).normalize(),i[4].setComponents(l-a,f-_,b-E,T-y).normalize(),t===Ls)i[5].setComponents(l+a,f+_,b+E,T+y).normalize();else if(t===yu)i[5].setComponents(a,_,E,y).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(),Hr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Hr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Hr)}intersectsSprite(e){return Hr.center.set(0,0,0),Hr.radius=.7071067811865476,Hr.applyMatrix4(e.matrixWorld),this.intersectsSphere(Hr)}intersectsSphere(e){const t=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,bd.y=s.normal.y>0?e.max.y:e.min.y,bd.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(bd)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function EI(){let n=null,e=!1,t=null,i=null;function s(r,o){t(r,o),i=n.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(s),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function CCt(n,e){const t=e.isWebGL2,i=new WeakMap;function s(d,c){const _=d.array,f=d.usage,m=_.byteLength,h=n.createBuffer();n.bindBuffer(c,h),n.bufferData(c,_,f),d.onUploadCallback();let E;if(_ instanceof Float32Array)E=n.FLOAT;else if(_ instanceof Uint16Array)if(d.isFloat16BufferAttribute)if(t)E=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else E=n.UNSIGNED_SHORT;else if(_ instanceof Int16Array)E=n.SHORT;else if(_ instanceof Uint32Array)E=n.UNSIGNED_INT;else if(_ instanceof Int32Array)E=n.INT;else if(_ instanceof Int8Array)E=n.BYTE;else if(_ instanceof Uint8Array)E=n.UNSIGNED_BYTE;else if(_ instanceof Uint8ClampedArray)E=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+_);return{buffer:h,type:E,bytesPerElement:_.BYTES_PER_ELEMENT,version:d.version,size:m}}function r(d,c,_){const f=c.array,m=c._updateRange,h=c.updateRanges;if(n.bindBuffer(_,d),m.count===-1&&h.length===0&&n.bufferSubData(_,0,f),h.length!==0){for(let E=0,b=h.length;E 0 +#endif`,zCt=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { @@ -457,26 +457,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #pragma unroll_loop_end if ( clipped ) discard; #endif -#endif`,GCt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,VCt=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,zCt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,HCt=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,VCt=`#if NUM_CLIPPING_PLANES > 0 +#endif`,qCt=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,HCt=`#if defined( USE_COLOR_ALPHA ) +#endif`,YCt=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,qCt=`#if defined( USE_COLOR_ALPHA ) +#endif`,$Ct=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,YCt=`#if defined( USE_COLOR_ALPHA ) +#endif`,WCt=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,$Ct=`#if defined( USE_COLOR_ALPHA ) +#endif`,KCt=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -486,7 +486,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`,WCt=`#define PI 3.141592653589793 +#endif`,jCt=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -564,7 +564,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`,KCt=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,QCt=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -662,7 +662,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`,jCt=`vec3 transformedNormal = objectNormal; +#endif`,XCt=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -691,18 +691,18 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,QCt=`#ifdef USE_DISPLACEMENTMAP +#endif`,ZCt=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,XCt=`#ifdef USE_DISPLACEMENTMAP +#endif`,JCt=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,ZCt=`#ifdef USE_EMISSIVEMAP +#endif`,e1t=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,JCt=`#ifdef USE_EMISSIVEMAP +#endif`,t1t=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,e1t="gl_FragColor = linearToOutputTexel( gl_FragColor );",t1t=` +#endif`,n1t="gl_FragColor = linearToOutputTexel( gl_FragColor );",i1t=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), @@ -730,7 +730,7 @@ vec4 LinearToLinear( in vec4 value ) { } vec4 LinearTosRGB( in vec4 value ) { return sRGBTransferOETF( value ); -}`,n1t=`#ifdef USE_ENVMAP +}`,s1t=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -759,7 +759,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,i1t=`#ifdef USE_ENVMAP +#endif`,r1t=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE @@ -768,7 +768,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,s1t=`#ifdef USE_ENVMAP +#endif`,o1t=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -779,7 +779,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,r1t=`#ifdef USE_ENVMAP +#endif`,a1t=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -790,7 +790,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,o1t=`#ifdef USE_ENVMAP +#endif`,l1t=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -807,18 +807,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,a1t=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,l1t=`#ifdef USE_FOG - varying float vFogDepth; #endif`,c1t=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,d1t=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,u1t=`#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`,d1t=`#ifdef USE_FOG +#endif`,p1t=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -827,7 +827,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,u1t=`#ifdef USE_GRADIENTMAP +#endif`,_1t=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -839,16 +839,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 -}`,p1t=`#ifdef USE_LIGHTMAP +}`,h1t=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,_1t=`#ifdef USE_LIGHTMAP +#endif`,f1t=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,h1t=`LambertMaterial material; +#endif`,m1t=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,f1t=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,g1t=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -862,7 +862,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`,m1t=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,b1t=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -985,7 +985,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,g1t=`#ifdef USE_ENVMAP +#endif`,E1t=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -1018,8 +1018,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,b1t=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,E1t=`varying vec3 vViewPosition; +#endif`,v1t=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,y1t=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -1031,11 +1031,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`,v1t=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,S1t=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,y1t=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,T1t=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -1052,7 +1052,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`,S1t=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,x1t=`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 ); @@ -1135,7 +1135,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`,T1t=`struct PhysicalMaterial { +#endif`,C1t=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1435,7 +1435,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 ); -}`,x1t=` +}`,R1t=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1550,7 +1550,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,C1t=`#if defined( RE_IndirectDiffuse ) +#endif`,A1t=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1569,25 +1569,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,R1t=`#if defined( RE_IndirectDiffuse ) +#endif`,w1t=`#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`,A1t=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,N1t=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,w1t=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,O1t=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,N1t=`#ifdef USE_LOGDEPTHBUF +#endif`,I1t=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,O1t=`#ifdef USE_LOGDEPTHBUF +#endif`,M1t=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -1597,16 +1597,16 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,I1t=`#ifdef USE_MAP +#endif`,D1t=`#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`,M1t=`#ifdef USE_MAP +#endif`,k1t=`#ifdef USE_MAP uniform sampler2D map; -#endif`,D1t=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,L1t=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1618,7 +1618,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,k1t=`#if defined( USE_POINTS_UV ) +#endif`,P1t=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1630,13 +1630,13 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,L1t=`float metalnessFactor = metalness; +#endif`,U1t=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,P1t=`#ifdef USE_METALNESSMAP +#endif`,F1t=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,U1t=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) +#endif`,B1t=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1645,7 +1645,7 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,F1t=`#ifdef USE_MORPHNORMALS +#endif`,G1t=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1657,7 +1657,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,B1t=`#ifdef USE_MORPHTARGETS +#endif`,z1t=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1677,7 +1677,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,G1t=`#ifdef USE_MORPHTARGETS +#endif`,V1t=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1695,7 +1695,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,z1t=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,H1t=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1736,7 +1736,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,V1t=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,q1t=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1751,25 +1751,25 @@ vec3 nonPerturbedNormal = normal;`,V1t=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,H1t=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,q1t=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif #endif`,Y1t=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,$1t=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,W1t=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,$1t=`#ifdef USE_NORMALMAP +#endif`,K1t=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1791,13 +1791,13 @@ vec3 nonPerturbedNormal = normal;`,V1t=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,W1t=`#ifdef USE_CLEARCOAT +#endif`,j1t=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,K1t=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,Q1t=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,j1t=`#ifdef USE_CLEARCOATMAP +#endif`,X1t=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1806,18 +1806,18 @@ vec3 nonPerturbedNormal = normal;`,V1t=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,Q1t=`#ifdef USE_IRIDESCENCEMAP +#endif`,Z1t=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,X1t=`#ifdef OPAQUE +#endif`,J1t=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Z1t=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,eRt=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1858,9 +1858,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 ); -}`,J1t=`#ifdef PREMULTIPLIED_ALPHA +}`,tRt=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,eRt=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,nRt=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1868,22 +1868,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,tRt=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,iRt=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,nRt=`#ifdef DITHERING +#endif`,sRt=`#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`,iRt=`float roughnessFactor = roughness; +#endif`,rRt=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,sRt=`#ifdef USE_ROUGHNESSMAP +#endif`,oRt=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,rRt=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,aRt=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -2060,7 +2060,7 @@ gl_Position = projectionMatrix * mvPosition;`,tRt=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,oRt=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,lRt=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -2098,7 +2098,7 @@ gl_Position = projectionMatrix * mvPosition;`,tRt=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,aRt=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,cRt=`#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 @@ -2130,7 +2130,7 @@ gl_Position = projectionMatrix * mvPosition;`,tRt=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,lRt=`float getShadowMask() { +#endif`,dRt=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2162,12 +2162,12 @@ gl_Position = projectionMatrix * mvPosition;`,tRt=`#ifdef DITHERING #endif #endif return shadow; -}`,cRt=`#ifdef USE_SKINNING +}`,uRt=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,dRt=`#ifdef USE_SKINNING +#endif`,pRt=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2182,7 +2182,7 @@ gl_Position = projectionMatrix * mvPosition;`,tRt=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,uRt=`#ifdef USE_SKINNING +#endif`,_Rt=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2190,7 +2190,7 @@ gl_Position = projectionMatrix * mvPosition;`,tRt=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,pRt=`#ifdef USE_SKINNING +#endif`,hRt=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2201,17 +2201,17 @@ gl_Position = projectionMatrix * mvPosition;`,tRt=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,_Rt=`float specularStrength; +#endif`,fRt=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,hRt=`#ifdef USE_SPECULARMAP +#endif`,mRt=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,fRt=`#if defined( TONE_MAPPING ) +#endif`,gRt=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,mRt=`#ifndef saturate +#endif`,bRt=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2247,7 +2247,7 @@ vec3 ACESFilmicToneMapping( vec3 color ) { color = ACESOutputMat * color; return saturate( color ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,gRt=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,ERt=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2268,7 +2268,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gRt=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,bRt=`#ifdef USE_TRANSMISSION +#endif`,vRt=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2374,7 +2374,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gRt=`#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`,ERt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,yRt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2444,7 +2444,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gRt=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,vRt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,SRt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2538,7 +2538,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gRt=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,yRt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,TRt=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2609,7 +2609,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gRt=`#ifdef USE_TRANSMIS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,SRt=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,xRt=`#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; @@ -2618,12 +2618,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gRt=`#ifdef USE_TRANSMIS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const TRt=`varying vec2 vUv; +#endif`;const CRt=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,xRt=`uniform sampler2D t2D; +}`,RRt=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2635,14 +2635,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,CRt=`varying vec3 vWorldDirection; +}`,ARt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,RRt=`#ifdef ENVMAP_TYPE_CUBE +}`,wRt=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2664,14 +2664,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,ARt=`varying vec3 vWorldDirection; +}`,NRt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,wRt=`uniform samplerCube tCube; +}`,ORt=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2681,7 +2681,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,NRt=`#include +}`,IRt=`#include #include #include #include @@ -2707,7 +2707,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,ORt=`#if DEPTH_PACKING == 3200 +}`,MRt=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2737,7 +2737,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,IRt=`#define DISTANCE +}`,DRt=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2763,7 +2763,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,MRt=`#define DISTANCE +}`,kRt=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2787,13 +2787,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,DRt=`varying vec3 vWorldDirection; +}`,LRt=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,kRt=`uniform sampler2D tEquirect; +}`,PRt=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2802,7 +2802,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,LRt=`uniform float scale; +}`,URt=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2823,7 +2823,7 @@ void main() { #include #include #include -}`,PRt=`uniform vec3 diffuse; +}`,FRt=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2851,7 +2851,7 @@ void main() { #include #include #include -}`,URt=`#include +}`,BRt=`#include #include #include #include @@ -2882,7 +2882,7 @@ void main() { #include #include #include -}`,FRt=`uniform vec3 diffuse; +}`,GRt=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2930,7 +2930,7 @@ void main() { #include #include #include -}`,BRt=`#define LAMBERT +}`,zRt=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2968,7 +2968,7 @@ void main() { #include #include #include -}`,GRt=`#define LAMBERT +}`,VRt=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3025,7 +3025,7 @@ void main() { #include #include #include -}`,zRt=`#define MATCAP +}`,HRt=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -3058,7 +3058,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,VRt=`#define MATCAP +}`,qRt=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3104,7 +3104,7 @@ void main() { #include #include #include -}`,HRt=`#define NORMAL +}`,YRt=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3136,7 +3136,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,qRt=`#define NORMAL +}`,$Rt=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3157,7 +3157,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,YRt=`#define PHONG +}`,WRt=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3195,7 +3195,7 @@ void main() { #include #include #include -}`,$Rt=`#define PHONG +}`,KRt=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3254,7 +3254,7 @@ void main() { #include #include #include -}`,WRt=`#define STANDARD +}`,jRt=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3296,7 +3296,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,KRt=`#define STANDARD +}`,QRt=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3418,7 +3418,7 @@ void main() { #include #include #include -}`,jRt=`#define TOON +}`,XRt=`#define TOON varying vec3 vViewPosition; #include #include @@ -3454,7 +3454,7 @@ void main() { #include #include #include -}`,QRt=`#define TOON +}`,ZRt=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3507,7 +3507,7 @@ void main() { #include #include #include -}`,XRt=`uniform float size; +}`,JRt=`uniform float size; uniform float scale; #include #include @@ -3537,7 +3537,7 @@ void main() { #include #include #include -}`,ZRt=`uniform vec3 diffuse; +}`,eAt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3562,7 +3562,7 @@ void main() { #include #include #include -}`,JRt=`#include +}`,tAt=`#include #include #include #include @@ -3584,7 +3584,7 @@ void main() { #include #include #include -}`,eAt=`uniform vec3 color; +}`,nAt=`uniform vec3 color; uniform float opacity; #include #include @@ -3600,7 +3600,7 @@ void main() { #include #include #include -}`,tAt=`uniform float rotation; +}`,iAt=`uniform float rotation; uniform vec2 center; #include #include @@ -3626,7 +3626,7 @@ void main() { #include #include #include -}`,nAt=`uniform vec3 diffuse; +}`,sAt=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3651,7 +3651,7 @@ void main() { #include #include #include -}`,Tt={alphahash_fragment:xCt,alphahash_pars_fragment:CCt,alphamap_fragment:RCt,alphamap_pars_fragment:ACt,alphatest_fragment:wCt,alphatest_pars_fragment:NCt,aomap_fragment:OCt,aomap_pars_fragment:ICt,batching_pars_vertex:MCt,batching_vertex:DCt,begin_vertex:kCt,beginnormal_vertex:LCt,bsdfs:PCt,iridescence_fragment:UCt,bumpmap_pars_fragment:FCt,clipping_planes_fragment:BCt,clipping_planes_pars_fragment:GCt,clipping_planes_pars_vertex:zCt,clipping_planes_vertex:VCt,color_fragment:HCt,color_pars_fragment:qCt,color_pars_vertex:YCt,color_vertex:$Ct,common:WCt,cube_uv_reflection_fragment:KCt,defaultnormal_vertex:jCt,displacementmap_pars_vertex:QCt,displacementmap_vertex:XCt,emissivemap_fragment:ZCt,emissivemap_pars_fragment:JCt,colorspace_fragment:e1t,colorspace_pars_fragment:t1t,envmap_fragment:n1t,envmap_common_pars_fragment:i1t,envmap_pars_fragment:s1t,envmap_pars_vertex:r1t,envmap_physical_pars_fragment:g1t,envmap_vertex:o1t,fog_vertex:a1t,fog_pars_vertex:l1t,fog_fragment:c1t,fog_pars_fragment:d1t,gradientmap_pars_fragment:u1t,lightmap_fragment:p1t,lightmap_pars_fragment:_1t,lights_lambert_fragment:h1t,lights_lambert_pars_fragment:f1t,lights_pars_begin:m1t,lights_toon_fragment:b1t,lights_toon_pars_fragment:E1t,lights_phong_fragment:v1t,lights_phong_pars_fragment:y1t,lights_physical_fragment:S1t,lights_physical_pars_fragment:T1t,lights_fragment_begin:x1t,lights_fragment_maps:C1t,lights_fragment_end:R1t,logdepthbuf_fragment:A1t,logdepthbuf_pars_fragment:w1t,logdepthbuf_pars_vertex:N1t,logdepthbuf_vertex:O1t,map_fragment:I1t,map_pars_fragment:M1t,map_particle_fragment:D1t,map_particle_pars_fragment:k1t,metalnessmap_fragment:L1t,metalnessmap_pars_fragment:P1t,morphcolor_vertex:U1t,morphnormal_vertex:F1t,morphtarget_pars_vertex:B1t,morphtarget_vertex:G1t,normal_fragment_begin:z1t,normal_fragment_maps:V1t,normal_pars_fragment:H1t,normal_pars_vertex:q1t,normal_vertex:Y1t,normalmap_pars_fragment:$1t,clearcoat_normal_fragment_begin:W1t,clearcoat_normal_fragment_maps:K1t,clearcoat_pars_fragment:j1t,iridescence_pars_fragment:Q1t,opaque_fragment:X1t,packing:Z1t,premultiplied_alpha_fragment:J1t,project_vertex:eRt,dithering_fragment:tRt,dithering_pars_fragment:nRt,roughnessmap_fragment:iRt,roughnessmap_pars_fragment:sRt,shadowmap_pars_fragment:rRt,shadowmap_pars_vertex:oRt,shadowmap_vertex:aRt,shadowmask_pars_fragment:lRt,skinbase_vertex:cRt,skinning_pars_vertex:dRt,skinning_vertex:uRt,skinnormal_vertex:pRt,specularmap_fragment:_Rt,specularmap_pars_fragment:hRt,tonemapping_fragment:fRt,tonemapping_pars_fragment:mRt,transmission_fragment:gRt,transmission_pars_fragment:bRt,uv_pars_fragment:ERt,uv_pars_vertex:vRt,uv_vertex:yRt,worldpos_vertex:SRt,background_vert:TRt,background_frag:xRt,backgroundCube_vert:CRt,backgroundCube_frag:RRt,cube_vert:ARt,cube_frag:wRt,depth_vert:NRt,depth_frag:ORt,distanceRGBA_vert:IRt,distanceRGBA_frag:MRt,equirect_vert:DRt,equirect_frag:kRt,linedashed_vert:LRt,linedashed_frag:PRt,meshbasic_vert:URt,meshbasic_frag:FRt,meshlambert_vert:BRt,meshlambert_frag:GRt,meshmatcap_vert:zRt,meshmatcap_frag:VRt,meshnormal_vert:HRt,meshnormal_frag:qRt,meshphong_vert:YRt,meshphong_frag:$Rt,meshphysical_vert:WRt,meshphysical_frag:KRt,meshtoon_vert:jRt,meshtoon_frag:QRt,points_vert:XRt,points_frag:ZRt,shadow_vert:JRt,shadow_frag:eAt,sprite_vert:tAt,sprite_frag:nAt},Ke={common:{diffuse:{value:new gt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Rt},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Rt}},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 Rt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Rt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Rt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Rt},normalScale:{value:new It(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Rt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Rt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Rt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Rt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new gt(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 gt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0},uvTransform:{value:new Rt}},sprite:{diffuse:{value:new gt(16777215)},opacity:{value:1},center:{value:new It(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Rt},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0}}},Xi={basic:{uniforms:Gn([Ke.common,Ke.specularmap,Ke.envmap,Ke.aomap,Ke.lightmap,Ke.fog]),vertexShader:Tt.meshbasic_vert,fragmentShader:Tt.meshbasic_frag},lambert:{uniforms:Gn([Ke.common,Ke.specularmap,Ke.envmap,Ke.aomap,Ke.lightmap,Ke.emissivemap,Ke.bumpmap,Ke.normalmap,Ke.displacementmap,Ke.fog,Ke.lights,{emissive:{value:new gt(0)}}]),vertexShader:Tt.meshlambert_vert,fragmentShader:Tt.meshlambert_frag},phong:{uniforms:Gn([Ke.common,Ke.specularmap,Ke.envmap,Ke.aomap,Ke.lightmap,Ke.emissivemap,Ke.bumpmap,Ke.normalmap,Ke.displacementmap,Ke.fog,Ke.lights,{emissive:{value:new gt(0)},specular:{value:new gt(1118481)},shininess:{value:30}}]),vertexShader:Tt.meshphong_vert,fragmentShader:Tt.meshphong_frag},standard:{uniforms:Gn([Ke.common,Ke.envmap,Ke.aomap,Ke.lightmap,Ke.emissivemap,Ke.bumpmap,Ke.normalmap,Ke.displacementmap,Ke.roughnessmap,Ke.metalnessmap,Ke.fog,Ke.lights,{emissive:{value:new gt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Tt.meshphysical_vert,fragmentShader:Tt.meshphysical_frag},toon:{uniforms:Gn([Ke.common,Ke.aomap,Ke.lightmap,Ke.emissivemap,Ke.bumpmap,Ke.normalmap,Ke.displacementmap,Ke.gradientmap,Ke.fog,Ke.lights,{emissive:{value:new gt(0)}}]),vertexShader:Tt.meshtoon_vert,fragmentShader:Tt.meshtoon_frag},matcap:{uniforms:Gn([Ke.common,Ke.bumpmap,Ke.normalmap,Ke.displacementmap,Ke.fog,{matcap:{value:null}}]),vertexShader:Tt.meshmatcap_vert,fragmentShader:Tt.meshmatcap_frag},points:{uniforms:Gn([Ke.points,Ke.fog]),vertexShader:Tt.points_vert,fragmentShader:Tt.points_frag},dashed:{uniforms:Gn([Ke.common,Ke.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Tt.linedashed_vert,fragmentShader:Tt.linedashed_frag},depth:{uniforms:Gn([Ke.common,Ke.displacementmap]),vertexShader:Tt.depth_vert,fragmentShader:Tt.depth_frag},normal:{uniforms:Gn([Ke.common,Ke.bumpmap,Ke.normalmap,Ke.displacementmap,{opacity:{value:1}}]),vertexShader:Tt.meshnormal_vert,fragmentShader:Tt.meshnormal_frag},sprite:{uniforms:Gn([Ke.sprite,Ke.fog]),vertexShader:Tt.sprite_vert,fragmentShader:Tt.sprite_frag},background:{uniforms:{uvTransform:{value:new Rt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Tt.background_vert,fragmentShader:Tt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Tt.backgroundCube_vert,fragmentShader:Tt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Tt.cube_vert,fragmentShader:Tt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Tt.equirect_vert,fragmentShader:Tt.equirect_frag},distanceRGBA:{uniforms:Gn([Ke.common,Ke.displacementmap,{referencePosition:{value:new be},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Tt.distanceRGBA_vert,fragmentShader:Tt.distanceRGBA_frag},shadow:{uniforms:Gn([Ke.lights,Ke.fog,{color:{value:new gt(0)},opacity:{value:1}}]),vertexShader:Tt.shadow_vert,fragmentShader:Tt.shadow_frag}};Xi.physical={uniforms:Gn([Xi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Rt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Rt},clearcoatNormalScale:{value:new It(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Rt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Rt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Rt},sheen:{value:0},sheenColor:{value:new gt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Rt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Rt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Rt},transmissionSamplerSize:{value:new It},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Rt},attenuationDistance:{value:0},attenuationColor:{value:new gt(0)},specularColor:{value:new gt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Rt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Rt},anisotropyVector:{value:new It},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Rt}}]),vertexShader:Tt.meshphysical_vert,fragmentShader:Tt.meshphysical_frag};const Ed={r:0,b:0,g:0};function iAt(n,e,t,i,s,r,o){const a=new gt(0);let l=r===!0?0:1,d,c,_=null,f=0,m=null;function h(b,g){let v=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=(g.backgroundBlurriness>0?t:e).get(y)),y===null?E(a,l):y&&y.isColor&&(E(y,1),v=!0);const T=n.xr.getEnvironmentBlendMode();T==="additive"?i.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||v)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),y&&(y.isCubeTexture||y.mapping===up)?(c===void 0&&(c=new Hn(new Cr(1,1,1),new Eo({name:"BackgroundCubeMaterial",uniforms:Oa(Xi.backgroundCube.uniforms),vertexShader:Xi.backgroundCube.vertexShader,fragmentShader:Xi.backgroundCube.fragmentShader,side:Zn,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(C,x,O){this.matrixWorld.copyPosition(O.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,c.material.toneMapped=Ft.getTransfer(y.colorSpace)!==Xt,(_!==y||f!==y.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,_=y,f=y.version,m=n.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(d===void 0&&(d=new Hn(new nv(2,2),new Eo({name:"BackgroundMaterial",uniforms:Oa(Xi.background.uniforms),vertexShader:Xi.background.vertexShader,fragmentShader:Xi.background.fragmentShader,side:Vs,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(d)),d.material.uniforms.t2D.value=y,d.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,d.material.toneMapped=Ft.getTransfer(y.colorSpace)!==Xt,y.matrixAutoUpdate===!0&&y.updateMatrix(),d.material.uniforms.uvTransform.value.copy(y.matrix),(_!==y||f!==y.version||m!==n.toneMapping)&&(d.material.needsUpdate=!0,_=y,f=y.version,m=n.toneMapping),d.layers.enableAll(),b.unshift(d,d.geometry,d.material,0,0,null))}function E(b,g){b.getRGB(Ed,mI(n)),i.buffers.color.setClear(Ed.r,Ed.g,Ed.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(b,g=1){a.set(b),l=g,E(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,E(a,l)},render:h}}function sAt(n,e,t,i){const s=n.getParameter(n.MAX_VERTEX_ATTRIBS),r=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||r!==null,a={},l=b(null);let d=l,c=!1;function _(L,H,G,P,j){let Y=!1;if(o){const Q=E(P,G,H);d!==Q&&(d=Q,m(d.object)),Y=g(L,P,G,j),Y&&v(L,P,G,j)}else{const Q=H.wireframe===!0;(d.geometry!==P.id||d.program!==G.id||d.wireframe!==Q)&&(d.geometry=P.id,d.program=G.id,d.wireframe=Q,Y=!0)}j!==null&&t.update(j,n.ELEMENT_ARRAY_BUFFER),(Y||c)&&(c=!1,R(L,H,G,P),j!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(j).buffer))}function f(){return i.isWebGL2?n.createVertexArray():r.createVertexArrayOES()}function m(L){return i.isWebGL2?n.bindVertexArray(L):r.bindVertexArrayOES(L)}function h(L){return i.isWebGL2?n.deleteVertexArray(L):r.deleteVertexArrayOES(L)}function E(L,H,G){const P=G.wireframe===!0;let j=a[L.id];j===void 0&&(j={},a[L.id]=j);let Y=j[H.id];Y===void 0&&(Y={},j[H.id]=Y);let Q=Y[P];return Q===void 0&&(Q=b(f()),Y[P]=Q),Q}function b(L){const H=[],G=[],P=[];for(let j=0;j=0){const fe=j[te];let ve=Y[te];if(ve===void 0&&(te==="instanceMatrix"&&L.instanceMatrix&&(ve=L.instanceMatrix),te==="instanceColor"&&L.instanceColor&&(ve=L.instanceColor)),fe===void 0||fe.attribute!==ve||ve&&fe.data!==ve.data)return!0;Q++}return d.attributesNum!==Q||d.index!==P}function v(L,H,G,P){const j={},Y=H.attributes;let Q=0;const re=G.getAttributes();for(const te in re)if(re[te].location>=0){let fe=Y[te];fe===void 0&&(te==="instanceMatrix"&&L.instanceMatrix&&(fe=L.instanceMatrix),te==="instanceColor"&&L.instanceColor&&(fe=L.instanceColor));const ve={};ve.attribute=fe,fe&&fe.data&&(ve.data=fe.data),j[te]=ve,Q++}d.attributes=j,d.attributesNum=Q,d.index=P}function y(){const L=d.newAttributes;for(let H=0,G=L.length;H=0){let Z=j[re];if(Z===void 0&&(re==="instanceMatrix"&&L.instanceMatrix&&(Z=L.instanceMatrix),re==="instanceColor"&&L.instanceColor&&(Z=L.instanceColor)),Z!==void 0){const fe=Z.normalized,ve=Z.itemSize,Ae=t.get(Z);if(Ae===void 0)continue;const J=Ae.buffer,me=Ae.type,ee=Ae.bytesPerElement,Se=i.isWebGL2===!0&&(me===n.INT||me===n.UNSIGNED_INT||Z.gpuType===ZO);if(Z.isInterleavedBufferAttribute){const Oe=Z.data,k=Oe.stride,B=Z.offset;if(Oe.isInstancedInterleavedBuffer){for(let $=0;$0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";O="mediump"}return O==="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 l=r(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const d=o||e.has("WEBGL_draw_buffers"),c=t.logarithmicDepthBuffer===!0,_=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_TEXTURE_SIZE),h=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),E=n.getParameter(n.MAX_VERTEX_ATTRIBS),b=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),v=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),y=f>0,T=o||e.has("OES_texture_float"),C=y&&T,x=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:d,getMaxAnisotropy:s,getMaxPrecision:r,precision:a,logarithmicDepthBuffer:c,maxTextures:_,maxVertexTextures:f,maxTextureSize:m,maxCubemapSize:h,maxAttributes:E,maxVertexUniforms:b,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:T,floatVertexTextures:C,maxSamples:x}}function aAt(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new Wr,a=new Rt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(_,f){const m=_.length!==0||f||i!==0||s;return s=f,i=_.length,m},this.beginShadows=function(){r=!0,c(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(_,f){t=c(_,f,0)},this.setState=function(_,f,m){const h=_.clippingPlanes,E=_.clipIntersection,b=_.clipShadows,g=n.get(_);if(!s||h===null||h.length===0||r&&!b)r?c(null):d();else{const v=r?0:i,y=v*4;let T=g.clippingState||null;l.value=T,T=c(h,f,y,m);for(let C=0;C!==y;++C)T[C]=t[C];g.clippingState=T,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=v}};function d(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function c(_,f,m,h){const E=_!==null?_.length:0;let b=null;if(E!==0){if(b=l.value,h!==!0||b===null){const g=m+E*4,v=f.matrixWorldInverse;a.getNormalMatrix(v),(b===null||b.length0){const d=new vCt(l.height/2);return d.fromEquirectangularTexture(n,o),e.set(o,d),o.addEventListener("dispose",s),t(d.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}class iv extends gI{constructor(e=-1,t=1,i=1,s=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=s,this.near=r,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,i,s,r,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=i,this.view.offsetY=s,this.view.width=r,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),i=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let r=i-e,o=i+e,a=s+t,l=s-t;if(this.view!==null&&this.view.enabled){const d=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=d*this.view.offsetX,o=r+d*this.view.width,a-=c*this.view.offsetY,l=a-c*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,l,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 Xo=4,H1=[.125,.215,.35,.446,.526,.582],eo=20,lg=new iv,q1=new gt;let cg=null,dg=0,ug=0;const Kr=(1+Math.sqrt(5))/2,Yo=1/Kr,Y1=[new be(1,1,1),new be(-1,1,1),new be(1,1,-1),new be(-1,1,-1),new be(0,Kr,Yo),new be(0,Kr,-Yo),new be(Yo,0,Kr),new be(-Yo,0,Kr),new be(Kr,Yo,0),new be(-Kr,Yo,0)];class $1{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,i=.1,s=100){cg=this._renderer.getRenderTarget(),dg=this._renderer.getActiveCubeFace(),ug=this._renderer.getActiveMipmapLevel(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,i,s,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=j1(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=K1(),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?y:0,y,y),c.setRenderTarget(s),E&&c.render(h,a),c.render(e,a)}h.geometry.dispose(),h.material.dispose(),c.toneMapping=f,c.autoClear=_,e.background=b}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===xa||e.mapping===Ca;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=j1()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=K1());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new Hn(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;vd(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,lg)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let s=1;seo&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${eo}`);const g=[];let v=0;for(let O=0;Oy-Xo?s-y+Xo:0),x=4*(this._cubeSize-T);vd(t,C,x,3*T,2*T),l.setRenderTarget(t),l.render(_,lg)}}function cAt(n){const e=[],t=[],i=[];let s=n;const r=n-Xo+1+H1.length;for(let o=0;on-Xo?l=H1[o-n+Xo-1]:o===0&&(l=0),i.push(l);const d=1/(a-2),c=-d,_=1+d,f=[c,c,_,c,_,_,c,c,_,_,c,_],m=6,h=6,E=3,b=2,g=1,v=new Float32Array(E*h*m),y=new Float32Array(b*h*m),T=new Float32Array(g*h*m);for(let x=0;x2?0:-1,S=[O,R,0,O+2/3,R,0,O+2/3,R+1,0,O,R,0,O+2/3,R+1,0,O,R+1,0];v.set(S,E*h*x),y.set(f,b*h*x);const A=[x,x,x,x,x,x];T.set(A,g*h*x)}const C=new fs;C.setAttribute("position",new Yn(v,E)),C.setAttribute("uv",new Yn(y,b)),C.setAttribute("faceIndex",new Yn(T,g)),e.push(C),s>Xo&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function W1(n,e,t){const i=new bo(n,e,t);return i.texture.mapping=up,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function vd(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function dAt(n,e,t){const i=new Float32Array(eo),s=new be(0,1,0);return new Eo({name:"SphericalGaussianBlur",defines:{n:eo,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:sv(),fragmentShader:` +}`,Tt={alphahash_fragment:RCt,alphahash_pars_fragment:ACt,alphamap_fragment:wCt,alphamap_pars_fragment:NCt,alphatest_fragment:OCt,alphatest_pars_fragment:ICt,aomap_fragment:MCt,aomap_pars_fragment:DCt,batching_pars_vertex:kCt,batching_vertex:LCt,begin_vertex:PCt,beginnormal_vertex:UCt,bsdfs:FCt,iridescence_fragment:BCt,bumpmap_pars_fragment:GCt,clipping_planes_fragment:zCt,clipping_planes_pars_fragment:VCt,clipping_planes_pars_vertex:HCt,clipping_planes_vertex:qCt,color_fragment:YCt,color_pars_fragment:$Ct,color_pars_vertex:WCt,color_vertex:KCt,common:jCt,cube_uv_reflection_fragment:QCt,defaultnormal_vertex:XCt,displacementmap_pars_vertex:ZCt,displacementmap_vertex:JCt,emissivemap_fragment:e1t,emissivemap_pars_fragment:t1t,colorspace_fragment:n1t,colorspace_pars_fragment:i1t,envmap_fragment:s1t,envmap_common_pars_fragment:r1t,envmap_pars_fragment:o1t,envmap_pars_vertex:a1t,envmap_physical_pars_fragment:E1t,envmap_vertex:l1t,fog_vertex:c1t,fog_pars_vertex:d1t,fog_fragment:u1t,fog_pars_fragment:p1t,gradientmap_pars_fragment:_1t,lightmap_fragment:h1t,lightmap_pars_fragment:f1t,lights_lambert_fragment:m1t,lights_lambert_pars_fragment:g1t,lights_pars_begin:b1t,lights_toon_fragment:v1t,lights_toon_pars_fragment:y1t,lights_phong_fragment:S1t,lights_phong_pars_fragment:T1t,lights_physical_fragment:x1t,lights_physical_pars_fragment:C1t,lights_fragment_begin:R1t,lights_fragment_maps:A1t,lights_fragment_end:w1t,logdepthbuf_fragment:N1t,logdepthbuf_pars_fragment:O1t,logdepthbuf_pars_vertex:I1t,logdepthbuf_vertex:M1t,map_fragment:D1t,map_pars_fragment:k1t,map_particle_fragment:L1t,map_particle_pars_fragment:P1t,metalnessmap_fragment:U1t,metalnessmap_pars_fragment:F1t,morphcolor_vertex:B1t,morphnormal_vertex:G1t,morphtarget_pars_vertex:z1t,morphtarget_vertex:V1t,normal_fragment_begin:H1t,normal_fragment_maps:q1t,normal_pars_fragment:Y1t,normal_pars_vertex:$1t,normal_vertex:W1t,normalmap_pars_fragment:K1t,clearcoat_normal_fragment_begin:j1t,clearcoat_normal_fragment_maps:Q1t,clearcoat_pars_fragment:X1t,iridescence_pars_fragment:Z1t,opaque_fragment:J1t,packing:eRt,premultiplied_alpha_fragment:tRt,project_vertex:nRt,dithering_fragment:iRt,dithering_pars_fragment:sRt,roughnessmap_fragment:rRt,roughnessmap_pars_fragment:oRt,shadowmap_pars_fragment:aRt,shadowmap_pars_vertex:lRt,shadowmap_vertex:cRt,shadowmask_pars_fragment:dRt,skinbase_vertex:uRt,skinning_pars_vertex:pRt,skinning_vertex:_Rt,skinnormal_vertex:hRt,specularmap_fragment:fRt,specularmap_pars_fragment:mRt,tonemapping_fragment:gRt,tonemapping_pars_fragment:bRt,transmission_fragment:ERt,transmission_pars_fragment:vRt,uv_pars_fragment:yRt,uv_pars_vertex:SRt,uv_vertex:TRt,worldpos_vertex:xRt,background_vert:CRt,background_frag:RRt,backgroundCube_vert:ARt,backgroundCube_frag:wRt,cube_vert:NRt,cube_frag:ORt,depth_vert:IRt,depth_frag:MRt,distanceRGBA_vert:DRt,distanceRGBA_frag:kRt,equirect_vert:LRt,equirect_frag:PRt,linedashed_vert:URt,linedashed_frag:FRt,meshbasic_vert:BRt,meshbasic_frag:GRt,meshlambert_vert:zRt,meshlambert_frag:VRt,meshmatcap_vert:HRt,meshmatcap_frag:qRt,meshnormal_vert:YRt,meshnormal_frag:$Rt,meshphong_vert:WRt,meshphong_frag:KRt,meshphysical_vert:jRt,meshphysical_frag:QRt,meshtoon_vert:XRt,meshtoon_frag:ZRt,points_vert:JRt,points_frag:eAt,shadow_vert:tAt,shadow_frag:nAt,sprite_vert:iAt,sprite_frag:sAt},Ke={common:{diffuse:{value:new gt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Rt},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Rt}},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 Rt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Rt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Rt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Rt},normalScale:{value:new It(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Rt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Rt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Rt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Rt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new gt(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 gt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0},uvTransform:{value:new Rt}},sprite:{diffuse:{value:new gt(16777215)},opacity:{value:1},center:{value:new It(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Rt},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0}}},Xi={basic:{uniforms:Gn([Ke.common,Ke.specularmap,Ke.envmap,Ke.aomap,Ke.lightmap,Ke.fog]),vertexShader:Tt.meshbasic_vert,fragmentShader:Tt.meshbasic_frag},lambert:{uniforms:Gn([Ke.common,Ke.specularmap,Ke.envmap,Ke.aomap,Ke.lightmap,Ke.emissivemap,Ke.bumpmap,Ke.normalmap,Ke.displacementmap,Ke.fog,Ke.lights,{emissive:{value:new gt(0)}}]),vertexShader:Tt.meshlambert_vert,fragmentShader:Tt.meshlambert_frag},phong:{uniforms:Gn([Ke.common,Ke.specularmap,Ke.envmap,Ke.aomap,Ke.lightmap,Ke.emissivemap,Ke.bumpmap,Ke.normalmap,Ke.displacementmap,Ke.fog,Ke.lights,{emissive:{value:new gt(0)},specular:{value:new gt(1118481)},shininess:{value:30}}]),vertexShader:Tt.meshphong_vert,fragmentShader:Tt.meshphong_frag},standard:{uniforms:Gn([Ke.common,Ke.envmap,Ke.aomap,Ke.lightmap,Ke.emissivemap,Ke.bumpmap,Ke.normalmap,Ke.displacementmap,Ke.roughnessmap,Ke.metalnessmap,Ke.fog,Ke.lights,{emissive:{value:new gt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Tt.meshphysical_vert,fragmentShader:Tt.meshphysical_frag},toon:{uniforms:Gn([Ke.common,Ke.aomap,Ke.lightmap,Ke.emissivemap,Ke.bumpmap,Ke.normalmap,Ke.displacementmap,Ke.gradientmap,Ke.fog,Ke.lights,{emissive:{value:new gt(0)}}]),vertexShader:Tt.meshtoon_vert,fragmentShader:Tt.meshtoon_frag},matcap:{uniforms:Gn([Ke.common,Ke.bumpmap,Ke.normalmap,Ke.displacementmap,Ke.fog,{matcap:{value:null}}]),vertexShader:Tt.meshmatcap_vert,fragmentShader:Tt.meshmatcap_frag},points:{uniforms:Gn([Ke.points,Ke.fog]),vertexShader:Tt.points_vert,fragmentShader:Tt.points_frag},dashed:{uniforms:Gn([Ke.common,Ke.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Tt.linedashed_vert,fragmentShader:Tt.linedashed_frag},depth:{uniforms:Gn([Ke.common,Ke.displacementmap]),vertexShader:Tt.depth_vert,fragmentShader:Tt.depth_frag},normal:{uniforms:Gn([Ke.common,Ke.bumpmap,Ke.normalmap,Ke.displacementmap,{opacity:{value:1}}]),vertexShader:Tt.meshnormal_vert,fragmentShader:Tt.meshnormal_frag},sprite:{uniforms:Gn([Ke.sprite,Ke.fog]),vertexShader:Tt.sprite_vert,fragmentShader:Tt.sprite_frag},background:{uniforms:{uvTransform:{value:new Rt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Tt.background_vert,fragmentShader:Tt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Tt.backgroundCube_vert,fragmentShader:Tt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Tt.cube_vert,fragmentShader:Tt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Tt.equirect_vert,fragmentShader:Tt.equirect_frag},distanceRGBA:{uniforms:Gn([Ke.common,Ke.displacementmap,{referencePosition:{value:new be},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Tt.distanceRGBA_vert,fragmentShader:Tt.distanceRGBA_frag},shadow:{uniforms:Gn([Ke.lights,Ke.fog,{color:{value:new gt(0)},opacity:{value:1}}]),vertexShader:Tt.shadow_vert,fragmentShader:Tt.shadow_frag}};Xi.physical={uniforms:Gn([Xi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Rt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Rt},clearcoatNormalScale:{value:new It(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Rt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Rt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Rt},sheen:{value:0},sheenColor:{value:new gt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Rt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Rt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Rt},transmissionSamplerSize:{value:new It},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Rt},attenuationDistance:{value:0},attenuationColor:{value:new gt(0)},specularColor:{value:new gt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Rt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Rt},anisotropyVector:{value:new It},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Rt}}]),vertexShader:Tt.meshphysical_vert,fragmentShader:Tt.meshphysical_frag};const Ed={r:0,b:0,g:0};function rAt(n,e,t,i,s,r,o){const a=new gt(0);let l=r===!0?0:1,d,c,_=null,f=0,m=null;function h(b,g){let v=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=(g.backgroundBlurriness>0?t:e).get(y)),y===null?E(a,l):y&&y.isColor&&(E(y,1),v=!0);const T=n.xr.getEnvironmentBlendMode();T==="additive"?i.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||v)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),y&&(y.isCubeTexture||y.mapping===up)?(c===void 0&&(c=new Hn(new Cr(1,1,1),new Eo({name:"BackgroundCubeMaterial",uniforms:Oa(Xi.backgroundCube.uniforms),vertexShader:Xi.backgroundCube.vertexShader,fragmentShader:Xi.backgroundCube.fragmentShader,side:Zn,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(C,x,O){this.matrixWorld.copyPosition(O.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,c.material.toneMapped=Ft.getTransfer(y.colorSpace)!==Xt,(_!==y||f!==y.version||m!==n.toneMapping)&&(c.material.needsUpdate=!0,_=y,f=y.version,m=n.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(d===void 0&&(d=new Hn(new nv(2,2),new Eo({name:"BackgroundMaterial",uniforms:Oa(Xi.background.uniforms),vertexShader:Xi.background.vertexShader,fragmentShader:Xi.background.fragmentShader,side:Vs,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(d)),d.material.uniforms.t2D.value=y,d.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,d.material.toneMapped=Ft.getTransfer(y.colorSpace)!==Xt,y.matrixAutoUpdate===!0&&y.updateMatrix(),d.material.uniforms.uvTransform.value.copy(y.matrix),(_!==y||f!==y.version||m!==n.toneMapping)&&(d.material.needsUpdate=!0,_=y,f=y.version,m=n.toneMapping),d.layers.enableAll(),b.unshift(d,d.geometry,d.material,0,0,null))}function E(b,g){b.getRGB(Ed,mI(n)),i.buffers.color.setClear(Ed.r,Ed.g,Ed.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(b,g=1){a.set(b),l=g,E(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,E(a,l)},render:h}}function oAt(n,e,t,i){const s=n.getParameter(n.MAX_VERTEX_ATTRIBS),r=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||r!==null,a={},l=b(null);let d=l,c=!1;function _(L,H,G,P,j){let Y=!1;if(o){const Q=E(P,G,H);d!==Q&&(d=Q,m(d.object)),Y=g(L,P,G,j),Y&&v(L,P,G,j)}else{const Q=H.wireframe===!0;(d.geometry!==P.id||d.program!==G.id||d.wireframe!==Q)&&(d.geometry=P.id,d.program=G.id,d.wireframe=Q,Y=!0)}j!==null&&t.update(j,n.ELEMENT_ARRAY_BUFFER),(Y||c)&&(c=!1,R(L,H,G,P),j!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(j).buffer))}function f(){return i.isWebGL2?n.createVertexArray():r.createVertexArrayOES()}function m(L){return i.isWebGL2?n.bindVertexArray(L):r.bindVertexArrayOES(L)}function h(L){return i.isWebGL2?n.deleteVertexArray(L):r.deleteVertexArrayOES(L)}function E(L,H,G){const P=G.wireframe===!0;let j=a[L.id];j===void 0&&(j={},a[L.id]=j);let Y=j[H.id];Y===void 0&&(Y={},j[H.id]=Y);let Q=Y[P];return Q===void 0&&(Q=b(f()),Y[P]=Q),Q}function b(L){const H=[],G=[],P=[];for(let j=0;j=0){const fe=j[te];let ve=Y[te];if(ve===void 0&&(te==="instanceMatrix"&&L.instanceMatrix&&(ve=L.instanceMatrix),te==="instanceColor"&&L.instanceColor&&(ve=L.instanceColor)),fe===void 0||fe.attribute!==ve||ve&&fe.data!==ve.data)return!0;Q++}return d.attributesNum!==Q||d.index!==P}function v(L,H,G,P){const j={},Y=H.attributes;let Q=0;const re=G.getAttributes();for(const te in re)if(re[te].location>=0){let fe=Y[te];fe===void 0&&(te==="instanceMatrix"&&L.instanceMatrix&&(fe=L.instanceMatrix),te==="instanceColor"&&L.instanceColor&&(fe=L.instanceColor));const ve={};ve.attribute=fe,fe&&fe.data&&(ve.data=fe.data),j[te]=ve,Q++}d.attributes=j,d.attributesNum=Q,d.index=P}function y(){const L=d.newAttributes;for(let H=0,G=L.length;H=0){let Z=j[re];if(Z===void 0&&(re==="instanceMatrix"&&L.instanceMatrix&&(Z=L.instanceMatrix),re==="instanceColor"&&L.instanceColor&&(Z=L.instanceColor)),Z!==void 0){const fe=Z.normalized,ve=Z.itemSize,Ae=t.get(Z);if(Ae===void 0)continue;const J=Ae.buffer,me=Ae.type,ee=Ae.bytesPerElement,Se=i.isWebGL2===!0&&(me===n.INT||me===n.UNSIGNED_INT||Z.gpuType===ZO);if(Z.isInterleavedBufferAttribute){const Oe=Z.data,k=Oe.stride,B=Z.offset;if(Oe.isInstancedInterleavedBuffer){for(let $=0;$0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";O="mediump"}return O==="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 l=r(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const d=o||e.has("WEBGL_draw_buffers"),c=t.logarithmicDepthBuffer===!0,_=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_TEXTURE_SIZE),h=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),E=n.getParameter(n.MAX_VERTEX_ATTRIBS),b=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),v=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),y=f>0,T=o||e.has("OES_texture_float"),C=y&&T,x=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:d,getMaxAnisotropy:s,getMaxPrecision:r,precision:a,logarithmicDepthBuffer:c,maxTextures:_,maxVertexTextures:f,maxTextureSize:m,maxCubemapSize:h,maxAttributes:E,maxVertexUniforms:b,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:T,floatVertexTextures:C,maxSamples:x}}function cAt(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new Wr,a=new Rt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(_,f){const m=_.length!==0||f||i!==0||s;return s=f,i=_.length,m},this.beginShadows=function(){r=!0,c(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(_,f){t=c(_,f,0)},this.setState=function(_,f,m){const h=_.clippingPlanes,E=_.clipIntersection,b=_.clipShadows,g=n.get(_);if(!s||h===null||h.length===0||r&&!b)r?c(null):d();else{const v=r?0:i,y=v*4;let T=g.clippingState||null;l.value=T,T=c(h,f,y,m);for(let C=0;C!==y;++C)T[C]=t[C];g.clippingState=T,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=v}};function d(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function c(_,f,m,h){const E=_!==null?_.length:0;let b=null;if(E!==0){if(b=l.value,h!==!0||b===null){const g=m+E*4,v=f.matrixWorldInverse;a.getNormalMatrix(v),(b===null||b.length0){const d=new SCt(l.height/2);return d.fromEquirectangularTexture(n,o),e.set(o,d),o.addEventListener("dispose",s),t(d.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}class iv extends gI{constructor(e=-1,t=1,i=1,s=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=s,this.near=r,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,i,s,r,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=i,this.view.offsetY=s,this.view.width=r,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),i=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let r=i-e,o=i+e,a=s+t,l=s-t;if(this.view!==null&&this.view.enabled){const d=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=d*this.view.offsetX,o=r+d*this.view.width,a-=c*this.view.offsetY,l=a-c*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,l,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 Xo=4,H1=[.125,.215,.35,.446,.526,.582],eo=20,lg=new iv,q1=new gt;let cg=null,dg=0,ug=0;const Kr=(1+Math.sqrt(5))/2,Yo=1/Kr,Y1=[new be(1,1,1),new be(-1,1,1),new be(1,1,-1),new be(-1,1,-1),new be(0,Kr,Yo),new be(0,Kr,-Yo),new be(Yo,0,Kr),new be(-Yo,0,Kr),new be(Kr,Yo,0),new be(-Kr,Yo,0)];class $1{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,i=.1,s=100){cg=this._renderer.getRenderTarget(),dg=this._renderer.getActiveCubeFace(),ug=this._renderer.getActiveMipmapLevel(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,i,s,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=j1(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=K1(),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?y:0,y,y),c.setRenderTarget(s),E&&c.render(h,a),c.render(e,a)}h.geometry.dispose(),h.material.dispose(),c.toneMapping=f,c.autoClear=_,e.background=b}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===xa||e.mapping===Ca;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=j1()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=K1());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new Hn(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;vd(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,lg)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let s=1;seo&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${eo}`);const g=[];let v=0;for(let O=0;Oy-Xo?s-y+Xo:0),x=4*(this._cubeSize-T);vd(t,C,x,3*T,2*T),l.setRenderTarget(t),l.render(_,lg)}}function uAt(n){const e=[],t=[],i=[];let s=n;const r=n-Xo+1+H1.length;for(let o=0;on-Xo?l=H1[o-n+Xo-1]:o===0&&(l=0),i.push(l);const d=1/(a-2),c=-d,_=1+d,f=[c,c,_,c,_,_,c,c,_,_,c,_],m=6,h=6,E=3,b=2,g=1,v=new Float32Array(E*h*m),y=new Float32Array(b*h*m),T=new Float32Array(g*h*m);for(let x=0;x2?0:-1,S=[O,R,0,O+2/3,R,0,O+2/3,R+1,0,O,R,0,O+2/3,R+1,0,O,R+1,0];v.set(S,E*h*x),y.set(f,b*h*x);const A=[x,x,x,x,x,x];T.set(A,g*h*x)}const C=new fs;C.setAttribute("position",new Yn(v,E)),C.setAttribute("uv",new Yn(y,b)),C.setAttribute("faceIndex",new Yn(T,g)),e.push(C),s>Xo&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function W1(n,e,t){const i=new bo(n,e,t);return i.texture.mapping=up,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function vd(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function pAt(n,e,t){const i=new Float32Array(eo),s=new be(0,1,0);return new Eo({name:"SphericalGaussianBlur",defines:{n:eo,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:sv(),fragmentShader:` precision mediump float; precision mediump int; @@ -3801,26 +3801,26 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function uAt(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,d=l===cb||l===db,c=l===xa||l===Ca;if(d||c)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let _=e.get(a);return t===null&&(t=new $1(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||c&&_&&s(_)){t===null&&(t=new $1(n));const f=d?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),a.addEventListener("dispose",r),f.texture}else return null}}}return a}function s(a){let l=0;const d=6;for(let c=0;ce.maxTextureSize&&(U=Math.ceil(A/e.maxTextureSize),A=e.maxTextureSize);const F=new Float32Array(A*U*4*E),K=new uI(F,A,U,E);K.type=ks,K.needsUpdate=!0;const L=S*4;for(let G=0;G0)return n;const s=e*t;let r=Q1[s];if(r===void 0&&(r=new Float32Array(s),Q1[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function fn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t0||c&&_&&s(_)){t===null&&(t=new $1(n));const f=d?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,f),a.addEventListener("dispose",r),f.texture}else return null}}}return a}function s(a){let l=0;const d=6;for(let c=0;ce.maxTextureSize&&(U=Math.ceil(A/e.maxTextureSize),A=e.maxTextureSize);const F=new Float32Array(A*U*4*E),K=new uI(F,A,U,E);K.type=ks,K.needsUpdate=!0;const L=S*4;for(let G=0;G0)return n;const s=e*t;let r=Q1[s];if(r===void 0&&(r=new Float32Array(s),Q1[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function fn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` -`)}function _wt(n){const e=Ft.getPrimaries(Ft.workingColorSpace),t=Ft.getPrimaries(n);let i;switch(e===t?i="":e===vu&&t===Eu?i="LinearDisplayP3ToLinearSRGB":e===Eu&&t===vu&&(i="LinearSRGBToLinearDisplayP3"),n){case Nn:case pp:return[i,"LinearTransferOETF"];case rn:case JE:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function iR(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),s=n.getShaderInfoLog(e).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` +`)}function fwt(n){const e=Ft.getPrimaries(Ft.workingColorSpace),t=Ft.getPrimaries(n);let i;switch(e===t?i="":e===vu&&t===Eu?i="LinearDisplayP3ToLinearSRGB":e===Eu&&t===vu&&(i="LinearSRGBToLinearDisplayP3"),n){case Nn:case pp:return[i,"LinearTransferOETF"];case rn:case JE:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function iR(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),s=n.getShaderInfoLog(e).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` `+s+` -`+pwt(n.getShaderSource(e),o)}else return s}function hwt(n,e){const t=_wt(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function fwt(n,e){let t;switch(e){case uxt:t="Linear";break;case pxt:t="Reinhard";break;case _xt:t="OptimizedCineon";break;case hxt:t="ACESFilmic";break;case fxt:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function mwt(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(wl).join(` -`)}function gwt(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function bwt(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function mb(n){return n.replace(Ewt,ywt)}const vwt=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function ywt(n,e){let t=Tt[e];if(t===void 0){const i=vwt.get(e);if(i!==void 0)t=Tt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return mb(t)}const Swt=/#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 oR(n){return n.replace(Swt,Twt)}function Twt(n,e,t,i){let s="";for(let r=parseInt(e);r/gm;function mb(n){return n.replace(ywt,Twt)}const Swt=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function Twt(n,e){let t=Tt[e];if(t===void 0){const i=Swt.get(e);if(i!==void 0)t=Tt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return mb(t)}const xwt=/#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 oR(n){return n.replace(xwt,Cwt)}function Cwt(n,e,t,i){let s="";for(let r=parseInt(e);r0&&(b+=` `),g=[m,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,h].filter(wl).join(` `),g.length>0&&(g+=` `)):(b=[aR(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,h,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 "+c:"",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 "+l:"",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(wl).join(` -`),g=[m,aR(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,h,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 "+c:"",t.envMap?"#define "+_:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.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 "+l:"",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!==Tr?"#define TONE_MAPPING":"",t.toneMapping!==Tr?Tt.tonemapping_pars_fragment:"",t.toneMapping!==Tr?fwt("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Tt.colorspace_pars_fragment,hwt("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`),g=[m,aR(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,h,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 "+c:"",t.envMap?"#define "+_:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.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 "+l:"",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!==Tr?"#define TONE_MAPPING":"",t.toneMapping!==Tr?Tt.tonemapping_pars_fragment:"",t.toneMapping!==Tr?gwt("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Tt.colorspace_pars_fragment,mwt("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(wl).join(` `)),o=mb(o),o=sR(o,t),o=rR(o,t),a=mb(a),a=sR(a,t),a=rR(a,t),o=oR(o),a=oR(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(v=`#version 300 es `,b=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` @@ -3831,9 +3831,9 @@ precision `+n.precision+" int;";return n.precision==="highp"?e+=` Program Info Log: `+F+` `+P+` -`+j)}else F!==""?console.warn("THREE.WebGLProgram: Program Info Log:",F):(K===""||L==="")&&(G=!1);G&&(U.diagnostics={runnable:H,programLog:F,vertexShader:{log:K,prefix:b},fragmentShader:{log:L,prefix:g}})}s.deleteShader(C),s.deleteShader(x),R=new Hd(s,E),S=bwt(s,E)}let R;this.getUniforms=function(){return R===void 0&&O(this),R};let S;this.getAttributes=function(){return S===void 0&&O(this),S};let A=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return A===!1&&(A=s.getProgramParameter(E,dwt)),A},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(E),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=uwt++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=C,this.fragmentShader=x,this}let Owt=0;class Iwt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.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 i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new Mwt(e),t.set(e,i)),i}}class Mwt{constructor(e){this.id=Owt++,this.code=e,this.usedTimes=0}}function Dwt(n,e,t,i,s,r,o){const a=new pI,l=new Iwt,d=[],c=s.isWebGL2,_=s.logarithmicDepthBuffer,f=s.vertexTextures;let m=s.precision;const h={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 E(S){return S===0?"uv":`uv${S}`}function b(S,A,U,F,K){const L=F.fog,H=K.geometry,G=S.isMeshStandardMaterial?F.environment:null,P=(S.isMeshStandardMaterial?t:e).get(S.envMap||G),j=P&&P.mapping===up?P.image.height:null,Y=h[S.type];S.precision!==null&&(m=s.getMaxPrecision(S.precision),m!==S.precision&&console.warn("THREE.WebGLProgram.getParameters:",S.precision,"not supported, using",m,"instead."));const Q=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,re=Q!==void 0?Q.length:0;let te=0;H.morphAttributes.position!==void 0&&(te=1),H.morphAttributes.normal!==void 0&&(te=2),H.morphAttributes.color!==void 0&&(te=3);let Z,fe,ve,Ae;if(Y){const ln=Xi[Y];Z=ln.vertexShader,fe=ln.fragmentShader}else Z=S.vertexShader,fe=S.fragmentShader,l.update(S),ve=l.getVertexShaderID(S),Ae=l.getFragmentShaderID(S);const J=n.getRenderTarget(),me=K.isInstancedMesh===!0,ee=K.isBatchedMesh===!0,Se=!!S.map,Oe=!!S.matcap,k=!!P,B=!!S.aoMap,$=!!S.lightMap,ce=!!S.bumpMap,ne=!!S.normalMap,Ce=!!S.displacementMap,we=!!S.emissiveMap,V=!!S.metalnessMap,_e=!!S.roughnessMap,ie=S.anisotropy>0,ae=S.clearcoat>0,D=S.iridescence>0,I=S.sheen>0,z=S.transmission>0,he=ie&&!!S.anisotropyMap,X=ae&&!!S.clearcoatMap,se=ae&&!!S.clearcoatNormalMap,Re=ae&&!!S.clearcoatRoughnessMap,xe=D&&!!S.iridescenceMap,De=D&&!!S.iridescenceThicknessMap,ze=I&&!!S.sheenColorMap,st=I&&!!S.sheenRoughnessMap,ke=!!S.specularMap,lt=!!S.specularColorMap,je=!!S.specularIntensityMap,He=z&&!!S.transmissionMap,et=z&&!!S.thicknessMap,Fe=!!S.gradientMap,ut=!!S.alphaMap,pe=S.alphaTest>0,We=!!S.alphaHash,Ue=!!S.extensions,Ne=!!H.attributes.uv1,Be=!!H.attributes.uv2,ct=!!H.attributes.uv3;let Et=Tr;return S.toneMapped&&(J===null||J.isXRRenderTarget===!0)&&(Et=n.toneMapping),{isWebGL2:c,shaderID:Y,shaderType:S.type,shaderName:S.name,vertexShader:Z,fragmentShader:fe,defines:S.defines,customVertexShaderID:ve,customFragmentShaderID:Ae,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:m,batching:ee,instancing:me,instancingColor:me&&K.instanceColor!==null,supportsVertexTextures:f,outputColorSpace:J===null?n.outputColorSpace:J.isXRRenderTarget===!0?J.texture.colorSpace:Nn,map:Se,matcap:Oe,envMap:k,envMapMode:k&&P.mapping,envMapCubeUVHeight:j,aoMap:B,lightMap:$,bumpMap:ce,normalMap:ne,displacementMap:f&&Ce,emissiveMap:we,normalMapObjectSpace:ne&&S.normalMapType===Nxt,normalMapTangentSpace:ne&&S.normalMapType===ZE,metalnessMap:V,roughnessMap:_e,anisotropy:ie,anisotropyMap:he,clearcoat:ae,clearcoatMap:X,clearcoatNormalMap:se,clearcoatRoughnessMap:Re,iridescence:D,iridescenceMap:xe,iridescenceThicknessMap:De,sheen:I,sheenColorMap:ze,sheenRoughnessMap:st,specularMap:ke,specularColorMap:lt,specularIntensityMap:je,transmission:z,transmissionMap:He,thicknessMap:et,gradientMap:Fe,opaque:S.transparent===!1&&S.blending===aa,alphaMap:ut,alphaTest:pe,alphaHash:We,combine:S.combine,mapUv:Se&&E(S.map.channel),aoMapUv:B&&E(S.aoMap.channel),lightMapUv:$&&E(S.lightMap.channel),bumpMapUv:ce&&E(S.bumpMap.channel),normalMapUv:ne&&E(S.normalMap.channel),displacementMapUv:Ce&&E(S.displacementMap.channel),emissiveMapUv:we&&E(S.emissiveMap.channel),metalnessMapUv:V&&E(S.metalnessMap.channel),roughnessMapUv:_e&&E(S.roughnessMap.channel),anisotropyMapUv:he&&E(S.anisotropyMap.channel),clearcoatMapUv:X&&E(S.clearcoatMap.channel),clearcoatNormalMapUv:se&&E(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Re&&E(S.clearcoatRoughnessMap.channel),iridescenceMapUv:xe&&E(S.iridescenceMap.channel),iridescenceThicknessMapUv:De&&E(S.iridescenceThicknessMap.channel),sheenColorMapUv:ze&&E(S.sheenColorMap.channel),sheenRoughnessMapUv:st&&E(S.sheenRoughnessMap.channel),specularMapUv:ke&&E(S.specularMap.channel),specularColorMapUv:lt&&E(S.specularColorMap.channel),specularIntensityMapUv:je&&E(S.specularIntensityMap.channel),transmissionMapUv:He&&E(S.transmissionMap.channel),thicknessMapUv:et&&E(S.thicknessMap.channel),alphaMapUv:ut&&E(S.alphaMap.channel),vertexTangents:!!H.attributes.tangent&&(ne||ie),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,vertexUv1s:Ne,vertexUv2s:Be,vertexUv3s:ct,pointsUvs:K.isPoints===!0&&!!H.attributes.uv&&(Se||ut),fog:!!L,useFog:S.fog===!0,fogExp2:L&&L.isFogExp2,flatShading:S.flatShading===!0,sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:_,skinning:K.isSkinnedMesh===!0,morphTargets:H.morphAttributes.position!==void 0,morphNormals:H.morphAttributes.normal!==void 0,morphColors:H.morphAttributes.color!==void 0,morphTargetsCount:re,morphTextureStride:te,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numSpotLightMaps:A.spotLightMap.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numSpotLightShadowsWithMaps:A.numSpotLightShadowsWithMaps,numLightProbes:A.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:n.shadowMap.enabled&&U.length>0,shadowMapType:n.shadowMap.type,toneMapping:Et,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Se&&S.map.isVideoTexture===!0&&Ft.getTransfer(S.map.colorSpace)===Xt,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===Ji,flipSided:S.side===Zn,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionDerivatives:Ue&&S.extensions.derivatives===!0,extensionFragDepth:Ue&&S.extensions.fragDepth===!0,extensionDrawBuffers:Ue&&S.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ue&&S.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:c||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()}}function g(S){const A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.customVertexShaderID),A.push(S.customFragmentShaderID)),S.defines!==void 0)for(const U in S.defines)A.push(U),A.push(S.defines[U]);return S.isRawShaderMaterial===!1&&(v(A,S),y(A,S),A.push(n.outputColorSpace)),A.push(S.customProgramCacheKey),A.join()}function v(S,A){S.push(A.precision),S.push(A.outputColorSpace),S.push(A.envMapMode),S.push(A.envMapCubeUVHeight),S.push(A.mapUv),S.push(A.alphaMapUv),S.push(A.lightMapUv),S.push(A.aoMapUv),S.push(A.bumpMapUv),S.push(A.normalMapUv),S.push(A.displacementMapUv),S.push(A.emissiveMapUv),S.push(A.metalnessMapUv),S.push(A.roughnessMapUv),S.push(A.anisotropyMapUv),S.push(A.clearcoatMapUv),S.push(A.clearcoatNormalMapUv),S.push(A.clearcoatRoughnessMapUv),S.push(A.iridescenceMapUv),S.push(A.iridescenceThicknessMapUv),S.push(A.sheenColorMapUv),S.push(A.sheenRoughnessMapUv),S.push(A.specularMapUv),S.push(A.specularColorMapUv),S.push(A.specularIntensityMapUv),S.push(A.transmissionMapUv),S.push(A.thicknessMapUv),S.push(A.combine),S.push(A.fogExp2),S.push(A.sizeAttenuation),S.push(A.morphTargetsCount),S.push(A.morphAttributeCount),S.push(A.numDirLights),S.push(A.numPointLights),S.push(A.numSpotLights),S.push(A.numSpotLightMaps),S.push(A.numHemiLights),S.push(A.numRectAreaLights),S.push(A.numDirLightShadows),S.push(A.numPointLightShadows),S.push(A.numSpotLightShadows),S.push(A.numSpotLightShadowsWithMaps),S.push(A.numLightProbes),S.push(A.shadowMapType),S.push(A.toneMapping),S.push(A.numClippingPlanes),S.push(A.numClipIntersection),S.push(A.depthPacking)}function y(S,A){a.disableAll(),A.isWebGL2&&a.enable(0),A.supportsVertexTextures&&a.enable(1),A.instancing&&a.enable(2),A.instancingColor&&a.enable(3),A.matcap&&a.enable(4),A.envMap&&a.enable(5),A.normalMapObjectSpace&&a.enable(6),A.normalMapTangentSpace&&a.enable(7),A.clearcoat&&a.enable(8),A.iridescence&&a.enable(9),A.alphaTest&&a.enable(10),A.vertexColors&&a.enable(11),A.vertexAlphas&&a.enable(12),A.vertexUv1s&&a.enable(13),A.vertexUv2s&&a.enable(14),A.vertexUv3s&&a.enable(15),A.vertexTangents&&a.enable(16),A.anisotropy&&a.enable(17),A.alphaHash&&a.enable(18),A.batching&&a.enable(19),S.push(a.mask),a.disableAll(),A.fog&&a.enable(0),A.useFog&&a.enable(1),A.flatShading&&a.enable(2),A.logarithmicDepthBuffer&&a.enable(3),A.skinning&&a.enable(4),A.morphTargets&&a.enable(5),A.morphNormals&&a.enable(6),A.morphColors&&a.enable(7),A.premultipliedAlpha&&a.enable(8),A.shadowMapEnabled&&a.enable(9),A.useLegacyLights&&a.enable(10),A.doubleSided&&a.enable(11),A.flipSided&&a.enable(12),A.useDepthPacking&&a.enable(13),A.dithering&&a.enable(14),A.transmission&&a.enable(15),A.sheen&&a.enable(16),A.opaque&&a.enable(17),A.pointsUvs&&a.enable(18),A.decodeVideoTexture&&a.enable(19),S.push(a.mask)}function T(S){const A=h[S.type];let U;if(A){const F=Xi[A];U=mCt.clone(F.uniforms)}else U=S.uniforms;return U}function C(S,A){let U;for(let F=0,K=d.length;F0?i.push(g):m.transparent===!0?s.push(g):t.push(g)}function l(_,f,m,h,E,b){const g=o(_,f,m,h,E,b);m.transmission>0?i.unshift(g):m.transparent===!0?s.unshift(g):t.unshift(g)}function d(_,f){t.length>1&&t.sort(_||Lwt),i.length>1&&i.sort(f||lR),s.length>1&&s.sort(f||lR)}function c(){for(let _=e,f=n.length;_=r.length?(o=new cR,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function Uwt(){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 be,color:new gt};break;case"SpotLight":t={position:new be,direction:new be,color:new gt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new be,color:new gt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new be,skyColor:new gt,groundColor:new gt};break;case"RectAreaLight":t={color:new gt,position:new be,halfWidth:new be,halfHeight:new be};break}return n[e.id]=t,t}}}function Fwt(){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 It};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new It};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new It,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let Bwt=0;function Gwt(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function zwt(n,e){const t=new Uwt,i=Fwt(),s={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 c=0;c<9;c++)s.probe.push(new be);const r=new be,o=new At,a=new At;function l(c,_){let f=0,m=0,h=0;for(let F=0;F<9;F++)s.probe[F].set(0,0,0);let E=0,b=0,g=0,v=0,y=0,T=0,C=0,x=0,O=0,R=0,S=0;c.sort(Gwt);const A=_===!0?Math.PI:1;for(let F=0,K=c.length;F0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Ke.LTC_FLOAT_1,s.rectAreaLTC2=Ke.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(s.rectAreaLTC1=Ke.LTC_HALF_1,s.rectAreaLTC2=Ke.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=f,s.ambient[1]=m,s.ambient[2]=h;const U=s.hash;(U.directionalLength!==E||U.pointLength!==b||U.spotLength!==g||U.rectAreaLength!==v||U.hemiLength!==y||U.numDirectionalShadows!==T||U.numPointShadows!==C||U.numSpotShadows!==x||U.numSpotMaps!==O||U.numLightProbes!==S)&&(s.directional.length=E,s.spot.length=g,s.rectArea.length=v,s.point.length=b,s.hemi.length=y,s.directionalShadow.length=T,s.directionalShadowMap.length=T,s.pointShadow.length=C,s.pointShadowMap.length=C,s.spotShadow.length=x,s.spotShadowMap.length=x,s.directionalShadowMatrix.length=T,s.pointShadowMatrix.length=C,s.spotLightMatrix.length=x+O-R,s.spotLightMap.length=O,s.numSpotLightShadowsWithMaps=R,s.numLightProbes=S,U.directionalLength=E,U.pointLength=b,U.spotLength=g,U.rectAreaLength=v,U.hemiLength=y,U.numDirectionalShadows=T,U.numPointShadows=C,U.numSpotShadows=x,U.numSpotMaps=O,U.numLightProbes=S,s.version=Bwt++)}function d(c,_){let f=0,m=0,h=0,E=0,b=0;const g=_.matrixWorldInverse;for(let v=0,y=c.length;v=a.length?(l=new dR(n,e),a.push(l)):l=a[o],l}function s(){t=new WeakMap}return{get:i,dispose:s}}class Hwt extends Vi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Axt,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 qwt extends Vi{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 Ywt=`void main() { +`+j)}else F!==""?console.warn("THREE.WebGLProgram: Program Info Log:",F):(K===""||L==="")&&(G=!1);G&&(U.diagnostics={runnable:H,programLog:F,vertexShader:{log:K,prefix:b},fragmentShader:{log:L,prefix:g}})}s.deleteShader(C),s.deleteShader(x),R=new Hd(s,E),S=vwt(s,E)}let R;this.getUniforms=function(){return R===void 0&&O(this),R};let S;this.getAttributes=function(){return S===void 0&&O(this),S};let A=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return A===!1&&(A=s.getProgramParameter(E,pwt)),A},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(E),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=_wt++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=C,this.fragmentShader=x,this}let Mwt=0;class Dwt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.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 i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new kwt(e),t.set(e,i)),i}}class kwt{constructor(e){this.id=Mwt++,this.code=e,this.usedTimes=0}}function Lwt(n,e,t,i,s,r,o){const a=new pI,l=new Dwt,d=[],c=s.isWebGL2,_=s.logarithmicDepthBuffer,f=s.vertexTextures;let m=s.precision;const h={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 E(S){return S===0?"uv":`uv${S}`}function b(S,A,U,F,K){const L=F.fog,H=K.geometry,G=S.isMeshStandardMaterial?F.environment:null,P=(S.isMeshStandardMaterial?t:e).get(S.envMap||G),j=P&&P.mapping===up?P.image.height:null,Y=h[S.type];S.precision!==null&&(m=s.getMaxPrecision(S.precision),m!==S.precision&&console.warn("THREE.WebGLProgram.getParameters:",S.precision,"not supported, using",m,"instead."));const Q=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,re=Q!==void 0?Q.length:0;let te=0;H.morphAttributes.position!==void 0&&(te=1),H.morphAttributes.normal!==void 0&&(te=2),H.morphAttributes.color!==void 0&&(te=3);let Z,fe,ve,Ae;if(Y){const ln=Xi[Y];Z=ln.vertexShader,fe=ln.fragmentShader}else Z=S.vertexShader,fe=S.fragmentShader,l.update(S),ve=l.getVertexShaderID(S),Ae=l.getFragmentShaderID(S);const J=n.getRenderTarget(),me=K.isInstancedMesh===!0,ee=K.isBatchedMesh===!0,Se=!!S.map,Oe=!!S.matcap,k=!!P,B=!!S.aoMap,$=!!S.lightMap,ce=!!S.bumpMap,ne=!!S.normalMap,Ce=!!S.displacementMap,we=!!S.emissiveMap,V=!!S.metalnessMap,_e=!!S.roughnessMap,ie=S.anisotropy>0,ae=S.clearcoat>0,D=S.iridescence>0,I=S.sheen>0,z=S.transmission>0,he=ie&&!!S.anisotropyMap,X=ae&&!!S.clearcoatMap,se=ae&&!!S.clearcoatNormalMap,Re=ae&&!!S.clearcoatRoughnessMap,xe=D&&!!S.iridescenceMap,De=D&&!!S.iridescenceThicknessMap,ze=I&&!!S.sheenColorMap,st=I&&!!S.sheenRoughnessMap,ke=!!S.specularMap,lt=!!S.specularColorMap,je=!!S.specularIntensityMap,He=z&&!!S.transmissionMap,et=z&&!!S.thicknessMap,Fe=!!S.gradientMap,ut=!!S.alphaMap,pe=S.alphaTest>0,We=!!S.alphaHash,Ue=!!S.extensions,Ne=!!H.attributes.uv1,Be=!!H.attributes.uv2,ct=!!H.attributes.uv3;let Et=Tr;return S.toneMapped&&(J===null||J.isXRRenderTarget===!0)&&(Et=n.toneMapping),{isWebGL2:c,shaderID:Y,shaderType:S.type,shaderName:S.name,vertexShader:Z,fragmentShader:fe,defines:S.defines,customVertexShaderID:ve,customFragmentShaderID:Ae,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:m,batching:ee,instancing:me,instancingColor:me&&K.instanceColor!==null,supportsVertexTextures:f,outputColorSpace:J===null?n.outputColorSpace:J.isXRRenderTarget===!0?J.texture.colorSpace:Nn,map:Se,matcap:Oe,envMap:k,envMapMode:k&&P.mapping,envMapCubeUVHeight:j,aoMap:B,lightMap:$,bumpMap:ce,normalMap:ne,displacementMap:f&&Ce,emissiveMap:we,normalMapObjectSpace:ne&&S.normalMapType===Ixt,normalMapTangentSpace:ne&&S.normalMapType===ZE,metalnessMap:V,roughnessMap:_e,anisotropy:ie,anisotropyMap:he,clearcoat:ae,clearcoatMap:X,clearcoatNormalMap:se,clearcoatRoughnessMap:Re,iridescence:D,iridescenceMap:xe,iridescenceThicknessMap:De,sheen:I,sheenColorMap:ze,sheenRoughnessMap:st,specularMap:ke,specularColorMap:lt,specularIntensityMap:je,transmission:z,transmissionMap:He,thicknessMap:et,gradientMap:Fe,opaque:S.transparent===!1&&S.blending===aa,alphaMap:ut,alphaTest:pe,alphaHash:We,combine:S.combine,mapUv:Se&&E(S.map.channel),aoMapUv:B&&E(S.aoMap.channel),lightMapUv:$&&E(S.lightMap.channel),bumpMapUv:ce&&E(S.bumpMap.channel),normalMapUv:ne&&E(S.normalMap.channel),displacementMapUv:Ce&&E(S.displacementMap.channel),emissiveMapUv:we&&E(S.emissiveMap.channel),metalnessMapUv:V&&E(S.metalnessMap.channel),roughnessMapUv:_e&&E(S.roughnessMap.channel),anisotropyMapUv:he&&E(S.anisotropyMap.channel),clearcoatMapUv:X&&E(S.clearcoatMap.channel),clearcoatNormalMapUv:se&&E(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Re&&E(S.clearcoatRoughnessMap.channel),iridescenceMapUv:xe&&E(S.iridescenceMap.channel),iridescenceThicknessMapUv:De&&E(S.iridescenceThicknessMap.channel),sheenColorMapUv:ze&&E(S.sheenColorMap.channel),sheenRoughnessMapUv:st&&E(S.sheenRoughnessMap.channel),specularMapUv:ke&&E(S.specularMap.channel),specularColorMapUv:lt&&E(S.specularColorMap.channel),specularIntensityMapUv:je&&E(S.specularIntensityMap.channel),transmissionMapUv:He&&E(S.transmissionMap.channel),thicknessMapUv:et&&E(S.thicknessMap.channel),alphaMapUv:ut&&E(S.alphaMap.channel),vertexTangents:!!H.attributes.tangent&&(ne||ie),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,vertexUv1s:Ne,vertexUv2s:Be,vertexUv3s:ct,pointsUvs:K.isPoints===!0&&!!H.attributes.uv&&(Se||ut),fog:!!L,useFog:S.fog===!0,fogExp2:L&&L.isFogExp2,flatShading:S.flatShading===!0,sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:_,skinning:K.isSkinnedMesh===!0,morphTargets:H.morphAttributes.position!==void 0,morphNormals:H.morphAttributes.normal!==void 0,morphColors:H.morphAttributes.color!==void 0,morphTargetsCount:re,morphTextureStride:te,numDirLights:A.directional.length,numPointLights:A.point.length,numSpotLights:A.spot.length,numSpotLightMaps:A.spotLightMap.length,numRectAreaLights:A.rectArea.length,numHemiLights:A.hemi.length,numDirLightShadows:A.directionalShadowMap.length,numPointLightShadows:A.pointShadowMap.length,numSpotLightShadows:A.spotShadowMap.length,numSpotLightShadowsWithMaps:A.numSpotLightShadowsWithMaps,numLightProbes:A.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:n.shadowMap.enabled&&U.length>0,shadowMapType:n.shadowMap.type,toneMapping:Et,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Se&&S.map.isVideoTexture===!0&&Ft.getTransfer(S.map.colorSpace)===Xt,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===Ji,flipSided:S.side===Zn,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionDerivatives:Ue&&S.extensions.derivatives===!0,extensionFragDepth:Ue&&S.extensions.fragDepth===!0,extensionDrawBuffers:Ue&&S.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ue&&S.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:c||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()}}function g(S){const A=[];if(S.shaderID?A.push(S.shaderID):(A.push(S.customVertexShaderID),A.push(S.customFragmentShaderID)),S.defines!==void 0)for(const U in S.defines)A.push(U),A.push(S.defines[U]);return S.isRawShaderMaterial===!1&&(v(A,S),y(A,S),A.push(n.outputColorSpace)),A.push(S.customProgramCacheKey),A.join()}function v(S,A){S.push(A.precision),S.push(A.outputColorSpace),S.push(A.envMapMode),S.push(A.envMapCubeUVHeight),S.push(A.mapUv),S.push(A.alphaMapUv),S.push(A.lightMapUv),S.push(A.aoMapUv),S.push(A.bumpMapUv),S.push(A.normalMapUv),S.push(A.displacementMapUv),S.push(A.emissiveMapUv),S.push(A.metalnessMapUv),S.push(A.roughnessMapUv),S.push(A.anisotropyMapUv),S.push(A.clearcoatMapUv),S.push(A.clearcoatNormalMapUv),S.push(A.clearcoatRoughnessMapUv),S.push(A.iridescenceMapUv),S.push(A.iridescenceThicknessMapUv),S.push(A.sheenColorMapUv),S.push(A.sheenRoughnessMapUv),S.push(A.specularMapUv),S.push(A.specularColorMapUv),S.push(A.specularIntensityMapUv),S.push(A.transmissionMapUv),S.push(A.thicknessMapUv),S.push(A.combine),S.push(A.fogExp2),S.push(A.sizeAttenuation),S.push(A.morphTargetsCount),S.push(A.morphAttributeCount),S.push(A.numDirLights),S.push(A.numPointLights),S.push(A.numSpotLights),S.push(A.numSpotLightMaps),S.push(A.numHemiLights),S.push(A.numRectAreaLights),S.push(A.numDirLightShadows),S.push(A.numPointLightShadows),S.push(A.numSpotLightShadows),S.push(A.numSpotLightShadowsWithMaps),S.push(A.numLightProbes),S.push(A.shadowMapType),S.push(A.toneMapping),S.push(A.numClippingPlanes),S.push(A.numClipIntersection),S.push(A.depthPacking)}function y(S,A){a.disableAll(),A.isWebGL2&&a.enable(0),A.supportsVertexTextures&&a.enable(1),A.instancing&&a.enable(2),A.instancingColor&&a.enable(3),A.matcap&&a.enable(4),A.envMap&&a.enable(5),A.normalMapObjectSpace&&a.enable(6),A.normalMapTangentSpace&&a.enable(7),A.clearcoat&&a.enable(8),A.iridescence&&a.enable(9),A.alphaTest&&a.enable(10),A.vertexColors&&a.enable(11),A.vertexAlphas&&a.enable(12),A.vertexUv1s&&a.enable(13),A.vertexUv2s&&a.enable(14),A.vertexUv3s&&a.enable(15),A.vertexTangents&&a.enable(16),A.anisotropy&&a.enable(17),A.alphaHash&&a.enable(18),A.batching&&a.enable(19),S.push(a.mask),a.disableAll(),A.fog&&a.enable(0),A.useFog&&a.enable(1),A.flatShading&&a.enable(2),A.logarithmicDepthBuffer&&a.enable(3),A.skinning&&a.enable(4),A.morphTargets&&a.enable(5),A.morphNormals&&a.enable(6),A.morphColors&&a.enable(7),A.premultipliedAlpha&&a.enable(8),A.shadowMapEnabled&&a.enable(9),A.useLegacyLights&&a.enable(10),A.doubleSided&&a.enable(11),A.flipSided&&a.enable(12),A.useDepthPacking&&a.enable(13),A.dithering&&a.enable(14),A.transmission&&a.enable(15),A.sheen&&a.enable(16),A.opaque&&a.enable(17),A.pointsUvs&&a.enable(18),A.decodeVideoTexture&&a.enable(19),S.push(a.mask)}function T(S){const A=h[S.type];let U;if(A){const F=Xi[A];U=bCt.clone(F.uniforms)}else U=S.uniforms;return U}function C(S,A){let U;for(let F=0,K=d.length;F0?i.push(g):m.transparent===!0?s.push(g):t.push(g)}function l(_,f,m,h,E,b){const g=o(_,f,m,h,E,b);m.transmission>0?i.unshift(g):m.transparent===!0?s.unshift(g):t.unshift(g)}function d(_,f){t.length>1&&t.sort(_||Uwt),i.length>1&&i.sort(f||lR),s.length>1&&s.sort(f||lR)}function c(){for(let _=e,f=n.length;_=r.length?(o=new cR,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function Bwt(){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 be,color:new gt};break;case"SpotLight":t={position:new be,direction:new be,color:new gt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new be,color:new gt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new be,skyColor:new gt,groundColor:new gt};break;case"RectAreaLight":t={color:new gt,position:new be,halfWidth:new be,halfHeight:new be};break}return n[e.id]=t,t}}}function Gwt(){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 It};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new It};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new It,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let zwt=0;function Vwt(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function Hwt(n,e){const t=new Bwt,i=Gwt(),s={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 c=0;c<9;c++)s.probe.push(new be);const r=new be,o=new At,a=new At;function l(c,_){let f=0,m=0,h=0;for(let F=0;F<9;F++)s.probe[F].set(0,0,0);let E=0,b=0,g=0,v=0,y=0,T=0,C=0,x=0,O=0,R=0,S=0;c.sort(Vwt);const A=_===!0?Math.PI:1;for(let F=0,K=c.length;F0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Ke.LTC_FLOAT_1,s.rectAreaLTC2=Ke.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(s.rectAreaLTC1=Ke.LTC_HALF_1,s.rectAreaLTC2=Ke.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=f,s.ambient[1]=m,s.ambient[2]=h;const U=s.hash;(U.directionalLength!==E||U.pointLength!==b||U.spotLength!==g||U.rectAreaLength!==v||U.hemiLength!==y||U.numDirectionalShadows!==T||U.numPointShadows!==C||U.numSpotShadows!==x||U.numSpotMaps!==O||U.numLightProbes!==S)&&(s.directional.length=E,s.spot.length=g,s.rectArea.length=v,s.point.length=b,s.hemi.length=y,s.directionalShadow.length=T,s.directionalShadowMap.length=T,s.pointShadow.length=C,s.pointShadowMap.length=C,s.spotShadow.length=x,s.spotShadowMap.length=x,s.directionalShadowMatrix.length=T,s.pointShadowMatrix.length=C,s.spotLightMatrix.length=x+O-R,s.spotLightMap.length=O,s.numSpotLightShadowsWithMaps=R,s.numLightProbes=S,U.directionalLength=E,U.pointLength=b,U.spotLength=g,U.rectAreaLength=v,U.hemiLength=y,U.numDirectionalShadows=T,U.numPointShadows=C,U.numSpotShadows=x,U.numSpotMaps=O,U.numLightProbes=S,s.version=zwt++)}function d(c,_){let f=0,m=0,h=0,E=0,b=0;const g=_.matrixWorldInverse;for(let v=0,y=c.length;v=a.length?(l=new dR(n,e),a.push(l)):l=a[o],l}function s(){t=new WeakMap}return{get:i,dispose:s}}class Ywt extends Vi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Nxt,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 $wt extends Vi{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 Wwt=`void main() { gl_Position = vec4( position, 1.0 ); -}`,$wt=`uniform sampler2D shadow_pass; +}`,Kwt=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3859,8 +3859,8 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function Wwt(n,e,t){let i=new tv;const s=new It,r=new It,o=new Wt,a=new Hwt({depthPacking:wxt}),l=new qwt,d={},c=t.maxTextureSize,_={[Vs]:Zn,[Zn]:Vs,[Ji]:Ji},f=new Eo({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new It},radius:{value:4}},vertexShader:Ywt,fragmentShader:$wt}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const h=new fs;h.setAttribute("position",new Yn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Hn(h,f),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=jO;let g=this.type;this.render=function(C,x,O){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||C.length===0)return;const R=n.getRenderTarget(),S=n.getActiveCubeFace(),A=n.getActiveMipmapLevel(),U=n.state;U.setBlending(Sr),U.buffers.color.setClear(1,1,1,1),U.buffers.depth.setTest(!0),U.setScissorTest(!1);const F=g!==Is&&this.type===Is,K=g===Is&&this.type!==Is;for(let L=0,H=C.length;Lc||s.y>c)&&(s.x>c&&(r.x=Math.floor(c/j.x),s.x=r.x*j.x,P.mapSize.x=r.x),s.y>c&&(r.y=Math.floor(c/j.y),s.y=r.y*j.y,P.mapSize.y=r.y)),P.map===null||F===!0||K===!0){const Q=this.type!==Is?{minFilter:En,magFilter:En}:{};P.map!==null&&P.map.dispose(),P.map=new bo(s.x,s.y,Q),P.map.texture.name=G.name+".shadowMap",P.camera.updateProjectionMatrix()}n.setRenderTarget(P.map),n.clear();const Y=P.getViewportCount();for(let Q=0;Q0||x.map&&x.alphaTest>0){const U=S.uuid,F=x.uuid;let K=d[U];K===void 0&&(K={},d[U]=K);let L=K[F];L===void 0&&(L=S.clone(),K[F]=L),S=L}if(S.visible=x.visible,S.wireframe=x.wireframe,R===Is?S.side=x.shadowSide!==null?x.shadowSide:x.side:S.side=x.shadowSide!==null?x.shadowSide:_[x.side],S.alphaMap=x.alphaMap,S.alphaTest=x.alphaTest,S.map=x.map,S.clipShadows=x.clipShadows,S.clippingPlanes=x.clippingPlanes,S.clipIntersection=x.clipIntersection,S.displacementMap=x.displacementMap,S.displacementScale=x.displacementScale,S.displacementBias=x.displacementBias,S.wireframeLinewidth=x.wireframeLinewidth,S.linewidth=x.linewidth,O.isPointLight===!0&&S.isMeshDistanceMaterial===!0){const U=n.properties.get(S);U.light=O}return S}function T(C,x,O,R,S){if(C.visible===!1)return;if(C.layers.test(x.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&S===Is)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,C.matrixWorld);const F=e.update(C),K=C.material;if(Array.isArray(K)){const L=F.groups;for(let H=0,G=L.length;H=1):Q.indexOf("OpenGL ES")!==-1&&(Y=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),j=Y>=2);let re=null,te={};const Z=n.getParameter(n.SCISSOR_BOX),fe=n.getParameter(n.VIEWPORT),ve=new Wt().fromArray(Z),Ae=new Wt().fromArray(fe);function J(pe,We,Ue,Ne){const Be=new Uint8Array(4),ct=n.createTexture();n.bindTexture(pe,ct),n.texParameteri(pe,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(pe,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Et=0;Et"u"?!1:/OculusBrowser/g.test(navigator.userAgent),h=new WeakMap;let E;const b=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(D,I){return g?new OffscreenCanvas(D,I):lc("canvas")}function y(D,I,z,he){let X=1;if((D.width>he||D.height>he)&&(X=he/Math.max(D.width,D.height)),X<1||I===!0)if(typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&D instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&D instanceof ImageBitmap){const se=I?Su:Math.floor,Re=se(X*D.width),xe=se(X*D.height);E===void 0&&(E=v(Re,xe));const De=z?v(Re,xe):E;return De.width=Re,De.height=xe,De.getContext("2d").drawImage(D,0,0,Re,xe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+D.width+"x"+D.height+") to ("+Re+"x"+xe+")."),De}else return"data"in D&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+D.width+"x"+D.height+")."),D;return D}function T(D){return fb(D.width)&&fb(D.height)}function C(D){return a?!1:D.wrapS!==gi||D.wrapT!==gi||D.minFilter!==En&&D.minFilter!==jn}function x(D,I){return D.generateMipmaps&&I&&D.minFilter!==En&&D.minFilter!==jn}function O(D){n.generateMipmap(D)}function R(D,I,z,he,X=!1){if(a===!1)return I;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 se=I;if(I===n.RED&&(z===n.FLOAT&&(se=n.R32F),z===n.HALF_FLOAT&&(se=n.R16F),z===n.UNSIGNED_BYTE&&(se=n.R8)),I===n.RED_INTEGER&&(z===n.UNSIGNED_BYTE&&(se=n.R8UI),z===n.UNSIGNED_SHORT&&(se=n.R16UI),z===n.UNSIGNED_INT&&(se=n.R32UI),z===n.BYTE&&(se=n.R8I),z===n.SHORT&&(se=n.R16I),z===n.INT&&(se=n.R32I)),I===n.RG&&(z===n.FLOAT&&(se=n.RG32F),z===n.HALF_FLOAT&&(se=n.RG16F),z===n.UNSIGNED_BYTE&&(se=n.RG8)),I===n.RGBA){const Re=X?bu:Ft.getTransfer(he);z===n.FLOAT&&(se=n.RGBA32F),z===n.HALF_FLOAT&&(se=n.RGBA16F),z===n.UNSIGNED_BYTE&&(se=Re===Xt?n.SRGB8_ALPHA8:n.RGBA8),z===n.UNSIGNED_SHORT_4_4_4_4&&(se=n.RGBA4),z===n.UNSIGNED_SHORT_5_5_5_1&&(se=n.RGB5_A1)}return(se===n.R16F||se===n.R32F||se===n.RG16F||se===n.RG32F||se===n.RGBA16F||se===n.RGBA32F)&&e.get("EXT_color_buffer_float"),se}function S(D,I,z){return x(D,z)===!0||D.isFramebufferTexture&&D.minFilter!==En&&D.minFilter!==jn?Math.log2(Math.max(I.width,I.height))+1:D.mipmaps!==void 0&&D.mipmaps.length>0?D.mipmaps.length:D.isCompressedTexture&&Array.isArray(D.image)?I.mipmaps.length:1}function A(D){return D===En||D===ub||D===Vd?n.NEAREST:n.LINEAR}function U(D){const I=D.target;I.removeEventListener("dispose",U),K(I),I.isVideoTexture&&h.delete(I)}function F(D){const I=D.target;I.removeEventListener("dispose",F),H(I)}function K(D){const I=i.get(D);if(I.__webglInit===void 0)return;const z=D.source,he=b.get(z);if(he){const X=he[I.__cacheKey];X.usedTimes--,X.usedTimes===0&&L(D),Object.keys(he).length===0&&b.delete(z)}i.remove(D)}function L(D){const I=i.get(D);n.deleteTexture(I.__webglTexture);const z=D.source,he=b.get(z);delete he[I.__cacheKey],o.memory.textures--}function H(D){const I=D.texture,z=i.get(D),he=i.get(I);if(he.__webglTexture!==void 0&&(n.deleteTexture(he.__webglTexture),o.memory.textures--),D.depthTexture&&D.depthTexture.dispose(),D.isWebGLCubeRenderTarget)for(let X=0;X<6;X++){if(Array.isArray(z.__webglFramebuffer[X]))for(let se=0;se=l&&console.warn("THREE.WebGLTextures: Trying to use "+D+" texture units while this GPU supports only "+l),G+=1,D}function Y(D){const I=[];return I.push(D.wrapS),I.push(D.wrapT),I.push(D.wrapR||0),I.push(D.magFilter),I.push(D.minFilter),I.push(D.anisotropy),I.push(D.internalFormat),I.push(D.format),I.push(D.type),I.push(D.generateMipmaps),I.push(D.premultiplyAlpha),I.push(D.flipY),I.push(D.unpackAlignment),I.push(D.colorSpace),I.join()}function Q(D,I){const z=i.get(D);if(D.isVideoTexture&&ie(D),D.isRenderTargetTexture===!1&&D.version>0&&z.__version!==D.version){const he=D.image;if(he===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(he.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ee(z,D,I);return}}t.bindTexture(n.TEXTURE_2D,z.__webglTexture,n.TEXTURE0+I)}function re(D,I){const z=i.get(D);if(D.version>0&&z.__version!==D.version){ee(z,D,I);return}t.bindTexture(n.TEXTURE_2D_ARRAY,z.__webglTexture,n.TEXTURE0+I)}function te(D,I){const z=i.get(D);if(D.version>0&&z.__version!==D.version){ee(z,D,I);return}t.bindTexture(n.TEXTURE_3D,z.__webglTexture,n.TEXTURE0+I)}function Z(D,I){const z=i.get(D);if(D.version>0&&z.__version!==D.version){Se(z,D,I);return}t.bindTexture(n.TEXTURE_CUBE_MAP,z.__webglTexture,n.TEXTURE0+I)}const fe={[Ra]:n.REPEAT,[gi]:n.CLAMP_TO_EDGE,[gu]:n.MIRRORED_REPEAT},ve={[En]:n.NEAREST,[ub]:n.NEAREST_MIPMAP_NEAREST,[Vd]:n.NEAREST_MIPMAP_LINEAR,[jn]:n.LINEAR,[XO]:n.LINEAR_MIPMAP_NEAREST,[go]:n.LINEAR_MIPMAP_LINEAR},Ae={[Oxt]:n.NEVER,[Pxt]:n.ALWAYS,[Ixt]:n.LESS,[aI]:n.LEQUAL,[Mxt]:n.EQUAL,[Lxt]:n.GEQUAL,[Dxt]:n.GREATER,[kxt]:n.NOTEQUAL};function J(D,I,z){if(z?(n.texParameteri(D,n.TEXTURE_WRAP_S,fe[I.wrapS]),n.texParameteri(D,n.TEXTURE_WRAP_T,fe[I.wrapT]),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,fe[I.wrapR]),n.texParameteri(D,n.TEXTURE_MAG_FILTER,ve[I.magFilter]),n.texParameteri(D,n.TEXTURE_MIN_FILTER,ve[I.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),(I.wrapS!==gi||I.wrapT!==gi)&&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,A(I.magFilter)),n.texParameteri(D,n.TEXTURE_MIN_FILTER,A(I.minFilter)),I.minFilter!==En&&I.minFilter!==jn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),I.compareFunction&&(n.texParameteri(D,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(D,n.TEXTURE_COMPARE_FUNC,Ae[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const he=e.get("EXT_texture_filter_anisotropic");if(I.magFilter===En||I.minFilter!==Vd&&I.minFilter!==go||I.type===ks&&e.has("OES_texture_float_linear")===!1||a===!1&&I.type===oc&&e.has("OES_texture_half_float_linear")===!1)return;(I.anisotropy>1||i.get(I).__currentAnisotropy)&&(n.texParameterf(D,he.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,s.getMaxAnisotropy())),i.get(I).__currentAnisotropy=I.anisotropy)}}function me(D,I){let z=!1;D.__webglInit===void 0&&(D.__webglInit=!0,I.addEventListener("dispose",U));const he=I.source;let X=b.get(he);X===void 0&&(X={},b.set(he,X));const se=Y(I);if(se!==D.__cacheKey){X[se]===void 0&&(X[se]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,z=!0),X[se].usedTimes++;const Re=X[D.__cacheKey];Re!==void 0&&(X[D.__cacheKey].usedTimes--,Re.usedTimes===0&&L(I)),D.__cacheKey=se,D.__webglTexture=X[se].texture}return z}function ee(D,I,z){let he=n.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(he=n.TEXTURE_2D_ARRAY),I.isData3DTexture&&(he=n.TEXTURE_3D);const X=me(D,I),se=I.source;t.bindTexture(he,D.__webglTexture,n.TEXTURE0+z);const Re=i.get(se);if(se.version!==Re.__version||X===!0){t.activeTexture(n.TEXTURE0+z);const xe=Ft.getPrimaries(Ft.workingColorSpace),De=I.colorSpace===Ei?null:Ft.getPrimaries(I.colorSpace),ze=I.colorSpace===Ei||xe===De?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,I.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,I.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,ze);const st=C(I)&&T(I.image)===!1;let ke=y(I.image,st,!1,c);ke=ae(I,ke);const lt=T(ke)||a,je=r.convert(I.format,I.colorSpace);let He=r.convert(I.type),et=R(I.internalFormat,je,He,I.colorSpace,I.isVideoTexture);J(he,I,lt);let Fe;const ut=I.mipmaps,pe=a&&I.isVideoTexture!==!0&&et!==sI,We=Re.__version===void 0||X===!0,Ue=S(I,ke,lt);if(I.isDepthTexture)et=n.DEPTH_COMPONENT,a?I.type===ks?et=n.DEPTH_COMPONENT32F:I.type===br?et=n.DEPTH_COMPONENT24:I.type===lo?et=n.DEPTH24_STENCIL8:et=n.DEPTH_COMPONENT16:I.type===ks&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),I.format===co&&et===n.DEPTH_COMPONENT&&I.type!==XE&&I.type!==br&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),I.type=br,He=r.convert(I.type)),I.format===Aa&&et===n.DEPTH_COMPONENT&&(et=n.DEPTH_STENCIL,I.type!==lo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),I.type=lo,He=r.convert(I.type))),We&&(pe?t.texStorage2D(n.TEXTURE_2D,1,et,ke.width,ke.height):t.texImage2D(n.TEXTURE_2D,0,et,ke.width,ke.height,0,je,He,null));else if(I.isDataTexture)if(ut.length>0&<){pe&&We&&t.texStorage2D(n.TEXTURE_2D,Ue,et,ut[0].width,ut[0].height);for(let Ne=0,Be=ut.length;Ne>=1,Be>>=1}}else if(ut.length>0&<){pe&&We&&t.texStorage2D(n.TEXTURE_2D,Ue,et,ut[0].width,ut[0].height);for(let Ne=0,Be=ut.length;Ne0&&We++,t.texStorage2D(n.TEXTURE_CUBE_MAP,We,Fe,ke[0].width,ke[0].height));for(let Ne=0;Ne<6;Ne++)if(st){ut?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,0,0,ke[Ne].width,ke[Ne].height,He,et,ke[Ne].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,Fe,ke[Ne].width,ke[Ne].height,0,He,et,ke[Ne].data);for(let Be=0;Be>se),ke=Math.max(1,I.height>>se);X===n.TEXTURE_3D||X===n.TEXTURE_2D_ARRAY?t.texImage3D(X,se,De,st,ke,I.depth,0,Re,xe,null):t.texImage2D(X,se,De,st,ke,0,Re,xe,null)}t.bindFramebuffer(n.FRAMEBUFFER,D),_e(I)?f.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,he,X,i.get(z).__webglTexture,0,V(I)):(X===n.TEXTURE_2D||X>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&X<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,he,X,i.get(z).__webglTexture,se),t.bindFramebuffer(n.FRAMEBUFFER,null)}function k(D,I,z){if(n.bindRenderbuffer(n.RENDERBUFFER,D),I.depthBuffer&&!I.stencilBuffer){let he=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(z||_e(I)){const X=I.depthTexture;X&&X.isDepthTexture&&(X.type===ks?he=n.DEPTH_COMPONENT32F:X.type===br&&(he=n.DEPTH_COMPONENT24));const se=V(I);_e(I)?f.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,se,he,I.width,I.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,se,he,I.width,I.height)}else n.renderbufferStorage(n.RENDERBUFFER,he,I.width,I.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,D)}else if(I.depthBuffer&&I.stencilBuffer){const he=V(I);z&&_e(I)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,he,n.DEPTH24_STENCIL8,I.width,I.height):_e(I)?f.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,he,n.DEPTH24_STENCIL8,I.width,I.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,I.width,I.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,D)}else{const he=I.isWebGLMultipleRenderTargets===!0?I.texture:[I.texture];for(let X=0;X0){z.__webglFramebuffer[xe]=[];for(let De=0;De0){z.__webglFramebuffer=[];for(let xe=0;xe0&&_e(D)===!1){const xe=se?I:[I];z.__webglMultisampledFramebuffer=n.createFramebuffer(),z.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,z.__webglMultisampledFramebuffer);for(let De=0;De0)for(let De=0;De0)for(let De=0;De0&&_e(D)===!1){const I=D.isWebGLMultipleRenderTargets?D.texture:[D.texture],z=D.width,he=D.height;let X=n.COLOR_BUFFER_BIT;const se=[],Re=D.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,xe=i.get(D),De=D.isWebGLMultipleRenderTargets===!0;if(De)for(let ze=0;ze0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function ie(D){const I=o.render.frame;h.get(D)!==I&&(h.set(D,I),D.update())}function ae(D,I){const z=D.colorSpace,he=D.format,X=D.type;return D.isCompressedTexture===!0||D.isVideoTexture===!0||D.format===hb||z!==Nn&&z!==Ei&&(Ft.getTransfer(z)===Xt?a===!1?e.has("EXT_sRGB")===!0&&he===bi?(D.format=hb,D.minFilter=jn,D.generateMipmaps=!1):I=cI.sRGBToLinear(I):(he!==bi||X!==xr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",z)),I}this.allocateTextureUnit=j,this.resetTextureUnits=P,this.setTexture2D=Q,this.setTexture2DArray=re,this.setTexture3D=te,this.setTextureCube=Z,this.rebindTextures=ce,this.setupRenderTarget=ne,this.updateRenderTargetMipmap=Ce,this.updateMultisampleRenderTarget=we,this.setupDepthRenderbuffer=$,this.setupFrameBufferTexture=Oe,this.useMultisampledRTT=_e}function Qwt(n,e,t){const i=t.isWebGL2;function s(r,o=Ei){let a;const l=Ft.getTransfer(o);if(r===xr)return n.UNSIGNED_BYTE;if(r===JO)return n.UNSIGNED_SHORT_4_4_4_4;if(r===eI)return n.UNSIGNED_SHORT_5_5_5_1;if(r===gxt)return n.BYTE;if(r===bxt)return n.SHORT;if(r===XE)return n.UNSIGNED_SHORT;if(r===ZO)return n.INT;if(r===br)return n.UNSIGNED_INT;if(r===ks)return n.FLOAT;if(r===oc)return i?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===Ext)return n.ALPHA;if(r===bi)return n.RGBA;if(r===vxt)return n.LUMINANCE;if(r===yxt)return n.LUMINANCE_ALPHA;if(r===co)return n.DEPTH_COMPONENT;if(r===Aa)return n.DEPTH_STENCIL;if(r===hb)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===Sxt)return n.RED;if(r===tI)return n.RED_INTEGER;if(r===Txt)return n.RG;if(r===nI)return n.RG_INTEGER;if(r===iI)return n.RGBA_INTEGER;if(r===Bm||r===Gm||r===zm||r===Vm)if(l===Xt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Bm)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===Gm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===zm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Vm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Bm)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Gm)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===zm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Vm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===QC||r===XC||r===ZC||r===JC)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===QC)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===XC)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===ZC)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===JC)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===sI)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===e1||r===t1)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===e1)return l===Xt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===t1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===n1||r===i1||r===s1||r===r1||r===o1||r===a1||r===l1||r===c1||r===d1||r===u1||r===p1||r===_1||r===h1||r===f1)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===n1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===i1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===s1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===r1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===o1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===a1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===l1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===c1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===d1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===u1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===p1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===_1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===h1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===f1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Hm||r===m1||r===g1)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===Hm)return l===Xt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===m1)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===g1)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===xxt||r===b1||r===E1||r===v1)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===Hm)return a.COMPRESSED_RED_RGTC1_EXT;if(r===b1)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===E1)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===v1)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===lo?i?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[r]!==void 0?n[r]:null}return{convert:s}}class Xwt extends Vn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class io extends sn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Zwt={type:"move"};class _g{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new io,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 io,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new be,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new be),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new io,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new be,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new be),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 i of e.hand.values())this._getHandJoint(t,i)}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,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,d=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(d&&e.hand){o=!0;for(const E of e.hand.values()){const b=t.getJointPose(E,i),g=this._getHandJoint(d,E);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 c=d.joints["index-finger-tip"],_=d.joints["thumb-tip"],f=c.position.distanceTo(_.position),m=.02,h=.005;d.inputState.pinching&&f>m+h?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!d.inputState.pinching&&f<=m-h&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(s=t.getPose(e.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Zwt)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),d!==null&&(d.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new io;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class Jwt extends ja{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,d=null,c=null,_=null,f=null,m=null,h=null;const E=t.getContextAttributes();let b=null,g=null;const v=[],y=[],T=new It;let C=null;const x=new Vn;x.layers.enable(1),x.viewport=new Wt;const O=new Vn;O.layers.enable(2),O.viewport=new Wt;const R=[x,O],S=new Xwt;S.layers.enable(1),S.layers.enable(2);let A=null,U=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Z){let fe=v[Z];return fe===void 0&&(fe=new _g,v[Z]=fe),fe.getTargetRaySpace()},this.getControllerGrip=function(Z){let fe=v[Z];return fe===void 0&&(fe=new _g,v[Z]=fe),fe.getGripSpace()},this.getHand=function(Z){let fe=v[Z];return fe===void 0&&(fe=new _g,v[Z]=fe),fe.getHandSpace()};function F(Z){const fe=y.indexOf(Z.inputSource);if(fe===-1)return;const ve=v[fe];ve!==void 0&&(ve.update(Z.inputSource,Z.frame,d||o),ve.dispatchEvent({type:Z.type,data:Z.inputSource}))}function K(){s.removeEventListener("select",F),s.removeEventListener("selectstart",F),s.removeEventListener("selectend",F),s.removeEventListener("squeeze",F),s.removeEventListener("squeezestart",F),s.removeEventListener("squeezeend",F),s.removeEventListener("end",K),s.removeEventListener("inputsourceschange",L);for(let Z=0;Z=0&&(y[Ae]=null,v[Ae].disconnect(ve))}for(let fe=0;fe=y.length){y.push(ve),Ae=me;break}else if(y[me]===null){y[me]=ve,Ae=me;break}if(Ae===-1)break}const J=v[Ae];J&&J.connect(ve)}}const H=new be,G=new be;function P(Z,fe,ve){H.setFromMatrixPosition(fe.matrixWorld),G.setFromMatrixPosition(ve.matrixWorld);const Ae=H.distanceTo(G),J=fe.projectionMatrix.elements,me=ve.projectionMatrix.elements,ee=J[14]/(J[10]-1),Se=J[14]/(J[10]+1),Oe=(J[9]+1)/J[5],k=(J[9]-1)/J[5],B=(J[8]-1)/J[0],$=(me[8]+1)/me[0],ce=ee*B,ne=ee*$,Ce=Ae/(-B+$),we=Ce*-B;fe.matrixWorld.decompose(Z.position,Z.quaternion,Z.scale),Z.translateX(we),Z.translateZ(Ce),Z.matrixWorld.compose(Z.position,Z.quaternion,Z.scale),Z.matrixWorldInverse.copy(Z.matrixWorld).invert();const V=ee+Ce,_e=Se+Ce,ie=ce-we,ae=ne+(Ae-we),D=Oe*Se/_e*V,I=k*Se/_e*V;Z.projectionMatrix.makePerspective(ie,ae,D,I,V,_e),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert()}function j(Z,fe){fe===null?Z.matrixWorld.copy(Z.matrix):Z.matrixWorld.multiplyMatrices(fe.matrixWorld,Z.matrix),Z.matrixWorldInverse.copy(Z.matrixWorld).invert()}this.updateCamera=function(Z){if(s===null)return;S.near=O.near=x.near=Z.near,S.far=O.far=x.far=Z.far,(A!==S.near||U!==S.far)&&(s.updateRenderState({depthNear:S.near,depthFar:S.far}),A=S.near,U=S.far);const fe=Z.parent,ve=S.cameras;j(S,fe);for(let Ae=0;Ae0&&(b.alphaTest.value=g.alphaTest);const v=e.get(g).envMap;if(v&&(b.envMap.value=v,b.flipEnvMap.value=v.isCubeTexture&&v.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 y=n._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=g.lightMapIntensity*y,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 l(b,g,v,y){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,b.size.value=g.size*v,b.scale.value=y*.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 c(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 f(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 m(b,g,v){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=v.texture,b.transmissionSamplerSize.value.set(v.width,v.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 h(b,g){g.matcap&&(b.matcap.value=g.matcap)}function E(b,g){const v=e.get(g).light;b.referencePosition.value.setFromMatrixPosition(v.matrixWorld),b.nearDistance.value=v.shadow.camera.near,b.farDistance.value=v.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function tNt(n,e,t,i){let s={},r={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(v,y){const T=y.program;i.uniformBlockBinding(v,T)}function d(v,y){let T=s[v.id];T===void 0&&(h(v),T=c(v),s[v.id]=T,v.addEventListener("dispose",b));const C=y.program;i.updateUBOMapping(v,C);const x=e.render.frame;r[v.id]!==x&&(f(v),r[v.id]=x)}function c(v){const y=_();v.__bindingPointIndex=y;const T=n.createBuffer(),C=v.__size,x=v.usage;return n.bindBuffer(n.UNIFORM_BUFFER,T),n.bufferData(n.UNIFORM_BUFFER,C,x),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,y,T),T}function _(){for(let v=0;v0){x=T%C;const F=C-x;x!==0&&F-A.boundary<0&&(T+=C-x,S.__offset=T)}T+=A.storage}return x=T%C,x>0&&(T+=C-x),v.__size=T,v.__cache={},this}function E(v){const y={boundary:0,storage:0};return typeof v=="number"?(y.boundary=4,y.storage=4):v.isVector2?(y.boundary=8,y.storage=8):v.isVector3||v.isColor?(y.boundary=16,y.storage=12):v.isVector4?(y.boundary=16,y.storage=16):v.isMatrix3?(y.boundary=48,y.storage=48):v.isMatrix4?(y.boundary=64,y.storage=64):v.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",v),y}function b(v){const y=v.target;y.removeEventListener("dispose",b);const T=o.indexOf(y.__bindingPointIndex);o.splice(T,1),n.deleteBuffer(s[y.id]),delete s[y.id],delete r[y.id]}function g(){for(const v in s)n.deleteBuffer(s[v]);o=[],s={},r={}}return{bind:l,update:d,dispose:g}}class RI{constructor(e={}){const{canvas:t=Zxt(),context:i=null,depth:s=!0,stencil:r=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:d=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:_=!1}=e;this.isWebGLRenderer=!0;let f;i!==null?f=i.getContextAttributes().alpha:f=o;const m=new Uint32Array(4),h=new Int32Array(4);let E=null,b=null;const g=[],v=[];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=rn,this._useLegacyLights=!1,this.toneMapping=Tr,this.toneMappingExposure=1;const y=this;let T=!1,C=0,x=0,O=null,R=-1,S=null;const A=new Wt,U=new Wt;let F=null;const K=new gt(0);let L=0,H=t.width,G=t.height,P=1,j=null,Y=null;const Q=new Wt(0,0,H,G),re=new Wt(0,0,H,G);let te=!1;const Z=new tv;let fe=!1,ve=!1,Ae=null;const J=new At,me=new It,ee=new be,Se={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Oe(){return O===null?P:1}let k=i;function B(N,W){for(let oe=0;oe{function Ge(){if(ye.forEach(function(Qe){we.get(Qe).currentProgram.isReady()&&ye.delete(Qe)}),ye.size===0){Ee(N);return}setTimeout(Ge,10)}$.get("KHR_parallel_shader_compile")!==null?Ge():setTimeout(Ge,10)})};let Et=null;function jt(N){Et&&Et(N)}function ln(){$t.stop()}function Ct(){$t.start()}const $t=new EI;$t.setAnimationLoop(jt),typeof self<"u"&&$t.setContext(self),this.setAnimationLoop=function(N){Et=N,Fe.setAnimationLoop(N),N===null?$t.stop():$t.start()},Fe.addEventListener("sessionstart",ln),Fe.addEventListener("sessionend",Ct),this.render=function(N,W){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;N.matrixWorldAutoUpdate===!0&&N.updateMatrixWorld(),W.parent===null&&W.matrixWorldAutoUpdate===!0&&W.updateMatrixWorld(),Fe.enabled===!0&&Fe.isPresenting===!0&&(Fe.cameraAutoUpdate===!0&&Fe.updateCamera(W),W=Fe.getCamera()),N.isScene===!0&&N.onBeforeRender(y,N,W,O),b=se.get(N,v.length),b.init(),v.push(b),J.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Z.setFromProjectionMatrix(J),ve=this.localClippingEnabled,fe=Re.init(this.clippingPlanes,ve),E=X.get(N,g.length),E.init(),g.push(E),yn(N,W,0,y.sortObjects),E.finish(),y.sortObjects===!0&&E.sort(j,Y),this.info.render.frame++,fe===!0&&Re.beginShadows();const oe=b.state.shadowsArray;if(xe.render(oe,N,W),fe===!0&&Re.endShadows(),this.info.autoReset===!0&&this.info.reset(),De.render(E,N),b.setupLights(y._useLegacyLights),W.isArrayCamera){const ye=W.cameras;for(let Ee=0,Ge=ye.length;Ee0?b=v[v.length-1]:b=null,g.pop(),g.length>0?E=g[g.length-1]:E=null};function yn(N,W,oe,ye){if(N.visible===!1)return;if(N.layers.test(W.layers)){if(N.isGroup)oe=N.renderOrder;else if(N.isLOD)N.autoUpdate===!0&&N.update(W);else if(N.isLight)b.pushLight(N),N.castShadow&&b.pushShadow(N);else if(N.isSprite){if(!N.frustumCulled||Z.intersectsSprite(N)){ye&&ee.setFromMatrixPosition(N.matrixWorld).applyMatrix4(J);const Qe=I.update(N),nt=N.material;nt.visible&&E.push(N,Qe,nt,oe,ee.z,null)}}else if((N.isMesh||N.isLine||N.isPoints)&&(!N.frustumCulled||Z.intersectsObject(N))){const Qe=I.update(N),nt=N.material;if(ye&&(N.boundingSphere!==void 0?(N.boundingSphere===null&&N.computeBoundingSphere(),ee.copy(N.boundingSphere.center)):(Qe.boundingSphere===null&&Qe.computeBoundingSphere(),ee.copy(Qe.boundingSphere.center)),ee.applyMatrix4(N.matrixWorld).applyMatrix4(J)),Array.isArray(nt)){const at=Qe.groups;for(let rt=0,pt=at.length;rt0&&kr(Ee,Ge,W,oe),ye&&ne.viewport(A.copy(ye)),Ee.length>0&&ci(Ee,W,oe),Ge.length>0&&ci(Ge,W,oe),Qe.length>0&&ci(Qe,W,oe),ne.buffers.depth.setTest(!0),ne.buffers.depth.setMask(!0),ne.buffers.color.setMask(!0),ne.setPolygonOffset(!1)}function kr(N,W,oe,ye){if((oe.isScene===!0?oe.overrideMaterial:null)!==null)return;const Ge=ce.isWebGL2;Ae===null&&(Ae=new bo(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")?oc:xr,minFilter:go,samples:Ge?4:0})),y.getDrawingBufferSize(me),Ge?Ae.setSize(me.x,me.y):Ae.setSize(Su(me.x),Su(me.y));const Qe=y.getRenderTarget();y.setRenderTarget(Ae),y.getClearColor(K),L=y.getClearAlpha(),L<1&&y.setClearColor(16777215,.5),y.clear();const nt=y.toneMapping;y.toneMapping=Tr,ci(N,oe,ye),V.updateMultisampleRenderTarget(Ae),V.updateRenderTargetMipmap(Ae);let at=!1;for(let rt=0,pt=W.length;rt0),ht=!!oe.morphAttributes.position,Kt=!!oe.morphAttributes.normal,Tn=!!oe.morphAttributes.color;let nn=Tr;ye.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(nn=y.toneMapping);const On=oe.morphAttributes.position||oe.morphAttributes.normal||oe.morphAttributes.color,Qt=On!==void 0?On.length:0,St=we.get(ye),tl=b.state.lights;if(fe===!0&&(ve===!0||N!==S)){const Wn=N===S&&ye.id===R;Re.setState(ye,N,Wn)}let en=!1;ye.version===St.__version?(St.needsLights&&St.lightsStateVersion!==tl.state.version||St.outputColorSpace!==nt||Ee.isBatchedMesh&&St.batching===!1||!Ee.isBatchedMesh&&St.batching===!0||Ee.isInstancedMesh&&St.instancing===!1||!Ee.isInstancedMesh&&St.instancing===!0||Ee.isSkinnedMesh&&St.skinning===!1||!Ee.isSkinnedMesh&&St.skinning===!0||Ee.isInstancedMesh&&St.instancingColor===!0&&Ee.instanceColor===null||Ee.isInstancedMesh&&St.instancingColor===!1&&Ee.instanceColor!==null||St.envMap!==at||ye.fog===!0&&St.fog!==Ge||St.numClippingPlanes!==void 0&&(St.numClippingPlanes!==Re.numPlanes||St.numIntersection!==Re.numIntersection)||St.vertexAlphas!==rt||St.vertexTangents!==pt||St.morphTargets!==ht||St.morphNormals!==Kt||St.morphColors!==Tn||St.toneMapping!==nn||ce.isWebGL2===!0&&St.morphTargetsCount!==Qt)&&(en=!0):(en=!0,St.__version=ye.version);let ys=St.currentProgram;en===!0&&(ys=di(ye,W,Ee));let Ac=!1,Lr=!1,nl=!1;const gn=ys.getUniforms(),Ss=St.uniforms;if(ne.useProgram(ys.program)&&(Ac=!0,Lr=!0,nl=!0),ye.id!==R&&(R=ye.id,Lr=!0),Ac||S!==N){gn.setValue(k,"projectionMatrix",N.projectionMatrix),gn.setValue(k,"viewMatrix",N.matrixWorldInverse);const Wn=gn.map.cameraPosition;Wn!==void 0&&Wn.setValue(k,ee.setFromMatrixPosition(N.matrixWorld)),ce.logarithmicDepthBuffer&&gn.setValue(k,"logDepthBufFC",2/(Math.log(N.far+1)/Math.LN2)),(ye.isMeshPhongMaterial||ye.isMeshToonMaterial||ye.isMeshLambertMaterial||ye.isMeshBasicMaterial||ye.isMeshStandardMaterial||ye.isShaderMaterial)&&gn.setValue(k,"isOrthographic",N.isOrthographicCamera===!0),S!==N&&(S=N,Lr=!0,nl=!0)}if(Ee.isSkinnedMesh){gn.setOptional(k,Ee,"bindMatrix"),gn.setOptional(k,Ee,"bindMatrixInverse");const Wn=Ee.skeleton;Wn&&(ce.floatVertexTextures?(Wn.boneTexture===null&&Wn.computeBoneTexture(),gn.setValue(k,"boneTexture",Wn.boneTexture,V)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}Ee.isBatchedMesh&&(gn.setOptional(k,Ee,"batchingTexture"),gn.setValue(k,"batchingTexture",Ee._matricesTexture,V));const il=oe.morphAttributes;if((il.position!==void 0||il.normal!==void 0||il.color!==void 0&&ce.isWebGL2===!0)&&ze.update(Ee,oe,ys),(Lr||St.receiveShadow!==Ee.receiveShadow)&&(St.receiveShadow=Ee.receiveShadow,gn.setValue(k,"receiveShadow",Ee.receiveShadow)),ye.isMeshGouraudMaterial&&ye.envMap!==null&&(Ss.envMap.value=at,Ss.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),Lr&&(gn.setValue(k,"toneMappingExposure",y.toneMappingExposure),St.needsLights&&vs(Ss,nl),Ge&&ye.fog===!0&&he.refreshFogUniforms(Ss,Ge),he.refreshMaterialUniforms(Ss,ye,P,G,Ae),Hd.upload(k,Ki(St),Ss,V)),ye.isShaderMaterial&&ye.uniformsNeedUpdate===!0&&(Hd.upload(k,Ki(St),Ss,V),ye.uniformsNeedUpdate=!1),ye.isSpriteMaterial&&gn.setValue(k,"center",Ee.center),gn.setValue(k,"modelViewMatrix",Ee.modelViewMatrix),gn.setValue(k,"normalMatrix",Ee.normalMatrix),gn.setValue(k,"modelMatrix",Ee.matrixWorld),ye.isShaderMaterial||ye.isRawShaderMaterial){const Wn=ye.uniformsGroups;for(let sl=0,Ep=Wn.length;sl0&&V.useMultisampledRTT(N)===!1?Ee=we.get(N).__webglMultisampledFramebuffer:Array.isArray(pt)?Ee=pt[oe]:Ee=pt,A.copy(N.viewport),U.copy(N.scissor),F=N.scissorTest}else A.copy(Q).multiplyScalar(P).floor(),U.copy(re).multiplyScalar(P).floor(),F=te;if(ne.bindFramebuffer(k.FRAMEBUFFER,Ee)&&ce.drawBuffers&&ye&&ne.drawBuffers(N,Ee),ne.viewport(A),ne.scissor(U),ne.setScissorTest(F),Ge){const at=we.get(N.texture);k.framebufferTexture2D(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,k.TEXTURE_CUBE_MAP_POSITIVE_X+W,at.__webglTexture,oe)}else if(Qe){const at=we.get(N.texture),rt=W||0;k.framebufferTextureLayer(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,at.__webglTexture,oe||0,rt)}R=-1},this.readRenderTargetPixels=function(N,W,oe,ye,Ee,Ge,Qe){if(!(N&&N.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let nt=we.get(N).__webglFramebuffer;if(N.isWebGLCubeRenderTarget&&Qe!==void 0&&(nt=nt[Qe]),nt){ne.bindFramebuffer(k.FRAMEBUFFER,nt);try{const at=N.texture,rt=at.format,pt=at.type;if(rt!==bi&<.convert(rt)!==k.getParameter(k.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ht=pt===oc&&($.has("EXT_color_buffer_half_float")||ce.isWebGL2&&$.has("EXT_color_buffer_float"));if(pt!==xr&<.convert(pt)!==k.getParameter(k.IMPLEMENTATION_COLOR_READ_TYPE)&&!(pt===ks&&(ce.isWebGL2||$.has("OES_texture_float")||$.has("WEBGL_color_buffer_float")))&&!ht){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}W>=0&&W<=N.width-ye&&oe>=0&&oe<=N.height-Ee&&k.readPixels(W,oe,ye,Ee,lt.convert(rt),lt.convert(pt),Ge)}finally{const at=O!==null?we.get(O).__webglFramebuffer:null;ne.bindFramebuffer(k.FRAMEBUFFER,at)}}},this.copyFramebufferToTexture=function(N,W,oe=0){const ye=Math.pow(2,-oe),Ee=Math.floor(W.image.width*ye),Ge=Math.floor(W.image.height*ye);V.setTexture2D(W,0),k.copyTexSubImage2D(k.TEXTURE_2D,oe,0,0,N.x,N.y,Ee,Ge),ne.unbindTexture()},this.copyTextureToTexture=function(N,W,oe,ye=0){const Ee=W.image.width,Ge=W.image.height,Qe=lt.convert(oe.format),nt=lt.convert(oe.type);V.setTexture2D(oe,0),k.pixelStorei(k.UNPACK_FLIP_Y_WEBGL,oe.flipY),k.pixelStorei(k.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),k.pixelStorei(k.UNPACK_ALIGNMENT,oe.unpackAlignment),W.isDataTexture?k.texSubImage2D(k.TEXTURE_2D,ye,N.x,N.y,Ee,Ge,Qe,nt,W.image.data):W.isCompressedTexture?k.compressedTexSubImage2D(k.TEXTURE_2D,ye,N.x,N.y,W.mipmaps[0].width,W.mipmaps[0].height,Qe,W.mipmaps[0].data):k.texSubImage2D(k.TEXTURE_2D,ye,N.x,N.y,Qe,nt,W.image),ye===0&&oe.generateMipmaps&&k.generateMipmap(k.TEXTURE_2D),ne.unbindTexture()},this.copyTextureToTexture3D=function(N,W,oe,ye,Ee=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ge=N.max.x-N.min.x+1,Qe=N.max.y-N.min.y+1,nt=N.max.z-N.min.z+1,at=lt.convert(ye.format),rt=lt.convert(ye.type);let pt;if(ye.isData3DTexture)V.setTexture3D(ye,0),pt=k.TEXTURE_3D;else if(ye.isDataArrayTexture)V.setTexture2DArray(ye,0),pt=k.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}k.pixelStorei(k.UNPACK_FLIP_Y_WEBGL,ye.flipY),k.pixelStorei(k.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ye.premultiplyAlpha),k.pixelStorei(k.UNPACK_ALIGNMENT,ye.unpackAlignment);const ht=k.getParameter(k.UNPACK_ROW_LENGTH),Kt=k.getParameter(k.UNPACK_IMAGE_HEIGHT),Tn=k.getParameter(k.UNPACK_SKIP_PIXELS),nn=k.getParameter(k.UNPACK_SKIP_ROWS),On=k.getParameter(k.UNPACK_SKIP_IMAGES),Qt=oe.isCompressedTexture?oe.mipmaps[0]:oe.image;k.pixelStorei(k.UNPACK_ROW_LENGTH,Qt.width),k.pixelStorei(k.UNPACK_IMAGE_HEIGHT,Qt.height),k.pixelStorei(k.UNPACK_SKIP_PIXELS,N.min.x),k.pixelStorei(k.UNPACK_SKIP_ROWS,N.min.y),k.pixelStorei(k.UNPACK_SKIP_IMAGES,N.min.z),oe.isDataTexture||oe.isData3DTexture?k.texSubImage3D(pt,Ee,W.x,W.y,W.z,Ge,Qe,nt,at,rt,Qt.data):oe.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),k.compressedTexSubImage3D(pt,Ee,W.x,W.y,W.z,Ge,Qe,nt,at,Qt.data)):k.texSubImage3D(pt,Ee,W.x,W.y,W.z,Ge,Qe,nt,at,rt,Qt),k.pixelStorei(k.UNPACK_ROW_LENGTH,ht),k.pixelStorei(k.UNPACK_IMAGE_HEIGHT,Kt),k.pixelStorei(k.UNPACK_SKIP_PIXELS,Tn),k.pixelStorei(k.UNPACK_SKIP_ROWS,nn),k.pixelStorei(k.UNPACK_SKIP_IMAGES,On),Ee===0&&ye.generateMipmaps&&k.generateMipmap(pt),ne.unbindTexture()},this.initTexture=function(N){N.isCubeTexture?V.setTextureCube(N,0):N.isData3DTexture?V.setTexture3D(N,0):N.isDataArrayTexture||N.isCompressedArrayTexture?V.setTexture2DArray(N,0):V.setTexture2D(N,0),ne.unbindTexture()},this.resetState=function(){C=0,x=0,O=null,ne.reset(),je.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ls}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===JE?"display-p3":"srgb",t.unpackColorSpace=Ft.workingColorSpace===pp?"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===rn?uo:oI}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===uo?rn:Nn}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 nNt extends RI{}nNt.prototype.isWebGL1Renderer=!0;class iNt extends sn{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 sNt{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=_b,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=zi()}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,i){e*=this.stride,i*=t.stride;for(let s=0,r=this.stride;sl)continue;f.applyMatrix4(this.matrixWorld);const R=e.ray.origin.distanceTo(f);Re.far||t.push({distance:R,point:_.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),v=Math.min(b.count,o.start+o.count);for(let y=g,T=v-1;yl)continue;f.applyMatrix4(this.matrixWorld);const x=e.ray.origin.distanceTo(f);xe.far||t.push({distance:x,point:_.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:d,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class lv extends Vi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new gt(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 gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ZE,this.normalScale=new It(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 js extends lv{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 It(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return kn(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 gt(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 gt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new gt(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 RR extends Vi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new gt(16777215),this.specular=new gt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ZE,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=QE,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 Rd(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 hNt(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function fNt(n){function e(s,r){return n[s]-n[r]}const t=n.length,i=new Array(t);for(let s=0;s!==t;++s)i[s]=s;return i.sort(e),i}function AR(n,e,t){const i=n.length,s=new n.constructor(i);for(let r=0,o=0;o!==i;++r){const a=t[r]*e;for(let l=0;l!==e;++l)s[o++]=n[a+l]}return s}function OI(n,e,t,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let o=r[i];if(o!==void 0)if(Array.isArray(o))do o=r[i],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=n[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),t.push(o)),r=n[s++];while(r!==void 0)}class xc{constructor(e,t,i,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,s=t[i],r=t[i-1];e:{t:{let o;n:{i:if(!(e=r)){const a=t[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=i.slice(r,o),this.values=this.values.slice(r*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 i=this.times,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(s!==void 0&&hNt(s))for(let a=0,l=s.length;a!==l;++a){const d=s[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(),i=this.getValueSize(),s=this.getInterpolation()===qm,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,d=0;d!==i;++d)t[l+d]=t[a+d];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,s=new i(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}ms.prototype.TimeBufferType=Float32Array;ms.prototype.ValueBufferType=Float32Array;ms.prototype.DefaultInterpolation=wa;class Xa extends ms{}Xa.prototype.ValueTypeName="bool";Xa.prototype.ValueBufferType=Array;Xa.prototype.DefaultInterpolation=ac;Xa.prototype.InterpolantFactoryMethodLinear=void 0;Xa.prototype.InterpolantFactoryMethodSmooth=void 0;class II extends ms{}II.prototype.ValueTypeName="color";class Ia extends ms{}Ia.prototype.ValueTypeName="number";class ENt extends xc{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(s-t);let d=e*a;for(let c=d+a;d!==c;d+=4)Dr.slerpFlat(r,0,o,d-a,o,d,l);return r}}class vo extends ms{InterpolantFactoryMethodLinear(e){return new ENt(this.times,this.values,this.getValueSize(),e)}}vo.prototype.ValueTypeName="quaternion";vo.prototype.DefaultInterpolation=wa;vo.prototype.InterpolantFactoryMethodSmooth=void 0;class Za extends ms{}Za.prototype.ValueTypeName="string";Za.prototype.ValueBufferType=Array;Za.prototype.DefaultInterpolation=ac;Za.prototype.InterpolantFactoryMethodLinear=void 0;Za.prototype.InterpolantFactoryMethodSmooth=void 0;class Ma extends ms{}Ma.prototype.ValueTypeName="vector";class vNt{constructor(e,t=-1,i,s=Cxt){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=zi(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(SNt(i[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)t.push(ms.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a1){const _=c[1];let f=s[_];f||(s[_]=f=[]),f.push(d)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(_,f,m,h,E){if(m.length!==0){const b=[],g=[];OI(m,b,g,h),b.length!==0&&E.push(new _(f,b,g))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const d=e.hierarchy||[];for(let _=0;_{t&&t(r),this.manager.itemEnd(e)},0),r;if(Ns[e]!==void 0){Ns[e].push({onLoad:t,onProgress:i,onError:s});return}Ns[e]=[],Ns[e].push({onLoad:t,onProgress:i,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=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 c=Ns[e],_=d.body.getReader(),f=d.headers.get("Content-Length")||d.headers.get("X-File-Size"),m=f?parseInt(f):0,h=m!==0;let E=0;const b=new ReadableStream({start(g){v();function v(){_.read().then(({done:y,value:T})=>{if(y)g.close();else{E+=T.byteLength;const C=new ProgressEvent("progress",{lengthComputable:h,loaded:E,total:m});for(let x=0,O=c.length;x{switch(l){case"arraybuffer":return d.arrayBuffer();case"blob":return d.blob();case"document":return d.text().then(c=>new DOMParser().parseFromString(c,a));case"json":return d.json();default:if(a===void 0)return d.text();{const _=/charset="?([^;"\s]*)"?/i.exec(a),f=_&&_[1]?_[1].toLowerCase():void 0,m=new TextDecoder(f);return d.arrayBuffer().then(h=>m.decode(h))}}}).then(d=>{Da.add(e,d);const c=Ns[e];delete Ns[e];for(let _=0,f=c.length;_{const c=Ns[e];if(c===void 0)throw this.manager.itemError(e),d;delete Ns[e];for(let _=0,f=c.length;_{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class RNt extends Ja{constructor(e){super(e)}load(e,t,i,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Da.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a=lc("img");function l(){c(),Da.add(e,this),t&&t(this),r.manager.itemEnd(e)}function d(_){c(),s&&s(_),r.manager.itemError(e),r.manager.itemEnd(e)}function c(){a.removeEventListener("load",l,!1),a.removeEventListener("error",d,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",d,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class DI extends Ja{constructor(e){super(e)}load(e,t,i,s){const r=new wn,o=new RNt(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,t!==void 0&&t(r)},i,s),r}}class mp extends sn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new gt(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 gg=new At,wR=new be,NR=new be;class cv{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new It(512,512),this.map=null,this.mapPass=null,this.matrix=new At,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new tv,this._frameExtents=new It(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,i=this.matrix;wR.setFromMatrixPosition(e.matrixWorld),t.position.copy(wR),NR.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(NR),t.updateMatrixWorld(),gg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(gg),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(gg)}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 ANt extends cv{constructor(){super(new Vn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=Na*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(i!==t.fov||s!==t.aspect||r!==t.far)&&(t.fov=i,t.aspect=s,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class wNt extends mp{constructor(e,t,i=0,s=Math.PI/3,r=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(sn.DEFAULT_UP),this.updateMatrix(),this.target=new sn,this.distance=i,this.angle=s,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new ANt}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 OR=new At,Sl=new be,bg=new be;class NNt extends cv{constructor(){super(new Vn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new It(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 be(1,0,0),new be(-1,0,0),new be(0,0,1),new be(0,0,-1),new be(0,1,0),new be(0,-1,0)],this._cubeUps=[new be(0,1,0),new be(0,1,0),new be(0,1,0),new be(0,1,0),new be(0,0,1),new be(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,s=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),Sl.setFromMatrixPosition(e.matrixWorld),i.position.copy(Sl),bg.copy(i.position),bg.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(bg),i.updateMatrixWorld(),s.makeTranslation(-Sl.x,-Sl.y,-Sl.z),OR.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(OR)}}class ONt extends mp{constructor(e,t,i=0,s=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=s,this.shadow=new NNt}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 INt extends cv{constructor(){super(new iv(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class kI extends mp{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(sn.DEFAULT_UP),this.updateMatrix(),this.target=new sn,this.shadow=new INt}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class MNt extends mp{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class zl{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,s=e.length;i"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,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Da.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){Da.add(e,l),t&&t(l),r.manager.itemEnd(e)}).catch(function(l){s&&s(l),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}const dv="\\[\\]\\.:\\/",kNt=new RegExp("["+dv+"]","g"),uv="[^"+dv+"]",LNt="[^"+dv.replace("\\.","")+"]",PNt=/((?:WC+[\/:])*)/.source.replace("WC",uv),UNt=/(WCOD+)?/.source.replace("WCOD",LNt),FNt=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",uv),BNt=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",uv),GNt=new RegExp("^"+PNt+UNt+FNt+BNt+"$"),zNt=["material","materials","bones","map"];class VNt{constructor(e,t,i){const s=i||Gt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Gt{constructor(e,t,i){this.path=t,this.parsedPath=i||Gt.parseTrackName(t),this.node=Gt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Gt.Composite(e,t,i):new Gt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(kNt,"")}static parseTrackName(e){const t=GNt.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);zNt.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=2.0 are supported."));return}const d=new yOt(r,{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 c=0;c=0&&a[_]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+_+'".')}}d.setExtensions(o),d.setPlugins(a),d.parse(i,s)}parseAsync(e,t){const i=this;return new Promise(function(s,r){i.parse(e,t,s,r)})}}function qNt(){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 Ot={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 YNt{constructor(e){this.parser=e,this.name=Ot.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,s=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}}class sOt{constructor(e){this.parser=e,this.name=Ot.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let l=i.textureLoader;if(a.uri){const d=i.options.manager.getHandler(a.uri);d!==null&&(l=d)}return this.detectSupport().then(function(d){if(d)return i.loadTextureImage(e,o.source,l);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.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 rOt{constructor(e){this.parser=e,this.name=Ot.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let l=i.textureLoader;if(a.uri){const d=i.options.manager.getHandler(a.uri);d!==null&&(l=d)}return this.detectSupport().then(function(d){if(d)return i.loadTextureImage(e,o.source,l);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.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 oOt{constructor(e){this.name=Ot.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const s=i.extensions[this.name],r=this.parser.getDependency("buffer",s.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 r.then(function(a){const l=s.byteOffset||0,d=s.byteLength||0,c=s.count,_=s.byteStride,f=new Uint8Array(a,l,d);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(c,_,f,s.mode,s.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(c*_);return o.decodeGltfBuffer(new Uint8Array(m),c,_,f,s.mode,s.filter),m})})}else return null}}class aOt{constructor(e){this.name=Ot.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const s=t.meshes[i.mesh];for(const d of s.primitives)if(d.mode!==fi.TRIANGLES&&d.mode!==fi.TRIANGLE_STRIP&&d.mode!==fi.TRIANGLE_FAN&&d.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const d in o)a.push(this.parser.getDependency("accessor",o[d]).then(c=>(l[d]=c,l[d])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(d=>{const c=d.pop(),_=c.isGroup?c.children:[c],f=d[0].count,m=[];for(const h of _){const E=new At,b=new be,g=new Dr,v=new be(1,1,1),y=new dNt(h.geometry,h.material,f);for(let T=0;T0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const vOt=new At;class yOt{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new qNt,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 i=!1,s=!1,r=-1;typeof navigator<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,s=navigator.userAgent.indexOf("Firefox")>-1,r=s?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||s&&r<98?this.textureLoader=new DI(this.options.manager):this.textureLoader=new DNt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new MI(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 i=this,s=this.json,r=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([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][s.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:s.asset,parser:i,userData:{}};return qr(r,a,s),fr(a,s),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let s=0,r=t.length;s{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[d,c]of o.children.entries())r(c,a.children[d])};return r(i,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&b.setY(S,x[O*l+1]),l>=3&&b.setZ(S,x[O*l+2]),l>=4&&b.setW(S,x[O*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e].source,o=t.images[r];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,i){const s=this,r=this.json,o=r.textures[e],a=r.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const d=this.loadImageSource(t,i).then(function(c){c.flipY=!1,c.name=o.name||a.name||"",c.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(c.name=a.uri);const f=(r.samplers||{})[o.sampler]||{};return c.magFilter=DR[f.magFilter]||jn,c.minFilter=DR[f.minFilter]||go,c.wrapS=kR[f.wrapS]||Ra,c.wrapT=kR[f.wrapT]||Ra,s.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=d,d}loadImageSource(e,t){const i=this,s=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(_=>_.clone());const o=s.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",d=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(_){d=!0;const f=new Blob([_],{type:o.mimeType});return l=a.createObjectURL(f),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(_){return new Promise(function(f,m){let h=f;t.isImageBitmapLoader===!0&&(h=function(E){const b=new wn(E);b.needsUpdate=!0,f(b)}),t.load(zl.resolveURL(_,r.path),h,void 0,m)})}).then(function(_){return d===!0&&a.revokeObjectURL(l),_.userData.mimeType=o.mimeType||EOt(o.uri),_}).catch(function(_){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),_});return this.sourceCache[e]=c,c}assignTexture(e,t,i,s){const r=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),r.extensions[Ot.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[Ot.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=r.associations.get(o);o=r.extensions[Ot.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,l)}}return s!==void 0&&(o.colorSpace=s),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const s=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new NI,Vi.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new wI,Vi.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(s||r||o){let a="ClonedMaterial:"+i.uuid+":";s&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),r&&(l.vertexColors=!0),o&&(l.flatShading=!0),s&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return lv}loadMaterial(e){const t=this,i=this.json,s=this.extensions,r=i.materials[e];let o;const a={},l=r.extensions||{},d=[];if(l[Ot.KHR_MATERIALS_UNLIT]){const _=s[Ot.KHR_MATERIALS_UNLIT];o=_.getMaterialType(),d.push(_.extendParams(a,r,t))}else{const _=r.pbrMetallicRoughness||{};if(a.color=new gt(1,1,1),a.opacity=1,Array.isArray(_.baseColorFactor)){const f=_.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],Nn),a.opacity=f[3]}_.baseColorTexture!==void 0&&d.push(t.assignTexture(a,"map",_.baseColorTexture,rn)),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(f){return f.getMaterialType&&f.getMaterialType(e)}),d.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=Ji);const c=r.alphaMode||vg.OPAQUE;if(c===vg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,c===vg.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==Er&&(d.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new It(1,1),r.normalTexture.scale!==void 0)){const _=r.normalTexture.scale;a.normalScale.set(_,_)}if(r.occlusionTexture!==void 0&&o!==Er&&(d.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==Er){const _=r.emissiveFactor;a.emissive=new gt().setRGB(_[0],_[1],_[2],Nn)}return r.emissiveTexture!==void 0&&o!==Er&&d.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,rn)),Promise.all(d).then(function(){const _=new o(a);return r.name&&(_.name=r.name),fr(_,r),t.associations.set(_,{materials:e}),r.extensions&&qr(s,_,r),_})}createUniqueName(e){const t=Gt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,s=this.primitiveCache;function r(a){return i[Ot.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return LR(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&gOt(g,r),g.name=t.createUniqueName(r.name||"mesh_"+e),fr(g,r),b.extensions&&qr(s,g,b),t.assignFinalMaterial(g),_.push(g)}for(let m=0,h=_.length;m1?c=new io:d.length===1?c=d[0]:c=new sn,c!==d[0])for(let _=0,f=d.length;_{const _=new Map;for(const[f,m]of s.associations)(f instanceof Vi||f instanceof wn)&&_.set(f,m);return c.traverse(f=>{const m=s.associations.get(f);m!=null&&_.set(f,m)}),_};return s.associations=d(r),r})}_createAnimationTracks(e,t,i,s,r){const o=[],a=e.name?e.name:e.uuid,l=[];rr[r.path]===rr.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(a);let d;switch(rr[r.path]){case rr.weights:d=Ia;break;case rr.rotation:d=vo;break;case rr.position:case rr.scale:d=Ma;break;default:switch(i.itemSize){case 1:d=Ia;break;case 2:case 3:default:d=Ma;break}break}const c=s.interpolation!==void 0?hOt[s.interpolation]:wa,_=this._getArrayFromAccessor(i);for(let f=0,m=l.length;f{qe.replace()})},stopVideoStream(){this.isVideoActive=!1,this.imageData=null,Xe.emit("stop_webcam_video_stream"),Ve(()=>{qe.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(){qe.replace(),Xe.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)}})}},xOt=["src"],COt=["src"],ROt={class:"controls"},AOt=u("i",{"data-feather":"video"},null,-1),wOt=[AOt],NOt=u("i",{"data-feather":"video"},null,-1),OOt=[NOt],IOt={key:2};function MOt(n,e,t,i,s,r){return w(),M("div",{class:"floating-frame bg-white",style:Jt({bottom:s.position.bottom+"px",right:s.position.right+"px","z-index":s.zIndex}),onMousedown:e[4]||(e[4]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[u("div",{class:"handle",onMousedown:e[0]||(e[0]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),s.isVideoActive&&s.imageDataUrl!=null?(w(),M("img",{key:0,src:s.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},null,8,xOt)):q("",!0),s.isVideoActive&&s.imageDataUrl==null?(w(),M("p",{key:1,src:s.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},"Loading. Please wait...",8,COt)):q("",!0),u("div",ROt,[s.isVideoActive?q("",!0):(w(),M("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)=>r.startVideoStream&&r.startVideoStream(...o))},wOt)),s.isVideoActive?(w(),M("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)=>r.stopVideoStream&&r.stopVideoStream(...o))},OOt)):q("",!0),s.isVideoActive?(w(),M("span",IOt,"FPS: "+ge(s.frameRate),1)):q("",!0)])],36)}const DOt=bt(TOt,[["render",MOt]]);const kOt={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(){Xe.emit("start_audio_stream",()=>{this.isAudioActive=!0}),Ve(()=>{qe.replace()})},stopAudioStream(){Xe.emit("stop_audio_stream",()=>{this.isAudioActive=!1,this.imageDataUrl=null}),Ve(()=>{qe.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(){qe.replace(),Xe.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)}})}},LOt=["src"],POt={class:"controls"},UOt=u("i",{"data-feather":"mic"},null,-1),FOt=[UOt],BOt=u("i",{"data-feather":"mic"},null,-1),GOt=[BOt],zOt={key:2};function VOt(n,e,t,i,s,r){return w(),M("div",{class:"floating-frame bg-white",style:Jt({bottom:s.position.bottom+"px",right:s.position.right+"px","z-index":s.zIndex}),onMousedown:e[4]||(e[4]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[u("div",{class:"handle",onMousedown:e[0]||(e[0]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),s.isAudioActive&&s.imageDataUrl!=null?(w(),M("img",{key:0,src:s.imageDataUrl,alt:"Spectrogram",width:"300",height:"300"},null,8,LOt)):q("",!0),u("div",POt,[s.isAudioActive?q("",!0):(w(),M("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)=>r.startAudioStream&&r.startAudioStream(...o))},FOt)),s.isAudioActive?(w(),M("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)=>r.stopAudioStream&&r.stopAudioStream(...o))},GOt)):q("",!0),s.isAudioActive?(w(),M("span",zOt,"FPS: "+ge(s.frameRate),1)):q("",!0)])],36)}const HOt=bt(kOt,[["render",VOt]]);const qOt={data(){return{activePersonality:null}},props:{personality:{type:Object,default:()=>({})}},components:{VideoFrame:DOt,AudioFrame:HOt},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(),Ve(()=>{qe.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 iNt,this.camera=new Vn(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new RI,this.renderer.setSize(window.innerWidth,window.innerHeight),this.$refs.webglContainer.appendChild(this.renderer.domElement);const n=new Cr,e=new RR({color:65280});this.cube=new Hn(n,e),this.scene.add(this.cube);const t=new MNt(4210752),i=new kI(16777215,.5);i.position.set(0,1,0),this.scene.add(t),this.scene.add(i),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 HNt().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 Cr,t=new DI().load(n),i=new Er({map:t});this.cube=new Hn(e,i),this.scene.add(this.cube)},showDefaultCube(){this.scene.remove(this.cube);const n=new Cr,e=new RR({color:65280});this.cube=new Hn(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)}}},YOt={ref:"webglContainer"},$Ot={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"},WOt={key:0,class:"text-center"},KOt={key:1,class:"text-center"},jOt={class:"floating-frame2"},QOt=["innerHTML"];function XOt(n,e,t,i,s,r){const o=ft("VideoFrame"),a=ft("AudioFrame");return w(),M($e,null,[u("div",YOt,null,512),u("div",$Ot,[!s.activePersonality||!s.activePersonality.scene_path?(w(),M("div",WOt," Personality does not have a 3d avatar. ")):q("",!0),!s.activePersonality||!s.activePersonality.avatar||s.activePersonality.avatar===""?(w(),M("div",KOt," Personality does not have an avatar. ")):q("",!0),u("div",jOt,[u("div",{innerHTML:n.htmlContent},null,8,QOt)])]),Ie(o,{ref:"video_frame"},null,512),Ie(a,{ref:"audio_frame"},null,512)],64)}const ZOt=bt(qOt,[["render",XOt]]);let Ad;const JOt=new Uint8Array(16);function eIt(){if(!Ad&&(Ad=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ad))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ad(JOt)}const xn=[];for(let n=0;n<256;++n)xn.push((n+256).toString(16).slice(1));function tIt(n,e=0){return xn[n[e+0]]+xn[n[e+1]]+xn[n[e+2]]+xn[n[e+3]]+"-"+xn[n[e+4]]+xn[n[e+5]]+"-"+xn[n[e+6]]+xn[n[e+7]]+"-"+xn[n[e+8]]+xn[n[e+9]]+"-"+xn[n[e+10]]+xn[n[e+11]]+xn[n[e+12]]+xn[n[e+13]]+xn[n[e+14]]+xn[n[e+15]]}const nIt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),PR={randomUUID:nIt};function Fs(n,e,t){if(PR.randomUUID&&!e&&!n)return PR.randomUUID();n=n||{};const i=n.random||(n.rng||eIt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let s=0;s<16;++s)e[t+s]=i[s];return e}return tIt(i)}class po{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 jwt(n,e,t){let i=new tv;const s=new It,r=new It,o=new Wt,a=new Ywt({depthPacking:Oxt}),l=new $wt,d={},c=t.maxTextureSize,_={[Vs]:Zn,[Zn]:Vs,[Ji]:Ji},f=new Eo({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new It},radius:{value:4}},vertexShader:Wwt,fragmentShader:Kwt}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const h=new fs;h.setAttribute("position",new Yn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Hn(h,f),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=jO;let g=this.type;this.render=function(C,x,O){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||C.length===0)return;const R=n.getRenderTarget(),S=n.getActiveCubeFace(),A=n.getActiveMipmapLevel(),U=n.state;U.setBlending(Sr),U.buffers.color.setClear(1,1,1,1),U.buffers.depth.setTest(!0),U.setScissorTest(!1);const F=g!==Is&&this.type===Is,K=g===Is&&this.type!==Is;for(let L=0,H=C.length;Lc||s.y>c)&&(s.x>c&&(r.x=Math.floor(c/j.x),s.x=r.x*j.x,P.mapSize.x=r.x),s.y>c&&(r.y=Math.floor(c/j.y),s.y=r.y*j.y,P.mapSize.y=r.y)),P.map===null||F===!0||K===!0){const Q=this.type!==Is?{minFilter:En,magFilter:En}:{};P.map!==null&&P.map.dispose(),P.map=new bo(s.x,s.y,Q),P.map.texture.name=G.name+".shadowMap",P.camera.updateProjectionMatrix()}n.setRenderTarget(P.map),n.clear();const Y=P.getViewportCount();for(let Q=0;Q0||x.map&&x.alphaTest>0){const U=S.uuid,F=x.uuid;let K=d[U];K===void 0&&(K={},d[U]=K);let L=K[F];L===void 0&&(L=S.clone(),K[F]=L),S=L}if(S.visible=x.visible,S.wireframe=x.wireframe,R===Is?S.side=x.shadowSide!==null?x.shadowSide:x.side:S.side=x.shadowSide!==null?x.shadowSide:_[x.side],S.alphaMap=x.alphaMap,S.alphaTest=x.alphaTest,S.map=x.map,S.clipShadows=x.clipShadows,S.clippingPlanes=x.clippingPlanes,S.clipIntersection=x.clipIntersection,S.displacementMap=x.displacementMap,S.displacementScale=x.displacementScale,S.displacementBias=x.displacementBias,S.wireframeLinewidth=x.wireframeLinewidth,S.linewidth=x.linewidth,O.isPointLight===!0&&S.isMeshDistanceMaterial===!0){const U=n.properties.get(S);U.light=O}return S}function T(C,x,O,R,S){if(C.visible===!1)return;if(C.layers.test(x.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&S===Is)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,C.matrixWorld);const F=e.update(C),K=C.material;if(Array.isArray(K)){const L=F.groups;for(let H=0,G=L.length;H=1):Q.indexOf("OpenGL ES")!==-1&&(Y=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),j=Y>=2);let re=null,te={};const Z=n.getParameter(n.SCISSOR_BOX),fe=n.getParameter(n.VIEWPORT),ve=new Wt().fromArray(Z),Ae=new Wt().fromArray(fe);function J(pe,We,Ue,Ne){const Be=new Uint8Array(4),ct=n.createTexture();n.bindTexture(pe,ct),n.texParameteri(pe,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(pe,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Et=0;Et"u"?!1:/OculusBrowser/g.test(navigator.userAgent),h=new WeakMap;let E;const b=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(D,I){return g?new OffscreenCanvas(D,I):lc("canvas")}function y(D,I,z,he){let X=1;if((D.width>he||D.height>he)&&(X=he/Math.max(D.width,D.height)),X<1||I===!0)if(typeof HTMLImageElement<"u"&&D instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&D instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&D instanceof ImageBitmap){const se=I?Su:Math.floor,Re=se(X*D.width),xe=se(X*D.height);E===void 0&&(E=v(Re,xe));const De=z?v(Re,xe):E;return De.width=Re,De.height=xe,De.getContext("2d").drawImage(D,0,0,Re,xe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+D.width+"x"+D.height+") to ("+Re+"x"+xe+")."),De}else return"data"in D&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+D.width+"x"+D.height+")."),D;return D}function T(D){return fb(D.width)&&fb(D.height)}function C(D){return a?!1:D.wrapS!==gi||D.wrapT!==gi||D.minFilter!==En&&D.minFilter!==jn}function x(D,I){return D.generateMipmaps&&I&&D.minFilter!==En&&D.minFilter!==jn}function O(D){n.generateMipmap(D)}function R(D,I,z,he,X=!1){if(a===!1)return I;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 se=I;if(I===n.RED&&(z===n.FLOAT&&(se=n.R32F),z===n.HALF_FLOAT&&(se=n.R16F),z===n.UNSIGNED_BYTE&&(se=n.R8)),I===n.RED_INTEGER&&(z===n.UNSIGNED_BYTE&&(se=n.R8UI),z===n.UNSIGNED_SHORT&&(se=n.R16UI),z===n.UNSIGNED_INT&&(se=n.R32UI),z===n.BYTE&&(se=n.R8I),z===n.SHORT&&(se=n.R16I),z===n.INT&&(se=n.R32I)),I===n.RG&&(z===n.FLOAT&&(se=n.RG32F),z===n.HALF_FLOAT&&(se=n.RG16F),z===n.UNSIGNED_BYTE&&(se=n.RG8)),I===n.RGBA){const Re=X?bu:Ft.getTransfer(he);z===n.FLOAT&&(se=n.RGBA32F),z===n.HALF_FLOAT&&(se=n.RGBA16F),z===n.UNSIGNED_BYTE&&(se=Re===Xt?n.SRGB8_ALPHA8:n.RGBA8),z===n.UNSIGNED_SHORT_4_4_4_4&&(se=n.RGBA4),z===n.UNSIGNED_SHORT_5_5_5_1&&(se=n.RGB5_A1)}return(se===n.R16F||se===n.R32F||se===n.RG16F||se===n.RG32F||se===n.RGBA16F||se===n.RGBA32F)&&e.get("EXT_color_buffer_float"),se}function S(D,I,z){return x(D,z)===!0||D.isFramebufferTexture&&D.minFilter!==En&&D.minFilter!==jn?Math.log2(Math.max(I.width,I.height))+1:D.mipmaps!==void 0&&D.mipmaps.length>0?D.mipmaps.length:D.isCompressedTexture&&Array.isArray(D.image)?I.mipmaps.length:1}function A(D){return D===En||D===ub||D===Vd?n.NEAREST:n.LINEAR}function U(D){const I=D.target;I.removeEventListener("dispose",U),K(I),I.isVideoTexture&&h.delete(I)}function F(D){const I=D.target;I.removeEventListener("dispose",F),H(I)}function K(D){const I=i.get(D);if(I.__webglInit===void 0)return;const z=D.source,he=b.get(z);if(he){const X=he[I.__cacheKey];X.usedTimes--,X.usedTimes===0&&L(D),Object.keys(he).length===0&&b.delete(z)}i.remove(D)}function L(D){const I=i.get(D);n.deleteTexture(I.__webglTexture);const z=D.source,he=b.get(z);delete he[I.__cacheKey],o.memory.textures--}function H(D){const I=D.texture,z=i.get(D),he=i.get(I);if(he.__webglTexture!==void 0&&(n.deleteTexture(he.__webglTexture),o.memory.textures--),D.depthTexture&&D.depthTexture.dispose(),D.isWebGLCubeRenderTarget)for(let X=0;X<6;X++){if(Array.isArray(z.__webglFramebuffer[X]))for(let se=0;se=l&&console.warn("THREE.WebGLTextures: Trying to use "+D+" texture units while this GPU supports only "+l),G+=1,D}function Y(D){const I=[];return I.push(D.wrapS),I.push(D.wrapT),I.push(D.wrapR||0),I.push(D.magFilter),I.push(D.minFilter),I.push(D.anisotropy),I.push(D.internalFormat),I.push(D.format),I.push(D.type),I.push(D.generateMipmaps),I.push(D.premultiplyAlpha),I.push(D.flipY),I.push(D.unpackAlignment),I.push(D.colorSpace),I.join()}function Q(D,I){const z=i.get(D);if(D.isVideoTexture&&ie(D),D.isRenderTargetTexture===!1&&D.version>0&&z.__version!==D.version){const he=D.image;if(he===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(he.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ee(z,D,I);return}}t.bindTexture(n.TEXTURE_2D,z.__webglTexture,n.TEXTURE0+I)}function re(D,I){const z=i.get(D);if(D.version>0&&z.__version!==D.version){ee(z,D,I);return}t.bindTexture(n.TEXTURE_2D_ARRAY,z.__webglTexture,n.TEXTURE0+I)}function te(D,I){const z=i.get(D);if(D.version>0&&z.__version!==D.version){ee(z,D,I);return}t.bindTexture(n.TEXTURE_3D,z.__webglTexture,n.TEXTURE0+I)}function Z(D,I){const z=i.get(D);if(D.version>0&&z.__version!==D.version){Se(z,D,I);return}t.bindTexture(n.TEXTURE_CUBE_MAP,z.__webglTexture,n.TEXTURE0+I)}const fe={[Ra]:n.REPEAT,[gi]:n.CLAMP_TO_EDGE,[gu]:n.MIRRORED_REPEAT},ve={[En]:n.NEAREST,[ub]:n.NEAREST_MIPMAP_NEAREST,[Vd]:n.NEAREST_MIPMAP_LINEAR,[jn]:n.LINEAR,[XO]:n.LINEAR_MIPMAP_NEAREST,[go]:n.LINEAR_MIPMAP_LINEAR},Ae={[Mxt]:n.NEVER,[Fxt]:n.ALWAYS,[Dxt]:n.LESS,[aI]:n.LEQUAL,[kxt]:n.EQUAL,[Uxt]:n.GEQUAL,[Lxt]:n.GREATER,[Pxt]:n.NOTEQUAL};function J(D,I,z){if(z?(n.texParameteri(D,n.TEXTURE_WRAP_S,fe[I.wrapS]),n.texParameteri(D,n.TEXTURE_WRAP_T,fe[I.wrapT]),(D===n.TEXTURE_3D||D===n.TEXTURE_2D_ARRAY)&&n.texParameteri(D,n.TEXTURE_WRAP_R,fe[I.wrapR]),n.texParameteri(D,n.TEXTURE_MAG_FILTER,ve[I.magFilter]),n.texParameteri(D,n.TEXTURE_MIN_FILTER,ve[I.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),(I.wrapS!==gi||I.wrapT!==gi)&&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,A(I.magFilter)),n.texParameteri(D,n.TEXTURE_MIN_FILTER,A(I.minFilter)),I.minFilter!==En&&I.minFilter!==jn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),I.compareFunction&&(n.texParameteri(D,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(D,n.TEXTURE_COMPARE_FUNC,Ae[I.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const he=e.get("EXT_texture_filter_anisotropic");if(I.magFilter===En||I.minFilter!==Vd&&I.minFilter!==go||I.type===ks&&e.has("OES_texture_float_linear")===!1||a===!1&&I.type===oc&&e.has("OES_texture_half_float_linear")===!1)return;(I.anisotropy>1||i.get(I).__currentAnisotropy)&&(n.texParameterf(D,he.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(I.anisotropy,s.getMaxAnisotropy())),i.get(I).__currentAnisotropy=I.anisotropy)}}function me(D,I){let z=!1;D.__webglInit===void 0&&(D.__webglInit=!0,I.addEventListener("dispose",U));const he=I.source;let X=b.get(he);X===void 0&&(X={},b.set(he,X));const se=Y(I);if(se!==D.__cacheKey){X[se]===void 0&&(X[se]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,z=!0),X[se].usedTimes++;const Re=X[D.__cacheKey];Re!==void 0&&(X[D.__cacheKey].usedTimes--,Re.usedTimes===0&&L(I)),D.__cacheKey=se,D.__webglTexture=X[se].texture}return z}function ee(D,I,z){let he=n.TEXTURE_2D;(I.isDataArrayTexture||I.isCompressedArrayTexture)&&(he=n.TEXTURE_2D_ARRAY),I.isData3DTexture&&(he=n.TEXTURE_3D);const X=me(D,I),se=I.source;t.bindTexture(he,D.__webglTexture,n.TEXTURE0+z);const Re=i.get(se);if(se.version!==Re.__version||X===!0){t.activeTexture(n.TEXTURE0+z);const xe=Ft.getPrimaries(Ft.workingColorSpace),De=I.colorSpace===Ei?null:Ft.getPrimaries(I.colorSpace),ze=I.colorSpace===Ei||xe===De?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,I.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,I.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,I.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,ze);const st=C(I)&&T(I.image)===!1;let ke=y(I.image,st,!1,c);ke=ae(I,ke);const lt=T(ke)||a,je=r.convert(I.format,I.colorSpace);let He=r.convert(I.type),et=R(I.internalFormat,je,He,I.colorSpace,I.isVideoTexture);J(he,I,lt);let Fe;const ut=I.mipmaps,pe=a&&I.isVideoTexture!==!0&&et!==sI,We=Re.__version===void 0||X===!0,Ue=S(I,ke,lt);if(I.isDepthTexture)et=n.DEPTH_COMPONENT,a?I.type===ks?et=n.DEPTH_COMPONENT32F:I.type===br?et=n.DEPTH_COMPONENT24:I.type===lo?et=n.DEPTH24_STENCIL8:et=n.DEPTH_COMPONENT16:I.type===ks&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),I.format===co&&et===n.DEPTH_COMPONENT&&I.type!==XE&&I.type!==br&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),I.type=br,He=r.convert(I.type)),I.format===Aa&&et===n.DEPTH_COMPONENT&&(et=n.DEPTH_STENCIL,I.type!==lo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),I.type=lo,He=r.convert(I.type))),We&&(pe?t.texStorage2D(n.TEXTURE_2D,1,et,ke.width,ke.height):t.texImage2D(n.TEXTURE_2D,0,et,ke.width,ke.height,0,je,He,null));else if(I.isDataTexture)if(ut.length>0&<){pe&&We&&t.texStorage2D(n.TEXTURE_2D,Ue,et,ut[0].width,ut[0].height);for(let Ne=0,Be=ut.length;Ne>=1,Be>>=1}}else if(ut.length>0&<){pe&&We&&t.texStorage2D(n.TEXTURE_2D,Ue,et,ut[0].width,ut[0].height);for(let Ne=0,Be=ut.length;Ne0&&We++,t.texStorage2D(n.TEXTURE_CUBE_MAP,We,Fe,ke[0].width,ke[0].height));for(let Ne=0;Ne<6;Ne++)if(st){ut?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,0,0,ke[Ne].width,ke[Ne].height,He,et,ke[Ne].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,Fe,ke[Ne].width,ke[Ne].height,0,He,et,ke[Ne].data);for(let Be=0;Be>se),ke=Math.max(1,I.height>>se);X===n.TEXTURE_3D||X===n.TEXTURE_2D_ARRAY?t.texImage3D(X,se,De,st,ke,I.depth,0,Re,xe,null):t.texImage2D(X,se,De,st,ke,0,Re,xe,null)}t.bindFramebuffer(n.FRAMEBUFFER,D),_e(I)?f.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,he,X,i.get(z).__webglTexture,0,V(I)):(X===n.TEXTURE_2D||X>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&X<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,he,X,i.get(z).__webglTexture,se),t.bindFramebuffer(n.FRAMEBUFFER,null)}function k(D,I,z){if(n.bindRenderbuffer(n.RENDERBUFFER,D),I.depthBuffer&&!I.stencilBuffer){let he=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(z||_e(I)){const X=I.depthTexture;X&&X.isDepthTexture&&(X.type===ks?he=n.DEPTH_COMPONENT32F:X.type===br&&(he=n.DEPTH_COMPONENT24));const se=V(I);_e(I)?f.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,se,he,I.width,I.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,se,he,I.width,I.height)}else n.renderbufferStorage(n.RENDERBUFFER,he,I.width,I.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,D)}else if(I.depthBuffer&&I.stencilBuffer){const he=V(I);z&&_e(I)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,he,n.DEPTH24_STENCIL8,I.width,I.height):_e(I)?f.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,he,n.DEPTH24_STENCIL8,I.width,I.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,I.width,I.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,D)}else{const he=I.isWebGLMultipleRenderTargets===!0?I.texture:[I.texture];for(let X=0;X0){z.__webglFramebuffer[xe]=[];for(let De=0;De0){z.__webglFramebuffer=[];for(let xe=0;xe0&&_e(D)===!1){const xe=se?I:[I];z.__webglMultisampledFramebuffer=n.createFramebuffer(),z.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,z.__webglMultisampledFramebuffer);for(let De=0;De0)for(let De=0;De0)for(let De=0;De0&&_e(D)===!1){const I=D.isWebGLMultipleRenderTargets?D.texture:[D.texture],z=D.width,he=D.height;let X=n.COLOR_BUFFER_BIT;const se=[],Re=D.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,xe=i.get(D),De=D.isWebGLMultipleRenderTargets===!0;if(De)for(let ze=0;ze0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&I.__useRenderToTexture!==!1}function ie(D){const I=o.render.frame;h.get(D)!==I&&(h.set(D,I),D.update())}function ae(D,I){const z=D.colorSpace,he=D.format,X=D.type;return D.isCompressedTexture===!0||D.isVideoTexture===!0||D.format===hb||z!==Nn&&z!==Ei&&(Ft.getTransfer(z)===Xt?a===!1?e.has("EXT_sRGB")===!0&&he===bi?(D.format=hb,D.minFilter=jn,D.generateMipmaps=!1):I=cI.sRGBToLinear(I):(he!==bi||X!==xr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",z)),I}this.allocateTextureUnit=j,this.resetTextureUnits=P,this.setTexture2D=Q,this.setTexture2DArray=re,this.setTexture3D=te,this.setTextureCube=Z,this.rebindTextures=ce,this.setupRenderTarget=ne,this.updateRenderTargetMipmap=Ce,this.updateMultisampleRenderTarget=we,this.setupDepthRenderbuffer=$,this.setupFrameBufferTexture=Oe,this.useMultisampledRTT=_e}function Zwt(n,e,t){const i=t.isWebGL2;function s(r,o=Ei){let a;const l=Ft.getTransfer(o);if(r===xr)return n.UNSIGNED_BYTE;if(r===JO)return n.UNSIGNED_SHORT_4_4_4_4;if(r===eI)return n.UNSIGNED_SHORT_5_5_5_1;if(r===Ext)return n.BYTE;if(r===vxt)return n.SHORT;if(r===XE)return n.UNSIGNED_SHORT;if(r===ZO)return n.INT;if(r===br)return n.UNSIGNED_INT;if(r===ks)return n.FLOAT;if(r===oc)return i?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===yxt)return n.ALPHA;if(r===bi)return n.RGBA;if(r===Sxt)return n.LUMINANCE;if(r===Txt)return n.LUMINANCE_ALPHA;if(r===co)return n.DEPTH_COMPONENT;if(r===Aa)return n.DEPTH_STENCIL;if(r===hb)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===xxt)return n.RED;if(r===tI)return n.RED_INTEGER;if(r===Cxt)return n.RG;if(r===nI)return n.RG_INTEGER;if(r===iI)return n.RGBA_INTEGER;if(r===Bm||r===Gm||r===zm||r===Vm)if(l===Xt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Bm)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===Gm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===zm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Vm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Bm)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Gm)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===zm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Vm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===QC||r===XC||r===ZC||r===JC)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===QC)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===XC)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===ZC)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===JC)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===sI)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===e1||r===t1)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===e1)return l===Xt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===t1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===n1||r===i1||r===s1||r===r1||r===o1||r===a1||r===l1||r===c1||r===d1||r===u1||r===p1||r===_1||r===h1||r===f1)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===n1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===i1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===s1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===r1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===o1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===a1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===l1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===c1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===d1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===u1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===p1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===_1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===h1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===f1)return l===Xt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Hm||r===m1||r===g1)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===Hm)return l===Xt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===m1)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===g1)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===Rxt||r===b1||r===E1||r===v1)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(r===Hm)return a.COMPRESSED_RED_RGTC1_EXT;if(r===b1)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===E1)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===v1)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===lo?i?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[r]!==void 0?n[r]:null}return{convert:s}}class Jwt extends Vn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class io extends sn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const eNt={type:"move"};class _g{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new io,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 io,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new be,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new be),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new io,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new be,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new be),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 i of e.hand.values())this._getHandJoint(t,i)}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,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,d=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(d&&e.hand){o=!0;for(const E of e.hand.values()){const b=t.getJointPose(E,i),g=this._getHandJoint(d,E);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 c=d.joints["index-finger-tip"],_=d.joints["thumb-tip"],f=c.position.distanceTo(_.position),m=.02,h=.005;d.inputState.pinching&&f>m+h?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!d.inputState.pinching&&f<=m-h&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(s=t.getPose(e.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(eNt)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),d!==null&&(d.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new io;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class tNt extends ja{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,d=null,c=null,_=null,f=null,m=null,h=null;const E=t.getContextAttributes();let b=null,g=null;const v=[],y=[],T=new It;let C=null;const x=new Vn;x.layers.enable(1),x.viewport=new Wt;const O=new Vn;O.layers.enable(2),O.viewport=new Wt;const R=[x,O],S=new Jwt;S.layers.enable(1),S.layers.enable(2);let A=null,U=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Z){let fe=v[Z];return fe===void 0&&(fe=new _g,v[Z]=fe),fe.getTargetRaySpace()},this.getControllerGrip=function(Z){let fe=v[Z];return fe===void 0&&(fe=new _g,v[Z]=fe),fe.getGripSpace()},this.getHand=function(Z){let fe=v[Z];return fe===void 0&&(fe=new _g,v[Z]=fe),fe.getHandSpace()};function F(Z){const fe=y.indexOf(Z.inputSource);if(fe===-1)return;const ve=v[fe];ve!==void 0&&(ve.update(Z.inputSource,Z.frame,d||o),ve.dispatchEvent({type:Z.type,data:Z.inputSource}))}function K(){s.removeEventListener("select",F),s.removeEventListener("selectstart",F),s.removeEventListener("selectend",F),s.removeEventListener("squeeze",F),s.removeEventListener("squeezestart",F),s.removeEventListener("squeezeend",F),s.removeEventListener("end",K),s.removeEventListener("inputsourceschange",L);for(let Z=0;Z=0&&(y[Ae]=null,v[Ae].disconnect(ve))}for(let fe=0;fe=y.length){y.push(ve),Ae=me;break}else if(y[me]===null){y[me]=ve,Ae=me;break}if(Ae===-1)break}const J=v[Ae];J&&J.connect(ve)}}const H=new be,G=new be;function P(Z,fe,ve){H.setFromMatrixPosition(fe.matrixWorld),G.setFromMatrixPosition(ve.matrixWorld);const Ae=H.distanceTo(G),J=fe.projectionMatrix.elements,me=ve.projectionMatrix.elements,ee=J[14]/(J[10]-1),Se=J[14]/(J[10]+1),Oe=(J[9]+1)/J[5],k=(J[9]-1)/J[5],B=(J[8]-1)/J[0],$=(me[8]+1)/me[0],ce=ee*B,ne=ee*$,Ce=Ae/(-B+$),we=Ce*-B;fe.matrixWorld.decompose(Z.position,Z.quaternion,Z.scale),Z.translateX(we),Z.translateZ(Ce),Z.matrixWorld.compose(Z.position,Z.quaternion,Z.scale),Z.matrixWorldInverse.copy(Z.matrixWorld).invert();const V=ee+Ce,_e=Se+Ce,ie=ce-we,ae=ne+(Ae-we),D=Oe*Se/_e*V,I=k*Se/_e*V;Z.projectionMatrix.makePerspective(ie,ae,D,I,V,_e),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert()}function j(Z,fe){fe===null?Z.matrixWorld.copy(Z.matrix):Z.matrixWorld.multiplyMatrices(fe.matrixWorld,Z.matrix),Z.matrixWorldInverse.copy(Z.matrixWorld).invert()}this.updateCamera=function(Z){if(s===null)return;S.near=O.near=x.near=Z.near,S.far=O.far=x.far=Z.far,(A!==S.near||U!==S.far)&&(s.updateRenderState({depthNear:S.near,depthFar:S.far}),A=S.near,U=S.far);const fe=Z.parent,ve=S.cameras;j(S,fe);for(let Ae=0;Ae0&&(b.alphaTest.value=g.alphaTest);const v=e.get(g).envMap;if(v&&(b.envMap.value=v,b.flipEnvMap.value=v.isCubeTexture&&v.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 y=n._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=g.lightMapIntensity*y,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 l(b,g,v,y){b.diffuse.value.copy(g.color),b.opacity.value=g.opacity,b.size.value=g.size*v,b.scale.value=y*.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 c(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 f(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 m(b,g,v){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=v.texture,b.transmissionSamplerSize.value.set(v.width,v.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 h(b,g){g.matcap&&(b.matcap.value=g.matcap)}function E(b,g){const v=e.get(g).light;b.referencePosition.value.setFromMatrixPosition(v.matrixWorld),b.nearDistance.value=v.shadow.camera.near,b.farDistance.value=v.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function iNt(n,e,t,i){let s={},r={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(v,y){const T=y.program;i.uniformBlockBinding(v,T)}function d(v,y){let T=s[v.id];T===void 0&&(h(v),T=c(v),s[v.id]=T,v.addEventListener("dispose",b));const C=y.program;i.updateUBOMapping(v,C);const x=e.render.frame;r[v.id]!==x&&(f(v),r[v.id]=x)}function c(v){const y=_();v.__bindingPointIndex=y;const T=n.createBuffer(),C=v.__size,x=v.usage;return n.bindBuffer(n.UNIFORM_BUFFER,T),n.bufferData(n.UNIFORM_BUFFER,C,x),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,y,T),T}function _(){for(let v=0;v0){x=T%C;const F=C-x;x!==0&&F-A.boundary<0&&(T+=C-x,S.__offset=T)}T+=A.storage}return x=T%C,x>0&&(T+=C-x),v.__size=T,v.__cache={},this}function E(v){const y={boundary:0,storage:0};return typeof v=="number"?(y.boundary=4,y.storage=4):v.isVector2?(y.boundary=8,y.storage=8):v.isVector3||v.isColor?(y.boundary=16,y.storage=12):v.isVector4?(y.boundary=16,y.storage=16):v.isMatrix3?(y.boundary=48,y.storage=48):v.isMatrix4?(y.boundary=64,y.storage=64):v.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",v),y}function b(v){const y=v.target;y.removeEventListener("dispose",b);const T=o.indexOf(y.__bindingPointIndex);o.splice(T,1),n.deleteBuffer(s[y.id]),delete s[y.id],delete r[y.id]}function g(){for(const v in s)n.deleteBuffer(s[v]);o=[],s={},r={}}return{bind:l,update:d,dispose:g}}class RI{constructor(e={}){const{canvas:t=eCt(),context:i=null,depth:s=!0,stencil:r=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:d=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:_=!1}=e;this.isWebGLRenderer=!0;let f;i!==null?f=i.getContextAttributes().alpha:f=o;const m=new Uint32Array(4),h=new Int32Array(4);let E=null,b=null;const g=[],v=[];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=rn,this._useLegacyLights=!1,this.toneMapping=Tr,this.toneMappingExposure=1;const y=this;let T=!1,C=0,x=0,O=null,R=-1,S=null;const A=new Wt,U=new Wt;let F=null;const K=new gt(0);let L=0,H=t.width,G=t.height,P=1,j=null,Y=null;const Q=new Wt(0,0,H,G),re=new Wt(0,0,H,G);let te=!1;const Z=new tv;let fe=!1,ve=!1,Ae=null;const J=new At,me=new It,ee=new be,Se={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Oe(){return O===null?P:1}let k=i;function B(N,W){for(let oe=0;oe{function Ge(){if(ye.forEach(function(Qe){we.get(Qe).currentProgram.isReady()&&ye.delete(Qe)}),ye.size===0){Ee(N);return}setTimeout(Ge,10)}$.get("KHR_parallel_shader_compile")!==null?Ge():setTimeout(Ge,10)})};let Et=null;function jt(N){Et&&Et(N)}function ln(){$t.stop()}function Ct(){$t.start()}const $t=new EI;$t.setAnimationLoop(jt),typeof self<"u"&&$t.setContext(self),this.setAnimationLoop=function(N){Et=N,Fe.setAnimationLoop(N),N===null?$t.stop():$t.start()},Fe.addEventListener("sessionstart",ln),Fe.addEventListener("sessionend",Ct),this.render=function(N,W){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;N.matrixWorldAutoUpdate===!0&&N.updateMatrixWorld(),W.parent===null&&W.matrixWorldAutoUpdate===!0&&W.updateMatrixWorld(),Fe.enabled===!0&&Fe.isPresenting===!0&&(Fe.cameraAutoUpdate===!0&&Fe.updateCamera(W),W=Fe.getCamera()),N.isScene===!0&&N.onBeforeRender(y,N,W,O),b=se.get(N,v.length),b.init(),v.push(b),J.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Z.setFromProjectionMatrix(J),ve=this.localClippingEnabled,fe=Re.init(this.clippingPlanes,ve),E=X.get(N,g.length),E.init(),g.push(E),yn(N,W,0,y.sortObjects),E.finish(),y.sortObjects===!0&&E.sort(j,Y),this.info.render.frame++,fe===!0&&Re.beginShadows();const oe=b.state.shadowsArray;if(xe.render(oe,N,W),fe===!0&&Re.endShadows(),this.info.autoReset===!0&&this.info.reset(),De.render(E,N),b.setupLights(y._useLegacyLights),W.isArrayCamera){const ye=W.cameras;for(let Ee=0,Ge=ye.length;Ee0?b=v[v.length-1]:b=null,g.pop(),g.length>0?E=g[g.length-1]:E=null};function yn(N,W,oe,ye){if(N.visible===!1)return;if(N.layers.test(W.layers)){if(N.isGroup)oe=N.renderOrder;else if(N.isLOD)N.autoUpdate===!0&&N.update(W);else if(N.isLight)b.pushLight(N),N.castShadow&&b.pushShadow(N);else if(N.isSprite){if(!N.frustumCulled||Z.intersectsSprite(N)){ye&&ee.setFromMatrixPosition(N.matrixWorld).applyMatrix4(J);const Qe=I.update(N),nt=N.material;nt.visible&&E.push(N,Qe,nt,oe,ee.z,null)}}else if((N.isMesh||N.isLine||N.isPoints)&&(!N.frustumCulled||Z.intersectsObject(N))){const Qe=I.update(N),nt=N.material;if(ye&&(N.boundingSphere!==void 0?(N.boundingSphere===null&&N.computeBoundingSphere(),ee.copy(N.boundingSphere.center)):(Qe.boundingSphere===null&&Qe.computeBoundingSphere(),ee.copy(Qe.boundingSphere.center)),ee.applyMatrix4(N.matrixWorld).applyMatrix4(J)),Array.isArray(nt)){const at=Qe.groups;for(let rt=0,pt=at.length;rt0&&kr(Ee,Ge,W,oe),ye&&ne.viewport(A.copy(ye)),Ee.length>0&&ci(Ee,W,oe),Ge.length>0&&ci(Ge,W,oe),Qe.length>0&&ci(Qe,W,oe),ne.buffers.depth.setTest(!0),ne.buffers.depth.setMask(!0),ne.buffers.color.setMask(!0),ne.setPolygonOffset(!1)}function kr(N,W,oe,ye){if((oe.isScene===!0?oe.overrideMaterial:null)!==null)return;const Ge=ce.isWebGL2;Ae===null&&(Ae=new bo(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")?oc:xr,minFilter:go,samples:Ge?4:0})),y.getDrawingBufferSize(me),Ge?Ae.setSize(me.x,me.y):Ae.setSize(Su(me.x),Su(me.y));const Qe=y.getRenderTarget();y.setRenderTarget(Ae),y.getClearColor(K),L=y.getClearAlpha(),L<1&&y.setClearColor(16777215,.5),y.clear();const nt=y.toneMapping;y.toneMapping=Tr,ci(N,oe,ye),V.updateMultisampleRenderTarget(Ae),V.updateRenderTargetMipmap(Ae);let at=!1;for(let rt=0,pt=W.length;rt0),ht=!!oe.morphAttributes.position,Kt=!!oe.morphAttributes.normal,Tn=!!oe.morphAttributes.color;let nn=Tr;ye.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(nn=y.toneMapping);const On=oe.morphAttributes.position||oe.morphAttributes.normal||oe.morphAttributes.color,Qt=On!==void 0?On.length:0,St=we.get(ye),tl=b.state.lights;if(fe===!0&&(ve===!0||N!==S)){const Wn=N===S&&ye.id===R;Re.setState(ye,N,Wn)}let en=!1;ye.version===St.__version?(St.needsLights&&St.lightsStateVersion!==tl.state.version||St.outputColorSpace!==nt||Ee.isBatchedMesh&&St.batching===!1||!Ee.isBatchedMesh&&St.batching===!0||Ee.isInstancedMesh&&St.instancing===!1||!Ee.isInstancedMesh&&St.instancing===!0||Ee.isSkinnedMesh&&St.skinning===!1||!Ee.isSkinnedMesh&&St.skinning===!0||Ee.isInstancedMesh&&St.instancingColor===!0&&Ee.instanceColor===null||Ee.isInstancedMesh&&St.instancingColor===!1&&Ee.instanceColor!==null||St.envMap!==at||ye.fog===!0&&St.fog!==Ge||St.numClippingPlanes!==void 0&&(St.numClippingPlanes!==Re.numPlanes||St.numIntersection!==Re.numIntersection)||St.vertexAlphas!==rt||St.vertexTangents!==pt||St.morphTargets!==ht||St.morphNormals!==Kt||St.morphColors!==Tn||St.toneMapping!==nn||ce.isWebGL2===!0&&St.morphTargetsCount!==Qt)&&(en=!0):(en=!0,St.__version=ye.version);let ys=St.currentProgram;en===!0&&(ys=di(ye,W,Ee));let Ac=!1,Lr=!1,nl=!1;const gn=ys.getUniforms(),Ss=St.uniforms;if(ne.useProgram(ys.program)&&(Ac=!0,Lr=!0,nl=!0),ye.id!==R&&(R=ye.id,Lr=!0),Ac||S!==N){gn.setValue(k,"projectionMatrix",N.projectionMatrix),gn.setValue(k,"viewMatrix",N.matrixWorldInverse);const Wn=gn.map.cameraPosition;Wn!==void 0&&Wn.setValue(k,ee.setFromMatrixPosition(N.matrixWorld)),ce.logarithmicDepthBuffer&&gn.setValue(k,"logDepthBufFC",2/(Math.log(N.far+1)/Math.LN2)),(ye.isMeshPhongMaterial||ye.isMeshToonMaterial||ye.isMeshLambertMaterial||ye.isMeshBasicMaterial||ye.isMeshStandardMaterial||ye.isShaderMaterial)&&gn.setValue(k,"isOrthographic",N.isOrthographicCamera===!0),S!==N&&(S=N,Lr=!0,nl=!0)}if(Ee.isSkinnedMesh){gn.setOptional(k,Ee,"bindMatrix"),gn.setOptional(k,Ee,"bindMatrixInverse");const Wn=Ee.skeleton;Wn&&(ce.floatVertexTextures?(Wn.boneTexture===null&&Wn.computeBoneTexture(),gn.setValue(k,"boneTexture",Wn.boneTexture,V)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}Ee.isBatchedMesh&&(gn.setOptional(k,Ee,"batchingTexture"),gn.setValue(k,"batchingTexture",Ee._matricesTexture,V));const il=oe.morphAttributes;if((il.position!==void 0||il.normal!==void 0||il.color!==void 0&&ce.isWebGL2===!0)&&ze.update(Ee,oe,ys),(Lr||St.receiveShadow!==Ee.receiveShadow)&&(St.receiveShadow=Ee.receiveShadow,gn.setValue(k,"receiveShadow",Ee.receiveShadow)),ye.isMeshGouraudMaterial&&ye.envMap!==null&&(Ss.envMap.value=at,Ss.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),Lr&&(gn.setValue(k,"toneMappingExposure",y.toneMappingExposure),St.needsLights&&vs(Ss,nl),Ge&&ye.fog===!0&&he.refreshFogUniforms(Ss,Ge),he.refreshMaterialUniforms(Ss,ye,P,G,Ae),Hd.upload(k,Ki(St),Ss,V)),ye.isShaderMaterial&&ye.uniformsNeedUpdate===!0&&(Hd.upload(k,Ki(St),Ss,V),ye.uniformsNeedUpdate=!1),ye.isSpriteMaterial&&gn.setValue(k,"center",Ee.center),gn.setValue(k,"modelViewMatrix",Ee.modelViewMatrix),gn.setValue(k,"normalMatrix",Ee.normalMatrix),gn.setValue(k,"modelMatrix",Ee.matrixWorld),ye.isShaderMaterial||ye.isRawShaderMaterial){const Wn=ye.uniformsGroups;for(let sl=0,Ep=Wn.length;sl0&&V.useMultisampledRTT(N)===!1?Ee=we.get(N).__webglMultisampledFramebuffer:Array.isArray(pt)?Ee=pt[oe]:Ee=pt,A.copy(N.viewport),U.copy(N.scissor),F=N.scissorTest}else A.copy(Q).multiplyScalar(P).floor(),U.copy(re).multiplyScalar(P).floor(),F=te;if(ne.bindFramebuffer(k.FRAMEBUFFER,Ee)&&ce.drawBuffers&&ye&&ne.drawBuffers(N,Ee),ne.viewport(A),ne.scissor(U),ne.setScissorTest(F),Ge){const at=we.get(N.texture);k.framebufferTexture2D(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,k.TEXTURE_CUBE_MAP_POSITIVE_X+W,at.__webglTexture,oe)}else if(Qe){const at=we.get(N.texture),rt=W||0;k.framebufferTextureLayer(k.FRAMEBUFFER,k.COLOR_ATTACHMENT0,at.__webglTexture,oe||0,rt)}R=-1},this.readRenderTargetPixels=function(N,W,oe,ye,Ee,Ge,Qe){if(!(N&&N.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let nt=we.get(N).__webglFramebuffer;if(N.isWebGLCubeRenderTarget&&Qe!==void 0&&(nt=nt[Qe]),nt){ne.bindFramebuffer(k.FRAMEBUFFER,nt);try{const at=N.texture,rt=at.format,pt=at.type;if(rt!==bi&<.convert(rt)!==k.getParameter(k.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ht=pt===oc&&($.has("EXT_color_buffer_half_float")||ce.isWebGL2&&$.has("EXT_color_buffer_float"));if(pt!==xr&<.convert(pt)!==k.getParameter(k.IMPLEMENTATION_COLOR_READ_TYPE)&&!(pt===ks&&(ce.isWebGL2||$.has("OES_texture_float")||$.has("WEBGL_color_buffer_float")))&&!ht){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}W>=0&&W<=N.width-ye&&oe>=0&&oe<=N.height-Ee&&k.readPixels(W,oe,ye,Ee,lt.convert(rt),lt.convert(pt),Ge)}finally{const at=O!==null?we.get(O).__webglFramebuffer:null;ne.bindFramebuffer(k.FRAMEBUFFER,at)}}},this.copyFramebufferToTexture=function(N,W,oe=0){const ye=Math.pow(2,-oe),Ee=Math.floor(W.image.width*ye),Ge=Math.floor(W.image.height*ye);V.setTexture2D(W,0),k.copyTexSubImage2D(k.TEXTURE_2D,oe,0,0,N.x,N.y,Ee,Ge),ne.unbindTexture()},this.copyTextureToTexture=function(N,W,oe,ye=0){const Ee=W.image.width,Ge=W.image.height,Qe=lt.convert(oe.format),nt=lt.convert(oe.type);V.setTexture2D(oe,0),k.pixelStorei(k.UNPACK_FLIP_Y_WEBGL,oe.flipY),k.pixelStorei(k.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),k.pixelStorei(k.UNPACK_ALIGNMENT,oe.unpackAlignment),W.isDataTexture?k.texSubImage2D(k.TEXTURE_2D,ye,N.x,N.y,Ee,Ge,Qe,nt,W.image.data):W.isCompressedTexture?k.compressedTexSubImage2D(k.TEXTURE_2D,ye,N.x,N.y,W.mipmaps[0].width,W.mipmaps[0].height,Qe,W.mipmaps[0].data):k.texSubImage2D(k.TEXTURE_2D,ye,N.x,N.y,Qe,nt,W.image),ye===0&&oe.generateMipmaps&&k.generateMipmap(k.TEXTURE_2D),ne.unbindTexture()},this.copyTextureToTexture3D=function(N,W,oe,ye,Ee=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ge=N.max.x-N.min.x+1,Qe=N.max.y-N.min.y+1,nt=N.max.z-N.min.z+1,at=lt.convert(ye.format),rt=lt.convert(ye.type);let pt;if(ye.isData3DTexture)V.setTexture3D(ye,0),pt=k.TEXTURE_3D;else if(ye.isDataArrayTexture)V.setTexture2DArray(ye,0),pt=k.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}k.pixelStorei(k.UNPACK_FLIP_Y_WEBGL,ye.flipY),k.pixelStorei(k.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ye.premultiplyAlpha),k.pixelStorei(k.UNPACK_ALIGNMENT,ye.unpackAlignment);const ht=k.getParameter(k.UNPACK_ROW_LENGTH),Kt=k.getParameter(k.UNPACK_IMAGE_HEIGHT),Tn=k.getParameter(k.UNPACK_SKIP_PIXELS),nn=k.getParameter(k.UNPACK_SKIP_ROWS),On=k.getParameter(k.UNPACK_SKIP_IMAGES),Qt=oe.isCompressedTexture?oe.mipmaps[0]:oe.image;k.pixelStorei(k.UNPACK_ROW_LENGTH,Qt.width),k.pixelStorei(k.UNPACK_IMAGE_HEIGHT,Qt.height),k.pixelStorei(k.UNPACK_SKIP_PIXELS,N.min.x),k.pixelStorei(k.UNPACK_SKIP_ROWS,N.min.y),k.pixelStorei(k.UNPACK_SKIP_IMAGES,N.min.z),oe.isDataTexture||oe.isData3DTexture?k.texSubImage3D(pt,Ee,W.x,W.y,W.z,Ge,Qe,nt,at,rt,Qt.data):oe.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),k.compressedTexSubImage3D(pt,Ee,W.x,W.y,W.z,Ge,Qe,nt,at,Qt.data)):k.texSubImage3D(pt,Ee,W.x,W.y,W.z,Ge,Qe,nt,at,rt,Qt),k.pixelStorei(k.UNPACK_ROW_LENGTH,ht),k.pixelStorei(k.UNPACK_IMAGE_HEIGHT,Kt),k.pixelStorei(k.UNPACK_SKIP_PIXELS,Tn),k.pixelStorei(k.UNPACK_SKIP_ROWS,nn),k.pixelStorei(k.UNPACK_SKIP_IMAGES,On),Ee===0&&ye.generateMipmaps&&k.generateMipmap(pt),ne.unbindTexture()},this.initTexture=function(N){N.isCubeTexture?V.setTextureCube(N,0):N.isData3DTexture?V.setTexture3D(N,0):N.isDataArrayTexture||N.isCompressedArrayTexture?V.setTexture2DArray(N,0):V.setTexture2D(N,0),ne.unbindTexture()},this.resetState=function(){C=0,x=0,O=null,ne.reset(),je.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ls}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===JE?"display-p3":"srgb",t.unpackColorSpace=Ft.workingColorSpace===pp?"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===rn?uo:oI}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===uo?rn:Nn}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 sNt extends RI{}sNt.prototype.isWebGL1Renderer=!0;class rNt extends sn{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 oNt{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=_b,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=zi()}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,i){e*=this.stride,i*=t.stride;for(let s=0,r=this.stride;sl)continue;f.applyMatrix4(this.matrixWorld);const R=e.ray.origin.distanceTo(f);Re.far||t.push({distance:R,point:_.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),v=Math.min(b.count,o.start+o.count);for(let y=g,T=v-1;yl)continue;f.applyMatrix4(this.matrixWorld);const x=e.ray.origin.distanceTo(f);xe.far||t.push({distance:x,point:_.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:d,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class lv extends Vi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new gt(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 gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ZE,this.normalScale=new It(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 js extends lv{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 It(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return kn(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 gt(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 gt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new gt(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 RR extends Vi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new gt(16777215),this.specular=new gt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new gt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ZE,this.normalScale=new It(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=QE,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 Rd(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 mNt(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function gNt(n){function e(s,r){return n[s]-n[r]}const t=n.length,i=new Array(t);for(let s=0;s!==t;++s)i[s]=s;return i.sort(e),i}function AR(n,e,t){const i=n.length,s=new n.constructor(i);for(let r=0,o=0;o!==i;++r){const a=t[r]*e;for(let l=0;l!==e;++l)s[o++]=n[a+l]}return s}function OI(n,e,t,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let o=r[i];if(o!==void 0)if(Array.isArray(o))do o=r[i],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=n[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),t.push(o)),r=n[s++];while(r!==void 0)}class xc{constructor(e,t,i,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,s=t[i],r=t[i-1];e:{t:{let o;n:{i:if(!(e=r)){const a=t[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=i.slice(r,o),this.values=this.values.slice(r*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 i=this.times,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(s!==void 0&&mNt(s))for(let a=0,l=s.length;a!==l;++a){const d=s[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(),i=this.getValueSize(),s=this.getInterpolation()===qm,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,d=0;d!==i;++d)t[l+d]=t[a+d];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,s=new i(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}ms.prototype.TimeBufferType=Float32Array;ms.prototype.ValueBufferType=Float32Array;ms.prototype.DefaultInterpolation=wa;class Xa extends ms{}Xa.prototype.ValueTypeName="bool";Xa.prototype.ValueBufferType=Array;Xa.prototype.DefaultInterpolation=ac;Xa.prototype.InterpolantFactoryMethodLinear=void 0;Xa.prototype.InterpolantFactoryMethodSmooth=void 0;class II extends ms{}II.prototype.ValueTypeName="color";class Ia extends ms{}Ia.prototype.ValueTypeName="number";class yNt extends xc{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(s-t);let d=e*a;for(let c=d+a;d!==c;d+=4)Dr.slerpFlat(r,0,o,d-a,o,d,l);return r}}class vo extends ms{InterpolantFactoryMethodLinear(e){return new yNt(this.times,this.values,this.getValueSize(),e)}}vo.prototype.ValueTypeName="quaternion";vo.prototype.DefaultInterpolation=wa;vo.prototype.InterpolantFactoryMethodSmooth=void 0;class Za extends ms{}Za.prototype.ValueTypeName="string";Za.prototype.ValueBufferType=Array;Za.prototype.DefaultInterpolation=ac;Za.prototype.InterpolantFactoryMethodLinear=void 0;Za.prototype.InterpolantFactoryMethodSmooth=void 0;class Ma extends ms{}Ma.prototype.ValueTypeName="vector";class SNt{constructor(e,t=-1,i,s=Axt){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=zi(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(xNt(i[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)t.push(ms.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a1){const _=c[1];let f=s[_];f||(s[_]=f=[]),f.push(d)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(_,f,m,h,E){if(m.length!==0){const b=[],g=[];OI(m,b,g,h),b.length!==0&&E.push(new _(f,b,g))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const d=e.hierarchy||[];for(let _=0;_{t&&t(r),this.manager.itemEnd(e)},0),r;if(Ns[e]!==void 0){Ns[e].push({onLoad:t,onProgress:i,onError:s});return}Ns[e]=[],Ns[e].push({onLoad:t,onProgress:i,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=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 c=Ns[e],_=d.body.getReader(),f=d.headers.get("Content-Length")||d.headers.get("X-File-Size"),m=f?parseInt(f):0,h=m!==0;let E=0;const b=new ReadableStream({start(g){v();function v(){_.read().then(({done:y,value:T})=>{if(y)g.close();else{E+=T.byteLength;const C=new ProgressEvent("progress",{lengthComputable:h,loaded:E,total:m});for(let x=0,O=c.length;x{switch(l){case"arraybuffer":return d.arrayBuffer();case"blob":return d.blob();case"document":return d.text().then(c=>new DOMParser().parseFromString(c,a));case"json":return d.json();default:if(a===void 0)return d.text();{const _=/charset="?([^;"\s]*)"?/i.exec(a),f=_&&_[1]?_[1].toLowerCase():void 0,m=new TextDecoder(f);return d.arrayBuffer().then(h=>m.decode(h))}}}).then(d=>{Da.add(e,d);const c=Ns[e];delete Ns[e];for(let _=0,f=c.length;_{const c=Ns[e];if(c===void 0)throw this.manager.itemError(e),d;delete Ns[e];for(let _=0,f=c.length;_{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class wNt extends Ja{constructor(e){super(e)}load(e,t,i,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Da.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a=lc("img");function l(){c(),Da.add(e,this),t&&t(this),r.manager.itemEnd(e)}function d(_){c(),s&&s(_),r.manager.itemError(e),r.manager.itemEnd(e)}function c(){a.removeEventListener("load",l,!1),a.removeEventListener("error",d,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",d,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class DI extends Ja{constructor(e){super(e)}load(e,t,i,s){const r=new wn,o=new wNt(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,t!==void 0&&t(r)},i,s),r}}class mp extends sn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new gt(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 gg=new At,wR=new be,NR=new be;class cv{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new It(512,512),this.map=null,this.mapPass=null,this.matrix=new At,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new tv,this._frameExtents=new It(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,i=this.matrix;wR.setFromMatrixPosition(e.matrixWorld),t.position.copy(wR),NR.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(NR),t.updateMatrixWorld(),gg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(gg),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(gg)}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 NNt extends cv{constructor(){super(new Vn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,i=Na*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(i!==t.fov||s!==t.aspect||r!==t.far)&&(t.fov=i,t.aspect=s,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class ONt extends mp{constructor(e,t,i=0,s=Math.PI/3,r=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(sn.DEFAULT_UP),this.updateMatrix(),this.target=new sn,this.distance=i,this.angle=s,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new NNt}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 OR=new At,Sl=new be,bg=new be;class INt extends cv{constructor(){super(new Vn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new It(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 be(1,0,0),new be(-1,0,0),new be(0,0,1),new be(0,0,-1),new be(0,1,0),new be(0,-1,0)],this._cubeUps=[new be(0,1,0),new be(0,1,0),new be(0,1,0),new be(0,1,0),new be(0,0,1),new be(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,s=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),Sl.setFromMatrixPosition(e.matrixWorld),i.position.copy(Sl),bg.copy(i.position),bg.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(bg),i.updateMatrixWorld(),s.makeTranslation(-Sl.x,-Sl.y,-Sl.z),OR.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(OR)}}class MNt extends mp{constructor(e,t,i=0,s=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=s,this.shadow=new INt}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 DNt extends cv{constructor(){super(new iv(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class kI extends mp{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(sn.DEFAULT_UP),this.updateMatrix(),this.target=new sn,this.shadow=new DNt}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class kNt extends mp{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class zl{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,s=e.length;i"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,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Da.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){Da.add(e,l),t&&t(l),r.manager.itemEnd(e)}).catch(function(l){s&&s(l),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}const dv="\\[\\]\\.:\\/",PNt=new RegExp("["+dv+"]","g"),uv="[^"+dv+"]",UNt="[^"+dv.replace("\\.","")+"]",FNt=/((?:WC+[\/:])*)/.source.replace("WC",uv),BNt=/(WCOD+)?/.source.replace("WCOD",UNt),GNt=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",uv),zNt=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",uv),VNt=new RegExp("^"+FNt+BNt+GNt+zNt+"$"),HNt=["material","materials","bones","map"];class qNt{constructor(e,t,i){const s=i||Gt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Gt{constructor(e,t,i){this.path=t,this.parsedPath=i||Gt.parseTrackName(t),this.node=Gt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Gt.Composite(e,t,i):new Gt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(PNt,"")}static parseTrackName(e){const t=VNt.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);HNt.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=2.0 are supported."));return}const d=new TOt(r,{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 c=0;c=0&&a[_]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+_+'".')}}d.setExtensions(o),d.setPlugins(a),d.parse(i,s)}parseAsync(e,t){const i=this;return new Promise(function(s,r){i.parse(e,t,s,r)})}}function $Nt(){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 Ot={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 WNt{constructor(e){this.parser=e,this.name=Ot.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,s=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,o)}}class oOt{constructor(e){this.parser=e,this.name=Ot.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let l=i.textureLoader;if(a.uri){const d=i.options.manager.getHandler(a.uri);d!==null&&(l=d)}return this.detectSupport().then(function(d){if(d)return i.loadTextureImage(e,o.source,l);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.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 aOt{constructor(e){this.parser=e,this.name=Ot.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,r=s.textures[e];if(!r.extensions||!r.extensions[t])return null;const o=r.extensions[t],a=s.images[o.source];let l=i.textureLoader;if(a.uri){const d=i.options.manager.getHandler(a.uri);d!==null&&(l=d)}return this.detectSupport().then(function(d){if(d)return i.loadTextureImage(e,o.source,l);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.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 lOt{constructor(e){this.name=Ot.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const s=i.extensions[this.name],r=this.parser.getDependency("buffer",s.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 r.then(function(a){const l=s.byteOffset||0,d=s.byteLength||0,c=s.count,_=s.byteStride,f=new Uint8Array(a,l,d);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(c,_,f,s.mode,s.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(c*_);return o.decodeGltfBuffer(new Uint8Array(m),c,_,f,s.mode,s.filter),m})})}else return null}}class cOt{constructor(e){this.name=Ot.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const s=t.meshes[i.mesh];for(const d of s.primitives)if(d.mode!==fi.TRIANGLES&&d.mode!==fi.TRIANGLE_STRIP&&d.mode!==fi.TRIANGLE_FAN&&d.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const d in o)a.push(this.parser.getDependency("accessor",o[d]).then(c=>(l[d]=c,l[d])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(d=>{const c=d.pop(),_=c.isGroup?c.children:[c],f=d[0].count,m=[];for(const h of _){const E=new At,b=new be,g=new Dr,v=new be(1,1,1),y=new pNt(h.geometry,h.material,f);for(let T=0;T0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const SOt=new At;class TOt{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new $Nt,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 i=!1,s=!1,r=-1;typeof navigator<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,s=navigator.userAgent.indexOf("Firefox")>-1,r=s?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||s&&r<98?this.textureLoader=new DI(this.options.manager):this.textureLoader=new LNt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new MI(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 i=this,s=this.json,r=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([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][s.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:s.asset,parser:i,userData:{}};return qr(r,a,s),fr(a,s),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let s=0,r=t.length;s{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[d,c]of o.children.entries())r(c,a.children[d])};return r(i,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&b.setY(S,x[O*l+1]),l>=3&&b.setZ(S,x[O*l+2]),l>=4&&b.setW(S,x[O*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e].source,o=t.images[r];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,i){const s=this,r=this.json,o=r.textures[e],a=r.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const d=this.loadImageSource(t,i).then(function(c){c.flipY=!1,c.name=o.name||a.name||"",c.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(c.name=a.uri);const f=(r.samplers||{})[o.sampler]||{};return c.magFilter=DR[f.magFilter]||jn,c.minFilter=DR[f.minFilter]||go,c.wrapS=kR[f.wrapS]||Ra,c.wrapT=kR[f.wrapT]||Ra,s.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=d,d}loadImageSource(e,t){const i=this,s=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(_=>_.clone());const o=s.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",d=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(_){d=!0;const f=new Blob([_],{type:o.mimeType});return l=a.createObjectURL(f),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(_){return new Promise(function(f,m){let h=f;t.isImageBitmapLoader===!0&&(h=function(E){const b=new wn(E);b.needsUpdate=!0,f(b)}),t.load(zl.resolveURL(_,r.path),h,void 0,m)})}).then(function(_){return d===!0&&a.revokeObjectURL(l),_.userData.mimeType=o.mimeType||yOt(o.uri),_}).catch(function(_){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),_});return this.sourceCache[e]=c,c}assignTexture(e,t,i,s){const r=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),r.extensions[Ot.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[Ot.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=r.associations.get(o);o=r.extensions[Ot.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,l)}}return s!==void 0&&(o.colorSpace=s),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const s=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new NI,Vi.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new wI,Vi.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(s||r||o){let a="ClonedMaterial:"+i.uuid+":";s&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),r&&(l.vertexColors=!0),o&&(l.flatShading=!0),s&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return lv}loadMaterial(e){const t=this,i=this.json,s=this.extensions,r=i.materials[e];let o;const a={},l=r.extensions||{},d=[];if(l[Ot.KHR_MATERIALS_UNLIT]){const _=s[Ot.KHR_MATERIALS_UNLIT];o=_.getMaterialType(),d.push(_.extendParams(a,r,t))}else{const _=r.pbrMetallicRoughness||{};if(a.color=new gt(1,1,1),a.opacity=1,Array.isArray(_.baseColorFactor)){const f=_.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],Nn),a.opacity=f[3]}_.baseColorTexture!==void 0&&d.push(t.assignTexture(a,"map",_.baseColorTexture,rn)),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(f){return f.getMaterialType&&f.getMaterialType(e)}),d.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=Ji);const c=r.alphaMode||vg.OPAQUE;if(c===vg.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,c===vg.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==Er&&(d.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new It(1,1),r.normalTexture.scale!==void 0)){const _=r.normalTexture.scale;a.normalScale.set(_,_)}if(r.occlusionTexture!==void 0&&o!==Er&&(d.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==Er){const _=r.emissiveFactor;a.emissive=new gt().setRGB(_[0],_[1],_[2],Nn)}return r.emissiveTexture!==void 0&&o!==Er&&d.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,rn)),Promise.all(d).then(function(){const _=new o(a);return r.name&&(_.name=r.name),fr(_,r),t.associations.set(_,{materials:e}),r.extensions&&qr(s,_,r),_})}createUniqueName(e){const t=Gt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,s=this.primitiveCache;function r(a){return i[Ot.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return LR(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&EOt(g,r),g.name=t.createUniqueName(r.name||"mesh_"+e),fr(g,r),b.extensions&&qr(s,g,b),t.assignFinalMaterial(g),_.push(g)}for(let m=0,h=_.length;m1?c=new io:d.length===1?c=d[0]:c=new sn,c!==d[0])for(let _=0,f=d.length;_{const _=new Map;for(const[f,m]of s.associations)(f instanceof Vi||f instanceof wn)&&_.set(f,m);return c.traverse(f=>{const m=s.associations.get(f);m!=null&&_.set(f,m)}),_};return s.associations=d(r),r})}_createAnimationTracks(e,t,i,s,r){const o=[],a=e.name?e.name:e.uuid,l=[];rr[r.path]===rr.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(a);let d;switch(rr[r.path]){case rr.weights:d=Ia;break;case rr.rotation:d=vo;break;case rr.position:case rr.scale:d=Ma;break;default:switch(i.itemSize){case 1:d=Ia;break;case 2:case 3:default:d=Ma;break}break}const c=s.interpolation!==void 0?mOt[s.interpolation]:wa,_=this._getArrayFromAccessor(i);for(let f=0,m=l.length;f{qe.replace()})},stopVideoStream(){this.isVideoActive=!1,this.imageData=null,Xe.emit("stop_webcam_video_stream"),Ve(()=>{qe.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(){qe.replace(),Xe.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)}})}},ROt=["src"],AOt=["src"],wOt={class:"controls"},NOt=u("i",{"data-feather":"video"},null,-1),OOt=[NOt],IOt=u("i",{"data-feather":"video"},null,-1),MOt=[IOt],DOt={key:2};function kOt(n,e,t,i,s,r){return w(),M("div",{class:"floating-frame bg-white",style:Jt({bottom:s.position.bottom+"px",right:s.position.right+"px","z-index":s.zIndex}),onMousedown:e[4]||(e[4]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[u("div",{class:"handle",onMousedown:e[0]||(e[0]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),s.isVideoActive&&s.imageDataUrl!=null?(w(),M("img",{key:0,src:s.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},null,8,ROt)):q("",!0),s.isVideoActive&&s.imageDataUrl==null?(w(),M("p",{key:1,src:s.imageDataUrl,alt:"Webcam Frame",width:"300",height:"300"},"Loading. Please wait...",8,AOt)):q("",!0),u("div",wOt,[s.isVideoActive?q("",!0):(w(),M("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)=>r.startVideoStream&&r.startVideoStream(...o))},OOt)),s.isVideoActive?(w(),M("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)=>r.stopVideoStream&&r.stopVideoStream(...o))},MOt)):q("",!0),s.isVideoActive?(w(),M("span",DOt,"FPS: "+ge(s.frameRate),1)):q("",!0)])],36)}const LOt=bt(COt,[["render",kOt]]);const POt={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(){Xe.emit("start_audio_stream",()=>{this.isAudioActive=!0}),Ve(()=>{qe.replace()})},stopAudioStream(){Xe.emit("stop_audio_stream",()=>{this.isAudioActive=!1,this.imageDataUrl=null}),Ve(()=>{qe.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(){qe.replace(),Xe.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)}})}},UOt=["src"],FOt={class:"controls"},BOt=u("i",{"data-feather":"mic"},null,-1),GOt=[BOt],zOt=u("i",{"data-feather":"mic"},null,-1),VOt=[zOt],HOt={key:2};function qOt(n,e,t,i,s,r){return w(),M("div",{class:"floating-frame bg-white",style:Jt({bottom:s.position.bottom+"px",right:s.position.right+"px","z-index":s.zIndex}),onMousedown:e[4]||(e[4]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[5]||(e[5]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},[u("div",{class:"handle",onMousedown:e[0]||(e[0]=Te((...o)=>r.startDrag&&r.startDrag(...o),["stop"])),onMouseup:e[1]||(e[1]=Te((...o)=>r.stopDrag&&r.stopDrag(...o),["stop"]))},"Drag Me",32),s.isAudioActive&&s.imageDataUrl!=null?(w(),M("img",{key:0,src:s.imageDataUrl,alt:"Spectrogram",width:"300",height:"300"},null,8,UOt)):q("",!0),u("div",FOt,[s.isAudioActive?q("",!0):(w(),M("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)=>r.startAudioStream&&r.startAudioStream(...o))},GOt)),s.isAudioActive?(w(),M("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)=>r.stopAudioStream&&r.stopAudioStream(...o))},VOt)):q("",!0),s.isAudioActive?(w(),M("span",HOt,"FPS: "+ge(s.frameRate),1)):q("",!0)])],36)}const YOt=bt(POt,[["render",qOt]]);const $Ot={data(){return{activePersonality:null}},props:{personality:{type:Object,default:()=>({})}},components:{VideoFrame:LOt,AudioFrame:YOt},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(),Ve(()=>{qe.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 rNt,this.camera=new Vn(75,window.innerWidth/window.innerHeight,.1,1e3),this.renderer=new RI,this.renderer.setSize(window.innerWidth,window.innerHeight),this.$refs.webglContainer.appendChild(this.renderer.domElement);const n=new Cr,e=new RR({color:65280});this.cube=new Hn(n,e),this.scene.add(this.cube);const t=new kNt(4210752),i=new kI(16777215,.5);i.position.set(0,1,0),this.scene.add(t),this.scene.add(i),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 YNt().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 Cr,t=new DI().load(n),i=new Er({map:t});this.cube=new Hn(e,i),this.scene.add(this.cube)},showDefaultCube(){this.scene.remove(this.cube);const n=new Cr,e=new RR({color:65280});this.cube=new Hn(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)}}},WOt={ref:"webglContainer"},KOt={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"},jOt={key:0,class:"text-center"},QOt={key:1,class:"text-center"},XOt={class:"floating-frame2"},ZOt=["innerHTML"];function JOt(n,e,t,i,s,r){const o=ft("VideoFrame"),a=ft("AudioFrame");return w(),M($e,null,[u("div",WOt,null,512),u("div",KOt,[!s.activePersonality||!s.activePersonality.scene_path?(w(),M("div",jOt," Personality does not have a 3d avatar. ")):q("",!0),!s.activePersonality||!s.activePersonality.avatar||s.activePersonality.avatar===""?(w(),M("div",QOt," Personality does not have an avatar. ")):q("",!0),u("div",XOt,[u("div",{innerHTML:n.htmlContent},null,8,ZOt)])]),Ie(o,{ref:"video_frame"},null,512),Ie(a,{ref:"audio_frame"},null,512)],64)}const eIt=bt($Ot,[["render",JOt]]);let Ad;const tIt=new Uint8Array(16);function nIt(){if(!Ad&&(Ad=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ad))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ad(tIt)}const xn=[];for(let n=0;n<256;++n)xn.push((n+256).toString(16).slice(1));function iIt(n,e=0){return xn[n[e+0]]+xn[n[e+1]]+xn[n[e+2]]+xn[n[e+3]]+"-"+xn[n[e+4]]+xn[n[e+5]]+"-"+xn[n[e+6]]+xn[n[e+7]]+"-"+xn[n[e+8]]+xn[n[e+9]]+"-"+xn[n[e+10]]+xn[n[e+11]]+xn[n[e+12]]+xn[n[e+13]]+xn[n[e+14]]+xn[n[e+15]]}const sIt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),PR={randomUUID:sIt};function Fs(n,e,t){if(PR.randomUUID&&!e&&!n)return PR.randomUUID();n=n||{};const i=n.random||(n.rng||nIt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let s=0;s<16;++s)e[t+s]=i[s];return e}return iIt(i)}class po{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 i=this._listeners.indexOf(t);i>=0&&this._listeners.splice(i,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 i=this.proxies.indexOf(t);i>=0&&this.proxies.splice(i,1)}}class qt extends po{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(t=>t(e,this.entity))}}class Pn extends po{constructor(e){super(),this.entity=e}emit(e){let t=!1;const i=()=>[t=!0];for(const s of Array.from(this.listeners.values()))if(s(e,i,this.entity),t)return{prevented:!0};return{prevented:!1}}}class UI extends po{execute(e,t){let i=e;for(const s of this.listeners)i=s(i,t);return i}}class li extends UI{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class iIt extends po{constructor(e){super(),this.entity=e}execute(e){const t=[];for(const i of this.listeners)t.push(i(e,this.entity));return t}}function ji(){const n=Symbol(),e=new Map,t=new Set,i=(l,d)=>{d instanceof po&&d.registerProxy(n,()=>{var c,_;return(_=(c=e.get(l))===null||c===void 0?void 0:c.listeners)!==null&&_!==void 0?_:[]})},s=l=>{const d=new po;e.set(l,d),t.forEach(c=>i(l,c[l]))},r=l=>{t.add(l);for(const d of e.keys())i(d,l[d])},o=l=>{for(const d of e.keys())l[d]instanceof po&&l[d].unregisterProxy(n);t.delete(l)},a=()=>{t.forEach(l=>o(l)),e.clear()};return new Proxy({},{get(l,d){return d==="addTarget"?r:d==="removeTarget"?o:d==="destroy"?a:typeof d!="string"||d.startsWith("_")?l[d]:(e.has(d)||s(d),e.get(d))}})}class UR{constructor(e,t){if(this.destructed=!1,this.events={destruct:new qt(this)},!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Fs(),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 FI{constructor(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Fs(),this.from=e,this.to=t}}function yb(n,e){return Object.fromEntries(Object.entries(n).map(([t,i])=>[t,e(i)]))}class BI{constructor(){this._title="",this.id=Fs(),this.events={loaded:new qt(this),beforeAddInput:new Pn(this),addInput:new qt(this),beforeRemoveInput:new Pn(this),removeInput:new qt(this),beforeAddOutput:new Pn(this),addOutput:new qt(this),beforeRemoveOutput:new Pn(this),removeOutput:new qt(this),beforeTitleChanged:new Pn(this),titleChanged:new qt(this),update:new qt(this)},this.hooks={beforeLoad:new li(this),afterSave:new li(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,i])=>{this.inputs[t]&&(this.inputs[t].load(i),this.inputs[t].nodeId=this.id)}),Object.entries(e.outputs).forEach(([t,i])=>{this.outputs[t]&&(this.outputs[t].load(i),this.outputs[t].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=yb(this.inputs,s=>s.save()),t=yb(this.outputs,s=>s.save()),i={type:this.type,id:this.id,title:this.title,inputs:e,outputs:t};return this.hooks.afterSave.execute(i)}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,i){i.isInput=e==="input",i.nodeId=this.id,i.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:t,intf:i}))}addInterface(e,t,i){const s=e==="input"?this.events.beforeAddInput:this.events.beforeAddOutput,r=e==="input"?this.events.addInput:this.events.addOutput,o=e==="input"?this.inputs:this.outputs;return s.emit(i).prevented?!1:(o[t]=i,this.initializeIntf(e,t,i),r.emit(i),!0)}removeInterface(e,t){const i=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,s=e==="input"?this.events.removeInput:this.events.removeOutput,r=e==="input"?this.inputs[t]:this.outputs[t];if(!r||i.emit(r).prevented)return!1;if(r.connectionCount>0)if(this.graphInstance)this.graphInstance.connections.filter(a=>a.from===r||a.to===r).forEach(a=>{this.graphInstance.removeConnection(a)});else throw new Error("Interface is connected, but no graph instance is specified. Unable to delete interface");return r.events.setValue.unsubscribe(this),e==="input"?delete this.inputs[t]:delete this.outputs[t],s.emit(r),!0}}let GI=class extends BI{load(e){super.load(e)}save(){return super.save()}};function el(n){return class extends GI{constructor(){var e,t;super(),this.type=n.type,this.inputs={},this.outputs={},this.calculate=n.calculate?(i,s)=>n.calculate.call(this,i,s):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(i=>{const s=t[i]();e==="input"?this.addInput(i,s):this.addOutput(i,s)})}}}class tn{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=Fs(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new qt(this),beforeSetValue:new Pn(this),setValue:new qt(this),updated:new qt(this)},this.hooks={load:new li(this),save:new li(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 ka="__baklava_SubgraphInputNode",La="__baklava_SubgraphOutputNode";class zI extends GI{constructor(){super(),this.graphInterfaceId=Fs()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class VI extends zI{constructor(){super(...arguments),this.type=ka,this.inputs={name:new tn("Name","Input")},this.outputs={placeholder:new tn("Value",void 0)}}static isGraphInputNode(e){return e.type===ka}}class HI extends zI{constructor(){super(...arguments),this.type=La,this.inputs={name:new tn("Name","Output"),placeholder:new tn("Value",void 0)},this.outputs={output:new tn("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===La}}class Cc{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===ka).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===La).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Fs(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new Pn(this),addNode:new qt(this),beforeRemoveNode:new Pn(this),removeNode:new qt(this),beforeAddConnection:new Pn(this),addConnection:new qt(this),checkConnection:new Pn(this),beforeRemoveConnection:new Pn(this),removeConnection:new qt(this)},this.hooks={save:new li(this),load:new li(this),checkConnection:new iIt(this)},this.nodeEvents=ji(),this.nodeHooks=ji(),this.connectionEvents=ji(),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(i=>t.includes(i.from)||t.includes(i.to)).forEach(i=>this.removeConnection(i)),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 i=this.checkConnection(e,t);if(!i.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:t}).prevented)return;for(const r of i.connectionsInDanger){const o=this.connections.find(a=>a.id===r.id);o&&this.removeConnection(o)}const s=new UR(i.dummyConnection.from,i.dummyConnection.to);return this.internalAddConnection(s),s}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 i=this.findNodeById(e.nodeId),s=this.findNodeById(t.nodeId);if(i&&s&&i===s)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 r=this.hooks.checkConnection.execute({from:e,to:t});if(r.some(a=>!a.connectionAllowed))return{connectionAllowed:!1};const o=Array.from(new Set(r.flatMap(a=>a.connectionsInDanger)));return{connectionAllowed:!0,dummyConnection:new FI(e,t),connectionsInDanger:o}}findNodeInterface(e){for(const t of this.nodes){for(const i in t.inputs){const s=t.inputs[i];if(s.id===e)return s}for(const i in t.outputs){const s=t.outputs[i];if(s.id===e)return s}}}findNodeById(e){return this.nodes.find(t=>t.id===e)}load(e){try{this._loading=!0;const t=[];for(let i=this.connections.length-1;i>=0;i--)this.removeConnection(this.connections[i]);for(let i=this.nodes.length-1;i>=0;i--)this.removeNode(this.nodes[i]);this.id=e.id;for(const i of e.nodes){const s=this.editor.nodeTypes.get(i.type);if(!s){t.push(`Node type ${i.type} is not registered`);continue}const r=new s.type;this.addNode(r),r.load(i)}for(const i of e.connections){const s=this.findNodeInterface(i.from),r=this.findNodeInterface(i.to);if(s)if(r){const o=new UR(s,r);o.id=i.id,this.internalAddConnection(o)}else{t.push(`Could not find interface with id ${i.to}`);continue}else{t.push(`Could not find interface with id ${i.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 cc="__baklava_GraphNode-";function Pa(n){return cc+n.id}function sIt(n){return class extends BI{constructor(){super(...arguments),this.type=Pa(n),this.inputs={},this.outputs={},this.template=n,this.calculate=async(t,i)=>{var s;if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!i.engine||typeof i.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const r=i.engine.getInputValues(this.subgraph);for(const l of this.subgraph.inputs)r.set(l.nodeInterfaceId,t[l.id]);const o=await i.engine.runGraph(this.subgraph,r,i.globalValues),a={};for(const l of this.subgraph.outputs)a[l.id]=(s=o.get(l.nodeId))===null||s===void 0?void 0:s.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,new tn(t.name,void 0));for(const t of Object.keys(this.inputs))this.subgraph.inputs.some(i=>i.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,new tn(t.name,void 0));for(const t of Object.keys(this.outputs))this.subgraph.outputs.some(i=>i.id===t)||this.removeOutput(t);this.addOutput("_calculationResults",new tn("_calculationResults",void 0).setHidden(!0))}}}class gp{static fromGraph(e,t){return new gp(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(Pa(this));t&&(t.title=e)}get inputs(){return this.nodes.filter(t=>t.type===ka).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===La).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Fs(),this._name="Subgraph",this.events={nameChanged:new qt(this),updated:new qt(this)},this.hooks={beforeLoad:new li(this),afterSave:new li(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,i=f=>{const m=Fs();return t.set(f,m),m},s=f=>{const m=t.get(f);if(!m)throw new Error(`Unable to create graph from template: Could not map old id ${f} to new id`);return m},r=f=>yb(f,m=>({id:i(m.id),templateId:m.id,value:m.value})),o=this.nodes.map(f=>({...f,id:i(f.id),inputs:r(f.inputs),outputs:r(f.outputs)})),a=this.connections.map(f=>({id:i(f.id),from:s(f.from),to:s(f.to)})),l=this.inputs.map(f=>({id:f.id,name:f.name,nodeId:s(f.nodeId),nodeInterfaceId:s(f.nodeInterfaceId)})),d=this.outputs.map(f=>({id:f.id,name:f.name,nodeId:s(f.nodeId),nodeInterfaceId:s(f.nodeInterfaceId)})),c={id:Fs(),nodes:o,connections:a,inputs:l,outputs:d};return e||(e=new Cc(this.editor)),e.load(c).forEach(f=>console.warn(f)),e.template=this,e}}class rIt{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 qt(this),beforeRegisterNodeType:new Pn(this),registerNodeType:new qt(this),beforeUnregisterNodeType:new Pn(this),unregisterNodeType:new qt(this),beforeAddGraphTemplate:new Pn(this),addGraphTemplate:new qt(this),beforeRemoveGraphTemplate:new Pn(this),removeGraphTemplate:new qt(this),registerGraph:new qt(this),unregisterGraph:new qt(this)},this.hooks={save:new li(this),load:new li(this)},this.graphTemplateEvents=ji(),this.graphTemplateHooks=ji(),this.graphEvents=ji(),this.graphHooks=ji(),this.nodeEvents=ji(),this.nodeHooks=ji(),this.connectionEvents=ji(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new Cc(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType(VI),this.registerNodeType(HI)}registerNodeType(e,t){var i,s;if(this.events.beforeRegisterNodeType.emit({type:e,options:t}).prevented)return;const r=new e;this._nodeTypes.set(r.type,{type:e,category:(i=t==null?void 0:t.category)!==null&&i!==void 0?i:"default",title:(s=t==null?void 0:t.title)!==null&&s!==void 0?s:r.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=sIt(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=Pa(e);for(const i of[this.graph,...this.graphs.values()]){const s=i.nodes.filter(r=>r.type===t);for(const r of s)i.removeNode(r)}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{this._loading=!0,e=this.hooks.load.execute(e),e.graphTemplates.forEach(i=>{const s=new gp(i,this);this.addGraphTemplate(s)});const t=this._graph.load(e.graph);return this.events.loaded.emit(),t.forEach(i=>console.warn(i)),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 oIt(n,e){const t=new Map;e.graphs.forEach(i=>{i.nodes.forEach(s=>t.set(s.id,s))}),n.forEach((i,s)=>{const r=t.get(s);r&&i.forEach((o,a)=>{const l=r.outputs[a];l&&(l.value=o)})})}class qI extends Error{constructor(){super("Cycle detected")}}function aIt(n){return typeof n=="string"}function YI(n,e){const t=new Map,i=new Map,s=new Map;let r,o;if(n instanceof Cc)r=n.nodes,o=n.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");r=n,o=e}r.forEach(d=>{Object.values(d.inputs).forEach(c=>t.set(c.id,d.id)),Object.values(d.outputs).forEach(c=>t.set(c.id,d.id))}),r.forEach(d=>{const c=o.filter(f=>f.from&&t.get(f.from.id)===d.id),_=new Set(c.map(f=>t.get(f.to.id)).filter(aIt));i.set(d.id,_),s.set(d,c)});const a=r.slice();o.forEach(d=>{const c=a.findIndex(_=>t.get(d.to.id)===_.id);c>=0&&a.splice(c,1)});const l=[];for(;a.length>0;){const d=a.pop();l.push(d);const c=i.get(d.id);for(;c.size>0;){const _=c.values().next().value;if(c.delete(_),Array.from(i.values()).every(f=>!f.has(_))){const f=r.find(m=>m.id===_);a.push(f)}}}if(Array.from(i.values()).some(d=>d.size>0))throw new qI;return{calculationOrder:l,connectionsFromNode:s,interfaceIdToNodeId:t}}function lIt(n,e){try{return YI(n,e),!1}catch(t){if(t instanceof qI)return!0;throw t}}var Kn;(function(n){n.Running="Running",n.Idle="Idle",n.Paused="Paused",n.Stopped="Stopped"})(Kn||(Kn={}));class cIt{get status(){return this.isRunning?Kn.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new Pn(this),afterRun:new qt(this),statusChange:new qt(this),beforeNodeCalculation:new qt(this),afterNodeCalculation:new qt(this)},this.hooks={gatherCalculationData:new li(this),transferData:new UI},this.recalculateOrder=!0,this.internalStatus=Kn.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(t,i)=>{i.graph&&!i.graph.loading&&i.graph.activeTransactions===0&&this.internalOnChange(i,t??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,t=>this.checkConnection(t.from,t.to))}start(){this.internalStatus===Kn.Stopped&&(this.internalStatus=Kn.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===Kn.Idle&&(this.internalStatus=Kn.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===Kn.Paused&&(this.internalStatus=Kn.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===Kn.Idle||this.internalStatus===Kn.Paused)&&(this.internalStatus=Kn.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 i=await this.execute(e,...t);return this.events.afterRun.emit(i),i}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,t){if(e.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};e=r}if(t.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,t.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};t=r}const i=new FI(e,t);let s=this.editor.graph.connections.slice();return t.allowMultipleConnections||(s=s.filter(r=>r.to!==t)),s.push(i),lIt(this.editor.graph.nodes,s)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:t.allowMultipleConnections?[]:this.editor.graph.connections.filter(r=>r.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(i=>{if(!(i in t))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${i}"`)})}internalOnChange(e,t){this.internalStatus===Kn.Idle&&this.onChange(this.recalculateOrder,e,t)}findInterfaceByTemplateId(e,t){for(const i of e)for(const s of[...Object.values(i.inputs),...Object.values(i.outputs)])if(s.templateId===t)return s;return null}}class dIt extends cIt{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,t,i){this.order.has(e.id)||this.order.set(e.id,YI(e));const{calculationOrder:s,connectionsFromNode:r}=this.order.get(e.id),o=new Map;for(const a of s){const l={};Object.entries(a.inputs).forEach(([c,_])=>{l[c]=this.getInterfaceValue(t,_.id)}),this.events.beforeNodeCalculation.emit({inputValues:l,node:a});let d;if(a.calculate)d=await a.calculate(l,{globalValues:i,engine:this});else{d={};for(const[c,_]of Object.entries(a.outputs))d[c]=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))),r.has(a)&&r.get(a).forEach(c=>{var _;const f=(_=Object.entries(a.outputs).find(([,h])=>h.id===c.from.id))===null||_===void 0?void 0:_[0];if(!f)throw new Error(`Could not find key for interface ${c.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 i=this.proxies.indexOf(t);i>=0&&this.proxies.splice(i,1)}}class qt extends po{constructor(e){super(),this.entity=e}emit(e){this.listeners.forEach(t=>t(e,this.entity))}}class Pn extends po{constructor(e){super(),this.entity=e}emit(e){let t=!1;const i=()=>[t=!0];for(const s of Array.from(this.listeners.values()))if(s(e,i,this.entity),t)return{prevented:!0};return{prevented:!1}}}class UI extends po{execute(e,t){let i=e;for(const s of this.listeners)i=s(i,t);return i}}class li extends UI{constructor(e){super(),this.entity=e}execute(e){return super.execute(e,this.entity)}}class rIt extends po{constructor(e){super(),this.entity=e}execute(e){const t=[];for(const i of this.listeners)t.push(i(e,this.entity));return t}}function ji(){const n=Symbol(),e=new Map,t=new Set,i=(l,d)=>{d instanceof po&&d.registerProxy(n,()=>{var c,_;return(_=(c=e.get(l))===null||c===void 0?void 0:c.listeners)!==null&&_!==void 0?_:[]})},s=l=>{const d=new po;e.set(l,d),t.forEach(c=>i(l,c[l]))},r=l=>{t.add(l);for(const d of e.keys())i(d,l[d])},o=l=>{for(const d of e.keys())l[d]instanceof po&&l[d].unregisterProxy(n);t.delete(l)},a=()=>{t.forEach(l=>o(l)),e.clear()};return new Proxy({},{get(l,d){return d==="addTarget"?r:d==="removeTarget"?o:d==="destroy"?a:typeof d!="string"||d.startsWith("_")?l[d]:(e.has(d)||s(d),e.get(d))}})}class UR{constructor(e,t){if(this.destructed=!1,this.events={destruct:new qt(this)},!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Fs(),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 FI{constructor(e,t){if(!e||!t)throw new Error("Cannot initialize connection with null/undefined for 'from' or 'to' values");this.id=Fs(),this.from=e,this.to=t}}function yb(n,e){return Object.fromEntries(Object.entries(n).map(([t,i])=>[t,e(i)]))}class BI{constructor(){this._title="",this.id=Fs(),this.events={loaded:new qt(this),beforeAddInput:new Pn(this),addInput:new qt(this),beforeRemoveInput:new Pn(this),removeInput:new qt(this),beforeAddOutput:new Pn(this),addOutput:new qt(this),beforeRemoveOutput:new Pn(this),removeOutput:new qt(this),beforeTitleChanged:new Pn(this),titleChanged:new qt(this),update:new qt(this)},this.hooks={beforeLoad:new li(this),afterSave:new li(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,i])=>{this.inputs[t]&&(this.inputs[t].load(i),this.inputs[t].nodeId=this.id)}),Object.entries(e.outputs).forEach(([t,i])=>{this.outputs[t]&&(this.outputs[t].load(i),this.outputs[t].nodeId=this.id)}),this.events.loaded.emit(this)}save(){const e=yb(this.inputs,s=>s.save()),t=yb(this.outputs,s=>s.save()),i={type:this.type,id:this.id,title:this.title,inputs:e,outputs:t};return this.hooks.afterSave.execute(i)}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,i){i.isInput=e==="input",i.nodeId=this.id,i.events.setValue.subscribe(this,()=>this.events.update.emit({type:e,name:t,intf:i}))}addInterface(e,t,i){const s=e==="input"?this.events.beforeAddInput:this.events.beforeAddOutput,r=e==="input"?this.events.addInput:this.events.addOutput,o=e==="input"?this.inputs:this.outputs;return s.emit(i).prevented?!1:(o[t]=i,this.initializeIntf(e,t,i),r.emit(i),!0)}removeInterface(e,t){const i=e==="input"?this.events.beforeRemoveInput:this.events.beforeRemoveOutput,s=e==="input"?this.events.removeInput:this.events.removeOutput,r=e==="input"?this.inputs[t]:this.outputs[t];if(!r||i.emit(r).prevented)return!1;if(r.connectionCount>0)if(this.graphInstance)this.graphInstance.connections.filter(a=>a.from===r||a.to===r).forEach(a=>{this.graphInstance.removeConnection(a)});else throw new Error("Interface is connected, but no graph instance is specified. Unable to delete interface");return r.events.setValue.unsubscribe(this),e==="input"?delete this.inputs[t]:delete this.outputs[t],s.emit(r),!0}}let GI=class extends BI{load(e){super.load(e)}save(){return super.save()}};function el(n){return class extends GI{constructor(){var e,t;super(),this.type=n.type,this.inputs={},this.outputs={},this.calculate=n.calculate?(i,s)=>n.calculate.call(this,i,s):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(i=>{const s=t[i]();e==="input"?this.addInput(i,s):this.addOutput(i,s)})}}}class tn{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=Fs(),this.nodeId="",this.port=!0,this.hidden=!1,this.events={setConnectionCount:new qt(this),beforeSetValue:new Pn(this),setValue:new qt(this),updated:new qt(this)},this.hooks={load:new li(this),save:new li(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 ka="__baklava_SubgraphInputNode",La="__baklava_SubgraphOutputNode";class zI extends GI{constructor(){super(),this.graphInterfaceId=Fs()}onPlaced(){super.onPlaced(),this.initializeIo()}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}load(e){super.load(e),this.graphInterfaceId=e.graphInterfaceId}}class VI extends zI{constructor(){super(...arguments),this.type=ka,this.inputs={name:new tn("Name","Input")},this.outputs={placeholder:new tn("Value",void 0)}}static isGraphInputNode(e){return e.type===ka}}class HI extends zI{constructor(){super(...arguments),this.type=La,this.inputs={name:new tn("Name","Output"),placeholder:new tn("Value",void 0)},this.outputs={output:new tn("Output",void 0).setHidden(!0)},this.calculate=({placeholder:e})=>({output:e})}static isGraphOutputNode(e){return e.type===La}}class Cc{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===ka).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===La).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Fs(),this.activeTransactions=0,this._nodes=[],this._connections=[],this._loading=!1,this._destroying=!1,this.events={beforeAddNode:new Pn(this),addNode:new qt(this),beforeRemoveNode:new Pn(this),removeNode:new qt(this),beforeAddConnection:new Pn(this),addConnection:new qt(this),checkConnection:new Pn(this),beforeRemoveConnection:new Pn(this),removeConnection:new qt(this)},this.hooks={save:new li(this),load:new li(this),checkConnection:new rIt(this)},this.nodeEvents=ji(),this.nodeHooks=ji(),this.connectionEvents=ji(),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(i=>t.includes(i.from)||t.includes(i.to)).forEach(i=>this.removeConnection(i)),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 i=this.checkConnection(e,t);if(!i.connectionAllowed||this.events.beforeAddConnection.emit({from:e,to:t}).prevented)return;for(const r of i.connectionsInDanger){const o=this.connections.find(a=>a.id===r.id);o&&this.removeConnection(o)}const s=new UR(i.dummyConnection.from,i.dummyConnection.to);return this.internalAddConnection(s),s}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 i=this.findNodeById(e.nodeId),s=this.findNodeById(t.nodeId);if(i&&s&&i===s)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 r=this.hooks.checkConnection.execute({from:e,to:t});if(r.some(a=>!a.connectionAllowed))return{connectionAllowed:!1};const o=Array.from(new Set(r.flatMap(a=>a.connectionsInDanger)));return{connectionAllowed:!0,dummyConnection:new FI(e,t),connectionsInDanger:o}}findNodeInterface(e){for(const t of this.nodes){for(const i in t.inputs){const s=t.inputs[i];if(s.id===e)return s}for(const i in t.outputs){const s=t.outputs[i];if(s.id===e)return s}}}findNodeById(e){return this.nodes.find(t=>t.id===e)}load(e){try{this._loading=!0;const t=[];for(let i=this.connections.length-1;i>=0;i--)this.removeConnection(this.connections[i]);for(let i=this.nodes.length-1;i>=0;i--)this.removeNode(this.nodes[i]);this.id=e.id;for(const i of e.nodes){const s=this.editor.nodeTypes.get(i.type);if(!s){t.push(`Node type ${i.type} is not registered`);continue}const r=new s.type;this.addNode(r),r.load(i)}for(const i of e.connections){const s=this.findNodeInterface(i.from),r=this.findNodeInterface(i.to);if(s)if(r){const o=new UR(s,r);o.id=i.id,this.internalAddConnection(o)}else{t.push(`Could not find interface with id ${i.to}`);continue}else{t.push(`Could not find interface with id ${i.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 cc="__baklava_GraphNode-";function Pa(n){return cc+n.id}function oIt(n){return class extends BI{constructor(){super(...arguments),this.type=Pa(n),this.inputs={},this.outputs={},this.template=n,this.calculate=async(t,i)=>{var s;if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!i.engine||typeof i.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const r=i.engine.getInputValues(this.subgraph);for(const l of this.subgraph.inputs)r.set(l.nodeInterfaceId,t[l.id]);const o=await i.engine.runGraph(this.subgraph,r,i.globalValues),a={};for(const l of this.subgraph.outputs)a[l.id]=(s=o.get(l.nodeId))===null||s===void 0?void 0:s.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,new tn(t.name,void 0));for(const t of Object.keys(this.inputs))this.subgraph.inputs.some(i=>i.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,new tn(t.name,void 0));for(const t of Object.keys(this.outputs))this.subgraph.outputs.some(i=>i.id===t)||this.removeOutput(t);this.addOutput("_calculationResults",new tn("_calculationResults",void 0).setHidden(!0))}}}class gp{static fromGraph(e,t){return new gp(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(Pa(this));t&&(t.title=e)}get inputs(){return this.nodes.filter(t=>t.type===ka).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===La).map(t=>({id:t.graphInterfaceId,name:t.inputs.name.value,nodeId:t.id,nodeInterfaceId:t.outputs.output.id}))}constructor(e,t){this.id=Fs(),this._name="Subgraph",this.events={nameChanged:new qt(this),updated:new qt(this)},this.hooks={beforeLoad:new li(this),afterSave:new li(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,i=f=>{const m=Fs();return t.set(f,m),m},s=f=>{const m=t.get(f);if(!m)throw new Error(`Unable to create graph from template: Could not map old id ${f} to new id`);return m},r=f=>yb(f,m=>({id:i(m.id),templateId:m.id,value:m.value})),o=this.nodes.map(f=>({...f,id:i(f.id),inputs:r(f.inputs),outputs:r(f.outputs)})),a=this.connections.map(f=>({id:i(f.id),from:s(f.from),to:s(f.to)})),l=this.inputs.map(f=>({id:f.id,name:f.name,nodeId:s(f.nodeId),nodeInterfaceId:s(f.nodeInterfaceId)})),d=this.outputs.map(f=>({id:f.id,name:f.name,nodeId:s(f.nodeId),nodeInterfaceId:s(f.nodeInterfaceId)})),c={id:Fs(),nodes:o,connections:a,inputs:l,outputs:d};return e||(e=new Cc(this.editor)),e.load(c).forEach(f=>console.warn(f)),e.template=this,e}}class aIt{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 qt(this),beforeRegisterNodeType:new Pn(this),registerNodeType:new qt(this),beforeUnregisterNodeType:new Pn(this),unregisterNodeType:new qt(this),beforeAddGraphTemplate:new Pn(this),addGraphTemplate:new qt(this),beforeRemoveGraphTemplate:new Pn(this),removeGraphTemplate:new qt(this),registerGraph:new qt(this),unregisterGraph:new qt(this)},this.hooks={save:new li(this),load:new li(this)},this.graphTemplateEvents=ji(),this.graphTemplateHooks=ji(),this.graphEvents=ji(),this.graphHooks=ji(),this.nodeEvents=ji(),this.nodeHooks=ji(),this.connectionEvents=ji(),this._graphs=new Set,this._nodeTypes=new Map,this._graph=new Cc(this),this._graphTemplates=[],this._loading=!1,this.registerNodeType(VI),this.registerNodeType(HI)}registerNodeType(e,t){var i,s;if(this.events.beforeRegisterNodeType.emit({type:e,options:t}).prevented)return;const r=new e;this._nodeTypes.set(r.type,{type:e,category:(i=t==null?void 0:t.category)!==null&&i!==void 0?i:"default",title:(s=t==null?void 0:t.title)!==null&&s!==void 0?s:r.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=oIt(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=Pa(e);for(const i of[this.graph,...this.graphs.values()]){const s=i.nodes.filter(r=>r.type===t);for(const r of s)i.removeNode(r)}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{this._loading=!0,e=this.hooks.load.execute(e),e.graphTemplates.forEach(i=>{const s=new gp(i,this);this.addGraphTemplate(s)});const t=this._graph.load(e.graph);return this.events.loaded.emit(),t.forEach(i=>console.warn(i)),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 lIt(n,e){const t=new Map;e.graphs.forEach(i=>{i.nodes.forEach(s=>t.set(s.id,s))}),n.forEach((i,s)=>{const r=t.get(s);r&&i.forEach((o,a)=>{const l=r.outputs[a];l&&(l.value=o)})})}class qI extends Error{constructor(){super("Cycle detected")}}function cIt(n){return typeof n=="string"}function YI(n,e){const t=new Map,i=new Map,s=new Map;let r,o;if(n instanceof Cc)r=n.nodes,o=n.connections;else{if(!e)throw new Error("Invalid argument value: expected array of connections");r=n,o=e}r.forEach(d=>{Object.values(d.inputs).forEach(c=>t.set(c.id,d.id)),Object.values(d.outputs).forEach(c=>t.set(c.id,d.id))}),r.forEach(d=>{const c=o.filter(f=>f.from&&t.get(f.from.id)===d.id),_=new Set(c.map(f=>t.get(f.to.id)).filter(cIt));i.set(d.id,_),s.set(d,c)});const a=r.slice();o.forEach(d=>{const c=a.findIndex(_=>t.get(d.to.id)===_.id);c>=0&&a.splice(c,1)});const l=[];for(;a.length>0;){const d=a.pop();l.push(d);const c=i.get(d.id);for(;c.size>0;){const _=c.values().next().value;if(c.delete(_),Array.from(i.values()).every(f=>!f.has(_))){const f=r.find(m=>m.id===_);a.push(f)}}}if(Array.from(i.values()).some(d=>d.size>0))throw new qI;return{calculationOrder:l,connectionsFromNode:s,interfaceIdToNodeId:t}}function dIt(n,e){try{return YI(n,e),!1}catch(t){if(t instanceof qI)return!0;throw t}}var Kn;(function(n){n.Running="Running",n.Idle="Idle",n.Paused="Paused",n.Stopped="Stopped"})(Kn||(Kn={}));class uIt{get status(){return this.isRunning?Kn.Running:this.internalStatus}constructor(e){this.editor=e,this.events={beforeRun:new Pn(this),afterRun:new qt(this),statusChange:new qt(this),beforeNodeCalculation:new qt(this),afterNodeCalculation:new qt(this)},this.hooks={gatherCalculationData:new li(this),transferData:new UI},this.recalculateOrder=!0,this.internalStatus=Kn.Stopped,this.isRunning=!1,this.editor.nodeEvents.update.subscribe(this,(t,i)=>{i.graph&&!i.graph.loading&&i.graph.activeTransactions===0&&this.internalOnChange(i,t??void 0)}),this.editor.graphEvents.addNode.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeNode.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.addConnection.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphEvents.removeConnection.subscribe(this,(t,i)=>{this.recalculateOrder=!0,!i.loading&&i.activeTransactions===0&&this.internalOnChange()}),this.editor.graphHooks.checkConnection.subscribe(this,t=>this.checkConnection(t.from,t.to))}start(){this.internalStatus===Kn.Stopped&&(this.internalStatus=Kn.Idle,this.events.statusChange.emit(this.status))}pause(){this.internalStatus===Kn.Idle&&(this.internalStatus=Kn.Paused,this.events.statusChange.emit(this.status))}resume(){this.internalStatus===Kn.Paused&&(this.internalStatus=Kn.Idle,this.events.statusChange.emit(this.status))}stop(){(this.internalStatus===Kn.Idle||this.internalStatus===Kn.Paused)&&(this.internalStatus=Kn.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 i=await this.execute(e,...t);return this.events.afterRun.emit(i),i}finally{this.isRunning=!1,this.events.statusChange.emit(this.status)}}checkConnection(e,t){if(e.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,e.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};e=r}if(t.templateId){const r=this.findInterfaceByTemplateId(this.editor.graph.nodes,t.templateId);if(!r)return{connectionAllowed:!0,connectionsInDanger:[]};t=r}const i=new FI(e,t);let s=this.editor.graph.connections.slice();return t.allowMultipleConnections||(s=s.filter(r=>r.to!==t)),s.push(i),dIt(this.editor.graph.nodes,s)?{connectionAllowed:!1,connectionsInDanger:[]}:{connectionAllowed:!0,connectionsInDanger:t.allowMultipleConnections?[]:this.editor.graph.connections.filter(r=>r.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(i=>{if(!(i in t))throw new Error(`Calculation return value from node ${e.id} (type ${e.type}) is missing key "${i}"`)})}internalOnChange(e,t){this.internalStatus===Kn.Idle&&this.onChange(this.recalculateOrder,e,t)}findInterfaceByTemplateId(e,t){for(const i of e)for(const s of[...Object.values(i.inputs),...Object.values(i.outputs)])if(s.templateId===t)return s;return null}}class pIt extends uIt{constructor(e){super(e),this.order=new Map}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(e,t,i){this.order.has(e.id)||this.order.set(e.id,YI(e));const{calculationOrder:s,connectionsFromNode:r}=this.order.get(e.id),o=new Map;for(const a of s){const l={};Object.entries(a.inputs).forEach(([c,_])=>{l[c]=this.getInterfaceValue(t,_.id)}),this.events.beforeNodeCalculation.emit({inputValues:l,node:a});let d;if(a.calculate)d=await a.calculate(l,{globalValues:i,engine:this});else{d={};for(const[c,_]of Object.entries(a.outputs))d[c]=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))),r.has(a)&&r.get(a).forEach(c=>{var _;const f=(_=Object.entries(a.outputs).find(([,h])=>h.id===c.from.id))===null||_===void 0?void 0:_[0];if(!f)throw new Error(`Could not find key for interface ${c.from.id} This is likely a Baklava internal issue. Please report it on GitHub.`);const m=this.hooks.transferData.execute(d[f],c);c.to.allowMultipleConnections?t.has(c.to.id)?t.get(c.to.id).push(m):t.set(c.to.id,[m]):t.set(c.to.id,m)})}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 i of e.nodes)Object.values(i.inputs).forEach(s=>{s.connectionCount===0&&t.set(s.id,s.value)}),i.calculate||Object.values(i.outputs).forEach(s=>{t.set(s.id,s.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)}}let Sb=null;function uIt(n){Sb=n}function Oi(){if(!Sb)throw new Error("providePlugin() must be called before usePlugin()");return{viewModel:Sb}}function Wi(){const{viewModel:n}=Oi();return{graph:jd(n.value,"displayedGraph"),switchGraph:n.value.switchGraph}}function $I(n){const{graph:e}=Wi(),t=mt(null),i=mt(null);return{dragging:it(()=>!!t.value),onPointerDown:l=>{t.value={x:l.pageX,y:l.pageY},i.value={x:n.value.x,y:n.value.y}},onPointerMove:l=>{if(t.value){const d=l.pageX-t.value.x,c=l.pageY-t.value.y;n.value.x=i.value.x+d/e.value.scaling,n.value.y=i.value.y+c/e.value.scaling}},onPointerUp:()=>{t.value=null,i.value=null}}}function WI(n,e,t){if(!e.template)return!1;if(Pa(e.template)===t)return!0;const i=n.graphTemplates.find(r=>Pa(r)===t);return i?i.nodes.filter(r=>r.type.startsWith(cc)).some(r=>WI(n,e,r.type)):!1}function KI(n){return it(()=>{const e=Array.from(n.value.editor.nodeTypes.entries()),t=new Set(e.map(([,s])=>s.category)),i=[];for(const s of t.values()){let r=e.filter(([,o])=>o.category===s);n.value.displayedGraph.template?r=r.filter(([o])=>!WI(n.value.editor,n.value.displayedGraph,o)):r=r.filter(([o])=>![ka,La].includes(o)),r.length>0&&i.push({name:s,nodeTypes:Object.fromEntries(r)})}return i.sort((s,r)=>s.name==="default"?-1:r.name==="default"||s.name>r.name?1:-1),i})}function jI(){const{graph:n}=Wi();return{transform:(t,i)=>{const s=t/n.value.scaling-n.value.panning.x,r=i/n.value.scaling-n.value.panning.y;return[s,r]}}}function pIt(){const{graph:n}=Wi();let e=[],t=-1,i={x:0,y:0};const s=it(()=>n.value.panning),r=$I(s),o=it(()=>({"transform-origin":"0 0",transform:`scale(${n.value.scaling}) translate(${n.value.panning.x}px, ${n.value.panning.y}px)`})),a=(m,h,E)=>{const b=[m/n.value.scaling-n.value.panning.x,h/n.value.scaling-n.value.panning.y],g=[m/E-n.value.panning.x,h/E-n.value.panning.y],v=[g[0]-b[0],g[1]-b[1]];n.value.panning.x+=v[0],n.value.panning.y+=v[1],n.value.scaling=E},l=m=>{m.preventDefault();let h=m.deltaY;m.deltaMode===1&&(h*=32);const E=n.value.scaling*(1-h/3e3);a(m.offsetX,m.offsetY,E)},d=()=>({ax:e[0].clientX,ay:e[0].clientY,bx:e[1].clientX,by:e[1].clientY});return{styles:o,...r,onPointerDown:m=>{if(e.push(m),r.onPointerDown(m),e.length===2){const{ax:h,ay:E,bx:b,by:g}=d();i={x:h+(b-h)/2,y:E+(g-E)/2}}},onPointerMove:m=>{for(let h=0;h0){const C=n.value.scaling*(1+(T-t)/500);a(i.x,i.y,C)}t=T}else r.onPointerMove(m)},onPointerUp:m=>{e=e.filter(h=>h.pointerId!==m.pointerId),t=-1,r.onPointerUp()},onMouseWheel:l}}var vi=(n=>(n[n.NONE=0]="NONE",n[n.ALLOWED=1]="ALLOWED",n[n.FORBIDDEN=2]="FORBIDDEN",n))(vi||{});const QI=Symbol();function _It(){const{graph:n}=Wi(),e=mt(null),t=mt(null),i=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)},s=()=>{if(t.value){if(e.value)return;const a=n.value.connections.find(l=>l.to===t.value);t.value.isInput&&a?(e.value={status:vi.NONE,from:a.from},n.value.removeConnection(a)):e.value={status:vi.NONE,from:t.value},e.value.mx=void 0,e.value.my=void 0}},r=()=>{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 l=n.value.checkConnection(e.value.from,e.value.to);if(e.value.status=l.connectionAllowed?vi.ALLOWED:vi.FORBIDDEN,l.connectionAllowed){const d=l.connectionsInDanger.map(c=>c.id);n.value.connections.forEach(c=>{d.includes(c.id)&&(c.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=vi.NONE,n.value.connections.forEach(l=>{l.isInDanger=!1}))};return sa(QI,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:i,onMouseDown:s,onMouseUp:r,hoveredOver:o}}function hIt(n){const e=mt(!1),t=mt(0),i=mt(0),s=KI(n),{transform:r}=jI(),o=it(()=>{let c=[];const _={};for(const m of s.value){const h=Object.entries(m.nodeTypes).map(([E,b])=>({label:b.title,value:"addNode:"+E}));m.name==="default"?c=h:_[m.name]=h}const f=[...Object.entries(_).map(([m,h])=>({label:m,submenu:h}))];return f.length>0&&c.length>0&&f.push({isDivider:!0}),f.push(...c),f}),a=it(()=>n.value.settings.contextMenu.additionalItems.length===0?o.value:[{label:"Add node",submenu:o.value},...n.value.settings.contextMenu.additionalItems.map(c=>"isDivider"in c||"submenu"in c?c:{label:c.label,value:"command:"+c.command,disabled:!n.value.commandHandler.canExecuteCommand(c.command)})]);function l(c){e.value=!0,t.value=c.offsetX,i.value=c.offsetY}function d(c){if(c.startsWith("addNode:")){const _=c.substring(8),f=n.value.editor.nodeTypes.get(_);if(!f)return;const m=ei(new f.type);n.value.displayedGraph.addNode(m);const[h,E]=r(t.value,i.value);m.position.x=h,m.position.y=E}else if(c.startsWith("command:")){const _=c.substring(8);n.value.commandHandler.canExecuteCommand(_)&&n.value.commandHandler.executeCommand(_)}}return{show:e,x:t,y:i,items:a,open:l,onClick:d}}const fIt=pn({setup(){const{viewModel:n}=Oi(),{graph:e}=Wi();return{styles:it(()=>{const i=n.value.settings.background,s=e.value.panning.x*e.value.scaling,r=e.value.panning.y*e.value.scaling,o=e.value.scaling*i.gridSize,a=o/i.gridDivision,l=`${o}px ${o}px, ${o}px ${o}px`,d=e.value.scaling>i.subGridVisibleThreshold?`, ${a}px ${a}px, ${a}px ${a}px`:"";return{backgroundPosition:`left ${s}px top ${r}px`,backgroundSize:`${l} ${d}`}})}}}),_n=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t};function mIt(n,e,t,i,s,r){return w(),M("div",{class:"background",style:Jt(n.styles)},null,4)}const gIt=_n(fIt,[["render",mIt]]);function bIt(n){return iA()?(LM(n),!0):!1}function pv(n){return typeof n=="function"?n():vt(n)}const XI=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const EIt=Object.prototype.toString,vIt=n=>EIt.call(n)==="[object Object]",qd=()=>{},yIt=SIt();function SIt(){var n,e;return XI&&((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 TIt(n,e,t=!1){return e.reduce((i,s)=>(s in n&&(!t||n[s]!==void 0)&&(i[s]=n[s]),i),{})}function xIt(n,e={}){if(!hn(n))return m2(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=f2(()=>({get(){return n.value[i]},set(s){var r;if((r=pv(e.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return t}function Nl(n){var e;const t=pv(n);return(e=t==null?void 0:t.$el)!=null?e:t}const _v=XI?window:void 0;function Vl(...n){let e,t,i,s;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,i,s]=n,e=_v):[e,t,i,s]=n,!e)return qd;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const r=[],o=()=>{r.forEach(c=>c()),r.length=0},a=(c,_,f,m)=>(c.addEventListener(_,f,m),()=>c.removeEventListener(_,f,m)),l=qn(()=>[Nl(e),pv(s)],([c,_])=>{if(o(),!c)return;const f=vIt(_)?{..._}:_;r.push(...t.flatMap(m=>i.map(h=>a(c,m,h,f))))},{immediate:!0,flush:"post"}),d=()=>{l(),o()};return bIt(d),d}let FR=!1;function ZI(n,e,t={}){const{window:i=_v,ignore:s=[],capture:r=!0,detectIframe:o=!1}=t;if(!i)return qd;yIt&&!FR&&(FR=!0,Array.from(i.document.body.children).forEach(f=>f.addEventListener("click",qd)),i.document.documentElement.addEventListener("click",qd));let a=!0;const l=f=>s.some(m=>{if(typeof m=="string")return Array.from(i.document.querySelectorAll(m)).some(h=>h===f.target||f.composedPath().includes(h));{const h=Nl(m);return h&&(f.target===h||f.composedPath().includes(h))}}),c=[Vl(i,"click",f=>{const m=Nl(n);if(!(!m||m===f.target||f.composedPath().includes(m))){if(f.detail===0&&(a=!l(f)),!a){a=!0;return}e(f)}},{passive:!0,capture:r}),Vl(i,"pointerdown",f=>{const m=Nl(n);a=!l(f)&&!!(m&&!f.composedPath().includes(m))},{passive:!0}),o&&Vl(i,"blur",f=>{setTimeout(()=>{var m;const h=Nl(n);((m=i.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!(h!=null&&h.contains(i.document.activeElement))&&e(f)},0)})].filter(Boolean);return()=>c.forEach(f=>f())}const JI={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},CIt=Object.keys(JI);function RIt(n={}){const{target:e=_v}=n,t=mt(!1),i=mt(n.initialValue||{});Object.assign(i.value,JI,i.value);const s=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(i.value=TIt(r,CIt,!1))};if(e){const r={passive:!0};Vl(e,["pointerdown","pointermove","pointerup"],s,r),Vl(e,"pointerleave",()=>t.value=!1,r)}return{...xIt(i),isInside:t}}const AIt=["onMouseenter","onMouseleave","onClick"],wIt={class:"flex-fill"},NIt={key:0,class:"__submenu-icon",style:{"line-height":"1em"}},OIt=u("svg",{width:"13",height:"13",viewBox:"-60 120 250 250"},[u("path",{d:"M160.875 279.5625 L70.875 369.5625 L70.875 189.5625 L160.875 279.5625 Z",stroke:"none",fill:"white"})],-1),IIt=[OIt],hv=pn({__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,i=e;let s=null;const r=mt(null),o=mt(-1),a=mt(0),l=mt({x:!1,y:!1}),d=it(()=>t.flippable&&(l.value.x||t.isFlipped.x)),c=it(()=>t.flippable&&(l.value.y||t.isFlipped.y)),_=it(()=>{const v={};return t.isNested||(v.top=(c.value?t.y-a.value:t.y)+"px",v.left=t.x+"px"),v}),f=it(()=>({"--flipped-x":d.value,"--flipped-y":c.value,"--nested":t.isNested})),m=it(()=>t.items.map(v=>({...v,hover:!1})));qn([()=>t.y,()=>t.items],()=>{var v,y,T,C;a.value=t.items.length*30;const x=((y=(v=r.value)==null?void 0:v.parentElement)==null?void 0:y.offsetWidth)??0,O=((C=(T=r.value)==null?void 0:T.parentElement)==null?void 0:C.offsetHeight)??0;l.value.x=!t.isNested&&t.x>x*.75,l.value.y=!t.isNested&&t.y+a.value>O-20}),ZI(r,()=>{t.modelValue&&i("update:modelValue",!1)});const h=v=>{!v.submenu&&v.value&&(i("click",v.value),i("update:modelValue",!1))},E=v=>{i("click",v),o.value=-1,t.isNested||i("update:modelValue",!1)},b=(v,y)=>{t.items[y].submenu&&(o.value=y,s!==null&&(clearTimeout(s),s=null))},g=(v,y)=>{t.items[y].submenu&&(s=window.setTimeout(()=>{o.value=-1,s=null},200))};return(v,y)=>{const T=ft("ContextMenu",!0);return w(),xt(ls,{name:"slide-fade"},{default:Je(()=>[le(u("div",{ref_key:"el",ref:r,class:Ye(["baklava-context-menu",f.value]),style:Jt(_.value)},[(w(!0),M($e,null,dt(m.value,(C,x)=>(w(),M($e,null,[C.isDivider?(w(),M("div",{key:`d-${x}`,class:"divider"})):(w(),M("div",{key:`i-${x}`,class:Ye(["item",{submenu:!!C.submenu,"--disabled":!!C.disabled}]),onMouseenter:O=>b(O,x),onMouseleave:O=>g(O,x),onClick:Te(O=>h(C),["stop","prevent"])},[u("div",wIt,ge(C.label),1),C.submenu?(w(),M("div",NIt,IIt)):q("",!0),C.submenu?(w(),xt(T,{key:1,"model-value":o.value===x,items:C.submenu,"is-nested":!0,"is-flipped":{x:d.value,y:c.value},flippable:v.flippable,onClick:E},null,8,["model-value","items","is-flipped","flippable"])):q("",!0)],42,AIt))],64))),256))],6),[[Mt,v.modelValue]])]),_:1})}}}),MIt={},DIt={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"},kIt=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),LIt=u("circle",{cx:"12",cy:"12",r:"1"},null,-1),PIt=u("circle",{cx:"12",cy:"19",r:"1"},null,-1),UIt=u("circle",{cx:"12",cy:"5",r:"1"},null,-1),FIt=[kIt,LIt,PIt,UIt];function BIt(n,e){return w(),M("svg",DIt,FIt)}const eM=_n(MIt,[["render",BIt]]),GIt=["id"],zIt={key:0,class:"__tooltip"},VIt={key:2,class:"align-middle"},BR=pn({__name:"NodeInterface",props:{node:{},intf:{}},setup(n){const e=(b,g=100)=>{const v=b!=null&&b.toString?b.toString():"";return v.length>g?v.slice(0,g)+"...":v},t=n,{viewModel:i}=Oi(),{hoveredOver:s,temporaryConnection:r}=Gi(QI),o=mt(null),a=it(()=>t.intf.connectionCount>0),l=mt(!1),d=it(()=>i.value.settings.displayValueOnHover&&l.value),c=it(()=>({"--input":t.intf.isInput,"--output":!t.intf.isInput,"--connected":a.value})),_=it(()=>t.intf.component&&(!t.intf.isInput||!t.intf.port||t.intf.connectionCount===0)),f=()=>{l.value=!0,s(t.intf)},m=()=>{l.value=!1,s(void 0)},h=()=>{o.value&&i.value.hooks.renderInterface.execute({intf:t.intf,el:o.value})},E=()=>{const b=i.value.displayedGraph.sidebar;b.nodeId=t.node.id,b.optionName=t.intf.name,b.visible=!0};return qs(h),pc(h),(b,g)=>{var v;return w(),M("div",{id:b.intf.id,ref_key:"el",ref:o,class:Ye(["baklava-node-interface",c.value])},[b.intf.port?(w(),M("div",{key:0,class:Ye(["__port",{"--selected":((v=vt(r))==null?void 0:v.from)===b.intf}]),onPointerover:f,onPointerout:m},[Dn(b.$slots,"portTooltip",{showTooltip:d.value},()=>[d.value===!0?(w(),M("span",zIt,ge(e(b.intf.value)),1)):q("",!0)])],34)):q("",!0),_.value?(w(),xt(Fu(b.intf.component),{key:1,modelValue:b.intf.value,"onUpdate:modelValue":g[0]||(g[0]=y=>b.intf.value=y),node:b.node,intf:b.intf,onOpenSidebar:E},null,40,["modelValue","node","intf"])):(w(),M("span",VIt,ge(b.intf.name),1))],10,GIt)}}}),HIt=["id","data-node-type"],qIt={class:"__title-label"},YIt={class:"__menu"},$It={class:"__outputs"},WIt={class:"__inputs"},KIt=pn({__name:"Node",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag"],setup(n,{emit:e}){const t=n,i=e,{viewModel:s}=Oi(),{graph:r,switchGraph:o}=Wi(),a=mt(null),l=mt(!1),d=mt(""),c=mt(null),_=mt(!1),f=mt(!1),m=it(()=>{const U=[{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return t.node.type.startsWith(cc)&&U.push({value:"editSubgraph",label:"Edit Subgraph"}),U}),h=it(()=>({"--selected":t.selected,"--dragging":t.dragging,"--two-column":!!t.node.twoColumn})),E=it(()=>{var U,F;return{top:`${((U=t.node.position)==null?void 0:U.y)??0}px`,left:`${((F=t.node.position)==null?void 0:F.x)??0}px`,"--width":`${t.node.width??s.value.settings.nodes.defaultWidth}px`}}),b=it(()=>Object.values(t.node.inputs).filter(U=>!U.hidden)),g=it(()=>Object.values(t.node.outputs).filter(U=>!U.hidden)),v=()=>{i("select")},y=U=>{t.selected||v(),i("start-drag",U)},T=()=>{f.value=!0},C=async U=>{var F;switch(U){case"delete":r.value.removeNode(t.node);break;case"rename":d.value=t.node.title,l.value=!0,await Ve(),(F=c.value)==null||F.focus();break;case"editSubgraph":o(t.node.template);break}},x=()=>{t.node.title=d.value,l.value=!1},O=()=>{a.value&&s.value.hooks.renderNode.execute({node:t.node,el:a.value})},R=U=>{_.value=!0,U.preventDefault()},S=U=>{if(!_.value)return;const F=t.node.width+U.movementX/r.value.scaling,K=s.value.settings.nodes.minWidth,L=s.value.settings.nodes.maxWidth;t.node.width=Math.max(K,Math.min(L,F))},A=()=>{_.value=!1};return qs(()=>{O(),window.addEventListener("mousemove",S),window.addEventListener("mouseup",A)}),pc(O),Va(()=>{window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",A)}),(U,F)=>(w(),M("div",{id:U.node.id,ref_key:"el",ref:a,class:Ye(["baklava-node",h.value]),style:Jt(E.value),"data-node-type":U.node.type,onPointerdown:v},[vt(s).settings.nodes.resizable?(w(),M("div",{key:0,class:"__resize-handle",onMousedown:R},null,32)):q("",!0),Dn(U.$slots,"title",{},()=>[u("div",{class:"__title",onPointerdown:Te(y,["self","stop"])},[l.value?le((w(),M("input",{key:1,ref_key:"renameInputEl",ref:c,"onUpdate:modelValue":F[1]||(F[1]=K=>d.value=K),type:"text",class:"baklava-input",placeholder:"Node Name",onBlur:x,onKeydown:wr(x,["enter"])},null,544)),[[Pe,d.value]]):(w(),M($e,{key:0},[u("div",qIt,ge(U.node.title),1),u("div",YIt,[Ie(eM,{class:"--clickable",onClick:T}),Ie(hv,{modelValue:f.value,"onUpdate:modelValue":F[0]||(F[0]=K=>f.value=K),x:0,y:0,items:m.value,onClick:C},null,8,["modelValue","items"])])],64))],32)]),Dn(U.$slots,"content",{},()=>[u("div",{class:"__content",onKeydown:F[2]||(F[2]=wr(Te(()=>{},["stop"]),["delete"]))},[u("div",$It,[(w(!0),M($e,null,dt(g.value,K=>Dn(U.$slots,"nodeInterface",{key:K.id,type:"output",node:U.node,intf:K},()=>[Ie(BR,{node:U.node,intf:K},null,8,["node","intf"])])),128))]),u("div",WIt,[(w(!0),M($e,null,dt(b.value,K=>Dn(U.$slots,"nodeInterface",{key:K.id,type:"input",node:U.node,intf:K},()=>[Ie(BR,{node:U.node,intf:K},null,8,["node","intf"])])),128))])],32)])],46,HIt))}}),jIt=pn({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:vi.NONE},isTemporary:{type:Boolean,default:!1}},setup(n){const{viewModel:e}=Oi(),{graph:t}=Wi(),i=(o,a)=>{const l=(o+t.value.panning.x)*t.value.scaling,d=(a+t.value.panning.y)*t.value.scaling;return[l,d]},s=it(()=>{const[o,a]=i(n.x1,n.y1),[l,d]=i(n.x2,n.y2);if(e.value.settings.useStraightConnections)return`M ${o} ${a} L ${l} ${d}`;{const c=.3*Math.abs(o-l);return`M ${o} ${a} C ${o+c} ${a}, ${l-c} ${d}, ${l} ${d}`}}),r=it(()=>({"--temporary":n.isTemporary,"--allowed":n.state===vi.ALLOWED,"--forbidden":n.state===vi.FORBIDDEN}));return{d:s,classes:r}}}),QIt=["d"];function XIt(n,e,t,i,s,r){return w(),M("path",{class:Ye(["baklava-connection",n.classes]),d:n.d},null,10,QIt)}const tM=_n(jIt,[["render",XIt]]);function ZIt(n){return document.getElementById(n.id)}function Ua(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 JIt=pn({components:{"connection-view":tM},props:{connection:{type:Object,required:!0}},setup(n){const{graph:e}=Wi();let t;const i=mt({x1:0,y1:0,x2:0,y2:0}),s=it(()=>n.connection.isInDanger?vi.FORBIDDEN:vi.NONE),r=it(()=>{var d;return(d=e.value.findNodeById(n.connection.from.nodeId))==null?void 0:d.position}),o=it(()=>{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],l=()=>{const d=Ua(n.connection.from),c=Ua(n.connection.to);d.node&&c.node&&(t||(t=new ResizeObserver(()=>{l()}),t.observe(d.node),t.observe(c.node)));const[_,f]=a(d),[m,h]=a(c);i.value={x1:_,y1:f,x2:m,y2:h}};return qs(async()=>{await Ve(),l()}),Va(()=>{t&&t.disconnect()}),qn([r,o],()=>l(),{deep:!0}),{d:i,state:s}}});function eMt(n,e,t,i,s,r){const o=ft("connection-view");return w(),xt(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 tMt=_n(JIt,[["render",eMt]]);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 nMt=pn({components:{"connection-view":tM},props:{connection:{type:Object,required:!0}},setup(n){const e=it(()=>n.connection?n.connection.status:vi.NONE);return{d:it(()=>{if(!n.connection)return{input:[0,0],output:[0,0]};const i=Tu(Ua(n.connection.from)),s=n.connection.to?Tu(Ua(n.connection.to)):[n.connection.mx||i[0],n.connection.my||i[1]];return n.connection.from.isInput?{input:s,output:i}:{input:i,output:s}}),status:e}}});function iMt(n,e,t,i,s,r){const o=ft("connection-view");return w(),xt(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 sMt=_n(nMt,[["render",iMt]]),rMt=pn({setup(){const{viewModel:n}=Oi(),{graph:e}=Wi(),t=mt(null),i=jd(n.value.settings.sidebar,"width"),s=it(()=>n.value.settings.sidebar.resizable),r=it(()=>{const _=e.value.sidebar.nodeId;return e.value.nodes.find(f=>f.id===_)}),o=it(()=>({width:`${i.value}px`})),a=it(()=>r.value?[...Object.values(r.value.inputs),...Object.values(r.value.outputs)].filter(f=>f.displayInSidebar&&f.component):[]),l=()=>{e.value.sidebar.visible=!1},d=()=>{window.addEventListener("mousemove",c),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",c)},{once:!0})},c=_=>{var f,m;const h=((m=(f=t.value)==null?void 0:f.parentElement)==null?void 0:m.getBoundingClientRect().width)??500;let E=i.value-_.movementX;E<300?E=300:E>.9*h&&(E=.9*h),i.value=E};return{el:t,graph:e,resizable:s,node:r,styles:o,displayedInterfaces:a,startResize:d,close:l}}}),oMt={class:"__header"},aMt={class:"__node-name"};function lMt(n,e,t,i,s,r){return w(),M("div",{ref:"el",class:Ye(["baklava-sidebar",{"--open":n.graph.sidebar.visible}]),style:Jt(n.styles)},[n.resizable?(w(),M("div",{key:0,class:"__resizer",onMousedown:e[0]||(e[0]=(...o)=>n.startResize&&n.startResize(...o))},null,32)):q("",!0),u("div",oMt,[u("button",{tabindex:"-1",class:"__close",onClick:e[1]||(e[1]=(...o)=>n.close&&n.close(...o))},"×"),u("div",aMt,[u("b",null,ge(n.node?n.node.title:""),1)])]),(w(!0),M($e,null,dt(n.displayedInterfaces,o=>(w(),M("div",{key:o.id,class:"__interface"},[(w(),xt(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 cMt=_n(rMt,[["render",lMt]]),dMt=pn({__name:"Minimap",setup(n){const{viewModel:e}=Oi(),{graph:t}=Wi(),i=mt(null),s=mt(!1);let r,o=!1,a={x1:0,y1:0,x2:0,y2:0},l;const d=()=>{var x,O;if(!r)return;r.canvas.width=i.value.offsetWidth,r.canvas.height=i.value.offsetHeight;const R=new Map,S=new Map;for(const L of t.value.nodes){const H=ZIt(L),G=(H==null?void 0:H.offsetWidth)??0,P=(H==null?void 0:H.offsetHeight)??0,j=((x=L.position)==null?void 0:x.x)??0,Y=((O=L.position)==null?void 0:O.y)??0;R.set(L,{x1:j,y1:Y,x2:j+G,y2:Y+P}),S.set(L,H)}const A={x1:Number.MAX_SAFE_INTEGER,y1:Number.MAX_SAFE_INTEGER,x2:Number.MIN_SAFE_INTEGER,y2:Number.MIN_SAFE_INTEGER};for(const L of R.values())L.x1A.x2&&(A.x2=L.x2),L.y2>A.y2&&(A.y2=L.y2);const U=50;A.x1-=U,A.y1-=U,A.x2+=U,A.y2+=U,a=A;const F=r.canvas.width/r.canvas.height,K=(a.x2-a.x1)/(a.y2-a.y1);if(F>K){const L=(F-K)*(a.y2-a.y1)*.5;a.x1-=L,a.x2+=L}else{const L=a.x2-a.x1,H=a.y2-a.y1,G=(L-F*H)/F*.5;a.y1-=G,a.y2+=G}r.clearRect(0,0,r.canvas.width,r.canvas.height),r.strokeStyle="white";for(const L of t.value.connections){const[H,G]=Tu(Ua(L.from)),[P,j]=Tu(Ua(L.to)),[Y,Q]=c(H,G),[re,te]=c(P,j);if(r.beginPath(),r.moveTo(Y,Q),e.value.settings.useStraightConnections)r.lineTo(re,te);else{const Z=.3*Math.abs(Y-re);r.bezierCurveTo(Y+Z,Q,re-Z,te,re,te)}r.stroke()}r.strokeStyle="lightgray";for(const[L,H]of R.entries()){const[G,P]=c(H.x1,H.y1),[j,Y]=c(H.x2,H.y2);r.fillStyle=f(S.get(L)),r.beginPath(),r.rect(G,P,j-G,Y-P),r.fill(),r.stroke()}if(s.value){const L=h(),[H,G]=c(L.x1,L.y1),[P,j]=c(L.x2,L.y2);r.fillStyle="rgba(255, 255, 255, 0.2)",r.fillRect(H,G,P-H,j-G)}},c=(x,O)=>[(x-a.x1)/(a.x2-a.x1)*r.canvas.width,(O-a.y1)/(a.y2-a.y1)*r.canvas.height],_=(x,O)=>[x*(a.x2-a.x1)/r.canvas.width+a.x1,O*(a.y2-a.y1)/r.canvas.height+a.y1],f=x=>{if(x){const O=x.querySelector(".__content");if(O){const S=m(O);if(S)return S}const R=m(x);if(R)return R}return"gray"},m=x=>{const O=getComputedStyle(x).backgroundColor;if(O&&O!=="rgba(0, 0, 0, 0)")return O},h=()=>{const x=i.value.parentElement.offsetWidth,O=i.value.parentElement.offsetHeight,R=x/t.value.scaling-t.value.panning.x,S=O/t.value.scaling-t.value.panning.y;return{x1:-t.value.panning.x,y1:-t.value.panning.y,x2:R,y2:S}},E=x=>{x.button===0&&(o=!0,b(x))},b=x=>{if(o){const[O,R]=_(x.offsetX,x.offsetY),S=h(),A=(S.x2-S.x1)/2,U=(S.y2-S.y1)/2;t.value.panning.x=-(O-A),t.value.panning.y=-(R-U)}},g=()=>{o=!1},v=()=>{s.value=!0},y=()=>{s.value=!1,g()};qn([s,t.value.panning,()=>t.value.scaling,()=>t.value.connections.length],()=>{d()});const T=it(()=>t.value.nodes.map(x=>x.position)),C=it(()=>t.value.nodes.map(x=>x.width));return qn([T,C],()=>{d()},{deep:!0}),qs(()=>{r=i.value.getContext("2d"),r.imageSmoothingQuality="high",d(),l=setInterval(d,500)}),Va(()=>{clearInterval(l)}),(x,O)=>(w(),M("canvas",{ref_key:"canvas",ref:i,class:"baklava-minimap",onMouseenter:v,onMouseleave:y,onMousedown:Te(E,["self"]),onMousemove:Te(b,["self"]),onMouseup:g},null,544))}}),uMt=pn({components:{ContextMenu:hv,VerticalDots:eM},props:{type:{type:String,required:!0},title:{type:String,required:!0}},setup(n){const{viewModel:e}=Oi(),{switchGraph:t}=Wi(),i=mt(!1),s=it(()=>n.type.startsWith(cc));return{showContextMenu:i,hasContextMenu:s,contextMenuItems:[{label:"Edit Subgraph",value:"editSubgraph"},{label:"Delete Subgraph",value:"deleteSubgraph"}],openContextMenu:()=>{i.value=!0},onContextMenuClick:l=>{const d=n.type.substring(cc.length),c=e.value.editor.graphTemplates.find(_=>_.id===d);if(c)switch(l){case"editSubgraph":t(c);break;case"deleteSubgraph":e.value.editor.removeGraphTemplate(c);break}}}}}),pMt=["data-node-type"],_Mt={class:"__title"},hMt={class:"__title-label"},fMt={key:0,class:"__menu"};function mMt(n,e,t,i,s,r){const o=ft("vertical-dots"),a=ft("context-menu");return w(),M("div",{class:"baklava-node --palette","data-node-type":n.type},[u("div",_Mt,[u("div",hMt,ge(n.title),1),n.hasContextMenu?(w(),M("div",fMt,[Ie(o,{class:"--clickable",onPointerdown:e[0]||(e[0]=Te(()=>{},["stop","prevent"])),onClick:Te(n.openContextMenu,["stop","prevent"])},null,8,["onClick"]),Ie(a,{modelValue:n.showContextMenu,"onUpdate:modelValue":e[1]||(e[1]=l=>n.showContextMenu=l),x:-100,y:0,items:n.contextMenuItems,onClick:n.onContextMenuClick,onPointerdown:e[2]||(e[2]=Te(()=>{},["stop","prevent"]))},null,8,["modelValue","items","onClick"])])):q("",!0)])],8,pMt)}const GR=_n(uMt,[["render",mMt]]),gMt={class:"baklava-node-palette"},bMt={key:0},EMt=pn({__name:"NodePalette",setup(n){const{viewModel:e}=Oi(),{x:t,y:i}=RIt(),{transform:s}=jI(),r=KI(e),o=Gi("editorEl"),a=mt(null),l=it(()=>{if(!a.value||!(o!=null&&o.value))return{};const{left:c,top:_}=o.value.getBoundingClientRect();return{top:`${i.value-_}px`,left:`${t.value-c}px`}}),d=(c,_)=>{a.value={type:c,nodeInformation:_};const f=()=>{const m=ei(new _.type);e.value.displayedGraph.addNode(m);const h=o.value.getBoundingClientRect(),[E,b]=s(t.value-h.left,i.value-h.top);m.position.x=E,m.position.y=b,a.value=null,document.removeEventListener("pointerup",f)};document.addEventListener("pointerup",f)};return(c,_)=>(w(),M($e,null,[u("div",gMt,[(w(!0),M($e,null,dt(vt(r),f=>(w(),M("section",{key:f.name},[f.name!=="default"?(w(),M("h1",bMt,ge(f.name),1)):q("",!0),(w(!0),M($e,null,dt(f.nodeTypes,(m,h)=>(w(),xt(GR,{key:h,type:h,title:m.title,onPointerdown:E=>d(h,m)},null,8,["type","title","onPointerdown"]))),128))]))),128))]),Ie(ls,{name:"fade"},{default:Je(()=>[a.value?(w(),M("div",{key:0,class:"baklava-dragged-node",style:Jt(l.value)},[Ie(GR,{type:a.value.type,title:a.value.nodeInformation.title},null,8,["type","title"])],4)):q("",!0)]),_:1})],64))}});let wd;const vMt=new Uint8Array(16);function yMt(){if(!wd&&(wd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!wd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return wd(vMt)}const Cn=[];for(let n=0;n<256;++n)Cn.push((n+256).toString(16).slice(1));function SMt(n,e=0){return Cn[n[e+0]]+Cn[n[e+1]]+Cn[n[e+2]]+Cn[n[e+3]]+"-"+Cn[n[e+4]]+Cn[n[e+5]]+"-"+Cn[n[e+6]]+Cn[n[e+7]]+"-"+Cn[n[e+8]]+Cn[n[e+9]]+"-"+Cn[n[e+10]]+Cn[n[e+11]]+Cn[n[e+12]]+Cn[n[e+13]]+Cn[n[e+14]]+Cn[n[e+15]]}const TMt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),zR={randomUUID:TMt};function xu(n,e,t){if(zR.randomUUID&&!e&&!n)return zR.randomUUID();n=n||{};const i=n.random||(n.rng||yMt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let s=0;s<16;++s)e[t+s]=i[s];return e}return SMt(i)}const dc="SAVE_SUBGRAPH";function xMt(n,e){const t=()=>{const i=n.value;if(!i.template)throw new Error("Graph template property not set");i.template.update(i.save()),i.template.panning=i.panning,i.template.scaling=i.scaling};e.registerCommand(dc,{canExecute:()=>{var i;return n.value!==((i=n.value.editor)==null?void 0:i.graph)},execute:t})}const CMt={},RMt={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"},AMt=u("polyline",{points:"6 9 12 15 18 9"},null,-1),wMt=[AMt];function NMt(n,e){return w(),M("svg",RMt,wMt)}const OMt=_n(CMt,[["render",NMt]]),IMt=pn({components:{"i-arrow":OMt},props:{intf:{type:Object,required:!0}},setup(n){const e=mt(null),t=mt(!1),i=it(()=>n.intf.items.find(o=>typeof o=="string"?o===n.intf.value:o.value===n.intf.value)),s=it(()=>i.value?typeof i.value=="string"?i.value:i.value.text:""),r=o=>{n.intf.value=typeof o=="string"?o:o.value};return ZI(e,()=>{t.value=!1}),{el:e,open:t,selectedItem:i,selectedText:s,setSelected:r}}}),MMt=["title"],DMt={class:"__selected"},kMt={class:"__text"},LMt={class:"__icon"},PMt={class:"__dropdown"},UMt={class:"item --header"},FMt=["onClick"];function BMt(n,e,t,i,s,r){const o=ft("i-arrow");return w(),M("div",{ref:"el",class:Ye(["baklava-select",{"--open":n.open}]),title:n.intf.name,onClick:e[0]||(e[0]=a=>n.open=!n.open)},[u("div",DMt,[u("div",kMt,ge(n.selectedText),1),u("div",LMt,[Ie(o)])]),Ie(ls,{name:"slide-fade"},{default:Je(()=>[le(u("div",PMt,[u("div",UMt,ge(n.intf.name),1),(w(!0),M($e,null,dt(n.intf.items,(a,l)=>(w(),M("div",{key:l,class:Ye(["item",{"--active":a===n.selectedItem}]),onClick:d=>n.setSelected(a)},ge(typeof a=="string"?a:a.text),11,FMt))),128))],512),[[Mt,n.open]])]),_:1})],10,MMt)}const GMt=_n(IMt,[["render",BMt]]);class zMt extends tn{constructor(e,t,i){super(e,t),this.component=uc(GMt),this.items=i}}const VMt=pn({props:{intf:{type:Object,required:!0}}});function HMt(n,e,t,i,s,r){return w(),M("div",null,ge(n.intf.value),1)}const qMt=_n(VMt,[["render",HMt]]);class YMt extends tn{constructor(e,t){super(e,t),this.component=uc(qMt),this.setPort(!1)}}const $Mt=pn({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(n,{emit:e}){return{v:it({get:()=>n.modelValue,set:i=>{e("update:modelValue",i)}})}}}),WMt=["placeholder","title"];function KMt(n,e,t,i,s,r){return w(),M("div",null,[le(u("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,WMt),[[Pe,n.v]])])}const jMt=_n($Mt,[["render",KMt]]);class Rc extends tn{constructor(){super(...arguments),this.component=uc(jMt)}}class nM extends VI{constructor(){super(...arguments),this._title="Subgraph Input",this.inputs={name:new Rc("Name","Input").setPort(!1)},this.outputs={placeholder:new tn("Connection",void 0)}}}class iM extends HI{constructor(){super(...arguments),this._title="Subgraph Output",this.inputs={name:new Rc("Name","Output").setPort(!1),placeholder:new tn("Connection",void 0)},this.outputs={output:new tn("Output",void 0).setHidden(!0)}}}const sM="CREATE_SUBGRAPH",VR=[ka,La];function QMt(n,e,t){const i=()=>n.value.selectedNodes.filter(r=>!VR.includes(r.type)).length>0,s=()=>{const{viewModel:r}=Oi(),o=n.value,a=n.value.editor;if(o.selectedNodes.length===0)return;const l=o.selectedNodes.filter(S=>!VR.includes(S.type)),d=l.flatMap(S=>Object.values(S.inputs)),c=l.flatMap(S=>Object.values(S.outputs)),_=o.connections.filter(S=>!c.includes(S.from)&&d.includes(S.to)),f=o.connections.filter(S=>c.includes(S.from)&&!d.includes(S.to)),m=o.connections.filter(S=>c.includes(S.from)&&d.includes(S.to)),h=l.map(S=>S.save()),E=m.map(S=>({id:S.id,from:S.from.id,to:S.to.id})),b=new Map,{xLeft:g,xRight:v,yTop:y}=XMt(l);console.log(g,v,y);for(const[S,A]of _.entries()){const U=new nM;U.inputs.name.value=A.to.name,h.push({...U.save(),position:{x:v-r.value.settings.nodes.defaultWidth-100,y:y+S*200}}),E.push({id:xu(),from:U.outputs.placeholder.id,to:A.to.id}),b.set(A.to.id,U.graphInterfaceId)}for(const[S,A]of f.entries()){const U=new iM;U.inputs.name.value=A.from.name,h.push({...U.save(),position:{x:g+100,y:y+S*200}}),E.push({id:xu(),from:A.from.id,to:U.inputs.placeholder.id}),b.set(A.from.id,U.graphInterfaceId)}const T=ei(new gp({connections:E,nodes:h,inputs:[],outputs:[]},a));a.addGraphTemplate(T);const C=a.nodeTypes.get(Pa(T));if(!C)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");const x=ei(new C.type);o.addNode(x);const O=Math.round(l.map(S=>S.position.x).reduce((S,A)=>S+A,0)/l.length),R=Math.round(l.map(S=>S.position.y).reduce((S,A)=>S+A,0)/l.length);x.position.x=O,x.position.y=R,_.forEach(S=>{o.removeConnection(S),o.addConnection(S.from,x.inputs[b.get(S.to.id)])}),f.forEach(S=>{o.removeConnection(S),o.addConnection(x.outputs[b.get(S.from.id)],S.to)}),l.forEach(S=>o.removeNode(S)),e.canExecuteCommand(dc)&&e.executeCommand(dc),t(T),n.value.panning={...o.panning},n.value.scaling=o.scaling};e.registerCommand(sM,{canExecute:i,execute:s})}function XMt(n){const e=n.reduce((s,r)=>{const o=r.position.x;return o{const o=r.position.y;return o{const o=r.position.x+r.width;return o>s?o:s},-1/0),xRight:e,yTop:t}}const HR="DELETE_NODES";function ZMt(n,e){e.registerCommand(HR,{canExecute:()=>n.value.selectedNodes.length>0,execute(){n.value.selectedNodes.forEach(t=>n.value.removeNode(t))}}),e.registerHotkey(["Delete"],HR)}const rM="SWITCH_TO_MAIN_GRAPH";function JMt(n,e,t){e.registerCommand(rM,{canExecute:()=>n.value!==n.value.editor.graph,execute:()=>{e.executeCommand(dc),t(n.value.editor.graph)}})}function e2t(n,e,t){ZMt(n,e),QMt(n,e,t),xMt(n,e),JMt(n,e,t)}class qR{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 i=new t.type;e.addNode(i),i.load(this.nodeState),this.nodeId=i.id}removeNode(e){const t=e.nodes.find(i=>i.id===this.nodeId);t&&(this.nodeState=t.save(),e.removeNode(t))}}class YR{constructor(e,t){if(this.type=e,e==="addConnection")this.connectionId=t;else{const i=t;this.connectionState={id:i.id,from:i.from.id,to:i.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),i=e.findNodeInterface(this.connectionState.to);!t||!i||e.addConnection(t,i)}removeConnection(e){const t=e.connections.find(i=>i.id===this.connectionId);t&&(this.connectionState={id:t.id,from:t.from.id,to:t.to.id},e.removeConnection(t))}}class t2t{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(!r.value)if(a.value)l.value.push(b);else for(o.value!==s.value.length-1&&(s.value=s.value.slice(0,o.value+1)),s.value.push(b),o.value++;s.value.length>i.value;)s.value.shift()},c=()=>{a.value=!0},_=()=>{a.value=!1,l.value.length>0&&(d(new t2t(l.value)),l.value=[])},f=()=>s.value.length!==0&&o.value!==-1,m=()=>{f()&&(r.value=!0,s.value[o.value--].undo(n.value),r.value=!1)},h=()=>s.value.length!==0&&o.value{h()&&(r.value=!0,s.value[++o.value].redo(n.value),r.value=!1)};return qn(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,v=>{d(new qR("addNode",v.id))}),b.events.removeNode.subscribe(t,v=>{d(new qR("removeNode",v.save()))}),b.events.addConnection.subscribe(t,v=>{d(new YR("addConnection",v.id))}),b.events.removeConnection.subscribe(t,v=>{d(new YR("removeConnection",v))}))},{immediate:!0}),e.registerCommand(Tb,{canExecute:f,execute:m}),e.registerCommand(xb,{canExecute:h,execute:E}),e.registerCommand(oM,{canExecute:()=>!a.value,execute:c}),e.registerCommand(aM,{canExecute:()=>a.value,execute:_}),e.registerHotkey(["Control","z"],Tb),e.registerHotkey(["Control","y"],xb),ei({maxSteps:i})}const Cb="COPY",Rb="PASTE",i2t="CLEAR_CLIPBOARD";function s2t(n,e,t){const i=Symbol("ClipboardToken"),s=mt(""),r=mt(""),o=it(()=>!s.value),a=()=>{s.value="",r.value=""},l=()=>{const _=n.value.selectedNodes.flatMap(m=>[...Object.values(m.inputs),...Object.values(m.outputs)]),f=n.value.connections.filter(m=>_.includes(m.from)||_.includes(m.to)).map(m=>({from:m.from.id,to:m.to.id}));r.value=JSON.stringify(f),s.value=JSON.stringify(n.value.selectedNodes.map(m=>m.save()))},d=(_,f,m)=>{for(const h of _){let E;if((!m||m==="input")&&(E=Object.values(h.inputs).find(b=>b.id===f)),!E&&(!m||m==="output")&&(E=Object.values(h.outputs).find(b=>b.id===f)),E)return E}},c=()=>{if(o.value)return;const _=new Map,f=JSON.parse(s.value),m=JSON.parse(r.value),h=[],E=[],b=n.value;t.executeCommand(oM);for(const g of f){const v=e.value.nodeTypes.get(g.type);if(!v){console.warn(`Node type ${g.type} not registered`);return}const y=new v.type,T=y.id;h.push(y),y.hooks.beforeLoad.subscribe(i,C=>{const x=C;return x.position&&(x.position.x+=100,x.position.y+=100),y.hooks.beforeLoad.unsubscribe(i),x}),b.addNode(y),y.load({...g,id:T}),y.id=T,_.set(g.id,T);for(const C of Object.values(y.inputs)){const x=xu();_.set(C.id,x),C.id=x}for(const C of Object.values(y.outputs)){const x=xu();_.set(C.id,x),C.id=x}}for(const g of m){const v=d(h,_.get(g.from),"output"),y=d(h,_.get(g.to),"input");if(!v||!y)continue;const T=b.addConnection(v,y);T&&E.push(T)}return n.value.selectedNodes=h,t.executeCommand(aM),{newNodes:h,newConnections:E}};return t.registerCommand(Cb,{canExecute:()=>n.value.selectedNodes.length>0,execute:l}),t.registerHotkey(["Control","c"],Cb),t.registerCommand(Rb,{canExecute:()=>!o.value,execute:c}),t.registerHotkey(["Control","v"],Rb),t.registerCommand(i2t,{canExecute:()=>!0,execute:a}),ei({isEmpty:o})}const r2t="OPEN_SIDEBAR";function o2t(n,e){e.registerCommand(r2t,{execute:t=>{n.value.sidebar.nodeId=t,n.value.sidebar.visible=!0},canExecute:()=>!0})}function a2t(n,e){o2t(n,e)}const l2t={},c2t={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"},d2t=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),u2t=u("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"},null,-1),p2t=[d2t,u2t];function _2t(n,e){return w(),M("svg",c2t,p2t)}const h2t=_n(l2t,[["render",_2t]]),f2t={},m2t={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"},g2t=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),b2t=u("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"},null,-1),E2t=[g2t,b2t];function v2t(n,e){return w(),M("svg",m2t,E2t)}const y2t=_n(f2t,[["render",v2t]]),S2t={},T2t={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"},x2t=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),C2t=u("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1),R2t=u("line",{x1:"5",y1:"12",x2:"11",y2:"18"},null,-1),A2t=u("line",{x1:"5",y1:"12",x2:"11",y2:"6"},null,-1),w2t=[x2t,C2t,R2t,A2t];function N2t(n,e){return w(),M("svg",T2t,w2t)}const O2t=_n(S2t,[["render",N2t]]),I2t={},M2t={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"},D2t=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),k2t=u("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),L2t=u("rect",{x:"9",y:"3",width:"6",height:"4",rx:"2"},null,-1),P2t=[D2t,k2t,L2t];function U2t(n,e){return w(),M("svg",M2t,P2t)}const F2t=_n(I2t,[["render",U2t]]),B2t={},G2t={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"},z2t=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),V2t=u("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1),H2t=u("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),q2t=[z2t,V2t,H2t];function Y2t(n,e){return w(),M("svg",G2t,q2t)}const $2t=_n(B2t,[["render",Y2t]]),W2t={},K2t={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"},j2t=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Q2t=u("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),X2t=u("circle",{cx:"12",cy:"14",r:"2"},null,-1),Z2t=u("polyline",{points:"14 4 14 8 8 8 8 4"},null,-1),J2t=[j2t,Q2t,X2t,Z2t];function eDt(n,e){return w(),M("svg",K2t,J2t)}const tDt=_n(W2t,[["render",eDt]]),nDt={},iDt={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"},sDt=zu('',6),rDt=[sDt];function oDt(n,e){return w(),M("svg",iDt,rDt)}const aDt=_n(nDt,[["render",oDt]]),lDt=pn({props:{command:{type:String,required:!0},title:{type:String,required:!0},icon:{type:Object,required:!1,default:void 0}},setup(){const{viewModel:n}=Oi();return{viewModel:n}}}),cDt=["disabled","title"];function dDt(n,e,t,i,s,r){return w(),M("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?(w(),xt(Fu(n.icon),{key:0})):(w(),M($e,{key:1},[Ze(ge(n.title),1)],64))],8,cDt)}const uDt=_n(lDt,[["render",dDt]]),pDt=pn({components:{ToolbarButton:uDt},setup(){const{viewModel:n}=Oi();return{isSubgraph:it(()=>n.value.displayedGraph!==n.value.editor.graph),commands:[{command:Cb,title:"Copy",icon:$2t},{command:Rb,title:"Paste",icon:F2t},{command:Tb,title:"Undo",icon:h2t},{command:xb,title:"Redo",icon:y2t},{command:sM,title:"Create Subgraph",icon:aDt}],subgraphCommands:[{command:dc,title:"Save Subgraph",icon:tDt},{command:rM,title:"Back to Main Graph",icon:O2t}]}}}),_Dt={class:"baklava-toolbar"};function hDt(n,e,t,i,s,r){const o=ft("toolbar-button");return w(),M("div",_Dt,[(w(!0),M($e,null,dt(n.commands,a=>(w(),xt(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)),n.isSubgraph?(w(!0),M($e,{key:0},dt(n.subgraphCommands,a=>(w(),xt(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)):q("",!0)])}const fDt=_n(pDt,[["render",hDt]]),mDt={class:"connections-container"},gDt=pn({__name:"Editor",props:{viewModel:{}},setup(n){const e=n,t=Symbol("EditorToken"),i=jd(e,"viewModel");uIt(i);const s=mt(null);sa("editorEl",s);const r=it(()=>e.viewModel.displayedGraph.nodes),o=it(()=>e.viewModel.displayedGraph.nodes.map(O=>$I(jd(O,"position")))),a=it(()=>e.viewModel.displayedGraph.connections),l=it(()=>e.viewModel.displayedGraph.selectedNodes),d=pIt(),c=_It(),_=hIt(i),f=it(()=>({...d.styles.value})),m=mt(0);e.viewModel.editor.hooks.load.subscribe(t,O=>(m.value++,O));const h=O=>{d.onPointerMove(O),c.onMouseMove(O)},E=O=>{O.button===0&&(O.target===s.value&&(T(),d.onPointerDown(O)),c.onMouseDown())},b=O=>{d.onPointerUp(O),c.onMouseUp()},g=O=>{O.key==="Tab"&&O.preventDefault(),e.viewModel.commandHandler.handleKeyDown(O)},v=O=>{e.viewModel.commandHandler.handleKeyUp(O)},y=O=>{["Control","Shift"].some(R=>e.viewModel.commandHandler.pressedKeys.includes(R))||T(),e.viewModel.displayedGraph.selectedNodes.push(O)},T=()=>{e.viewModel.displayedGraph.selectedNodes=[]},C=O=>{for(const R of e.viewModel.displayedGraph.selectedNodes){const S=r.value.indexOf(R),A=o.value[S];A.onPointerDown(O),document.addEventListener("pointermove",A.onPointerMove)}document.addEventListener("pointerup",x)},x=()=>{for(const O of e.viewModel.displayedGraph.selectedNodes){const R=r.value.indexOf(O),S=o.value[R];S.onPointerUp(),document.removeEventListener("pointermove",S.onPointerMove)}document.removeEventListener("pointerup",x)};return(O,R)=>(w(),M("div",{ref_key:"el",ref:s,tabindex:"-1",class:Ye(["baklava-editor",{"baklava-ignore-mouse":!!vt(c).temporaryConnection.value||vt(d).dragging.value,"--temporary-connection":!!vt(c).temporaryConnection.value}]),onPointermove:Te(h,["self"]),onPointerdown:E,onPointerup:b,onWheel:R[1]||(R[1]=Te((...S)=>vt(d).onMouseWheel&&vt(d).onMouseWheel(...S),["self"])),onKeydown:g,onKeyup:v,onContextmenu:R[2]||(R[2]=Te((...S)=>vt(_).open&&vt(_).open(...S),["self","prevent"]))},[Dn(O.$slots,"background",{},()=>[Ie(gIt)]),Dn(O.$slots,"toolbar",{},()=>[Ie(fDt)]),Dn(O.$slots,"palette",{},()=>[Ie(EMt)]),(w(),M("svg",mDt,[(w(!0),M($e,null,dt(a.value,S=>(w(),M("g",{key:S.id+m.value.toString()},[Dn(O.$slots,"connection",{connection:S},()=>[Ie(tMt,{connection:S},null,8,["connection"])])]))),128)),Dn(O.$slots,"temporaryConnection",{temporaryConnection:vt(c).temporaryConnection.value},()=>[vt(c).temporaryConnection.value?(w(),xt(sMt,{key:0,connection:vt(c).temporaryConnection.value},null,8,["connection"])):q("",!0)])])),u("div",{class:"node-container",style:Jt(f.value)},[Ie(rs,{name:"fade"},{default:Je(()=>[(w(!0),M($e,null,dt(r.value,(S,A)=>Dn(O.$slots,"node",{key:S.id+m.value.toString(),node:S,selected:l.value.includes(S),dragging:o.value[A].dragging.value,onSelect:U=>y(S),onStartDrag:C},()=>[Ie(KIt,{node:S,selected:l.value.includes(S),dragging:o.value[A].dragging.value,onSelect:U=>y(S),onStartDrag:C},null,8,["node","selected","dragging","onSelect"])])),128))]),_:3})],4),Dn(O.$slots,"sidebar",{},()=>[Ie(cMt)]),Dn(O.$slots,"minimap",{},()=>[O.viewModel.settings.enableMinimap?(w(),xt(dMt,{key:0})):q("",!0)]),Dn(O.$slots,"contextMenu",{contextMenu:vt(_)},()=>[O.viewModel.settings.contextMenu.enabled?(w(),xt(hv,{key:0,modelValue:vt(_).show.value,"onUpdate:modelValue":R[0]||(R[0]=S=>vt(_).show.value=S),items:vt(_).items.value,x:vt(_).x.value,y:vt(_).y.value,onClick:vt(_).onClick},null,8,["modelValue","items","x","y","onClick"])):q("",!0)])],34))}}),bDt=["INPUT","TEXTAREA","SELECT"];function EDt(n){const e=mt([]),t=mt([]);return{pressedKeys:e,handleKeyDown:o=>{var a;e.value.includes(o.key)||e.value.push(o.key),!bDt.includes(((a=document.activeElement)==null?void 0:a.tagName)??"")&&t.value.forEach(l=>{l.keys.every(d=>e.value.includes(d))&&n(l.commandName)})},handleKeyUp:o=>{const a=e.value.indexOf(o.key);a>=0&&e.value.splice(a,1)},registerHotkey:(o,a)=>{t.value.push({keys:o,commandName:a})}}}const vDt=()=>{const n=mt(new Map),e=(r,o)=>{if(n.value.has(r))throw new Error(`Command "${r}" already exists`);n.value.set(r,o)},t=(r,o=!1,...a)=>{if(!n.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return}return n.value.get(r).execute(...a)},i=(r,o=!1,...a)=>{if(!n.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return!1}return n.value.get(r).canExecute(a)},s=EDt(t);return ei({registerCommand:e,executeCommand:t,canExecuteCommand:i,...s})},yDt=n=>!(n instanceof Cc);function SDt(n,e){return{switchGraph:i=>{let s;if(yDt(i))s=new Cc(n.value),i.createGraph(s);else{if(i!==n.value.graph)throw new Error("Can only switch using 'Graph' instance when it is the root graph. Otherwise a 'GraphTemplate' must be used.");s=i}e.value&&e.value!==n.value.graph&&e.value.destroy(),s.panning=s.panning??i.panning??{x:0,y:0},s.scaling=s.scaling??i.scaling??1,s.selectedNodes=s.selectedNodes??[],s.sidebar=s.sidebar??{visible:!1,nodeId:"",optionName:""},e.value=s}}}function TDt(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 xDt=()=>({useStraightConnections:!1,enableMinimap:!1,background:{gridSize:100,gridDivision:5,subGridVisibleThreshold:.6},sidebar:{width:300,resizable:!0},displayValueOnHover:!1,nodes:{defaultWidth:200,maxWidth:320,minWidth:150,resizable:!1},contextMenu:{enabled:!0,additionalItems:[]}});function CDt(n){const e=mt(n??new rIt),t=Symbol("ViewModelToken"),i=mt(null),s=d2(i),{switchGraph:r}=SDt(e,i),o=it(()=>s.value&&s.value!==e.value.graph),a=ei(xDt()),l=vDt(),d=n2t(s,l),c=s2t(s,e,l),_={renderNode:new li(null),renderInterface:new li(null)};return e2t(s,l,r),a2t(s,l),qn(e,(f,m)=>{m&&(m.events.registerGraph.unsubscribe(t),m.graphEvents.beforeAddNode.unsubscribe(t),f.nodeHooks.beforeLoad.unsubscribe(t),f.nodeHooks.afterSave.unsubscribe(t),f.graphTemplateHooks.beforeLoad.unsubscribe(t),f.graphTemplateHooks.afterSave.unsubscribe(t),f.graph.hooks.load.unsubscribe(t),f.graph.hooks.save.unsubscribe(t)),f&&(f.nodeHooks.beforeLoad.subscribe(t,(h,E)=>(E.position=h.position??{x:0,y:0},E.width=h.width??a.nodes.defaultWidth,E.twoColumn=h.twoColumn??!1,h)),f.nodeHooks.afterSave.subscribe(t,(h,E)=>(h.position=E.position,h.width=E.width,h.twoColumn=E.twoColumn,h)),f.graphTemplateHooks.beforeLoad.subscribe(t,(h,E)=>(E.panning=h.panning,E.scaling=h.scaling,h)),f.graphTemplateHooks.afterSave.subscribe(t,(h,E)=>(h.panning=E.panning,h.scaling=E.scaling,h)),f.graph.hooks.load.subscribe(t,(h,E)=>(E.panning=h.panning,E.scaling=h.scaling,h)),f.graph.hooks.save.subscribe(t,(h,E)=>(h.panning=E.panning,h.scaling=E.scaling,h)),f.graphEvents.beforeAddNode.subscribe(t,h=>TDt(h,{defaultWidth:a.nodes.defaultWidth})),e.value.registerNodeType(nM,{category:"Subgraphs"}),e.value.registerNodeType(iM,{category:"Subgraphs"}),r(f.graph))},{immediate:!0}),ei({editor:e,displayedGraph:s,isSubgraph:o,settings:a,commandHandler:l,history:d,clipboard:c,hooks:_,switchGraph:r})}const RDt=el({type:"PersonalityNode",title:"Personality",inputs:{request:()=>new tn("Request",""),agent_name:()=>new zMt("Personality","",Cu.state.config.personalities).setPort(!1)},outputs:{response:()=>new tn("Response","")},async calculate({request:n}){console.log(Cu.state.config.personalities);let e="";try{e=(await Me.post("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),ADt=el({type:"RAGNode",title:"RAG",inputs:{request:()=>new tn("Prompt",""),document_path:()=>new Rc("Document path","").setPort(!1)},outputs:{prompt:()=>new tn("Prompt with Data","")},async calculate({request:n,document_path:e}){let t="";try{t=(await Me.get("/rag",{params:{text:n,doc_path:e}})).data}catch(i){console.error(i)}return{response:t}}}),$R=el({type:"Task",title:"Task",inputs:{description:()=>new Rc("Task description","").setPort(!1)},outputs:{prompt:()=>new tn("Prompt")},calculate({description:n}){return{prompt:n}}}),WR=el({type:"TextDisplayNode",title:"TextDisplay",inputs:{text2display:()=>new tn("Input","")},outputs:{response:()=>new YMt("Text","")},async calculate({request:n}){}}),KR=el({type:"LLMNode",title:"LLM",inputs:{request:()=>new tn("Request","")},outputs:{response:()=>new tn("Response","")},async calculate({request:n}){console.log(Cu.state.config.personalities);let e="";try{e=(await Me.post("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),wDt=el({type:"MultichoiceNode",title:"Multichoice",inputs:{question:()=>new tn("Question",""),outputs:()=>new Rc("choices, one per line","","").setPort(!1)},outputs:{response:()=>new tn("Response","")}}),NDt=pn({components:{"baklava-editor":gDt},setup(){const n=CDt(),e=new dIt(n.editor);n.editor.registerNodeType(RDt),n.editor.registerNodeType($R),n.editor.registerNodeType(ADt),n.editor.registerNodeType(WR),n.editor.registerNodeType(KR),n.editor.registerNodeType(wDt);const t=Symbol();e.events.afterRun.subscribe(t,a=>{e.pause(),oIt(a,n.editor),e.resume()}),e.start();function i(a,l,d){const c=new a;return n.displayedGraph.addNode(c),c.position.x=l,c.position.y=d,c}const s=i($R,300,140),r=i(KR,550,140),o=i(WR,850,140);return n.displayedGraph.addConnection(s.outputs.prompt,r.inputs.request),n.displayedGraph.addConnection(r.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)}}}}),ODt={style:{width:"100vw",height:"100vh"}};function IDt(n,e,t,i,s,r){const o=ft("baklava-editor");return w(),M("div",ODt,[Ie(o,{"view-model":n.baklava},null,8,["view-model"]),u("button",{onClick:e[0]||(e[0]=(...a)=>n.saveGraph&&n.saveGraph(...a))},"Save Graph"),u("button",{onClick:e[1]||(e[1]=(...a)=>n.loadGraph&&n.loadGraph(...a))},"Load Graph")])}const MDt=bt(NDt,[["render",IDt]]),DDt={},kDt={style:{width:"100vw",height:"100vh"}},LDt=["src"];function PDt(n,e,t,i,s,r){return w(),M("div",kDt,[u("iframe",{src:n.$store.state.config.comfyui_base_url,class:"m-0 p-0 w-full h-full"},null,8,LDt)])}const UDt=bt(DDt,[["render",PDt]]),FDt=jP({history:_P("/"),routes:[{path:"/comfyui_view/",name:"ComfyUI",component:UDt},{path:"/playground/",name:"playground",component:Ett},{path:"/extensions/",name:"extensions",component:Ott},{path:"/help/",name:"help",component:Qtt},{path:"/settings/",name:"settings",component:smt},{path:"/training/",name:"training",component:Cmt},{path:"/quantizing/",name:"quantizing",component:kmt},{path:"/",name:"discussions",component:PTt},{path:"/",name:"interactive",component:ZOt},{path:"/",name:"nodes",component:MDt}]});const bp=tk(yZe);console.log("Loaded main.js");function jR(n){const e={};for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}const Cu=Ak({state(){return{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},client_id:"",yesNoDialog:null,universalForm:null,toast:null,news:null,messageBox:null,api_get_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:[],mountedExtensions:[],bindingsZoo:[],modelsArr:[],selectedModel:null,personalities:[],diskUsage:null,ramUsage:null,vramUsage:null,modelsZoo:[],installedModels:[],currentModel:null,extensionsZoo:[],databases:[]}},mutations:{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},setMountedExtensions(n,e){n.mountedExtensions=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},setCurrentModel(n,e){n.currentModel=e},setExtensionsZoo(n,e){n.extensionsZoo=e},setDatabases(n,e){n.databases=e},setTheme(n){this.currentTheme=n}},getters:{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},getmmountedExtensions(n){return n.mountedExtensions},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},getCurrentModel(n){return n.currentModel},getExtensionsZoo(n){return n.extensionsZoo}},actions:{async getVersion(){try{let n=await Me.get("/get_lollms_webui_version",{});n&&(this.state.version=n.data,console.log("version res:",n),console.log("version :",this.state.version))}catch{console.log("Coudln't get version")}},async refreshConfig({commit:n}){console.log("Fetching configuration");try{const e=await _i("get_config");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],e.extensions.length>0?e.extension_category=e.extensions[-1]:e.extension_category="ai_sensors",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 _i("list_databases");console.log("databases:",e),n("setDatabases",e)},async refreshPersonalitiesZoo({commit:n}){let e=[];const t=await _i("get_all_personalities"),i=Object.keys(t);console.log("Personalities recovered:"+this.state.config.personalities);for(let s=0;s{let d=!1;for(const _ of this.state.config.personalities)if(_.includes(r+"/"+l.folder))if(d=!0,_.includes(":")){const f=_.split(":");l.language=f[1]}else l.language=null;let c={};return c=l,c.category=r,c.full_path=r+"/"+l.folder,c.isMounted=d,c});e.length==0?e=a:e=e.concat(a)}e.sort((s,r)=>s.name.localeCompare(r.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 i=0;ia.full_path==s||a.full_path==r[0]);if(o>=0){let a=jR(this.state.personalities[o]);r.length>1&&(a.language=r[1]),a?e.push(a):e.push(this.state.personalities[this.state.personalities.findIndex(l=>l.full_path=="generic/lollms")])}else t.push(i),console.log("Couldn't load personality : ",s)}for(let i=t.length-1;i>=0;i--)console.log("Removing personality : ",this.state.config.personalities[t[i]]),this.state.config.personalities.splice(t[i],1),this.state.config.active_personality_id>t[i]&&(this.state.config.active_personality_id-=1);n("setMountedPersArr",e),this.state.mountedPers=this.state.personalities[this.state.personalities.findIndex(i=>i.full_path==this.state.config.personalities[this.state.config.active_personality_id]||i.full_path+":"+i.language==this.state.config.personalities[this.state.config.active_personality_id])]},async refreshBindings({commit:n}){let e=await _i("list_bindings");n("setbindingsZoo",e)},async refreshModelsZoo({commit:n}){console.log("Fetching models");const t=(await Me.get("/get_available_models")).data.filter(i=>i.variants&&i.variants.length>0);console.log(`get_available_models: ${t}`),n("setModelsZoo",t)},async refreshModelStatus({commit:n}){let e=await _i("get_model_status");n("setIsModelOk",e.status)},async refreshModels({commit:n}){console.log("Fetching models");let e=await _i("list_models");console.log(`Found ${e}`);let t=await _i("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(s=>{console.log("model found"),s.isInstalled=e.includes(s.name)}),this.state.installedModels=this.state.modelsZoo.filter(s=>s.isInstalled);const i=this.state.modelsZoo.findIndex(s=>s.name==this.state.config.model_name);i!=-1&&n("setCurrentModel",this.state.modelsZoo[i])},async refreshExtensionsZoo({commit:n}){let e=[],t=await _i("list_extensions");const i=Object.keys(t);console.log("Extensions recovered:"+t);for(let s=0;s{let d=!1;for(const _ of this.state.config.extensions)_.includes(r+"/"+l.folder)&&(d=!0);let c={};return c=l,c.category=r,c.full_path=r+"/"+l.folder,c.isMounted=d,c});e.length==0?e=a:e=e.concat(a)}e.sort((s,r)=>s.name.localeCompare(r.name)),console.log("Done loading extensions"),n("setExtensionsZoo",e)},refreshmountedExtensions({commit:n}){console.log("Mounting extensions");let e=[];const t=[];for(let i=0;io.full_path==s);if(r>=0){let o=jR(this.state.config.extensions[r]);o&&e.push(o)}else t.push(i),console.log("Couldn't load extension : ",s)}for(let i=t.length-1;i>=0;i--)console.log("Removing extensions : ",this.state.config.extensions[t[i]]),this.state.config.extensions.splice(t[i],1);n("setMountedExtensions",e)},async refreshDiskUsage({commit:n}){this.state.diskUsage=await _i("disk_usage")},async refreshRamUsage({commit:n}){this.state.ramUsage=await _i("ram_usage")},async refreshVramUsage({commit:n}){const e=await _i("vram_usage"),t=[];if(e.nb_gpus>0){for(let s=0;s!!t.value),onPointerDown:l=>{t.value={x:l.pageX,y:l.pageY},i.value={x:n.value.x,y:n.value.y}},onPointerMove:l=>{if(t.value){const d=l.pageX-t.value.x,c=l.pageY-t.value.y;n.value.x=i.value.x+d/e.value.scaling,n.value.y=i.value.y+c/e.value.scaling}},onPointerUp:()=>{t.value=null,i.value=null}}}function WI(n,e,t){if(!e.template)return!1;if(Pa(e.template)===t)return!0;const i=n.graphTemplates.find(r=>Pa(r)===t);return i?i.nodes.filter(r=>r.type.startsWith(cc)).some(r=>WI(n,e,r.type)):!1}function KI(n){return it(()=>{const e=Array.from(n.value.editor.nodeTypes.entries()),t=new Set(e.map(([,s])=>s.category)),i=[];for(const s of t.values()){let r=e.filter(([,o])=>o.category===s);n.value.displayedGraph.template?r=r.filter(([o])=>!WI(n.value.editor,n.value.displayedGraph,o)):r=r.filter(([o])=>![ka,La].includes(o)),r.length>0&&i.push({name:s,nodeTypes:Object.fromEntries(r)})}return i.sort((s,r)=>s.name==="default"?-1:r.name==="default"||s.name>r.name?1:-1),i})}function jI(){const{graph:n}=Wi();return{transform:(t,i)=>{const s=t/n.value.scaling-n.value.panning.x,r=i/n.value.scaling-n.value.panning.y;return[s,r]}}}function hIt(){const{graph:n}=Wi();let e=[],t=-1,i={x:0,y:0};const s=it(()=>n.value.panning),r=$I(s),o=it(()=>({"transform-origin":"0 0",transform:`scale(${n.value.scaling}) translate(${n.value.panning.x}px, ${n.value.panning.y}px)`})),a=(m,h,E)=>{const b=[m/n.value.scaling-n.value.panning.x,h/n.value.scaling-n.value.panning.y],g=[m/E-n.value.panning.x,h/E-n.value.panning.y],v=[g[0]-b[0],g[1]-b[1]];n.value.panning.x+=v[0],n.value.panning.y+=v[1],n.value.scaling=E},l=m=>{m.preventDefault();let h=m.deltaY;m.deltaMode===1&&(h*=32);const E=n.value.scaling*(1-h/3e3);a(m.offsetX,m.offsetY,E)},d=()=>({ax:e[0].clientX,ay:e[0].clientY,bx:e[1].clientX,by:e[1].clientY});return{styles:o,...r,onPointerDown:m=>{if(e.push(m),r.onPointerDown(m),e.length===2){const{ax:h,ay:E,bx:b,by:g}=d();i={x:h+(b-h)/2,y:E+(g-E)/2}}},onPointerMove:m=>{for(let h=0;h0){const C=n.value.scaling*(1+(T-t)/500);a(i.x,i.y,C)}t=T}else r.onPointerMove(m)},onPointerUp:m=>{e=e.filter(h=>h.pointerId!==m.pointerId),t=-1,r.onPointerUp()},onMouseWheel:l}}var vi=(n=>(n[n.NONE=0]="NONE",n[n.ALLOWED=1]="ALLOWED",n[n.FORBIDDEN=2]="FORBIDDEN",n))(vi||{});const QI=Symbol();function fIt(){const{graph:n}=Wi(),e=mt(null),t=mt(null),i=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)},s=()=>{if(t.value){if(e.value)return;const a=n.value.connections.find(l=>l.to===t.value);t.value.isInput&&a?(e.value={status:vi.NONE,from:a.from},n.value.removeConnection(a)):e.value={status:vi.NONE,from:t.value},e.value.mx=void 0,e.value.my=void 0}},r=()=>{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 l=n.value.checkConnection(e.value.from,e.value.to);if(e.value.status=l.connectionAllowed?vi.ALLOWED:vi.FORBIDDEN,l.connectionAllowed){const d=l.connectionsInDanger.map(c=>c.id);n.value.connections.forEach(c=>{d.includes(c.id)&&(c.isInDanger=!0)})}}else!a&&e.value&&(e.value.to=void 0,e.value.status=vi.NONE,n.value.connections.forEach(l=>{l.isInDanger=!1}))};return sa(QI,{temporaryConnection:e,hoveredOver:o}),{temporaryConnection:e,onMouseMove:i,onMouseDown:s,onMouseUp:r,hoveredOver:o}}function mIt(n){const e=mt(!1),t=mt(0),i=mt(0),s=KI(n),{transform:r}=jI(),o=it(()=>{let c=[];const _={};for(const m of s.value){const h=Object.entries(m.nodeTypes).map(([E,b])=>({label:b.title,value:"addNode:"+E}));m.name==="default"?c=h:_[m.name]=h}const f=[...Object.entries(_).map(([m,h])=>({label:m,submenu:h}))];return f.length>0&&c.length>0&&f.push({isDivider:!0}),f.push(...c),f}),a=it(()=>n.value.settings.contextMenu.additionalItems.length===0?o.value:[{label:"Add node",submenu:o.value},...n.value.settings.contextMenu.additionalItems.map(c=>"isDivider"in c||"submenu"in c?c:{label:c.label,value:"command:"+c.command,disabled:!n.value.commandHandler.canExecuteCommand(c.command)})]);function l(c){e.value=!0,t.value=c.offsetX,i.value=c.offsetY}function d(c){if(c.startsWith("addNode:")){const _=c.substring(8),f=n.value.editor.nodeTypes.get(_);if(!f)return;const m=ei(new f.type);n.value.displayedGraph.addNode(m);const[h,E]=r(t.value,i.value);m.position.x=h,m.position.y=E}else if(c.startsWith("command:")){const _=c.substring(8);n.value.commandHandler.canExecuteCommand(_)&&n.value.commandHandler.executeCommand(_)}}return{show:e,x:t,y:i,items:a,open:l,onClick:d}}const gIt=pn({setup(){const{viewModel:n}=Oi(),{graph:e}=Wi();return{styles:it(()=>{const i=n.value.settings.background,s=e.value.panning.x*e.value.scaling,r=e.value.panning.y*e.value.scaling,o=e.value.scaling*i.gridSize,a=o/i.gridDivision,l=`${o}px ${o}px, ${o}px ${o}px`,d=e.value.scaling>i.subGridVisibleThreshold?`, ${a}px ${a}px, ${a}px ${a}px`:"";return{backgroundPosition:`left ${s}px top ${r}px`,backgroundSize:`${l} ${d}`}})}}}),_n=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t};function bIt(n,e,t,i,s,r){return w(),M("div",{class:"background",style:Jt(n.styles)},null,4)}const EIt=_n(gIt,[["render",bIt]]);function vIt(n){return iA()?(LM(n),!0):!1}function pv(n){return typeof n=="function"?n():vt(n)}const XI=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const yIt=Object.prototype.toString,SIt=n=>yIt.call(n)==="[object Object]",qd=()=>{},TIt=xIt();function xIt(){var n,e;return XI&&((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 CIt(n,e,t=!1){return e.reduce((i,s)=>(s in n&&(!t||n[s]!==void 0)&&(i[s]=n[s]),i),{})}function RIt(n,e={}){if(!hn(n))return m2(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=f2(()=>({get(){return n.value[i]},set(s){var r;if((r=pv(e.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return t}function Nl(n){var e;const t=pv(n);return(e=t==null?void 0:t.$el)!=null?e:t}const _v=XI?window:void 0;function Vl(...n){let e,t,i,s;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,i,s]=n,e=_v):[e,t,i,s]=n,!e)return qd;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const r=[],o=()=>{r.forEach(c=>c()),r.length=0},a=(c,_,f,m)=>(c.addEventListener(_,f,m),()=>c.removeEventListener(_,f,m)),l=qn(()=>[Nl(e),pv(s)],([c,_])=>{if(o(),!c)return;const f=SIt(_)?{..._}:_;r.push(...t.flatMap(m=>i.map(h=>a(c,m,h,f))))},{immediate:!0,flush:"post"}),d=()=>{l(),o()};return vIt(d),d}let FR=!1;function ZI(n,e,t={}){const{window:i=_v,ignore:s=[],capture:r=!0,detectIframe:o=!1}=t;if(!i)return qd;TIt&&!FR&&(FR=!0,Array.from(i.document.body.children).forEach(f=>f.addEventListener("click",qd)),i.document.documentElement.addEventListener("click",qd));let a=!0;const l=f=>s.some(m=>{if(typeof m=="string")return Array.from(i.document.querySelectorAll(m)).some(h=>h===f.target||f.composedPath().includes(h));{const h=Nl(m);return h&&(f.target===h||f.composedPath().includes(h))}}),c=[Vl(i,"click",f=>{const m=Nl(n);if(!(!m||m===f.target||f.composedPath().includes(m))){if(f.detail===0&&(a=!l(f)),!a){a=!0;return}e(f)}},{passive:!0,capture:r}),Vl(i,"pointerdown",f=>{const m=Nl(n);a=!l(f)&&!!(m&&!f.composedPath().includes(m))},{passive:!0}),o&&Vl(i,"blur",f=>{setTimeout(()=>{var m;const h=Nl(n);((m=i.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!(h!=null&&h.contains(i.document.activeElement))&&e(f)},0)})].filter(Boolean);return()=>c.forEach(f=>f())}const JI={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},AIt=Object.keys(JI);function wIt(n={}){const{target:e=_v}=n,t=mt(!1),i=mt(n.initialValue||{});Object.assign(i.value,JI,i.value);const s=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(i.value=CIt(r,AIt,!1))};if(e){const r={passive:!0};Vl(e,["pointerdown","pointermove","pointerup"],s,r),Vl(e,"pointerleave",()=>t.value=!1,r)}return{...RIt(i),isInside:t}}const NIt=["onMouseenter","onMouseleave","onClick"],OIt={class:"flex-fill"},IIt={key:0,class:"__submenu-icon",style:{"line-height":"1em"}},MIt=u("svg",{width:"13",height:"13",viewBox:"-60 120 250 250"},[u("path",{d:"M160.875 279.5625 L70.875 369.5625 L70.875 189.5625 L160.875 279.5625 Z",stroke:"none",fill:"white"})],-1),DIt=[MIt],hv=pn({__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,i=e;let s=null;const r=mt(null),o=mt(-1),a=mt(0),l=mt({x:!1,y:!1}),d=it(()=>t.flippable&&(l.value.x||t.isFlipped.x)),c=it(()=>t.flippable&&(l.value.y||t.isFlipped.y)),_=it(()=>{const v={};return t.isNested||(v.top=(c.value?t.y-a.value:t.y)+"px",v.left=t.x+"px"),v}),f=it(()=>({"--flipped-x":d.value,"--flipped-y":c.value,"--nested":t.isNested})),m=it(()=>t.items.map(v=>({...v,hover:!1})));qn([()=>t.y,()=>t.items],()=>{var v,y,T,C;a.value=t.items.length*30;const x=((y=(v=r.value)==null?void 0:v.parentElement)==null?void 0:y.offsetWidth)??0,O=((C=(T=r.value)==null?void 0:T.parentElement)==null?void 0:C.offsetHeight)??0;l.value.x=!t.isNested&&t.x>x*.75,l.value.y=!t.isNested&&t.y+a.value>O-20}),ZI(r,()=>{t.modelValue&&i("update:modelValue",!1)});const h=v=>{!v.submenu&&v.value&&(i("click",v.value),i("update:modelValue",!1))},E=v=>{i("click",v),o.value=-1,t.isNested||i("update:modelValue",!1)},b=(v,y)=>{t.items[y].submenu&&(o.value=y,s!==null&&(clearTimeout(s),s=null))},g=(v,y)=>{t.items[y].submenu&&(s=window.setTimeout(()=>{o.value=-1,s=null},200))};return(v,y)=>{const T=ft("ContextMenu",!0);return w(),xt(ls,{name:"slide-fade"},{default:Je(()=>[le(u("div",{ref_key:"el",ref:r,class:Ye(["baklava-context-menu",f.value]),style:Jt(_.value)},[(w(!0),M($e,null,dt(m.value,(C,x)=>(w(),M($e,null,[C.isDivider?(w(),M("div",{key:`d-${x}`,class:"divider"})):(w(),M("div",{key:`i-${x}`,class:Ye(["item",{submenu:!!C.submenu,"--disabled":!!C.disabled}]),onMouseenter:O=>b(O,x),onMouseleave:O=>g(O,x),onClick:Te(O=>h(C),["stop","prevent"])},[u("div",OIt,ge(C.label),1),C.submenu?(w(),M("div",IIt,DIt)):q("",!0),C.submenu?(w(),xt(T,{key:1,"model-value":o.value===x,items:C.submenu,"is-nested":!0,"is-flipped":{x:d.value,y:c.value},flippable:v.flippable,onClick:E},null,8,["model-value","items","is-flipped","flippable"])):q("",!0)],42,NIt))],64))),256))],6),[[Mt,v.modelValue]])]),_:1})}}}),kIt={},LIt={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"},PIt=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),UIt=u("circle",{cx:"12",cy:"12",r:"1"},null,-1),FIt=u("circle",{cx:"12",cy:"19",r:"1"},null,-1),BIt=u("circle",{cx:"12",cy:"5",r:"1"},null,-1),GIt=[PIt,UIt,FIt,BIt];function zIt(n,e){return w(),M("svg",LIt,GIt)}const eM=_n(kIt,[["render",zIt]]),VIt=["id"],HIt={key:0,class:"__tooltip"},qIt={key:2,class:"align-middle"},BR=pn({__name:"NodeInterface",props:{node:{},intf:{}},setup(n){const e=(b,g=100)=>{const v=b!=null&&b.toString?b.toString():"";return v.length>g?v.slice(0,g)+"...":v},t=n,{viewModel:i}=Oi(),{hoveredOver:s,temporaryConnection:r}=Gi(QI),o=mt(null),a=it(()=>t.intf.connectionCount>0),l=mt(!1),d=it(()=>i.value.settings.displayValueOnHover&&l.value),c=it(()=>({"--input":t.intf.isInput,"--output":!t.intf.isInput,"--connected":a.value})),_=it(()=>t.intf.component&&(!t.intf.isInput||!t.intf.port||t.intf.connectionCount===0)),f=()=>{l.value=!0,s(t.intf)},m=()=>{l.value=!1,s(void 0)},h=()=>{o.value&&i.value.hooks.renderInterface.execute({intf:t.intf,el:o.value})},E=()=>{const b=i.value.displayedGraph.sidebar;b.nodeId=t.node.id,b.optionName=t.intf.name,b.visible=!0};return qs(h),pc(h),(b,g)=>{var v;return w(),M("div",{id:b.intf.id,ref_key:"el",ref:o,class:Ye(["baklava-node-interface",c.value])},[b.intf.port?(w(),M("div",{key:0,class:Ye(["__port",{"--selected":((v=vt(r))==null?void 0:v.from)===b.intf}]),onPointerover:f,onPointerout:m},[Dn(b.$slots,"portTooltip",{showTooltip:d.value},()=>[d.value===!0?(w(),M("span",HIt,ge(e(b.intf.value)),1)):q("",!0)])],34)):q("",!0),_.value?(w(),xt(Fu(b.intf.component),{key:1,modelValue:b.intf.value,"onUpdate:modelValue":g[0]||(g[0]=y=>b.intf.value=y),node:b.node,intf:b.intf,onOpenSidebar:E},null,40,["modelValue","node","intf"])):(w(),M("span",qIt,ge(b.intf.name),1))],10,VIt)}}}),YIt=["id","data-node-type"],$It={class:"__title-label"},WIt={class:"__menu"},KIt={class:"__outputs"},jIt={class:"__inputs"},QIt=pn({__name:"Node",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag"],setup(n,{emit:e}){const t=n,i=e,{viewModel:s}=Oi(),{graph:r,switchGraph:o}=Wi(),a=mt(null),l=mt(!1),d=mt(""),c=mt(null),_=mt(!1),f=mt(!1),m=it(()=>{const U=[{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return t.node.type.startsWith(cc)&&U.push({value:"editSubgraph",label:"Edit Subgraph"}),U}),h=it(()=>({"--selected":t.selected,"--dragging":t.dragging,"--two-column":!!t.node.twoColumn})),E=it(()=>{var U,F;return{top:`${((U=t.node.position)==null?void 0:U.y)??0}px`,left:`${((F=t.node.position)==null?void 0:F.x)??0}px`,"--width":`${t.node.width??s.value.settings.nodes.defaultWidth}px`}}),b=it(()=>Object.values(t.node.inputs).filter(U=>!U.hidden)),g=it(()=>Object.values(t.node.outputs).filter(U=>!U.hidden)),v=()=>{i("select")},y=U=>{t.selected||v(),i("start-drag",U)},T=()=>{f.value=!0},C=async U=>{var F;switch(U){case"delete":r.value.removeNode(t.node);break;case"rename":d.value=t.node.title,l.value=!0,await Ve(),(F=c.value)==null||F.focus();break;case"editSubgraph":o(t.node.template);break}},x=()=>{t.node.title=d.value,l.value=!1},O=()=>{a.value&&s.value.hooks.renderNode.execute({node:t.node,el:a.value})},R=U=>{_.value=!0,U.preventDefault()},S=U=>{if(!_.value)return;const F=t.node.width+U.movementX/r.value.scaling,K=s.value.settings.nodes.minWidth,L=s.value.settings.nodes.maxWidth;t.node.width=Math.max(K,Math.min(L,F))},A=()=>{_.value=!1};return qs(()=>{O(),window.addEventListener("mousemove",S),window.addEventListener("mouseup",A)}),pc(O),Va(()=>{window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",A)}),(U,F)=>(w(),M("div",{id:U.node.id,ref_key:"el",ref:a,class:Ye(["baklava-node",h.value]),style:Jt(E.value),"data-node-type":U.node.type,onPointerdown:v},[vt(s).settings.nodes.resizable?(w(),M("div",{key:0,class:"__resize-handle",onMousedown:R},null,32)):q("",!0),Dn(U.$slots,"title",{},()=>[u("div",{class:"__title",onPointerdown:Te(y,["self","stop"])},[l.value?le((w(),M("input",{key:1,ref_key:"renameInputEl",ref:c,"onUpdate:modelValue":F[1]||(F[1]=K=>d.value=K),type:"text",class:"baklava-input",placeholder:"Node Name",onBlur:x,onKeydown:wr(x,["enter"])},null,544)),[[Pe,d.value]]):(w(),M($e,{key:0},[u("div",$It,ge(U.node.title),1),u("div",WIt,[Ie(eM,{class:"--clickable",onClick:T}),Ie(hv,{modelValue:f.value,"onUpdate:modelValue":F[0]||(F[0]=K=>f.value=K),x:0,y:0,items:m.value,onClick:C},null,8,["modelValue","items"])])],64))],32)]),Dn(U.$slots,"content",{},()=>[u("div",{class:"__content",onKeydown:F[2]||(F[2]=wr(Te(()=>{},["stop"]),["delete"]))},[u("div",KIt,[(w(!0),M($e,null,dt(g.value,K=>Dn(U.$slots,"nodeInterface",{key:K.id,type:"output",node:U.node,intf:K},()=>[Ie(BR,{node:U.node,intf:K},null,8,["node","intf"])])),128))]),u("div",jIt,[(w(!0),M($e,null,dt(b.value,K=>Dn(U.$slots,"nodeInterface",{key:K.id,type:"input",node:U.node,intf:K},()=>[Ie(BR,{node:U.node,intf:K},null,8,["node","intf"])])),128))])],32)])],46,YIt))}}),XIt=pn({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:vi.NONE},isTemporary:{type:Boolean,default:!1}},setup(n){const{viewModel:e}=Oi(),{graph:t}=Wi(),i=(o,a)=>{const l=(o+t.value.panning.x)*t.value.scaling,d=(a+t.value.panning.y)*t.value.scaling;return[l,d]},s=it(()=>{const[o,a]=i(n.x1,n.y1),[l,d]=i(n.x2,n.y2);if(e.value.settings.useStraightConnections)return`M ${o} ${a} L ${l} ${d}`;{const c=.3*Math.abs(o-l);return`M ${o} ${a} C ${o+c} ${a}, ${l-c} ${d}, ${l} ${d}`}}),r=it(()=>({"--temporary":n.isTemporary,"--allowed":n.state===vi.ALLOWED,"--forbidden":n.state===vi.FORBIDDEN}));return{d:s,classes:r}}}),ZIt=["d"];function JIt(n,e,t,i,s,r){return w(),M("path",{class:Ye(["baklava-connection",n.classes]),d:n.d},null,10,ZIt)}const tM=_n(XIt,[["render",JIt]]);function eMt(n){return document.getElementById(n.id)}function Ua(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 tMt=pn({components:{"connection-view":tM},props:{connection:{type:Object,required:!0}},setup(n){const{graph:e}=Wi();let t;const i=mt({x1:0,y1:0,x2:0,y2:0}),s=it(()=>n.connection.isInDanger?vi.FORBIDDEN:vi.NONE),r=it(()=>{var d;return(d=e.value.findNodeById(n.connection.from.nodeId))==null?void 0:d.position}),o=it(()=>{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],l=()=>{const d=Ua(n.connection.from),c=Ua(n.connection.to);d.node&&c.node&&(t||(t=new ResizeObserver(()=>{l()}),t.observe(d.node),t.observe(c.node)));const[_,f]=a(d),[m,h]=a(c);i.value={x1:_,y1:f,x2:m,y2:h}};return qs(async()=>{await Ve(),l()}),Va(()=>{t&&t.disconnect()}),qn([r,o],()=>l(),{deep:!0}),{d:i,state:s}}});function nMt(n,e,t,i,s,r){const o=ft("connection-view");return w(),xt(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 iMt=_n(tMt,[["render",nMt]]);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 sMt=pn({components:{"connection-view":tM},props:{connection:{type:Object,required:!0}},setup(n){const e=it(()=>n.connection?n.connection.status:vi.NONE);return{d:it(()=>{if(!n.connection)return{input:[0,0],output:[0,0]};const i=Tu(Ua(n.connection.from)),s=n.connection.to?Tu(Ua(n.connection.to)):[n.connection.mx||i[0],n.connection.my||i[1]];return n.connection.from.isInput?{input:s,output:i}:{input:i,output:s}}),status:e}}});function rMt(n,e,t,i,s,r){const o=ft("connection-view");return w(),xt(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 oMt=_n(sMt,[["render",rMt]]),aMt=pn({setup(){const{viewModel:n}=Oi(),{graph:e}=Wi(),t=mt(null),i=jd(n.value.settings.sidebar,"width"),s=it(()=>n.value.settings.sidebar.resizable),r=it(()=>{const _=e.value.sidebar.nodeId;return e.value.nodes.find(f=>f.id===_)}),o=it(()=>({width:`${i.value}px`})),a=it(()=>r.value?[...Object.values(r.value.inputs),...Object.values(r.value.outputs)].filter(f=>f.displayInSidebar&&f.component):[]),l=()=>{e.value.sidebar.visible=!1},d=()=>{window.addEventListener("mousemove",c),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",c)},{once:!0})},c=_=>{var f,m;const h=((m=(f=t.value)==null?void 0:f.parentElement)==null?void 0:m.getBoundingClientRect().width)??500;let E=i.value-_.movementX;E<300?E=300:E>.9*h&&(E=.9*h),i.value=E};return{el:t,graph:e,resizable:s,node:r,styles:o,displayedInterfaces:a,startResize:d,close:l}}}),lMt={class:"__header"},cMt={class:"__node-name"};function dMt(n,e,t,i,s,r){return w(),M("div",{ref:"el",class:Ye(["baklava-sidebar",{"--open":n.graph.sidebar.visible}]),style:Jt(n.styles)},[n.resizable?(w(),M("div",{key:0,class:"__resizer",onMousedown:e[0]||(e[0]=(...o)=>n.startResize&&n.startResize(...o))},null,32)):q("",!0),u("div",lMt,[u("button",{tabindex:"-1",class:"__close",onClick:e[1]||(e[1]=(...o)=>n.close&&n.close(...o))},"×"),u("div",cMt,[u("b",null,ge(n.node?n.node.title:""),1)])]),(w(!0),M($e,null,dt(n.displayedInterfaces,o=>(w(),M("div",{key:o.id,class:"__interface"},[(w(),xt(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 uMt=_n(aMt,[["render",dMt]]),pMt=pn({__name:"Minimap",setup(n){const{viewModel:e}=Oi(),{graph:t}=Wi(),i=mt(null),s=mt(!1);let r,o=!1,a={x1:0,y1:0,x2:0,y2:0},l;const d=()=>{var x,O;if(!r)return;r.canvas.width=i.value.offsetWidth,r.canvas.height=i.value.offsetHeight;const R=new Map,S=new Map;for(const L of t.value.nodes){const H=eMt(L),G=(H==null?void 0:H.offsetWidth)??0,P=(H==null?void 0:H.offsetHeight)??0,j=((x=L.position)==null?void 0:x.x)??0,Y=((O=L.position)==null?void 0:O.y)??0;R.set(L,{x1:j,y1:Y,x2:j+G,y2:Y+P}),S.set(L,H)}const A={x1:Number.MAX_SAFE_INTEGER,y1:Number.MAX_SAFE_INTEGER,x2:Number.MIN_SAFE_INTEGER,y2:Number.MIN_SAFE_INTEGER};for(const L of R.values())L.x1A.x2&&(A.x2=L.x2),L.y2>A.y2&&(A.y2=L.y2);const U=50;A.x1-=U,A.y1-=U,A.x2+=U,A.y2+=U,a=A;const F=r.canvas.width/r.canvas.height,K=(a.x2-a.x1)/(a.y2-a.y1);if(F>K){const L=(F-K)*(a.y2-a.y1)*.5;a.x1-=L,a.x2+=L}else{const L=a.x2-a.x1,H=a.y2-a.y1,G=(L-F*H)/F*.5;a.y1-=G,a.y2+=G}r.clearRect(0,0,r.canvas.width,r.canvas.height),r.strokeStyle="white";for(const L of t.value.connections){const[H,G]=Tu(Ua(L.from)),[P,j]=Tu(Ua(L.to)),[Y,Q]=c(H,G),[re,te]=c(P,j);if(r.beginPath(),r.moveTo(Y,Q),e.value.settings.useStraightConnections)r.lineTo(re,te);else{const Z=.3*Math.abs(Y-re);r.bezierCurveTo(Y+Z,Q,re-Z,te,re,te)}r.stroke()}r.strokeStyle="lightgray";for(const[L,H]of R.entries()){const[G,P]=c(H.x1,H.y1),[j,Y]=c(H.x2,H.y2);r.fillStyle=f(S.get(L)),r.beginPath(),r.rect(G,P,j-G,Y-P),r.fill(),r.stroke()}if(s.value){const L=h(),[H,G]=c(L.x1,L.y1),[P,j]=c(L.x2,L.y2);r.fillStyle="rgba(255, 255, 255, 0.2)",r.fillRect(H,G,P-H,j-G)}},c=(x,O)=>[(x-a.x1)/(a.x2-a.x1)*r.canvas.width,(O-a.y1)/(a.y2-a.y1)*r.canvas.height],_=(x,O)=>[x*(a.x2-a.x1)/r.canvas.width+a.x1,O*(a.y2-a.y1)/r.canvas.height+a.y1],f=x=>{if(x){const O=x.querySelector(".__content");if(O){const S=m(O);if(S)return S}const R=m(x);if(R)return R}return"gray"},m=x=>{const O=getComputedStyle(x).backgroundColor;if(O&&O!=="rgba(0, 0, 0, 0)")return O},h=()=>{const x=i.value.parentElement.offsetWidth,O=i.value.parentElement.offsetHeight,R=x/t.value.scaling-t.value.panning.x,S=O/t.value.scaling-t.value.panning.y;return{x1:-t.value.panning.x,y1:-t.value.panning.y,x2:R,y2:S}},E=x=>{x.button===0&&(o=!0,b(x))},b=x=>{if(o){const[O,R]=_(x.offsetX,x.offsetY),S=h(),A=(S.x2-S.x1)/2,U=(S.y2-S.y1)/2;t.value.panning.x=-(O-A),t.value.panning.y=-(R-U)}},g=()=>{o=!1},v=()=>{s.value=!0},y=()=>{s.value=!1,g()};qn([s,t.value.panning,()=>t.value.scaling,()=>t.value.connections.length],()=>{d()});const T=it(()=>t.value.nodes.map(x=>x.position)),C=it(()=>t.value.nodes.map(x=>x.width));return qn([T,C],()=>{d()},{deep:!0}),qs(()=>{r=i.value.getContext("2d"),r.imageSmoothingQuality="high",d(),l=setInterval(d,500)}),Va(()=>{clearInterval(l)}),(x,O)=>(w(),M("canvas",{ref_key:"canvas",ref:i,class:"baklava-minimap",onMouseenter:v,onMouseleave:y,onMousedown:Te(E,["self"]),onMousemove:Te(b,["self"]),onMouseup:g},null,544))}}),_Mt=pn({components:{ContextMenu:hv,VerticalDots:eM},props:{type:{type:String,required:!0},title:{type:String,required:!0}},setup(n){const{viewModel:e}=Oi(),{switchGraph:t}=Wi(),i=mt(!1),s=it(()=>n.type.startsWith(cc));return{showContextMenu:i,hasContextMenu:s,contextMenuItems:[{label:"Edit Subgraph",value:"editSubgraph"},{label:"Delete Subgraph",value:"deleteSubgraph"}],openContextMenu:()=>{i.value=!0},onContextMenuClick:l=>{const d=n.type.substring(cc.length),c=e.value.editor.graphTemplates.find(_=>_.id===d);if(c)switch(l){case"editSubgraph":t(c);break;case"deleteSubgraph":e.value.editor.removeGraphTemplate(c);break}}}}}),hMt=["data-node-type"],fMt={class:"__title"},mMt={class:"__title-label"},gMt={key:0,class:"__menu"};function bMt(n,e,t,i,s,r){const o=ft("vertical-dots"),a=ft("context-menu");return w(),M("div",{class:"baklava-node --palette","data-node-type":n.type},[u("div",fMt,[u("div",mMt,ge(n.title),1),n.hasContextMenu?(w(),M("div",gMt,[Ie(o,{class:"--clickable",onPointerdown:e[0]||(e[0]=Te(()=>{},["stop","prevent"])),onClick:Te(n.openContextMenu,["stop","prevent"])},null,8,["onClick"]),Ie(a,{modelValue:n.showContextMenu,"onUpdate:modelValue":e[1]||(e[1]=l=>n.showContextMenu=l),x:-100,y:0,items:n.contextMenuItems,onClick:n.onContextMenuClick,onPointerdown:e[2]||(e[2]=Te(()=>{},["stop","prevent"]))},null,8,["modelValue","items","onClick"])])):q("",!0)])],8,hMt)}const GR=_n(_Mt,[["render",bMt]]),EMt={class:"baklava-node-palette"},vMt={key:0},yMt=pn({__name:"NodePalette",setup(n){const{viewModel:e}=Oi(),{x:t,y:i}=wIt(),{transform:s}=jI(),r=KI(e),o=Gi("editorEl"),a=mt(null),l=it(()=>{if(!a.value||!(o!=null&&o.value))return{};const{left:c,top:_}=o.value.getBoundingClientRect();return{top:`${i.value-_}px`,left:`${t.value-c}px`}}),d=(c,_)=>{a.value={type:c,nodeInformation:_};const f=()=>{const m=ei(new _.type);e.value.displayedGraph.addNode(m);const h=o.value.getBoundingClientRect(),[E,b]=s(t.value-h.left,i.value-h.top);m.position.x=E,m.position.y=b,a.value=null,document.removeEventListener("pointerup",f)};document.addEventListener("pointerup",f)};return(c,_)=>(w(),M($e,null,[u("div",EMt,[(w(!0),M($e,null,dt(vt(r),f=>(w(),M("section",{key:f.name},[f.name!=="default"?(w(),M("h1",vMt,ge(f.name),1)):q("",!0),(w(!0),M($e,null,dt(f.nodeTypes,(m,h)=>(w(),xt(GR,{key:h,type:h,title:m.title,onPointerdown:E=>d(h,m)},null,8,["type","title","onPointerdown"]))),128))]))),128))]),Ie(ls,{name:"fade"},{default:Je(()=>[a.value?(w(),M("div",{key:0,class:"baklava-dragged-node",style:Jt(l.value)},[Ie(GR,{type:a.value.type,title:a.value.nodeInformation.title},null,8,["type","title"])],4)):q("",!0)]),_:1})],64))}});let wd;const SMt=new Uint8Array(16);function TMt(){if(!wd&&(wd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!wd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return wd(SMt)}const Cn=[];for(let n=0;n<256;++n)Cn.push((n+256).toString(16).slice(1));function xMt(n,e=0){return Cn[n[e+0]]+Cn[n[e+1]]+Cn[n[e+2]]+Cn[n[e+3]]+"-"+Cn[n[e+4]]+Cn[n[e+5]]+"-"+Cn[n[e+6]]+Cn[n[e+7]]+"-"+Cn[n[e+8]]+Cn[n[e+9]]+"-"+Cn[n[e+10]]+Cn[n[e+11]]+Cn[n[e+12]]+Cn[n[e+13]]+Cn[n[e+14]]+Cn[n[e+15]]}const CMt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),zR={randomUUID:CMt};function xu(n,e,t){if(zR.randomUUID&&!e&&!n)return zR.randomUUID();n=n||{};const i=n.random||(n.rng||TMt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let s=0;s<16;++s)e[t+s]=i[s];return e}return xMt(i)}const dc="SAVE_SUBGRAPH";function RMt(n,e){const t=()=>{const i=n.value;if(!i.template)throw new Error("Graph template property not set");i.template.update(i.save()),i.template.panning=i.panning,i.template.scaling=i.scaling};e.registerCommand(dc,{canExecute:()=>{var i;return n.value!==((i=n.value.editor)==null?void 0:i.graph)},execute:t})}const AMt={},wMt={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"},NMt=u("polyline",{points:"6 9 12 15 18 9"},null,-1),OMt=[NMt];function IMt(n,e){return w(),M("svg",wMt,OMt)}const MMt=_n(AMt,[["render",IMt]]),DMt=pn({components:{"i-arrow":MMt},props:{intf:{type:Object,required:!0}},setup(n){const e=mt(null),t=mt(!1),i=it(()=>n.intf.items.find(o=>typeof o=="string"?o===n.intf.value:o.value===n.intf.value)),s=it(()=>i.value?typeof i.value=="string"?i.value:i.value.text:""),r=o=>{n.intf.value=typeof o=="string"?o:o.value};return ZI(e,()=>{t.value=!1}),{el:e,open:t,selectedItem:i,selectedText:s,setSelected:r}}}),kMt=["title"],LMt={class:"__selected"},PMt={class:"__text"},UMt={class:"__icon"},FMt={class:"__dropdown"},BMt={class:"item --header"},GMt=["onClick"];function zMt(n,e,t,i,s,r){const o=ft("i-arrow");return w(),M("div",{ref:"el",class:Ye(["baklava-select",{"--open":n.open}]),title:n.intf.name,onClick:e[0]||(e[0]=a=>n.open=!n.open)},[u("div",LMt,[u("div",PMt,ge(n.selectedText),1),u("div",UMt,[Ie(o)])]),Ie(ls,{name:"slide-fade"},{default:Je(()=>[le(u("div",FMt,[u("div",BMt,ge(n.intf.name),1),(w(!0),M($e,null,dt(n.intf.items,(a,l)=>(w(),M("div",{key:l,class:Ye(["item",{"--active":a===n.selectedItem}]),onClick:d=>n.setSelected(a)},ge(typeof a=="string"?a:a.text),11,GMt))),128))],512),[[Mt,n.open]])]),_:1})],10,kMt)}const VMt=_n(DMt,[["render",zMt]]);class HMt extends tn{constructor(e,t,i){super(e,t),this.component=uc(VMt),this.items=i}}const qMt=pn({props:{intf:{type:Object,required:!0}}});function YMt(n,e,t,i,s,r){return w(),M("div",null,ge(n.intf.value),1)}const $Mt=_n(qMt,[["render",YMt]]);class WMt extends tn{constructor(e,t){super(e,t),this.component=uc($Mt),this.setPort(!1)}}const KMt=pn({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(n,{emit:e}){return{v:it({get:()=>n.modelValue,set:i=>{e("update:modelValue",i)}})}}}),jMt=["placeholder","title"];function QMt(n,e,t,i,s,r){return w(),M("div",null,[le(u("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,jMt),[[Pe,n.v]])])}const XMt=_n(KMt,[["render",QMt]]);class Rc extends tn{constructor(){super(...arguments),this.component=uc(XMt)}}class nM extends VI{constructor(){super(...arguments),this._title="Subgraph Input",this.inputs={name:new Rc("Name","Input").setPort(!1)},this.outputs={placeholder:new tn("Connection",void 0)}}}class iM extends HI{constructor(){super(...arguments),this._title="Subgraph Output",this.inputs={name:new Rc("Name","Output").setPort(!1),placeholder:new tn("Connection",void 0)},this.outputs={output:new tn("Output",void 0).setHidden(!0)}}}const sM="CREATE_SUBGRAPH",VR=[ka,La];function ZMt(n,e,t){const i=()=>n.value.selectedNodes.filter(r=>!VR.includes(r.type)).length>0,s=()=>{const{viewModel:r}=Oi(),o=n.value,a=n.value.editor;if(o.selectedNodes.length===0)return;const l=o.selectedNodes.filter(S=>!VR.includes(S.type)),d=l.flatMap(S=>Object.values(S.inputs)),c=l.flatMap(S=>Object.values(S.outputs)),_=o.connections.filter(S=>!c.includes(S.from)&&d.includes(S.to)),f=o.connections.filter(S=>c.includes(S.from)&&!d.includes(S.to)),m=o.connections.filter(S=>c.includes(S.from)&&d.includes(S.to)),h=l.map(S=>S.save()),E=m.map(S=>({id:S.id,from:S.from.id,to:S.to.id})),b=new Map,{xLeft:g,xRight:v,yTop:y}=JMt(l);console.log(g,v,y);for(const[S,A]of _.entries()){const U=new nM;U.inputs.name.value=A.to.name,h.push({...U.save(),position:{x:v-r.value.settings.nodes.defaultWidth-100,y:y+S*200}}),E.push({id:xu(),from:U.outputs.placeholder.id,to:A.to.id}),b.set(A.to.id,U.graphInterfaceId)}for(const[S,A]of f.entries()){const U=new iM;U.inputs.name.value=A.from.name,h.push({...U.save(),position:{x:g+100,y:y+S*200}}),E.push({id:xu(),from:A.from.id,to:U.inputs.placeholder.id}),b.set(A.from.id,U.graphInterfaceId)}const T=ei(new gp({connections:E,nodes:h,inputs:[],outputs:[]},a));a.addGraphTemplate(T);const C=a.nodeTypes.get(Pa(T));if(!C)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");const x=ei(new C.type);o.addNode(x);const O=Math.round(l.map(S=>S.position.x).reduce((S,A)=>S+A,0)/l.length),R=Math.round(l.map(S=>S.position.y).reduce((S,A)=>S+A,0)/l.length);x.position.x=O,x.position.y=R,_.forEach(S=>{o.removeConnection(S),o.addConnection(S.from,x.inputs[b.get(S.to.id)])}),f.forEach(S=>{o.removeConnection(S),o.addConnection(x.outputs[b.get(S.from.id)],S.to)}),l.forEach(S=>o.removeNode(S)),e.canExecuteCommand(dc)&&e.executeCommand(dc),t(T),n.value.panning={...o.panning},n.value.scaling=o.scaling};e.registerCommand(sM,{canExecute:i,execute:s})}function JMt(n){const e=n.reduce((s,r)=>{const o=r.position.x;return o{const o=r.position.y;return o{const o=r.position.x+r.width;return o>s?o:s},-1/0),xRight:e,yTop:t}}const HR="DELETE_NODES";function e2t(n,e){e.registerCommand(HR,{canExecute:()=>n.value.selectedNodes.length>0,execute(){n.value.selectedNodes.forEach(t=>n.value.removeNode(t))}}),e.registerHotkey(["Delete"],HR)}const rM="SWITCH_TO_MAIN_GRAPH";function t2t(n,e,t){e.registerCommand(rM,{canExecute:()=>n.value!==n.value.editor.graph,execute:()=>{e.executeCommand(dc),t(n.value.editor.graph)}})}function n2t(n,e,t){e2t(n,e),ZMt(n,e,t),RMt(n,e),t2t(n,e,t)}class qR{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 i=new t.type;e.addNode(i),i.load(this.nodeState),this.nodeId=i.id}removeNode(e){const t=e.nodes.find(i=>i.id===this.nodeId);t&&(this.nodeState=t.save(),e.removeNode(t))}}class YR{constructor(e,t){if(this.type=e,e==="addConnection")this.connectionId=t;else{const i=t;this.connectionState={id:i.id,from:i.from.id,to:i.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),i=e.findNodeInterface(this.connectionState.to);!t||!i||e.addConnection(t,i)}removeConnection(e){const t=e.connections.find(i=>i.id===this.connectionId);t&&(this.connectionState={id:t.id,from:t.from.id,to:t.to.id},e.removeConnection(t))}}class i2t{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(!r.value)if(a.value)l.value.push(b);else for(o.value!==s.value.length-1&&(s.value=s.value.slice(0,o.value+1)),s.value.push(b),o.value++;s.value.length>i.value;)s.value.shift()},c=()=>{a.value=!0},_=()=>{a.value=!1,l.value.length>0&&(d(new i2t(l.value)),l.value=[])},f=()=>s.value.length!==0&&o.value!==-1,m=()=>{f()&&(r.value=!0,s.value[o.value--].undo(n.value),r.value=!1)},h=()=>s.value.length!==0&&o.value{h()&&(r.value=!0,s.value[++o.value].redo(n.value),r.value=!1)};return qn(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,v=>{d(new qR("addNode",v.id))}),b.events.removeNode.subscribe(t,v=>{d(new qR("removeNode",v.save()))}),b.events.addConnection.subscribe(t,v=>{d(new YR("addConnection",v.id))}),b.events.removeConnection.subscribe(t,v=>{d(new YR("removeConnection",v))}))},{immediate:!0}),e.registerCommand(Tb,{canExecute:f,execute:m}),e.registerCommand(xb,{canExecute:h,execute:E}),e.registerCommand(oM,{canExecute:()=>!a.value,execute:c}),e.registerCommand(aM,{canExecute:()=>a.value,execute:_}),e.registerHotkey(["Control","z"],Tb),e.registerHotkey(["Control","y"],xb),ei({maxSteps:i})}const Cb="COPY",Rb="PASTE",r2t="CLEAR_CLIPBOARD";function o2t(n,e,t){const i=Symbol("ClipboardToken"),s=mt(""),r=mt(""),o=it(()=>!s.value),a=()=>{s.value="",r.value=""},l=()=>{const _=n.value.selectedNodes.flatMap(m=>[...Object.values(m.inputs),...Object.values(m.outputs)]),f=n.value.connections.filter(m=>_.includes(m.from)||_.includes(m.to)).map(m=>({from:m.from.id,to:m.to.id}));r.value=JSON.stringify(f),s.value=JSON.stringify(n.value.selectedNodes.map(m=>m.save()))},d=(_,f,m)=>{for(const h of _){let E;if((!m||m==="input")&&(E=Object.values(h.inputs).find(b=>b.id===f)),!E&&(!m||m==="output")&&(E=Object.values(h.outputs).find(b=>b.id===f)),E)return E}},c=()=>{if(o.value)return;const _=new Map,f=JSON.parse(s.value),m=JSON.parse(r.value),h=[],E=[],b=n.value;t.executeCommand(oM);for(const g of f){const v=e.value.nodeTypes.get(g.type);if(!v){console.warn(`Node type ${g.type} not registered`);return}const y=new v.type,T=y.id;h.push(y),y.hooks.beforeLoad.subscribe(i,C=>{const x=C;return x.position&&(x.position.x+=100,x.position.y+=100),y.hooks.beforeLoad.unsubscribe(i),x}),b.addNode(y),y.load({...g,id:T}),y.id=T,_.set(g.id,T);for(const C of Object.values(y.inputs)){const x=xu();_.set(C.id,x),C.id=x}for(const C of Object.values(y.outputs)){const x=xu();_.set(C.id,x),C.id=x}}for(const g of m){const v=d(h,_.get(g.from),"output"),y=d(h,_.get(g.to),"input");if(!v||!y)continue;const T=b.addConnection(v,y);T&&E.push(T)}return n.value.selectedNodes=h,t.executeCommand(aM),{newNodes:h,newConnections:E}};return t.registerCommand(Cb,{canExecute:()=>n.value.selectedNodes.length>0,execute:l}),t.registerHotkey(["Control","c"],Cb),t.registerCommand(Rb,{canExecute:()=>!o.value,execute:c}),t.registerHotkey(["Control","v"],Rb),t.registerCommand(r2t,{canExecute:()=>!0,execute:a}),ei({isEmpty:o})}const a2t="OPEN_SIDEBAR";function l2t(n,e){e.registerCommand(a2t,{execute:t=>{n.value.sidebar.nodeId=t,n.value.sidebar.visible=!0},canExecute:()=>!0})}function c2t(n,e){l2t(n,e)}const d2t={},u2t={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"},p2t=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_2t=u("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"},null,-1),h2t=[p2t,_2t];function f2t(n,e){return w(),M("svg",u2t,h2t)}const m2t=_n(d2t,[["render",f2t]]),g2t={},b2t={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"},E2t=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v2t=u("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"},null,-1),y2t=[E2t,v2t];function S2t(n,e){return w(),M("svg",b2t,y2t)}const T2t=_n(g2t,[["render",S2t]]),x2t={},C2t={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"},R2t=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),A2t=u("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1),w2t=u("line",{x1:"5",y1:"12",x2:"11",y2:"18"},null,-1),N2t=u("line",{x1:"5",y1:"12",x2:"11",y2:"6"},null,-1),O2t=[R2t,A2t,w2t,N2t];function I2t(n,e){return w(),M("svg",C2t,O2t)}const M2t=_n(x2t,[["render",I2t]]),D2t={},k2t={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"},L2t=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),P2t=u("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),U2t=u("rect",{x:"9",y:"3",width:"6",height:"4",rx:"2"},null,-1),F2t=[L2t,P2t,U2t];function B2t(n,e){return w(),M("svg",k2t,F2t)}const G2t=_n(D2t,[["render",B2t]]),z2t={},V2t={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"},H2t=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),q2t=u("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"},null,-1),Y2t=u("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),$2t=[H2t,q2t,Y2t];function W2t(n,e){return w(),M("svg",V2t,$2t)}const K2t=_n(z2t,[["render",W2t]]),j2t={},Q2t={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"},X2t=u("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),Z2t=u("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),J2t=u("circle",{cx:"12",cy:"14",r:"2"},null,-1),eDt=u("polyline",{points:"14 4 14 8 8 8 8 4"},null,-1),tDt=[X2t,Z2t,J2t,eDt];function nDt(n,e){return w(),M("svg",Q2t,tDt)}const iDt=_n(j2t,[["render",nDt]]),sDt={},rDt={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"},oDt=zu('',6),aDt=[oDt];function lDt(n,e){return w(),M("svg",rDt,aDt)}const cDt=_n(sDt,[["render",lDt]]),dDt=pn({props:{command:{type:String,required:!0},title:{type:String,required:!0},icon:{type:Object,required:!1,default:void 0}},setup(){const{viewModel:n}=Oi();return{viewModel:n}}}),uDt=["disabled","title"];function pDt(n,e,t,i,s,r){return w(),M("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?(w(),xt(Fu(n.icon),{key:0})):(w(),M($e,{key:1},[Ze(ge(n.title),1)],64))],8,uDt)}const _Dt=_n(dDt,[["render",pDt]]),hDt=pn({components:{ToolbarButton:_Dt},setup(){const{viewModel:n}=Oi();return{isSubgraph:it(()=>n.value.displayedGraph!==n.value.editor.graph),commands:[{command:Cb,title:"Copy",icon:K2t},{command:Rb,title:"Paste",icon:G2t},{command:Tb,title:"Undo",icon:m2t},{command:xb,title:"Redo",icon:T2t},{command:sM,title:"Create Subgraph",icon:cDt}],subgraphCommands:[{command:dc,title:"Save Subgraph",icon:iDt},{command:rM,title:"Back to Main Graph",icon:M2t}]}}}),fDt={class:"baklava-toolbar"};function mDt(n,e,t,i,s,r){const o=ft("toolbar-button");return w(),M("div",fDt,[(w(!0),M($e,null,dt(n.commands,a=>(w(),xt(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)),n.isSubgraph?(w(!0),M($e,{key:0},dt(n.subgraphCommands,a=>(w(),xt(o,{key:a.command,command:a.command,title:a.title,icon:a.icon},null,8,["command","title","icon"]))),128)):q("",!0)])}const gDt=_n(hDt,[["render",mDt]]),bDt={class:"connections-container"},EDt=pn({__name:"Editor",props:{viewModel:{}},setup(n){const e=n,t=Symbol("EditorToken"),i=jd(e,"viewModel");_It(i);const s=mt(null);sa("editorEl",s);const r=it(()=>e.viewModel.displayedGraph.nodes),o=it(()=>e.viewModel.displayedGraph.nodes.map(O=>$I(jd(O,"position")))),a=it(()=>e.viewModel.displayedGraph.connections),l=it(()=>e.viewModel.displayedGraph.selectedNodes),d=hIt(),c=fIt(),_=mIt(i),f=it(()=>({...d.styles.value})),m=mt(0);e.viewModel.editor.hooks.load.subscribe(t,O=>(m.value++,O));const h=O=>{d.onPointerMove(O),c.onMouseMove(O)},E=O=>{O.button===0&&(O.target===s.value&&(T(),d.onPointerDown(O)),c.onMouseDown())},b=O=>{d.onPointerUp(O),c.onMouseUp()},g=O=>{O.key==="Tab"&&O.preventDefault(),e.viewModel.commandHandler.handleKeyDown(O)},v=O=>{e.viewModel.commandHandler.handleKeyUp(O)},y=O=>{["Control","Shift"].some(R=>e.viewModel.commandHandler.pressedKeys.includes(R))||T(),e.viewModel.displayedGraph.selectedNodes.push(O)},T=()=>{e.viewModel.displayedGraph.selectedNodes=[]},C=O=>{for(const R of e.viewModel.displayedGraph.selectedNodes){const S=r.value.indexOf(R),A=o.value[S];A.onPointerDown(O),document.addEventListener("pointermove",A.onPointerMove)}document.addEventListener("pointerup",x)},x=()=>{for(const O of e.viewModel.displayedGraph.selectedNodes){const R=r.value.indexOf(O),S=o.value[R];S.onPointerUp(),document.removeEventListener("pointermove",S.onPointerMove)}document.removeEventListener("pointerup",x)};return(O,R)=>(w(),M("div",{ref_key:"el",ref:s,tabindex:"-1",class:Ye(["baklava-editor",{"baklava-ignore-mouse":!!vt(c).temporaryConnection.value||vt(d).dragging.value,"--temporary-connection":!!vt(c).temporaryConnection.value}]),onPointermove:Te(h,["self"]),onPointerdown:E,onPointerup:b,onWheel:R[1]||(R[1]=Te((...S)=>vt(d).onMouseWheel&&vt(d).onMouseWheel(...S),["self"])),onKeydown:g,onKeyup:v,onContextmenu:R[2]||(R[2]=Te((...S)=>vt(_).open&&vt(_).open(...S),["self","prevent"]))},[Dn(O.$slots,"background",{},()=>[Ie(EIt)]),Dn(O.$slots,"toolbar",{},()=>[Ie(gDt)]),Dn(O.$slots,"palette",{},()=>[Ie(yMt)]),(w(),M("svg",bDt,[(w(!0),M($e,null,dt(a.value,S=>(w(),M("g",{key:S.id+m.value.toString()},[Dn(O.$slots,"connection",{connection:S},()=>[Ie(iMt,{connection:S},null,8,["connection"])])]))),128)),Dn(O.$slots,"temporaryConnection",{temporaryConnection:vt(c).temporaryConnection.value},()=>[vt(c).temporaryConnection.value?(w(),xt(oMt,{key:0,connection:vt(c).temporaryConnection.value},null,8,["connection"])):q("",!0)])])),u("div",{class:"node-container",style:Jt(f.value)},[Ie(rs,{name:"fade"},{default:Je(()=>[(w(!0),M($e,null,dt(r.value,(S,A)=>Dn(O.$slots,"node",{key:S.id+m.value.toString(),node:S,selected:l.value.includes(S),dragging:o.value[A].dragging.value,onSelect:U=>y(S),onStartDrag:C},()=>[Ie(QIt,{node:S,selected:l.value.includes(S),dragging:o.value[A].dragging.value,onSelect:U=>y(S),onStartDrag:C},null,8,["node","selected","dragging","onSelect"])])),128))]),_:3})],4),Dn(O.$slots,"sidebar",{},()=>[Ie(uMt)]),Dn(O.$slots,"minimap",{},()=>[O.viewModel.settings.enableMinimap?(w(),xt(pMt,{key:0})):q("",!0)]),Dn(O.$slots,"contextMenu",{contextMenu:vt(_)},()=>[O.viewModel.settings.contextMenu.enabled?(w(),xt(hv,{key:0,modelValue:vt(_).show.value,"onUpdate:modelValue":R[0]||(R[0]=S=>vt(_).show.value=S),items:vt(_).items.value,x:vt(_).x.value,y:vt(_).y.value,onClick:vt(_).onClick},null,8,["modelValue","items","x","y","onClick"])):q("",!0)])],34))}}),vDt=["INPUT","TEXTAREA","SELECT"];function yDt(n){const e=mt([]),t=mt([]);return{pressedKeys:e,handleKeyDown:o=>{var a;e.value.includes(o.key)||e.value.push(o.key),!vDt.includes(((a=document.activeElement)==null?void 0:a.tagName)??"")&&t.value.forEach(l=>{l.keys.every(d=>e.value.includes(d))&&n(l.commandName)})},handleKeyUp:o=>{const a=e.value.indexOf(o.key);a>=0&&e.value.splice(a,1)},registerHotkey:(o,a)=>{t.value.push({keys:o,commandName:a})}}}const SDt=()=>{const n=mt(new Map),e=(r,o)=>{if(n.value.has(r))throw new Error(`Command "${r}" already exists`);n.value.set(r,o)},t=(r,o=!1,...a)=>{if(!n.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return}return n.value.get(r).execute(...a)},i=(r,o=!1,...a)=>{if(!n.value.has(r)){if(o)throw new Error(`[CommandHandler] Command ${r} not registered`);return!1}return n.value.get(r).canExecute(a)},s=yDt(t);return ei({registerCommand:e,executeCommand:t,canExecuteCommand:i,...s})},TDt=n=>!(n instanceof Cc);function xDt(n,e){return{switchGraph:i=>{let s;if(TDt(i))s=new Cc(n.value),i.createGraph(s);else{if(i!==n.value.graph)throw new Error("Can only switch using 'Graph' instance when it is the root graph. Otherwise a 'GraphTemplate' must be used.");s=i}e.value&&e.value!==n.value.graph&&e.value.destroy(),s.panning=s.panning??i.panning??{x:0,y:0},s.scaling=s.scaling??i.scaling??1,s.selectedNodes=s.selectedNodes??[],s.sidebar=s.sidebar??{visible:!1,nodeId:"",optionName:""},e.value=s}}}function CDt(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 RDt=()=>({useStraightConnections:!1,enableMinimap:!1,background:{gridSize:100,gridDivision:5,subGridVisibleThreshold:.6},sidebar:{width:300,resizable:!0},displayValueOnHover:!1,nodes:{defaultWidth:200,maxWidth:320,minWidth:150,resizable:!1},contextMenu:{enabled:!0,additionalItems:[]}});function ADt(n){const e=mt(n??new aIt),t=Symbol("ViewModelToken"),i=mt(null),s=d2(i),{switchGraph:r}=xDt(e,i),o=it(()=>s.value&&s.value!==e.value.graph),a=ei(RDt()),l=SDt(),d=s2t(s,l),c=o2t(s,e,l),_={renderNode:new li(null),renderInterface:new li(null)};return n2t(s,l,r),c2t(s,l),qn(e,(f,m)=>{m&&(m.events.registerGraph.unsubscribe(t),m.graphEvents.beforeAddNode.unsubscribe(t),f.nodeHooks.beforeLoad.unsubscribe(t),f.nodeHooks.afterSave.unsubscribe(t),f.graphTemplateHooks.beforeLoad.unsubscribe(t),f.graphTemplateHooks.afterSave.unsubscribe(t),f.graph.hooks.load.unsubscribe(t),f.graph.hooks.save.unsubscribe(t)),f&&(f.nodeHooks.beforeLoad.subscribe(t,(h,E)=>(E.position=h.position??{x:0,y:0},E.width=h.width??a.nodes.defaultWidth,E.twoColumn=h.twoColumn??!1,h)),f.nodeHooks.afterSave.subscribe(t,(h,E)=>(h.position=E.position,h.width=E.width,h.twoColumn=E.twoColumn,h)),f.graphTemplateHooks.beforeLoad.subscribe(t,(h,E)=>(E.panning=h.panning,E.scaling=h.scaling,h)),f.graphTemplateHooks.afterSave.subscribe(t,(h,E)=>(h.panning=E.panning,h.scaling=E.scaling,h)),f.graph.hooks.load.subscribe(t,(h,E)=>(E.panning=h.panning,E.scaling=h.scaling,h)),f.graph.hooks.save.subscribe(t,(h,E)=>(h.panning=E.panning,h.scaling=E.scaling,h)),f.graphEvents.beforeAddNode.subscribe(t,h=>CDt(h,{defaultWidth:a.nodes.defaultWidth})),e.value.registerNodeType(nM,{category:"Subgraphs"}),e.value.registerNodeType(iM,{category:"Subgraphs"}),r(f.graph))},{immediate:!0}),ei({editor:e,displayedGraph:s,isSubgraph:o,settings:a,commandHandler:l,history:d,clipboard:c,hooks:_,switchGraph:r})}const wDt=el({type:"PersonalityNode",title:"Personality",inputs:{request:()=>new tn("Request",""),agent_name:()=>new HMt("Personality","",Cu.state.config.personalities).setPort(!1)},outputs:{response:()=>new tn("Response","")},async calculate({request:n}){console.log(Cu.state.config.personalities);let e="";try{e=(await Me.post("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),NDt=el({type:"RAGNode",title:"RAG",inputs:{request:()=>new tn("Prompt",""),document_path:()=>new Rc("Document path","").setPort(!1)},outputs:{prompt:()=>new tn("Prompt with Data","")},async calculate({request:n,document_path:e}){let t="";try{t=(await Me.get("/rag",{params:{text:n,doc_path:e}})).data}catch(i){console.error(i)}return{response:t}}}),$R=el({type:"Task",title:"Task",inputs:{description:()=>new Rc("Task description","").setPort(!1)},outputs:{prompt:()=>new tn("Prompt")},calculate({description:n}){return{prompt:n}}}),WR=el({type:"TextDisplayNode",title:"TextDisplay",inputs:{text2display:()=>new tn("Input","")},outputs:{response:()=>new WMt("Text","")},async calculate({request:n}){}}),KR=el({type:"LLMNode",title:"LLM",inputs:{request:()=>new tn("Request","")},outputs:{response:()=>new tn("Response","")},async calculate({request:n}){console.log(Cu.state.config.personalities);let e="";try{e=(await Me.post("/generate",{params:{text:n}})).data}catch(t){console.error(t)}return{display:e,response:e}}}),ODt=el({type:"MultichoiceNode",title:"Multichoice",inputs:{question:()=>new tn("Question",""),outputs:()=>new Rc("choices, one per line","","").setPort(!1)},outputs:{response:()=>new tn("Response","")}}),IDt=pn({components:{"baklava-editor":EDt},setup(){const n=ADt(),e=new pIt(n.editor);n.editor.registerNodeType(wDt),n.editor.registerNodeType($R),n.editor.registerNodeType(NDt),n.editor.registerNodeType(WR),n.editor.registerNodeType(KR),n.editor.registerNodeType(ODt);const t=Symbol();e.events.afterRun.subscribe(t,a=>{e.pause(),lIt(a,n.editor),e.resume()}),e.start();function i(a,l,d){const c=new a;return n.displayedGraph.addNode(c),c.position.x=l,c.position.y=d,c}const s=i($R,300,140),r=i(KR,550,140),o=i(WR,850,140);return n.displayedGraph.addConnection(s.outputs.prompt,r.inputs.request),n.displayedGraph.addConnection(r.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)}}}}),MDt={style:{width:"100vw",height:"100vh"}};function DDt(n,e,t,i,s,r){const o=ft("baklava-editor");return w(),M("div",MDt,[Ie(o,{"view-model":n.baklava},null,8,["view-model"]),u("button",{onClick:e[0]||(e[0]=(...a)=>n.saveGraph&&n.saveGraph(...a))},"Save Graph"),u("button",{onClick:e[1]||(e[1]=(...a)=>n.loadGraph&&n.loadGraph(...a))},"Load Graph")])}const kDt=bt(IDt,[["render",DDt]]),LDt={},PDt={style:{width:"100vw",height:"100vh"}},UDt=["src"];function FDt(n,e,t,i,s,r){return w(),M("div",PDt,[u("iframe",{src:n.$store.state.config.comfyui_base_url,class:"m-0 p-0 w-full h-full"},null,8,UDt)])}const BDt=bt(LDt,[["render",FDt]]),GDt=jP({history:_P("/"),routes:[{path:"/comfyui_view/",name:"ComfyUI",component:BDt},{path:"/playground/",name:"playground",component:Ett},{path:"/extensions/",name:"extensions",component:Ott},{path:"/help/",name:"help",component:Qtt},{path:"/settings/",name:"settings",component:omt},{path:"/training/",name:"training",component:Amt},{path:"/quantizing/",name:"quantizing",component:Pmt},{path:"/",name:"discussions",component:FTt},{path:"/",name:"interactive",component:eIt},{path:"/",name:"nodes",component:kDt}]});const bp=tk(yZe);console.log("Loaded main.js");function jR(n){const e={};for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}const Cu=Ak({state(){return{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},client_id:"",yesNoDialog:null,universalForm:null,toast:null,news:null,messageBox:null,api_get_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:[],mountedExtensions:[],bindingsZoo:[],modelsArr:[],selectedModel:null,personalities:[],diskUsage:null,ramUsage:null,vramUsage:null,modelsZoo:[],installedModels:[],currentModel:null,extensionsZoo:[],databases:[]}},mutations:{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},setMountedExtensions(n,e){n.mountedExtensions=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},setCurrentModel(n,e){n.currentModel=e},setExtensionsZoo(n,e){n.extensionsZoo=e},setDatabases(n,e){n.databases=e},setTheme(n){this.currentTheme=n}},getters:{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},getmmountedExtensions(n){return n.mountedExtensions},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},getCurrentModel(n){return n.currentModel},getExtensionsZoo(n){return n.extensionsZoo}},actions:{async getVersion(){try{let n=await Me.get("/get_lollms_webui_version",{});n&&(this.state.version=n.data,console.log("version res:",n),console.log("version :",this.state.version))}catch{console.log("Coudln't get version")}},async refreshConfig({commit:n}){console.log("Fetching configuration");try{const e=await _i("get_config");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],e.extensions.length>0?e.extension_category=e.extensions[-1]:e.extension_category="ai_sensors",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 _i("list_databases");console.log("databases:",e),n("setDatabases",e)},async refreshPersonalitiesZoo({commit:n}){let e=[];const t=await _i("get_all_personalities"),i=Object.keys(t);console.log("Personalities recovered:"+this.state.config.personalities);for(let s=0;s{let d=!1;for(const _ of this.state.config.personalities)if(_.includes(r+"/"+l.folder))if(d=!0,_.includes(":")){const f=_.split(":");l.language=f[1]}else l.language=null;let c={};return c=l,c.category=r,c.full_path=r+"/"+l.folder,c.isMounted=d,c});e.length==0?e=a:e=e.concat(a)}e.sort((s,r)=>s.name.localeCompare(r.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 i=0;ia.full_path==s||a.full_path==r[0]);if(o>=0){let a=jR(this.state.personalities[o]);r.length>1&&(a.language=r[1]),a?e.push(a):e.push(this.state.personalities[this.state.personalities.findIndex(l=>l.full_path=="generic/lollms")])}else t.push(i),console.log("Couldn't load personality : ",s)}for(let i=t.length-1;i>=0;i--)console.log("Removing personality : ",this.state.config.personalities[t[i]]),this.state.config.personalities.splice(t[i],1),this.state.config.active_personality_id>t[i]&&(this.state.config.active_personality_id-=1);n("setMountedPersArr",e),this.state.mountedPers=this.state.personalities[this.state.personalities.findIndex(i=>i.full_path==this.state.config.personalities[this.state.config.active_personality_id]||i.full_path+":"+i.language==this.state.config.personalities[this.state.config.active_personality_id])]},async refreshBindings({commit:n}){let e=await _i("list_bindings");n("setbindingsZoo",e)},async refreshModelsZoo({commit:n}){console.log("Fetching models");const t=(await Me.get("/get_available_models")).data.filter(i=>i.variants&&i.variants.length>0);console.log(`get_available_models: ${t}`),n("setModelsZoo",t)},async refreshModelStatus({commit:n}){let e=await _i("get_model_status");n("setIsModelOk",e.status)},async refreshModels({commit:n}){console.log("Fetching models");let e=await _i("list_models");console.log(`Found ${e}`);let t=await _i("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(s=>{console.log("model found"),s.isInstalled=e.includes(s.name)}),this.state.installedModels=this.state.modelsZoo.filter(s=>s.isInstalled);const i=this.state.modelsZoo.findIndex(s=>s.name==this.state.config.model_name);i!=-1&&n("setCurrentModel",this.state.modelsZoo[i])},async refreshExtensionsZoo({commit:n}){let e=[],t=await _i("list_extensions");const i=Object.keys(t);console.log("Extensions recovered:"+t);for(let s=0;s{let d=!1;for(const _ of this.state.config.extensions)_.includes(r+"/"+l.folder)&&(d=!0);let c={};return c=l,c.category=r,c.full_path=r+"/"+l.folder,c.isMounted=d,c});e.length==0?e=a:e=e.concat(a)}e.sort((s,r)=>s.name.localeCompare(r.name)),console.log("Done loading extensions"),n("setExtensionsZoo",e)},refreshmountedExtensions({commit:n}){console.log("Mounting extensions");let e=[];const t=[];for(let i=0;io.full_path==s);if(r>=0){let o=jR(this.state.config.extensions[r]);o&&e.push(o)}else t.push(i),console.log("Couldn't load extension : ",s)}for(let i=t.length-1;i>=0;i--)console.log("Removing extensions : ",this.state.config.extensions[t[i]]),this.state.config.extensions.splice(t[i],1);n("setMountedExtensions",e)},async refreshDiskUsage({commit:n}){this.state.diskUsage=await _i("disk_usage")},async refreshRamUsage({commit:n}){this.state.ramUsage=await _i("ram_usage")},async refreshVramUsage({commit:n}){const e=await _i("vram_usage"),t=[];if(e.nb_gpus>0){for(let s=0;s 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}.progress-bar-container{background-color:#f0f0f0;border-radius:4px;height:8px;overflow:hidden}.progress-bar{background-color:#3498db;height:100%;transition:width .3s ease}.fade-enter-active[data-v-39acdea0],.fade-leave-active[data-v-39acdea0]{transition:opacity .5s}.fade-enter[data-v-39acdea0],.fade-leave-to[data-v-39acdea0]{opacity:0}.container{margin:0;padding:0}.link-item{height:25px;margin-top:5px;padding:0 20px;margin-bottom:-5px;display:flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:5px 5px 0 0;font-weight:700;transition:duration-300 ease-in-out transform}.link-item-dark{padding:0 20px;color:#f0f8ff;margin-bottom:-5px;display:flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:5px 5px 0 0;font-weight:700;transition:duration-300 ease-in-out transform}.nav-ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;height:100%}.nav-li{cursor:pointer;display:flex;align-items:center;padding:5px}.dot{width:10px;height:10px;border-radius:50%}.dot-green{background-color:green}.dot-red{background-color:red}.hovered{transition:transform .3s cubic-bezier(.175,.885,.32,1.275);transform:scale(1.1)}.active{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#0009;pointer-events:all}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:250px;background-color:#fff;z-index:1000;display:none}.settings-button{cursor:pointer;padding:10px;border:1px solid #ddd;border-radius:5px;color:#333;font-size:14px}.settings-button:hover{background-color:#eee}.settings-button:active{background-color:#ddd}.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}.scrollbar[data-v-b19a05a8]{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);white-space:pre-wrap;overflow-wrap:break-word}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar{width:8px}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar-track{background-color:var(--scrollbar-track-color)}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:4px}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover-color)}.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}.selected-choice{background-color:#bde4ff}.heartbeat-text[data-v-20db2a02]{font-size:24px;animation:pulsate-20db2a02 1.5s infinite}@keyframes pulsate-20db2a02{0%{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}to{transform:scale(1);opacity:1}}.list-move[data-v-20db2a02],.list-enter-active[data-v-20db2a02],.list-leave-active[data-v-20db2a02]{transition:all .5s ease}.list-enter-from[data-v-20db2a02]{transform:translatey(-30px)}.list-leave-to[data-v-20db2a02]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-20db2a02]{position:absolute}.bounce-enter-active[data-v-20db2a02]{animation:bounce-in-20db2a02 .5s}.bounce-leave-active[data-v-20db2a02]{animation:bounce-in-20db2a02 .5s reverse}@keyframes bounce-in-20db2a02{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.bg-primary-light[data-v-20db2a02]{background-color:#0ff}.hover[data-v-20db2a02]:bg-primary-light:hover{background-color:#7fffd4}.font-bold[data-v-20db2a02]{font-weight:700}.collapsible-section{cursor:pointer;margin-bottom:10px;font-weight:700}.collapsible-section:hover{color:#1a202c}.collapsible-section .toggle-icon{margin-right:.25rem}.collapsible-section .toggle-icon i{color:#4a5568}.collapsible-section .toggle-icon i:hover{color:#1a202c}.json-viewer{max-height:300px;max-width:700px;flex:auto;overflow-y:auto;padding:10px;background-color:#f1f1f1;border:1px solid #ccc;border-radius:4px}.json-viewer .toggle-icon{cursor:pointer;margin-right:.25rem}.json-viewer .toggle-icon i{color:#4a5568}.json-viewer .toggle-icon i:hover{color:#1a202c}.expand-button{margin-left:10px;margin-right:10px;background:none;border:none;padding:0;cursor:pointer}.htmljs{background:none}.bounce-enter-active[data-v-c50eee06]{animation:bounce-in-c50eee06 .5s}.bounce-leave-active[data-v-c50eee06]{animation:bounce-in-c50eee06 .5s reverse}@keyframes bounce-in-c50eee06{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar-track{background-color:#f1f1f1}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar-thumb{background-color:#888;border-radius:4px}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar-thumb:hover{background-color:#555}.menu[data-v-52cfa09c]{display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper[data-v-52cfa09c]{position:relative;display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper>#commands-menu-items[data-v-52cfa09c]{top:calc(-100% - 2rem)}.list-move[data-v-3d2d8162],.list-enter-active[data-v-3d2d8162],.list-leave-active[data-v-3d2d8162]{transition:all .5s ease}.list-enter-from[data-v-3d2d8162]{transform:translatey(-30px)}.list-leave-to[data-v-3d2d8162]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-3d2d8162]{position:absolute}.slide-right-enter-active[data-v-46f45c62],.slide-right-leave-active[data-v-46f45c62]{transition:transform .3s ease}.slide-right-enter[data-v-46f45c62],.slide-right-leave-to[data-v-46f45c62]{transform:translate(-100%)}.fade-and-fly-enter-active[data-v-46f45c62]{animation:fade-and-fly-enter-46f45c62 .5s ease}.fade-and-fly-leave-active[data-v-46f45c62]{animation:fade-and-fly-leave-46f45c62 .5s ease}@keyframes fade-and-fly-enter-46f45c62{0%{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes fade-and-fly-leave-46f45c62{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-20px) scale(1.2)}}.list-move[data-v-46f45c62],.list-enter-active[data-v-46f45c62],.list-leave-active[data-v-46f45c62]{transition:all .5s ease}.list-enter-from[data-v-46f45c62]{transform:translatey(-30px)}.list-leave-to[data-v-46f45c62]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-46f45c62]{position:absolute}.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-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 *: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:white;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>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}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{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}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-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;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[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]{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:white;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}html{scroll-behavior:smooth}@font-face{font-family:Roboto;src:url(/assets/Roboto-Regular-7277cfb8.ttf) format("truetype")}@font-face{font-family:PTSans;src:url(/assets/PTSans-Regular-23b91352.ttf) format("truetype")}*,: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: }::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: }.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-1{bottom:-.25rem}.-bottom-1\.5{bottom:-.375rem}.-bottom-2{bottom:-.5rem}.-bottom-4{bottom:-1rem}.-left-1{left:-.25rem}.-left-1\.5{left:-.375rem}.-right-0{right:-0px}.-right-0\.5{right:-.125rem}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.-top-20{top:-5rem}.bottom-0{bottom:0}.bottom-16{bottom:4rem}.bottom-2{bottom:.5rem}.bottom-2\.5{bottom:.625rem}.bottom-20{bottom:5rem}.bottom-5{bottom:1.25rem}.bottom-\[60px\]{bottom:60px}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-20{left:5rem}.left-7{left:1.75rem}.left-9{left:2.25rem}.right-0{right:0}.right-2{right:.5rem}.right-2\.5{right:.625rem}.right-20{right:5rem}.right-3{right:.75rem}.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}.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}.m-5{margin:1.25rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-1\.5{margin-left:-.375rem;margin-right:-.375rem}.-mx-5{margin-left:-1.25rem;margin-right:-1.25rem}.-my-1{margin-top:-.25rem;margin-bottom:-.25rem}.-my-1\.5{margin-top:-.375rem;margin-bottom:-.375rem}.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-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.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}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.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}.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-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}.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-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-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-auto{height:auto}.h-full{height:100%}.h-modal{height:calc(100% - 2rem)}.h-px{height:1px}.h-screen{height:100vh}.max-h-6{max-height:1.5rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.max-h-\[400px\]{max-height:400px}.max-h-full{max-height:100%}.max-h-screen{max-height:100vh}.min-h-\[900px\]{min-height:900px}.min-h-full{min-height:100%}.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-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-4\/6{width:66.666667%}.w-48{width:12rem}.w-5{width:1.25rem}.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-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.w-screen{width:100vw}.min-w-\[23rem\]{min-width:23rem}.min-w-\[24rem\]{min-width:24rem}.min-w-\[300px\]{min-width:300px}.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-\[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}.-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-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-75{--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))}.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-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.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-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-\[40px\,1fr\]{grid-template-columns:40px 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.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-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.-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-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))}.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-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-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-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))}.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-discussion{background-color:var(--color-bg-light-discussion)}.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-300{--tw-bg-opacity: 1;background-color:rgb(164 202 254 / 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-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-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-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-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-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-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%}.fill-blue-600{fill:#1c64f2}.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}.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-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}.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-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.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-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-24{padding-top:6rem}.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-sans{font-family:PTSans,Roboto,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-\[\.82rem\]{font-size:.82rem}.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}.leading-4{line-height:1rem}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.text-blue-100{--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.text-blue-400{--tw-text-opacity: 1;color:rgb(118 169 250 / 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-100{--tw-text-opacity: 1;color:rgb(243 244 246 / 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-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-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-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-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-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-30{opacity:.3}.opacity-50{opacity:.5}.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-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-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-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))}.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)}.grayscale-0{--tw-grayscale: grayscale(0);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)}.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-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.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:auto}.scrollbar::-webkit-scrollbar{display:block;width:var(--scrollbar-width, 16px);height:var(--scrollbar-height, 16px)}.scrollbar-thin{scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.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-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-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}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.display-none{display:none}h1{font-size:36px;font-weight:700}h2{font-size:24px;font-weight:700}h3{font-size:18px;font-weight:700}h4{font-size:18px;font-style:italic}p{font-size:16px;word-wrap:break-word;overflow-wrap:break-word;white-space:normal}ul{list-style-type:disc;margin-left:0}li{list-style-type:disc;margin-left:20px}ol{list-style-type:decimal;margin-left:20px}:root{--color-primary: #0e8ef0;--color-primary-light: #3dabff;--color-secondary: #0fd974;--color-accent: #f0700e;--color-bg-dark: #132e59;--color-bg-dark-tone: #25477d;--color-bg-dark-tone-panel: #4367a3;--color-bg-dark-code-block: #2254a7;--color-bg-light: #e2edff;--color-bg-light-tone: #b9d2f7;--color-bg-light-code-block: #cad7ed;--color-bg-light-tone-panel: #8fb5ef;--color-bg-dark-discussion: #435E8A;--color-bg-dark-discussion-odd: #284471;--color-bg-light-discussion: #c5d8f8;--color-bg-light-discussion-odd: #d6e7ff}.last\:\!border-transparent:last-child{border-color:transparent!important}.last\:pb-0:last-child{padding-bottom:0}.odd\:bg-bg-light-tone:nth-child(odd){background-color:var(--color-bg-light-tone)}.even\:bg-bg-light-discussion-odd:nth-child(2n){background-color:var(--color-bg-light-discussion-odd)}.even\:bg-bg-light-tone-panel:nth-child(2n){background-color:var(--color-bg-light-tone-panel)}.group:hover .group-hover\:visible{visibility:visible}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:-translate-y-10{--tw-translate-y: -2.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))}.group:hover .group-hover\:border-secondary{border-color:var(--color-secondary)}.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: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\:block:hover{display:block}.hover\:h-8:hover{height:2rem}.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\:translate-y-\[-5px\]:hover{--tw-translate-y: -5px;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-95:hover{--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))}.hover\:border-2:hover{border-width:2px}.hover\:border-solid:hover{border-style:solid}.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-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-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-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\: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\:fill-primary:hover{fill:var(--color-primary)}.hover\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.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-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\:text-green-500:hover{--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}.hover\:text-primary:hover{color:var(--color-primary)}.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-secondary:hover{color:var(--color-secondary)}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / 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\: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\: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-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-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-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))}.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\:scrollbar-thumb-secondary{--scrollbar-thumb-active: var(--color-secondary) !important}:is(.dark .dark\:divide-gray-700)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity))}:is(.dark .dark\:border-bg-light){border-color:var(--color-bg-light)}:is(.dark .dark\:border-blue-500){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-500){--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-600){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-700){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-800){--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-900){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity))}:is(.dark .dark\:border-green-500){--tw-border-opacity: 1;border-color:rgb(14 159 110 / var(--tw-border-opacity))}:is(.dark .dark\:border-pink-400){--tw-border-opacity: 1;border-color:rgb(241 126 184 / var(--tw-border-opacity))}:is(.dark .dark\:border-pink-500){--tw-border-opacity: 1;border-color:rgb(231 70 148 / var(--tw-border-opacity))}:is(.dark .dark\:border-purple-400){--tw-border-opacity: 1;border-color:rgb(172 148 250 / var(--tw-border-opacity))}:is(.dark .dark\:border-purple-500){--tw-border-opacity: 1;border-color:rgb(144 97 249 / var(--tw-border-opacity))}:is(.dark .dark\:border-red-500){--tw-border-opacity: 1;border-color:rgb(240 82 82 / var(--tw-border-opacity))}:is(.dark .dark\:border-transparent){border-color:transparent}:is(.dark .dark\:border-yellow-300){--tw-border-opacity: 1;border-color:rgb(250 202 21 / var(--tw-border-opacity))}:is(.dark .dark\:bg-bg-dark){background-color:var(--color-bg-dark)}:is(.dark .dark\:bg-bg-dark-discussion){background-color:var(--color-bg-dark-discussion)}:is(.dark .dark\:bg-bg-dark-tone){background-color:var(--color-bg-dark-tone)}:is(.dark .dark\:bg-bg-dark-tone-panel){background-color:var(--color-bg-dark-tone-panel)}:is(.dark .dark\:bg-black){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-200){--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-500){--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-600){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-700){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-800){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-900){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-200){--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-300){--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-400){--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-500){--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-600){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-700){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800\/30){background-color:#1f29374d}:is(.dark .dark\:bg-gray-800\/50){background-color:#1f293780}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-200){--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-500){--tw-bg-opacity: 1;background-color:rgb(14 159 110 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-600){--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-800){--tw-bg-opacity: 1;background-color:rgb(3 84 63 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-indigo-200){--tw-bg-opacity: 1;background-color:rgb(205 219 254 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-indigo-500){--tw-bg-opacity: 1;background-color:rgb(104 117 245 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-orange-700){--tw-bg-opacity: 1;background-color:rgb(180 52 3 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-orange-800){--tw-bg-opacity: 1;background-color:rgb(138 44 13 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-pink-200){--tw-bg-opacity: 1;background-color:rgb(250 209 232 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-pink-600){--tw-bg-opacity: 1;background-color:rgb(214 31 105 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-200){--tw-bg-opacity: 1;background-color:rgb(220 215 254 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-500){--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-600){--tw-bg-opacity: 1;background-color:rgb(126 58 242 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-200){--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-500){--tw-bg-opacity: 1;background-color:rgb(240 82 82 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-600){--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-800){--tw-bg-opacity: 1;background-color:rgb(155 28 28 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-yellow-200){--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-opacity-70){--tw-bg-opacity: .7}:is(.dark .dark\:bg-opacity-80){--tw-bg-opacity: .8}:is(.dark .dark\:from-bg-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)}:is(.dark .dark\:from-bg-dark-tone){--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)}:is(.dark .dark\:via-bg-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)}:is(.dark .dark\:fill-gray-300){fill:#d1d5db}:is(.dark .dark\:fill-white){fill:#fff}:is(.dark .dark\:text-blue-200){--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}:is(.dark .dark\:text-blue-500){--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}:is(.dark .dark\:text-blue-800){--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-200){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-300){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-400){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-500){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-600){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-800){--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-200){--tw-text-opacity: 1;color:rgb(188 240 218 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-500){--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-800){--tw-text-opacity: 1;color:rgb(3 84 63 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-900){--tw-text-opacity: 1;color:rgb(1 71 55 / var(--tw-text-opacity))}:is(.dark .dark\:text-indigo-500){--tw-text-opacity: 1;color:rgb(104 117 245 / var(--tw-text-opacity))}:is(.dark .dark\:text-indigo-900){--tw-text-opacity: 1;color:rgb(54 47 120 / var(--tw-text-opacity))}:is(.dark .dark\:text-orange-200){--tw-text-opacity: 1;color:rgb(252 217 189 / var(--tw-text-opacity))}:is(.dark .dark\:text-pink-400){--tw-text-opacity: 1;color:rgb(241 126 184 / var(--tw-text-opacity))}:is(.dark .dark\:text-pink-500){--tw-text-opacity: 1;color:rgb(231 70 148 / var(--tw-text-opacity))}:is(.dark .dark\:text-pink-900){--tw-text-opacity: 1;color:rgb(117 26 61 / var(--tw-text-opacity))}:is(.dark .dark\:text-primary){color:var(--color-primary)}:is(.dark .dark\:text-purple-400){--tw-text-opacity: 1;color:rgb(172 148 250 / var(--tw-text-opacity))}:is(.dark .dark\:text-purple-500){--tw-text-opacity: 1;color:rgb(144 97 249 / var(--tw-text-opacity))}:is(.dark .dark\:text-purple-900){--tw-text-opacity: 1;color:rgb(74 29 150 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-200){--tw-text-opacity: 1;color:rgb(251 213 213 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-500){--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-800){--tw-text-opacity: 1;color:rgb(155 28 28 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-900){--tw-text-opacity: 1;color:rgb(119 29 29 / var(--tw-text-opacity))}:is(.dark .dark\:text-slate-50){--tw-text-opacity: 1;color:rgb(248 250 252 / var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-300){--tw-text-opacity: 1;color:rgb(250 202 21 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-500){--tw-text-opacity: 1;color:rgb(194 120 3 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-800){--tw-text-opacity: 1;color:rgb(114 59 19 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-900){--tw-text-opacity: 1;color:rgb(99 49 18 / var(--tw-text-opacity))}:is(.dark .dark\:placeholder-gray-400)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-gray-400)::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}:is(.dark .dark\: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)}:is(.dark .dark\:shadow-blue-800\/80){--tw-shadow-color: rgb(30 66 159 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-cyan-800\/80){--tw-shadow-color: rgb(21 94 117 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-green-800\/80){--tw-shadow-color: rgb(3 84 63 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-lime-800\/80){--tw-shadow-color: rgb(63 98 18 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-pink-800\/80){--tw-shadow-color: rgb(153 21 75 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-purple-800\/80){--tw-shadow-color: rgb(85 33 181 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-red-800\/80){--tw-shadow-color: rgb(155 28 28 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-teal-800\/80){--tw-shadow-color: rgb(5 80 92 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:ring-gray-500){--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}:is(.dark .dark\:ring-offset-gray-700){--tw-ring-offset-color: #374151}:is(.dark .dark\:ring-offset-gray-800){--tw-ring-offset-color: #1F2937}:is(.dark .dark\:scrollbar-track-bg-dark){--scrollbar-track: var(--color-bg-dark) !important}:is(.dark .dark\:scrollbar-track-bg-dark-tone){--scrollbar-track: var(--color-bg-dark-tone) !important}:is(.dark .dark\:scrollbar-thumb-bg-dark-tone){--scrollbar-thumb: var(--color-bg-dark-tone) !important}:is(.dark .dark\:scrollbar-thumb-bg-dark-tone-panel){--scrollbar-thumb: var(--color-bg-dark-tone-panel) !important}:is(.dark .odd\:dark\:bg-bg-dark-tone):nth-child(odd){background-color:var(--color-bg-dark-tone)}:is(.dark .dark\:even\:bg-bg-dark-discussion-odd:nth-child(2n)){background-color:var(--color-bg-dark-discussion-odd)}:is(.dark .dark\:even\:bg-bg-dark-tone-panel:nth-child(2n)){background-color:var(--color-bg-dark-tone-panel)}:is(.dark .group:hover .dark\:group-hover\:bg-gray-800\/60){background-color:#1f293799}:is(.dark .group:hover .dark\:group-hover\:text-white){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .group:focus .dark\:group-focus\:ring-gray-800\/70){--tw-ring-color: rgb(31 41 55 / .7)}:is(.dark .dark\:hover\:border-gray-600:hover){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}:is(.dark .dark\:hover\:border-primary:hover){border-color:var(--color-primary)}:is(.dark .dark\:hover\:bg-bg-dark-tone:hover){background-color:var(--color-bg-dark-tone)}:is(.dark .dark\:hover\:bg-blue-300:hover){--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-600:hover){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-700:hover){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-600:hover){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-700:hover){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-800:hover){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-300:hover){--tw-bg-opacity: 1;background-color:rgb(132 225 188 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-600:hover){--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-700:hover){--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-pink-500:hover){--tw-bg-opacity: 1;background-color:rgb(231 70 148 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-pink-700:hover){--tw-bg-opacity: 1;background-color:rgb(191 18 93 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-primary:hover){background-color:var(--color-primary)}:is(.dark .dark\:hover\:bg-purple-500:hover){--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-purple-700:hover){--tw-bg-opacity: 1;background-color:rgb(108 43 217 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-300:hover){--tw-bg-opacity: 1;background-color:rgb(248 180 180 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-600:hover){--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-700:hover){--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-yellow-300:hover){--tw-bg-opacity: 1;background-color:rgb(250 202 21 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-yellow-400:hover){--tw-bg-opacity: 1;background-color:rgb(227 160 8 / var(--tw-bg-opacity))}:is(.dark .hover\:dark\:bg-bg-dark-tone):hover{background-color:var(--color-bg-dark-tone)}:is(.dark .hover\:dark\:bg-bg-dark-tone-panel):hover{background-color:var(--color-bg-dark-tone-panel)}:is(.dark .hover\:dark\:bg-bg-light-tone):hover{background-color:var(--color-bg-light-tone)}:is(.dark .dark\:hover\:fill-primary:hover){fill:var(--color-primary)}:is(.dark .dark\:hover\:text-blue-500:hover){--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-gray-300:hover){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-gray-900:hover){--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-white:hover){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:scrollbar-thumb-primary){--scrollbar-thumb-hover: var(--color-primary) !important}:is(.dark .dark\:focus\:border-blue-500:focus){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}:is(.dark .dark\:focus\:border-secondary:focus){border-color:var(--color-secondary)}:is(.dark .dark\:focus\:text-white:focus){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:focus\:ring-blue-500:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-blue-600:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(28 100 242 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-blue-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-cyan-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(21 94 117 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-500:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-600:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-700:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-green-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(3 84 63 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-lime-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(63 98 18 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-pink-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(153 21 75 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-pink-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(117 26 61 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-purple-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(85 33 181 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-purple-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(74 29 150 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-400:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(155 28 28 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(119 29 29 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-secondary:focus){--tw-ring-color: var(--color-secondary)}:is(.dark .dark\:focus\:ring-teal-700:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(3 102 114 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-teal-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(5 80 92 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-yellow-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(99 49 18 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-offset-gray-700:focus){--tw-ring-offset-color: #374151}@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\: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\:my-2{margin-top:.5rem;margin-bottom:.5rem}.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-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))}:is(.dark .md\:dark\:bg-gray-900){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}:is(.dark .md\:dark\:hover\:bg-transparent:hover){background-color:transparent}:is(.dark .md\:dark\:hover\:text-white:hover){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}}@media (min-width: 1024px){.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.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}} +*/.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}.progress-bar-container{background-color:#f0f0f0;border-radius:4px;height:8px;overflow:hidden}.progress-bar{background-color:#3498db;height:100%;transition:width .3s ease}.fade-enter-active[data-v-39acdea0],.fade-leave-active[data-v-39acdea0]{transition:opacity .5s}.fade-enter[data-v-39acdea0],.fade-leave-to[data-v-39acdea0]{opacity:0}.container{margin:0;padding:0}.link-item{height:25px;margin-top:5px;padding:0 20px;margin-bottom:-5px;display:flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:5px 5px 0 0;font-weight:700;transition:duration-300 ease-in-out transform}.link-item-dark{padding:0 20px;color:#f0f8ff;margin-bottom:-5px;display:flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:5px 5px 0 0;font-weight:700;transition:duration-300 ease-in-out transform}.nav-ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;height:100%}.nav-li{cursor:pointer;display:flex;align-items:center;padding:5px}.dot{width:10px;height:10px;border-radius:50%}.dot-green{background-color:green}.dot-red{background-color:red}.hovered{transition:transform .3s cubic-bezier(.175,.885,.32,1.275);transform:scale(1.1)}.active{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#0009;pointer-events:all}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:250px;background-color:#fff;z-index:1000;display:none}.settings-button{cursor:pointer;padding:10px;border:1px solid #ddd;border-radius:5px;color:#333;font-size:14px}.settings-button:hover{background-color:#eee}.settings-button:active{background-color:#ddd}.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}.scrollbar[data-v-b19a05a8]{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);white-space:pre-wrap;overflow-wrap:break-word}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar{width:8px}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar-track{background-color:var(--scrollbar-track-color)}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color);border-radius:4px}.scrollbar[data-v-b19a05a8]::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover-color)}.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}.selected-choice{background-color:#bde4ff}.heartbeat-text[data-v-26efbf12]{font-size:24px;animation:pulsate-26efbf12 1.5s infinite}@keyframes pulsate-26efbf12{0%{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}to{transform:scale(1);opacity:1}}.list-move[data-v-26efbf12],.list-enter-active[data-v-26efbf12],.list-leave-active[data-v-26efbf12]{transition:all .5s ease}.list-enter-from[data-v-26efbf12]{transform:translatey(-30px)}.list-leave-to[data-v-26efbf12]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-26efbf12]{position:absolute}.bounce-enter-active[data-v-26efbf12]{animation:bounce-in-26efbf12 .5s}.bounce-leave-active[data-v-26efbf12]{animation:bounce-in-26efbf12 .5s reverse}@keyframes bounce-in-26efbf12{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.bg-primary-light[data-v-26efbf12]{background-color:#0ff}.hover[data-v-26efbf12]:bg-primary-light:hover{background-color:#7fffd4}.font-bold[data-v-26efbf12]{font-weight:700}.collapsible-section{cursor:pointer;margin-bottom:10px;font-weight:700}.collapsible-section:hover{color:#1a202c}.collapsible-section .toggle-icon{margin-right:.25rem}.collapsible-section .toggle-icon i{color:#4a5568}.collapsible-section .toggle-icon i:hover{color:#1a202c}.json-viewer{max-height:300px;max-width:700px;flex:auto;overflow-y:auto;padding:10px;background-color:#f1f1f1;border:1px solid #ccc;border-radius:4px}.json-viewer .toggle-icon{cursor:pointer;margin-right:.25rem}.json-viewer .toggle-icon i{color:#4a5568}.json-viewer .toggle-icon i:hover{color:#1a202c}.expand-button{margin-left:10px;margin-right:10px;background:none;border:none;padding:0;cursor:pointer}.htmljs{background:none}.bounce-enter-active[data-v-c50eee06]{animation:bounce-in-c50eee06 .5s}.bounce-leave-active[data-v-c50eee06]{animation:bounce-in-c50eee06 .5s reverse}@keyframes bounce-in-c50eee06{0%{transform:scale(0)}50%{transform:scale(1.25)}to{transform:scale(1)}}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar-track{background-color:#f1f1f1}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar-thumb{background-color:#888;border-radius:4px}.custom-scrollbar[data-v-52cfa09c]::-webkit-scrollbar-thumb:hover{background-color:#555}.menu[data-v-52cfa09c]{display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper[data-v-52cfa09c]{position:relative;display:flex;flex-direction:column;align-items:center}.commands-menu-items-wrapper>#commands-menu-items[data-v-52cfa09c]{top:calc(-100% - 2rem)}.list-move[data-v-3d2d8162],.list-enter-active[data-v-3d2d8162],.list-leave-active[data-v-3d2d8162]{transition:all .5s ease}.list-enter-from[data-v-3d2d8162]{transform:translatey(-30px)}.list-leave-to[data-v-3d2d8162]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-3d2d8162]{position:absolute}.slide-right-enter-active[data-v-46f45c62],.slide-right-leave-active[data-v-46f45c62]{transition:transform .3s ease}.slide-right-enter[data-v-46f45c62],.slide-right-leave-to[data-v-46f45c62]{transform:translate(-100%)}.fade-and-fly-enter-active[data-v-46f45c62]{animation:fade-and-fly-enter-46f45c62 .5s ease}.fade-and-fly-leave-active[data-v-46f45c62]{animation:fade-and-fly-leave-46f45c62 .5s ease}@keyframes fade-and-fly-enter-46f45c62{0%{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes fade-and-fly-leave-46f45c62{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-20px) scale(1.2)}}.list-move[data-v-46f45c62],.list-enter-active[data-v-46f45c62],.list-leave-active[data-v-46f45c62]{transition:all .5s ease}.list-enter-from[data-v-46f45c62]{transform:translatey(-30px)}.list-leave-to[data-v-46f45c62]{opacity:0;transform:translatey(30px)}.list-leave-active[data-v-46f45c62]{position:absolute}.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-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 *: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:white;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>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}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{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}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-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;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[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]{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:white;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}html{scroll-behavior:smooth}@font-face{font-family:Roboto;src:url(/assets/Roboto-Regular-7277cfb8.ttf) format("truetype")}@font-face{font-family:PTSans;src:url(/assets/PTSans-Regular-23b91352.ttf) format("truetype")}*,: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: }::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: }.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-1{bottom:-.25rem}.-bottom-1\.5{bottom:-.375rem}.-bottom-2{bottom:-.5rem}.-bottom-4{bottom:-1rem}.-left-1{left:-.25rem}.-left-1\.5{left:-.375rem}.-right-0{right:-0px}.-right-0\.5{right:-.125rem}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.-top-20{top:-5rem}.bottom-0{bottom:0}.bottom-16{bottom:4rem}.bottom-2{bottom:.5rem}.bottom-2\.5{bottom:.625rem}.bottom-20{bottom:5rem}.bottom-5{bottom:1.25rem}.bottom-\[60px\]{bottom:60px}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-20{left:5rem}.left-7{left:1.75rem}.left-9{left:2.25rem}.right-0{right:0}.right-2{right:.5rem}.right-2\.5{right:.625rem}.right-20{right:5rem}.right-3{right:.75rem}.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}.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}.m-5{margin:1.25rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-1\.5{margin-left:-.375rem;margin-right:-.375rem}.-mx-5{margin-left:-1.25rem;margin-right:-1.25rem}.-my-1{margin-top:-.25rem;margin-bottom:-.25rem}.-my-1\.5{margin-top:-.375rem;margin-bottom:-.375rem}.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-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.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}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.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}.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-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}.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-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-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-auto{height:auto}.h-full{height:100%}.h-modal{height:calc(100% - 2rem)}.h-px{height:1px}.h-screen{height:100vh}.max-h-6{max-height:1.5rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.max-h-\[400px\]{max-height:400px}.max-h-full{max-height:100%}.max-h-screen{max-height:100vh}.min-h-\[900px\]{min-height:900px}.min-h-full{min-height:100%}.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-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-4\/6{width:66.666667%}.w-48{width:12rem}.w-5{width:1.25rem}.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-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.w-screen{width:100vw}.min-w-\[23rem\]{min-width:23rem}.min-w-\[24rem\]{min-width:24rem}.min-w-\[300px\]{min-width:300px}.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-\[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}.-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-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-75{--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))}.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-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.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-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-\[40px\,1fr\]{grid-template-columns:40px 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.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-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.-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-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))}.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-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-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-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))}.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-discussion{background-color:var(--color-bg-light-discussion)}.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-300{--tw-bg-opacity: 1;background-color:rgb(164 202 254 / 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-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-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-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-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-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-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%}.fill-blue-600{fill:#1c64f2}.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}.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-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}.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-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.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-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-24{padding-top:6rem}.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-sans{font-family:PTSans,Roboto,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-\[\.82rem\]{font-size:.82rem}.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}.leading-4{line-height:1rem}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.text-blue-100{--tw-text-opacity: 1;color:rgb(225 239 254 / var(--tw-text-opacity))}.text-blue-400{--tw-text-opacity: 1;color:rgb(118 169 250 / 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-100{--tw-text-opacity: 1;color:rgb(243 244 246 / 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-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-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-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-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-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-30{opacity:.3}.opacity-50{opacity:.5}.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-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-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-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))}.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)}.grayscale-0{--tw-grayscale: grayscale(0);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)}.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-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.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:auto}.scrollbar::-webkit-scrollbar{display:block;width:var(--scrollbar-width, 16px);height:var(--scrollbar-height, 16px)}.scrollbar-thin{scrollbar-color:var(--scrollbar-thumb, initial) var(--scrollbar-track, initial)}.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-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-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}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.display-none{display:none}h1{font-size:36px;font-weight:700}h2{font-size:24px;font-weight:700}h3{font-size:18px;font-weight:700}h4{font-size:18px;font-style:italic}p{font-size:16px;word-wrap:break-word;overflow-wrap:break-word;white-space:normal}ul{list-style-type:disc;margin-left:0}li{list-style-type:disc;margin-left:20px}ol{list-style-type:decimal;margin-left:20px}:root{--color-primary: #0e8ef0;--color-primary-light: #3dabff;--color-secondary: #0fd974;--color-accent: #f0700e;--color-bg-dark: #132e59;--color-bg-dark-tone: #25477d;--color-bg-dark-tone-panel: #4367a3;--color-bg-dark-code-block: #2254a7;--color-bg-light: #e2edff;--color-bg-light-tone: #b9d2f7;--color-bg-light-code-block: #cad7ed;--color-bg-light-tone-panel: #8fb5ef;--color-bg-dark-discussion: #435E8A;--color-bg-dark-discussion-odd: #284471;--color-bg-light-discussion: #c5d8f8;--color-bg-light-discussion-odd: #d6e7ff}.last\:\!border-transparent:last-child{border-color:transparent!important}.last\:pb-0:last-child{padding-bottom:0}.odd\:bg-bg-light-tone:nth-child(odd){background-color:var(--color-bg-light-tone)}.even\:bg-bg-light-discussion-odd:nth-child(2n){background-color:var(--color-bg-light-discussion-odd)}.even\:bg-bg-light-tone-panel:nth-child(2n){background-color:var(--color-bg-light-tone-panel)}.group:hover .group-hover\:visible{visibility:visible}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:-translate-y-10{--tw-translate-y: -2.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))}.group:hover .group-hover\:border-secondary{border-color:var(--color-secondary)}.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: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\:block:hover{display:block}.hover\:h-8:hover{height:2rem}.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\:translate-y-\[-5px\]:hover{--tw-translate-y: -5px;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-95:hover{--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))}.hover\:border-2:hover{border-width:2px}.hover\:border-solid:hover{border-style:solid}.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-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-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-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\: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\:fill-primary:hover{fill:var(--color-primary)}.hover\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(118 169 250 / var(--tw-text-opacity))}.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-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\:text-green-500:hover{--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}.hover\:text-primary:hover{color:var(--color-primary)}.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-secondary:hover{color:var(--color-secondary)}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / 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\: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\: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-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-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-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))}.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\:scrollbar-thumb-secondary{--scrollbar-thumb-active: var(--color-secondary) !important}:is(.dark .dark\:divide-gray-700)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity))}:is(.dark .dark\:border-bg-light){border-color:var(--color-bg-light)}:is(.dark .dark\:border-blue-500){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-500){--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-600){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-700){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-800){--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity))}:is(.dark .dark\:border-gray-900){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity))}:is(.dark .dark\:border-green-500){--tw-border-opacity: 1;border-color:rgb(14 159 110 / var(--tw-border-opacity))}:is(.dark .dark\:border-pink-400){--tw-border-opacity: 1;border-color:rgb(241 126 184 / var(--tw-border-opacity))}:is(.dark .dark\:border-pink-500){--tw-border-opacity: 1;border-color:rgb(231 70 148 / var(--tw-border-opacity))}:is(.dark .dark\:border-purple-400){--tw-border-opacity: 1;border-color:rgb(172 148 250 / var(--tw-border-opacity))}:is(.dark .dark\:border-purple-500){--tw-border-opacity: 1;border-color:rgb(144 97 249 / var(--tw-border-opacity))}:is(.dark .dark\:border-red-500){--tw-border-opacity: 1;border-color:rgb(240 82 82 / var(--tw-border-opacity))}:is(.dark .dark\:border-transparent){border-color:transparent}:is(.dark .dark\:border-yellow-300){--tw-border-opacity: 1;border-color:rgb(250 202 21 / var(--tw-border-opacity))}:is(.dark .dark\:bg-bg-dark){background-color:var(--color-bg-dark)}:is(.dark .dark\:bg-bg-dark-discussion){background-color:var(--color-bg-dark-discussion)}:is(.dark .dark\:bg-bg-dark-tone){background-color:var(--color-bg-dark-tone)}:is(.dark .dark\:bg-bg-dark-tone-panel){background-color:var(--color-bg-dark-tone-panel)}:is(.dark .dark\:bg-black){--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-200){--tw-bg-opacity: 1;background-color:rgb(195 221 253 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-500){--tw-bg-opacity: 1;background-color:rgb(63 131 248 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-600){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-700){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-800){--tw-bg-opacity: 1;background-color:rgb(30 66 159 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-blue-900){--tw-bg-opacity: 1;background-color:rgb(35 56 118 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-200){--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-300){--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-400){--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-500){--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-600){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-700){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-800\/30){background-color:#1f29374d}:is(.dark .dark\:bg-gray-800\/50){background-color:#1f293780}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-200){--tw-bg-opacity: 1;background-color:rgb(188 240 218 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-500){--tw-bg-opacity: 1;background-color:rgb(14 159 110 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-600){--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-green-800){--tw-bg-opacity: 1;background-color:rgb(3 84 63 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-indigo-200){--tw-bg-opacity: 1;background-color:rgb(205 219 254 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-indigo-500){--tw-bg-opacity: 1;background-color:rgb(104 117 245 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-orange-700){--tw-bg-opacity: 1;background-color:rgb(180 52 3 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-orange-800){--tw-bg-opacity: 1;background-color:rgb(138 44 13 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-pink-200){--tw-bg-opacity: 1;background-color:rgb(250 209 232 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-pink-600){--tw-bg-opacity: 1;background-color:rgb(214 31 105 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-200){--tw-bg-opacity: 1;background-color:rgb(220 215 254 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-500){--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-purple-600){--tw-bg-opacity: 1;background-color:rgb(126 58 242 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-200){--tw-bg-opacity: 1;background-color:rgb(251 213 213 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-500){--tw-bg-opacity: 1;background-color:rgb(240 82 82 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-600){--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-800){--tw-bg-opacity: 1;background-color:rgb(155 28 28 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-yellow-200){--tw-bg-opacity: 1;background-color:rgb(252 233 106 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-opacity-70){--tw-bg-opacity: .7}:is(.dark .dark\:bg-opacity-80){--tw-bg-opacity: .8}:is(.dark .dark\:from-bg-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)}:is(.dark .dark\:from-bg-dark-tone){--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)}:is(.dark .dark\:via-bg-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)}:is(.dark .dark\:fill-gray-300){fill:#d1d5db}:is(.dark .dark\:fill-white){fill:#fff}:is(.dark .dark\:text-blue-200){--tw-text-opacity: 1;color:rgb(195 221 253 / var(--tw-text-opacity))}:is(.dark .dark\:text-blue-500){--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}:is(.dark .dark\:text-blue-800){--tw-text-opacity: 1;color:rgb(30 66 159 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-200){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-300){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-400){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-500){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-600){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-800){--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-200){--tw-text-opacity: 1;color:rgb(188 240 218 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-500){--tw-text-opacity: 1;color:rgb(14 159 110 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-800){--tw-text-opacity: 1;color:rgb(3 84 63 / var(--tw-text-opacity))}:is(.dark .dark\:text-green-900){--tw-text-opacity: 1;color:rgb(1 71 55 / var(--tw-text-opacity))}:is(.dark .dark\:text-indigo-500){--tw-text-opacity: 1;color:rgb(104 117 245 / var(--tw-text-opacity))}:is(.dark .dark\:text-indigo-900){--tw-text-opacity: 1;color:rgb(54 47 120 / var(--tw-text-opacity))}:is(.dark .dark\:text-orange-200){--tw-text-opacity: 1;color:rgb(252 217 189 / var(--tw-text-opacity))}:is(.dark .dark\:text-pink-400){--tw-text-opacity: 1;color:rgb(241 126 184 / var(--tw-text-opacity))}:is(.dark .dark\:text-pink-500){--tw-text-opacity: 1;color:rgb(231 70 148 / var(--tw-text-opacity))}:is(.dark .dark\:text-pink-900){--tw-text-opacity: 1;color:rgb(117 26 61 / var(--tw-text-opacity))}:is(.dark .dark\:text-primary){color:var(--color-primary)}:is(.dark .dark\:text-purple-400){--tw-text-opacity: 1;color:rgb(172 148 250 / var(--tw-text-opacity))}:is(.dark .dark\:text-purple-500){--tw-text-opacity: 1;color:rgb(144 97 249 / var(--tw-text-opacity))}:is(.dark .dark\:text-purple-900){--tw-text-opacity: 1;color:rgb(74 29 150 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-200){--tw-text-opacity: 1;color:rgb(251 213 213 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-500){--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-800){--tw-text-opacity: 1;color:rgb(155 28 28 / var(--tw-text-opacity))}:is(.dark .dark\:text-red-900){--tw-text-opacity: 1;color:rgb(119 29 29 / var(--tw-text-opacity))}:is(.dark .dark\:text-slate-50){--tw-text-opacity: 1;color:rgb(248 250 252 / var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-300){--tw-text-opacity: 1;color:rgb(250 202 21 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-500){--tw-text-opacity: 1;color:rgb(194 120 3 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-800){--tw-text-opacity: 1;color:rgb(114 59 19 / var(--tw-text-opacity))}:is(.dark .dark\:text-yellow-900){--tw-text-opacity: 1;color:rgb(99 49 18 / var(--tw-text-opacity))}:is(.dark .dark\:placeholder-gray-400)::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-gray-400)::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}:is(.dark .dark\: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)}:is(.dark .dark\:shadow-blue-800\/80){--tw-shadow-color: rgb(30 66 159 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-cyan-800\/80){--tw-shadow-color: rgb(21 94 117 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-green-800\/80){--tw-shadow-color: rgb(3 84 63 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-lime-800\/80){--tw-shadow-color: rgb(63 98 18 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-pink-800\/80){--tw-shadow-color: rgb(153 21 75 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-purple-800\/80){--tw-shadow-color: rgb(85 33 181 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-red-800\/80){--tw-shadow-color: rgb(155 28 28 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:shadow-teal-800\/80){--tw-shadow-color: rgb(5 80 92 / .8);--tw-shadow: var(--tw-shadow-colored)}:is(.dark .dark\:ring-gray-500){--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}:is(.dark .dark\:ring-offset-gray-700){--tw-ring-offset-color: #374151}:is(.dark .dark\:ring-offset-gray-800){--tw-ring-offset-color: #1F2937}:is(.dark .dark\:scrollbar-track-bg-dark){--scrollbar-track: var(--color-bg-dark) !important}:is(.dark .dark\:scrollbar-track-bg-dark-tone){--scrollbar-track: var(--color-bg-dark-tone) !important}:is(.dark .dark\:scrollbar-thumb-bg-dark-tone){--scrollbar-thumb: var(--color-bg-dark-tone) !important}:is(.dark .dark\:scrollbar-thumb-bg-dark-tone-panel){--scrollbar-thumb: var(--color-bg-dark-tone-panel) !important}:is(.dark .odd\:dark\:bg-bg-dark-tone):nth-child(odd){background-color:var(--color-bg-dark-tone)}:is(.dark .dark\:even\:bg-bg-dark-discussion-odd:nth-child(2n)){background-color:var(--color-bg-dark-discussion-odd)}:is(.dark .dark\:even\:bg-bg-dark-tone-panel:nth-child(2n)){background-color:var(--color-bg-dark-tone-panel)}:is(.dark .group:hover .dark\:group-hover\:bg-gray-800\/60){background-color:#1f293799}:is(.dark .group:hover .dark\:group-hover\:text-white){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .group:focus .dark\:group-focus\:ring-gray-800\/70){--tw-ring-color: rgb(31 41 55 / .7)}:is(.dark .dark\:hover\:border-gray-600:hover){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}:is(.dark .dark\:hover\:border-primary:hover){border-color:var(--color-primary)}:is(.dark .dark\:hover\:bg-bg-dark-tone:hover){background-color:var(--color-bg-dark-tone)}:is(.dark .dark\:hover\:bg-blue-300:hover){--tw-bg-opacity: 1;background-color:rgb(164 202 254 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-600:hover){--tw-bg-opacity: 1;background-color:rgb(28 100 242 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-blue-700:hover){--tw-bg-opacity: 1;background-color:rgb(26 86 219 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-600:hover){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-700:hover){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-gray-800:hover){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-300:hover){--tw-bg-opacity: 1;background-color:rgb(132 225 188 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-600:hover){--tw-bg-opacity: 1;background-color:rgb(5 122 85 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-green-700:hover){--tw-bg-opacity: 1;background-color:rgb(4 108 78 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-pink-500:hover){--tw-bg-opacity: 1;background-color:rgb(231 70 148 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-pink-700:hover){--tw-bg-opacity: 1;background-color:rgb(191 18 93 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-primary:hover){background-color:var(--color-primary)}:is(.dark .dark\:hover\:bg-purple-500:hover){--tw-bg-opacity: 1;background-color:rgb(144 97 249 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-purple-700:hover){--tw-bg-opacity: 1;background-color:rgb(108 43 217 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-300:hover){--tw-bg-opacity: 1;background-color:rgb(248 180 180 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-600:hover){--tw-bg-opacity: 1;background-color:rgb(224 36 36 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-red-700:hover){--tw-bg-opacity: 1;background-color:rgb(200 30 30 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-yellow-300:hover){--tw-bg-opacity: 1;background-color:rgb(250 202 21 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-yellow-400:hover){--tw-bg-opacity: 1;background-color:rgb(227 160 8 / var(--tw-bg-opacity))}:is(.dark .hover\:dark\:bg-bg-dark-tone):hover{background-color:var(--color-bg-dark-tone)}:is(.dark .hover\:dark\:bg-bg-dark-tone-panel):hover{background-color:var(--color-bg-dark-tone-panel)}:is(.dark .hover\:dark\:bg-bg-light-tone):hover{background-color:var(--color-bg-light-tone)}:is(.dark .dark\:hover\:fill-primary:hover){fill:var(--color-primary)}:is(.dark .dark\:hover\:text-blue-500:hover){--tw-text-opacity: 1;color:rgb(63 131 248 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-gray-300:hover){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-gray-900:hover){--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:text-white:hover){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:scrollbar-thumb-primary){--scrollbar-thumb-hover: var(--color-primary) !important}:is(.dark .dark\:focus\:border-blue-500:focus){--tw-border-opacity: 1;border-color:rgb(63 131 248 / var(--tw-border-opacity))}:is(.dark .dark\:focus\:border-secondary:focus){border-color:var(--color-secondary)}:is(.dark .dark\:focus\:text-white:focus){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:focus\:ring-blue-500:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-blue-600:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(28 100 242 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-blue-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-cyan-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(21 94 117 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-500:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-600:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-700:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-gray-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-green-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(3 84 63 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-lime-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(63 98 18 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-pink-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(153 21 75 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-pink-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(117 26 61 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-purple-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(85 33 181 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-purple-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(74 29 150 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-400:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(249 128 128 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(155 28 28 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-red-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(119 29 29 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-secondary:focus){--tw-ring-color: var(--color-secondary)}:is(.dark .dark\:focus\:ring-teal-700:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(3 102 114 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-teal-800:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(5 80 92 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-yellow-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(99 49 18 / var(--tw-ring-opacity))}:is(.dark .dark\:focus\:ring-offset-gray-700:focus){--tw-ring-offset-color: #374151}@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\: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\:my-2{margin-top:.5rem;margin-bottom:.5rem}.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-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))}:is(.dark .md\:dark\:bg-gray-900){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}:is(.dark .md\:dark\:hover\:bg-transparent:hover){background-color:transparent}:is(.dark .md\:dark\:hover\:text-white:hover){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}}@media (min-width: 1024px){.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.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 fd32bf3b..86da254a 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,8 +6,8 @@ LoLLMS WebUI - Welcome - - + +
diff --git a/web/src/views/SettingsView.vue b/web/src/views/SettingsView.vue index b6124ffc..2b5ecf60 100644 --- a/web/src/views/SettingsView.vue +++ b/web/src/views/SettingsView.vue @@ -1283,6 +1283,8 @@
+ +
@@ -1333,16 +1335,18 @@ -
+ + +
- + @@ -2911,6 +2915,16 @@ export default { console.error(error); }); + }, + upgradeSDService(){ + axios.get('upgrade_sd') + .then(response => { + + }) + .catch(error => { + console.error(error); + }); + }, startSDService(){ axios.get('start_sd') @@ -2941,6 +2955,16 @@ export default { console.error(error); }); + }, + upgradeComfyUIService(){ + axios.get('upgrade_comfyui') + .then(response => { + + }) + .catch(error => { + console.error(error); + }); + }, startComfyUIService(){ axios.get('start_comfyui') @@ -2961,8 +2985,6 @@ export default { console.error(error); }); }, - - reinstallMotionCtrlService(){ axios.get('install_motion_ctrl') .then(response => { diff --git a/zoos/bindings_zoo b/zoos/bindings_zoo index e770f1e2..dc652637 160000 --- a/zoos/bindings_zoo +++ b/zoos/bindings_zoo @@ -1 +1 @@ -Subproject commit e770f1e20bd99bd1a5eec403d0fef080ff7eb1a8 +Subproject commit dc652637ff8b5907e5bd04e7e71a8548547e10e5 diff --git a/zoos/models_zoo b/zoos/models_zoo index 617b335c..b9423ea4 160000 --- a/zoos/models_zoo +++ b/zoos/models_zoo @@ -1 +1 @@ -Subproject commit 617b335c1e4de22039c86bb3c3649a2b7cd80166 +Subproject commit b9423ea479484a0f927bc9c27d4060cca71d4200