diff --git a/app.py b/app.py index f7b6d793..42452084 100644 --- a/app.py +++ b/app.py @@ -499,7 +499,6 @@ class LoLLMsWebUI(LoLLMsAPPI): self.copy_files("presets",presets_folder) presets = [] for filename in presets_folder.glob('*.yaml'): - print(filename) with open(filename, 'r', encoding='utf-8') as file: preset = yaml.safe_load(file) if preset is not None: @@ -1377,6 +1376,9 @@ class LoLLMsWebUI(LoLLMsAPPI): "active_personality_id":self.config["active_personality_id"] }) else: + if self.config.auto_save: + ASCIIColors.info("Saving configuration") + self.config.save_config() return jsonify({"status": True, "personalities":self.config["personalities"], "active_personality_id":self.config["active_personality_id"] @@ -1461,6 +1463,9 @@ class LoLLMsWebUI(LoLLMsAPPI): self.mounted_personalities = self.rebuild_personalities() self.personality = self.mounted_personalities[self.config["active_personality_id"]] ASCIIColors.success("ok") + if self.config.auto_save: + ASCIIColors.info("Saving configuration") + self.config.save_config() return jsonify({ "status": True, "personalities":self.config["personalities"], @@ -1504,6 +1509,9 @@ class LoLLMsWebUI(LoLLMsAPPI): if hasattr(self.personality.processor,"personality_config"): self.personality.processor.personality_config.update_template(data) self.personality.processor.personality_config.config.save_config() + if self.config.auto_save: + ASCIIColors.info("Saving configuration") + self.config.save_config() return jsonify({'status':True}) else: return jsonify({'status':False}) @@ -1541,6 +1549,9 @@ class LoLLMsWebUI(LoLLMsAPPI): gc.collect() self.binding= BindingBuilder().build_binding(self.config, self.lollms_paths) self.model = self.binding.build_model() + if self.config.auto_save: + ASCIIColors.info("Saving configuration") + self.config.save_config() return jsonify({'status':True}) else: return jsonify({'status':False}) @@ -1588,6 +1599,9 @@ class LoLLMsWebUI(LoLLMsAPPI): self.personality = self.mounted_personalities[self.config["active_personality_id"]] ASCIIColors.success("ok") print(f"Mounted {self.personality.name}") + if self.config.auto_save: + ASCIIColors.info("Saving configuration") + self.config.save_config() return jsonify({ "status": True, "personalities":self.config["personalities"], diff --git a/presets/airoboros_instruct.yaml b/presets/airoboros_instruct.yaml new file mode 100644 index 00000000..671fa68d --- /dev/null +++ b/presets/airoboros_instruct.yaml @@ -0,0 +1,13 @@ +name: Airoboros Instruct +content: | + A chat between a curious user and an assistant. + The assistant gives helpful, detailed, accurate responses to the user's input. + USER: @@ ASSISTANT: @@ + +help: | + This is the default Airoboros fine tuning format for chat mode with input. + There are two parameters: + - The first is the input, which is the subject of your injstruction. For example, if the instruction is summerize this text, then the input is the text. + - The second parameter is the instruction itself. For example, summerize this text. + +author: ParisNeo (adapted from the original Airoboros documentation by Jon Durbin) \ No newline at end of file diff --git a/presets/airoboros_instruct_with_obs.yaml b/presets/airoboros_instruct_with_obs.yaml new file mode 100644 index 00000000..0dc7f623 --- /dev/null +++ b/presets/airoboros_instruct_with_obs.yaml @@ -0,0 +1,22 @@ +name: Airoboros Instruct with obs +content: | + A chat between a curious user and an assistant. + The assistant gives helpful, detailed, accurate responses to the user's input. + USER: BEGININPUT + BEGINCONTEXT + @@ + ENDCONTEXT + @@ + ENDINPUT + BEGININSTRUCTION + @@ + ENDINSTRUCTION ASSISTANT: @@ + +help: | + This is the default Airoboros fine tuning format for chat mode with context obedient question answering + By obedient, JonDurbin means the model was trained to ignore what it thinks it knows, and uses the context to answer the question. + This expects an input block + an instruction block. + The input block has two parameters, first a key:value pairs, then a text input. + The instructions block tells the AI what to do. + +author: ParisNeo (adapted from the original Airoboros documentation by Jon Durbin) \ No newline at end of file diff --git a/presets/alpaca_instruct.yaml b/presets/alpaca_instruct.yaml index 095de27d..99cff34a 100644 --- a/presets/alpaca_instruct.yaml +++ b/presets/alpaca_instruct.yaml @@ -9,6 +9,5 @@ content: | help: | This is the default Alpaca fine tuning format for instruct mode with input. - There are two parameters: - - The first is the input, which is the subject of your injstruction. For example, if the instruction is summerize this text, then the input is the text. - - The second parameter is the instruction itself. For example, summerize this text. \ No newline at end of file + There is a single parameter: + - The instruction to the AI. For example, Who is Abraham Lincoln? \ No newline at end of file diff --git a/presets/build_markdown_book.yaml b/presets/build_markdown_book.yaml new file mode 100644 index 00000000..09dfa784 --- /dev/null +++ b/presets/build_markdown_book.yaml @@ -0,0 +1,5 @@ +name: Build a Markdown Book +content: | + @@ + # @@ + \ No newline at end of file diff --git a/presets/email_enhancing_cervice.yaml b/presets/email_enhancing_cervice.yaml new file mode 100644 index 00000000..c082cd8f --- /dev/null +++ b/presets/email_enhancing_cervice.yaml @@ -0,0 +1,14 @@ +name: Email enhancing service +content: | + Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. + + ### Instruction: + Enhance the following email using the following settings: + - Tone @@ + + ### Input: + @@ + + ### Response:@@ +help: | + This preset enables you to format your email in order to make it even better \ No newline at end of file diff --git a/web/dist/assets/index-09652204.js b/web/dist/assets/index-8e0404da.js similarity index 91% rename from web/dist/assets/index-09652204.js rename to web/dist/assets/index-8e0404da.js index 596654cb..b71191c3 100644 --- a/web/dist/assets/index-09652204.js +++ b/web/dist/assets/index-8e0404da.js @@ -80,7 +80,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),_e=T,we=q),G===void 0& }); } - `,t.async=!0,document.body.appendChild(t),this.renderedMarkdown=_l.render(this.markdownText),be(()=>{ve.replace()})},methods:{},watch:{markdownText(t){this.renderedMarkdown=_l.render(t),be(()=>{ve.replace()})}}},NTe={class:"break-all"},DTe=["innerHTML"];function LTe(t,e,n,s,o,r){return k(),C("div",NTe,[c("div",{innerHTML:o.renderedMarkdown,class:"markdown-content"},null,8,DTe)])}const Fg=Ue(RTe,[["render",LTe]]);const ITe={props:{value:String,inputType:{type:String,default:"text",validator:t=>["text","email","password","file","path","integer","float"].includes(t)},fileAccept:String},data(){return{inputValue:this.value,placeholderText:this.getPlaceholderText()}},watch:{value(t){console.log("Changing value to ",t),this.inputValue=t}},mounted(){be(()=>{ve.replace()}),console.log("Changing value to ",this.value),this.inputValue=this.value},methods:{handleSliderInput(t){this.inputValue=t.target.value,this.$emit("input",t.target.value)},getPlaceholderText(){switch(this.inputType){case"text":return"Enter text here";case"email":return"Enter your email";case"password":return"Enter your password";case"file":case"path":return"Choose a file";case"integer":return"Enter an integer";case"float":return"Enter a float";default:return"Enter value here"}},handleInput(t){if(this.inputType==="integer"){const e=t.target.value.replace(/[^0-9]/g,"");this.inputValue=e}console.log("handling input : ",t.target.value),this.$emit("input",t.target.value)},async pasteFromClipboard(){try{const t=await navigator.clipboard.readText();this.handleClipboardData(t)}catch(t){console.error("Failed to read from clipboard:",t)}},handlePaste(t){const e=t.clipboardData.getData("text");this.handleClipboardData(e)},handleClipboardData(t){switch(this.inputType){case"email":this.inputValue=this.isValidEmail(t)?t:"";break;case"password":this.inputValue=t;break;case"file":case"path":this.inputValue="";break;case"integer":this.inputValue=this.parseInteger(t);break;case"float":this.inputValue=this.parseFloat(t);break;default:this.inputValue=t;break}},isValidEmail(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)},parseInteger(t){const e=parseInt(t);return isNaN(e)?"":e},parseFloat(t){const e=parseFloat(t);return isNaN(e)?"":e},openFileInput(){this.$refs.fileInput.click()},handleFileInputChange(t){const e=t.target.files[0];e&&(this.inputValue=e.name)}}},PTe={class:"flex items-center space-x-2"},FTe=["value","type","placeholder"],BTe=["value","min","max"],$Te=c("i",{"data-feather":"clipboard"},null,-1),zTe=[$Te],jTe=c("i",{"data-feather":"upload"},null,-1),UTe=[jTe],qTe=["accept"];function HTe(t,e,n,s,o,r){return k(),C("div",PTe,[t.useSlider?(k(),C("input",{key:1,type:"range",value:parseInt(o.inputValue),min:t.minSliderValue,max:t.maxSliderValue,onInput:e[2]||(e[2]=(...i)=>r.handleSliderInput&&r.handleSliderInput(...i)),class:"flex-1 px-4 py-2 text-lg border dark:bg-gray-600 border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,BTe)):(k(),C("input",{key:0,value:o.inputValue,type:n.inputType,placeholder:o.placeholderText,onInput:e[0]||(e[0]=(...i)=>r.handleInput&&r.handleInput(...i)),onPaste:e[1]||(e[1]=(...i)=>r.handlePaste&&r.handlePaste(...i)),class:"flex-1 px-4 py-2 text-lg dark:bg-gray-600 border border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,FTe)),c("button",{onClick:e[3]||(e[3]=(...i)=>r.pasteFromClipboard&&r.pasteFromClipboard(...i)),class:"p-2 bg-blue-500 dark:bg-gray-600 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring focus:border-blue-300"},zTe),n.inputType==="file"?(k(),C("button",{key:2,onClick:e[4]||(e[4]=(...i)=>r.openFileInput&&r.openFileInput(...i)),class:"p-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring focus:border-blue-300"},UTe)):P("",!0),n.inputType==="file"?(k(),C("input",{key:3,ref:"fileInput",type:"file",style:{display:"none"},accept:n.fileAccept,onChange:e[5]||(e[5]=(...i)=>r.handleFileInputChange&&r.handleFileInputChange(...i))},null,40,qTe)):P("",!0)])}const vc=Ue(ITe,[["render",HTe]]);const VTe={props:{is_subcard:{type:Boolean,default:!1},is_shrunk:{type:Boolean,default:!1},title:{type:String,default:""},isHorizontal:{type:Boolean,default:!1},cardWidth:{type:String,default:"w-3/4"},disableHoverAnimation:{type:Boolean,default:!0},disableFocus:{type:Boolean,default:!1}},data(){return{shrink:this.is_shrunk,isHovered:!1,isActive:!1}},computed:{cardClass(){return["bg-gray-50","border","border-gray-300","text-gray-900","text-sm","rounded-lg","focus:ring-blue-500","focus:border-blue-500","w-full","p-2.5","dark:bg-gray-500","dark:border-gray-600","dark:placeholder-gray-400","dark:text-white","dark:focus:ring-blue-500","dark:focus:border-blue-500",{"cursor-pointer":!this.isActive&&!this.disableFocus,"w-auto":!this.isActive}]},cardWidthClass(){return this.isActive?this.cardWidth:""}},methods:{toggleCard(){this.disableFocus||(this.isActive=!this.isActive)}}},GTe={key:1,class:"flex flex-wrap"},KTe={key:2,class:"mb-2"};function WTe(t,e,n,s,o,r){return k(),C(Re,null,[o.isActive?(k(),C("div",{key:0,class:"overlay",onClick:e[0]||(e[0]=(...i)=>r.toggleCard&&r.toggleCard(...i))})):P("",!0),se(c("div",{class:Me(["border-blue-300 rounded-lg shadow-lg p-2",r.cardWidthClass,"m-2",{"bg-white dark:bg-gray-800":n.is_subcard},{"bg-white dark:bg-gray-900":!n.is_subcard},{hovered:!n.disableHoverAnimation&&o.isHovered,active:o.isActive}]),onMouseenter:e[2]||(e[2]=i=>o.isHovered=!0),onMouseleave:e[3]||(e[3]=i=>o.isHovered=!1),onClick:e[4]||(e[4]=de((...i)=>r.toggleCard&&r.toggleCard(...i),["self"])),style:yt({cursor:this.disableFocus?"":"pointer"})},[n.title?(k(),C("div",{key:0,onClick:e[1]||(e[1]=i=>o.shrink=!0),class:Me([{"text-center p-2 m-2 bg-gray-200":!n.is_subcard},"bg-gray-100 dark:bg-gray-500 rounded-lg pl-2 pr-2 mb-2 font-bold cursor-pointer"])},H(n.title),3)):P("",!0),n.isHorizontal?(k(),C("div",GTe,[xr(t.$slots,"default")])):(k(),C("div",KTe,[xr(t.$slots,"default")]))],38),[[Ye,o.shrink===!1]]),n.is_subcard?se((k(),C("div",{key:1,onClick:e[5]||(e[5]=i=>o.shrink=!1),class:"bg-white text-center text-xl bold dark:bg-gray-500 border-blue-300 rounded-lg shadow-lg p-2 h-10 cursor-pointer m-2"},H(n.title),513)),[[Ye,o.shrink===!0]]):se((k(),C("div",{key:2,onClick:e[6]||(e[6]=i=>o.shrink=!1),class:"bg-white text-center text-2xl dark:bg-gray-500 border-2 border-blue-300 rounded-lg shadow-lg p-0 h-7 cursor-pointer hover:h-8 hover:bg-blue-300"}," + ",512)),[[Ye,o.shrink===!0]])],64)}const vi=Ue(VTe,[["render",WTe]]);async function Th(t,e="",n=[]){return new Promise((s,o)=>{const r=document.createElement("div");r.className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50",n.length===0?r.innerHTML=` + `,t.async=!0,document.body.appendChild(t),this.markdownText?this.renderedMarkdown=_l.render(this.markdownText):this.renderedMarkdown="",be(()=>{ve.replace()})},methods:{},watch:{markdownText(t){this.renderedMarkdown=_l.render(t),be(()=>{ve.replace()})}}},NTe={class:"break-all"},DTe=["innerHTML"];function LTe(t,e,n,s,o,r){return k(),C("div",NTe,[c("div",{innerHTML:o.renderedMarkdown,class:"markdown-content"},null,8,DTe)])}const Fg=Ue(RTe,[["render",LTe]]);const ITe={props:{value:String,inputType:{type:String,default:"text",validator:t=>["text","email","password","file","path","integer","float"].includes(t)},fileAccept:String},data(){return{inputValue:this.value,placeholderText:this.getPlaceholderText()}},watch:{value(t){console.log("Changing value to ",t),this.inputValue=t}},mounted(){be(()=>{ve.replace()}),console.log("Changing value to ",this.value),this.inputValue=this.value},methods:{handleSliderInput(t){this.inputValue=t.target.value,this.$emit("input",t.target.value)},getPlaceholderText(){switch(this.inputType){case"text":return"Enter text here";case"email":return"Enter your email";case"password":return"Enter your password";case"file":case"path":return"Choose a file";case"integer":return"Enter an integer";case"float":return"Enter a float";default:return"Enter value here"}},handleInput(t){if(this.inputType==="integer"){const e=t.target.value.replace(/[^0-9]/g,"");this.inputValue=e}console.log("handling input : ",t.target.value),this.$emit("input",t.target.value)},async pasteFromClipboard(){try{const t=await navigator.clipboard.readText();this.handleClipboardData(t)}catch(t){console.error("Failed to read from clipboard:",t)}},handlePaste(t){const e=t.clipboardData.getData("text");this.handleClipboardData(e)},handleClipboardData(t){switch(this.inputType){case"email":this.inputValue=this.isValidEmail(t)?t:"";break;case"password":this.inputValue=t;break;case"file":case"path":this.inputValue="";break;case"integer":this.inputValue=this.parseInteger(t);break;case"float":this.inputValue=this.parseFloat(t);break;default:this.inputValue=t;break}},isValidEmail(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)},parseInteger(t){const e=parseInt(t);return isNaN(e)?"":e},parseFloat(t){const e=parseFloat(t);return isNaN(e)?"":e},openFileInput(){this.$refs.fileInput.click()},handleFileInputChange(t){const e=t.target.files[0];e&&(this.inputValue=e.name)}}},PTe={class:"flex items-center space-x-2"},FTe=["value","type","placeholder"],BTe=["value","min","max"],$Te=c("i",{"data-feather":"clipboard"},null,-1),zTe=[$Te],jTe=c("i",{"data-feather":"upload"},null,-1),UTe=[jTe],qTe=["accept"];function HTe(t,e,n,s,o,r){return k(),C("div",PTe,[t.useSlider?(k(),C("input",{key:1,type:"range",value:parseInt(o.inputValue),min:t.minSliderValue,max:t.maxSliderValue,onInput:e[2]||(e[2]=(...i)=>r.handleSliderInput&&r.handleSliderInput(...i)),class:"flex-1 px-4 py-2 text-lg border dark:bg-gray-600 border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,BTe)):(k(),C("input",{key:0,value:o.inputValue,type:n.inputType,placeholder:o.placeholderText,onInput:e[0]||(e[0]=(...i)=>r.handleInput&&r.handleInput(...i)),onPaste:e[1]||(e[1]=(...i)=>r.handlePaste&&r.handlePaste(...i)),class:"flex-1 px-4 py-2 text-lg dark:bg-gray-600 border border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,FTe)),c("button",{onClick:e[3]||(e[3]=(...i)=>r.pasteFromClipboard&&r.pasteFromClipboard(...i)),class:"p-2 bg-blue-500 dark:bg-gray-600 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring focus:border-blue-300"},zTe),n.inputType==="file"?(k(),C("button",{key:2,onClick:e[4]||(e[4]=(...i)=>r.openFileInput&&r.openFileInput(...i)),class:"p-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring focus:border-blue-300"},UTe)):P("",!0),n.inputType==="file"?(k(),C("input",{key:3,ref:"fileInput",type:"file",style:{display:"none"},accept:n.fileAccept,onChange:e[5]||(e[5]=(...i)=>r.handleFileInputChange&&r.handleFileInputChange(...i))},null,40,qTe)):P("",!0)])}const vc=Ue(ITe,[["render",HTe]]);const VTe={props:{is_subcard:{type:Boolean,default:!1},is_shrunk:{type:Boolean,default:!1},title:{type:String,default:""},isHorizontal:{type:Boolean,default:!1},cardWidth:{type:String,default:"w-3/4"},disableHoverAnimation:{type:Boolean,default:!0},disableFocus:{type:Boolean,default:!1}},data(){return{shrink:this.is_shrunk,isHovered:!1,isActive:!1}},computed:{cardClass(){return["bg-gray-50","border","border-gray-300","text-gray-900","text-sm","rounded-lg","focus:ring-blue-500","focus:border-blue-500","w-full","p-2.5","dark:bg-gray-500","dark:border-gray-600","dark:placeholder-gray-400","dark:text-white","dark:focus:ring-blue-500","dark:focus:border-blue-500",{"cursor-pointer":!this.isActive&&!this.disableFocus,"w-auto":!this.isActive}]},cardWidthClass(){return this.isActive?this.cardWidth:""}},methods:{toggleCard(){this.disableFocus||(this.isActive=!this.isActive)}}},GTe={key:1,class:"flex flex-wrap"},KTe={key:2,class:"mb-2"};function WTe(t,e,n,s,o,r){return k(),C(Re,null,[o.isActive?(k(),C("div",{key:0,class:"overlay",onClick:e[0]||(e[0]=(...i)=>r.toggleCard&&r.toggleCard(...i))})):P("",!0),se(c("div",{class:Me(["border-blue-300 rounded-lg shadow-lg p-2",r.cardWidthClass,"m-2",{"bg-white dark:bg-gray-800":n.is_subcard},{"bg-white dark:bg-gray-900":!n.is_subcard},{hovered:!n.disableHoverAnimation&&o.isHovered,active:o.isActive}]),onMouseenter:e[2]||(e[2]=i=>o.isHovered=!0),onMouseleave:e[3]||(e[3]=i=>o.isHovered=!1),onClick:e[4]||(e[4]=de((...i)=>r.toggleCard&&r.toggleCard(...i),["self"])),style:yt({cursor:this.disableFocus?"":"pointer"})},[n.title?(k(),C("div",{key:0,onClick:e[1]||(e[1]=i=>o.shrink=!0),class:Me([{"text-center p-2 m-2 bg-gray-200":!n.is_subcard},"bg-gray-100 dark:bg-gray-500 rounded-lg pl-2 pr-2 mb-2 font-bold cursor-pointer"])},H(n.title),3)):P("",!0),n.isHorizontal?(k(),C("div",GTe,[xr(t.$slots,"default")])):(k(),C("div",KTe,[xr(t.$slots,"default")]))],38),[[Ye,o.shrink===!1]]),n.is_subcard?se((k(),C("div",{key:1,onClick:e[5]||(e[5]=i=>o.shrink=!1),class:"bg-white text-center text-xl bold dark:bg-gray-500 border-blue-300 rounded-lg shadow-lg p-2 h-10 cursor-pointer m-2"},H(n.title),513)),[[Ye,o.shrink===!0]]):se((k(),C("div",{key:2,onClick:e[6]||(e[6]=i=>o.shrink=!1),class:"bg-white text-center text-2xl dark:bg-gray-500 border-2 border-blue-300 rounded-lg shadow-lg p-0 h-7 cursor-pointer hover:h-8 hover:bg-blue-300"}," + ",512)),[[Ye,o.shrink===!0]])],64)}const vi=Ue(VTe,[["render",WTe]]);async function Th(t,e="",n=[]){return new Promise((s,o)=>{const r=document.createElement("div");r.className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50",n.length===0?r.innerHTML=`

${t}

@@ -101,7 +101,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),_e=T,we=q),G===void 0&
`,document.body.appendChild(r);const i=r.querySelector("#cancelButton"),a=r.querySelector("#okButton");i.addEventListener("click",()=>{document.body.removeChild(r),s(null)}),a.addEventListener("click",()=>{if(n.length===0){const d=r.querySelector("#replacementInput").value.trim();document.body.removeChild(r),s(d)}else{const d=r.querySelector("#options_selector").value.trim();document.body.removeChild(r),s(d)}})})}function ZTe(t,e){console.log(t);let n={},s=/@<([^>]+)>@/g,o=[],r;for(;(r=s.exec(t))!==null;)o.push("@<"+r[1]+">@");console.log("matches"),console.log(o),o=[...new Set(o)];async function i(l){console.log(l);let d=l.toLowerCase().substring(2,l.length-2);if(d!=="generation_placeholder")if(d.includes(":")){Object.entries({all_language_options:"english:french:german:chinese:japanese:spanish:italian:russian:portuguese:swedish:danish:dutch:norwegian:slovak:czech:hungarian:polish:ukrainian:bulgarian:latvian:lithuanian:estonian:maltese:irish:galician:basque:welsh:breton:georgian:turkmen:kazakh:uzbek:tajik:afghan:sri-lankan:filipino:vietnamese:lao:cambodian:thai:burmese:kenyan:botswanan:zimbabwean:malawian:mozambican:angolan:namibian:south-african:madagascan:seychellois:mauritian:haitian:peruvian:ecuadorian:bolivian:paraguayan:chilean:argentinean:uruguayan:brazilian:colombian:venezuelan:puerto-rican:cuban:dominican:honduran:nicaraguan:salvadorean:guatemalan:el-salvadoran:belizean:panamanian:costa-rican:antiguan:barbudan:dominica's:grenada's:st-lucia's:st-vincent's:gibraltarian:faroe-islander:greenlandic:icelandic:jamaican:trinidadian:tobagonian:barbadian:anguillan:british-virgin-islander:us-virgin-islander:turkish:israeli:palestinian:lebanese:egyptian:libyan:tunisian:algerian:moroccan:bahraini:kuwaiti:saudi-arabian:yemeni:omani:irani:iraqi:afghanistan's:pakistani:indian:nepalese:sri-lankan:maldivan:burmese:thai:lao:vietnamese:kampuchean:malaysian:bruneian:indonesian:australian:new-zealanders:fijians:tongans:samoans:vanuatuans:wallisians:kiribatians:tuvaluans:solomon-islanders:marshallese:micronesians:hawaiians",all_programming_language_options:"python:c:c++:java:javascript:php:ruby:go:swift:kotlin:rust:haskell:erlang:lisp:scheme:prolog:cobol:fortran:pascal:delphi:d:eiffel:h:basic:visual_basic:smalltalk:objective-c:html5:node.js:vue.js:svelte:react:angular:ember:clipper:stex:arduino:brainfuck:r:assembly:mason:lepton:seacat:bbc_microbit:raspberry_pi_gpio:raspberry_pi_spi:raspberry_pi_i2c:raspberry_pi_uart:raspberry_pi_adc:raspberry_pi_ddio"}).forEach(([p,b])=>{console.log(`Key: ${p}, Value: ${b}`);function y(R){return R.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const x=y(p),S=new RegExp(x,"g");d=d.replace(S,b)});let h=d.split(":"),f=h[0],g=h[1]||"",m=[];h.length>2&&(m=h.slice(1));let _=await Th(f,g,m);_!==null&&(n[l]=_)}else{let u=await Th(d);u!==null&&(n[l]=u)}}let a=Promise.resolve();o.forEach(l=>{a=a.then(()=>i(l)).then(d=>{console.log(d)})}),a.then(()=>{Object.entries(n).forEach(([l,d])=>{console.log(`Key: ${l}, Value: ${d}`);function u(g){return g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const h=u(l),f=new RegExp(h,"g");t=t.replace(f,d)}),e(t)})}const YTe={name:"PlayGroundView",data(){return{selecting_model:!1,tab_id:"source",generating:!1,isSpeaking:!1,voices:[],isLesteningToVoice:!1,presets:[],selectedPreset:"",models:{},selectedModel:"",cursorPosition:0,text:"",pre_text:"",post_text:"",temperature:.1,top_k:50,top_p:.9,repeat_penalty:1.3,repeat_last_n:50,n_crop:-1,n_predicts:2e3,seed:-1,silenceTimeout:5e3}},components:{Toast:Ks,MarkdownRenderer:Fg,ClipBoardTextInput:vc,Card:vi},mounted(){ye.get("list_models").then(t=>{console.log("List models "+t.data),this.models=t.data,ye.get("get_active_model").then(e=>{console.log("Active model "+JSON.stringify(e.data)),e.data!=null&&(this.selectedModel=e.data.model)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,4,!1)}),ye.get("./get_presets").then(t=>{console.log(t.data),this.presets=t.data,this.selectedPreset=this.presets[0]}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,4,!1)}),Ee.on("text_chunk",t=>{this.appendToOutput(t.chunk)}),Ee.on("text_generated",t=>{this.generating=!1}),Ee.on("generation_error",t=>{console.log("generation_error:",t),this.$refs.toast.showToast(`Error: ${t}`,4,!1),this.generating=!1}),Ee.on("connect",()=>{console.log("Connected to LoLLMs server"),this.$store.state.isConnected=!0,this.generating=!1}),Ee.on("buzzy",t=>{console.error("Server is busy. Wait for your turn",t),this.$refs.toast.showToast(`Error: ${t.message}`,4,!1),this.generating=!1}),Ee.on("generation_canceled",t=>{this.generating=!1,console.log("Generation canceled OK")}),this.$nextTick(()=>{ve.replace()}),"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.")},created(){},computed:{isTalking:{get(){return this.isSpeaking}}},methods:{text_element_changed(){console.log("text_element_changed"),this.cursorPosition=this.$refs.text_element.selectionStart},text_element_clicked(){console.log("text_element_clicked"),this.cursorPosition=this.$refs.text_element.selectionStart},setModel(){this.selecting_model=!0,ye.post("/update_setting",{setting_name:"model_name",setting_value:this.selectedModel}).then(t=>{console.log(t),t.status&&this.$refs.toast.showToast(`Model changed to ${this.selectedModel}`,4,!0),this.selecting_model=!1}).catch(t=>{this.$refs.toast.showToast(`Error ${t}`,4,!0),this.selecting_model=!1})},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let t=0;console.log("voice on"),this.isSpeaking=!0;const e=200;this.msg=new SpeechSynthesisUtterance,this.msg.pitch=this.$store.state.config.audio_pitch,this.voices.length>0&&(this.msg.voice=this.voices.filter(o=>o.name===this.$store.state.config.audio_out_voice)[0]);const n=o=>{let r=this.text.substring(o,o+e);const i=[".","!","?",` -`];let a=-1;return i.forEach(l=>{const d=r.lastIndexOf(l);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+o+1},s=()=>{const o=n(t),r=this.text.substring(t,o);this.msg.text=r,t=o+1,this.msg.onend=i=>{t{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",o))},this.speechSynthesis.speak(this.msg)};s()},getCursorPosition(){return this.cursorPosition},appendToOutput(t){this.pre_text+=t,this.text=this.pre_text+this.post_text},generate_in_placeholder(){console.log("Finding cursor position");let t=this.text.indexOf("@@");if(t<0){this.$refs.toast.showToast("No generation placeholder found",4,!1);return}this.text=this.text.substring(0,t)+this.text.substring(t+26,this.text.length),this.pre_text=this.text.substring(0,t),this.post_text=this.text.substring(t,this.text.length);var e=this.text.substring(0,t);console.log(e),Ee.emit("generate_text",{prompt:e,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},generate(){console.log("Finding cursor position"),this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length);var t=this.text.substring(0,this.getCursorPosition());console.log(t),Ee.emit("generate_text",{prompt:t,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},stopGeneration(){Ee.emit("cancel_text_generation",{})},exportText(){const t=this.text,e=document.createElement("a"),n=new Blob([t],{type:"text/plain"});e.href=URL.createObjectURL(n),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const t=document.getElementById("import-input");t&&(t.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const n=new FileReader;n.onload=()=>{this.text=n.result},n.readAsText(e.target.files[0])}else alert("Please select a file.")}),t.click())},setPreset(){console.log("Setting preset"),console.log(this.selectedPreset),this.text=ZTe(this.selectedPreset.content,t=>{console.log("Done"),console.log(t),this.text=t})},addPreset(){let t=prompt("Enter the title of the preset:");this.presets[t]={name:t,content:this.text},ye.post("./add_preset",this.presets[t]).then(e=>{console.log(e.data)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset.name]},reloadPresets(){ye.get("./get_presets").then(t=>{console.log(t.data),this.presets=t.data,this.selectedPreset=this.presets[0]}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,4,!1)})},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.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length),this.recognition.onresult=t=>{this.generated="";for(let e=t.resultIndex;e{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=t=>{console.error("Speech recognition error:",t.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,this.pre_text=this.pre_text+this.generated,this.cursorPosition=this.pre_text.length,clearTimeout(this.silenceTimer)},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")}}},JTe={class:"container bg-bg-light dark:bg-bg-dark shadow-lg 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"},QTe={class:"container flex flex-row m-2"},XTe={class:"flex-grow m-2"},e7e={class:"flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},t7e=c("i",{"data-feather":"pen-tool"},null,-1),n7e=[t7e],s7e=c("i",{"data-feather":"archive"},null,-1),o7e=[s7e],r7e=c("span",{class:"w-80"},null,-1),i7e=c("i",{"data-feather":"x"},null,-1),a7e=[i7e],l7e=c("i",{"data-feather":"mic"},null,-1),c7e=[l7e],d7e=c("i",{"data-feather":"volume-2"},null,-1),u7e=[d7e],h7e=c("i",{"data-feather":"upload"},null,-1),f7e=[h7e],p7e=c("i",{"data-feather":"download"},null,-1),g7e=[p7e],m7e=c("input",{type:"file",id:"import-input",class:"hidden"},null,-1),_7e={class:"flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},b7e={class:"flex flex-row m-2 p-0"},y7e={key:0},v7e={key:1},w7e=["value"],x7e={key:0,title:"Selecting model",class:"flex flex-row flex-grow justify-end"},k7e=c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Selecting model...")],-1),E7e=[k7e],C7e=["value"],A7e=c("br",null,null,-1),S7e=c("i",{"data-feather":"check"},null,-1),T7e=[S7e],M7e=c("i",{"data-feather":"plus"},null,-1),O7e=[M7e],R7e=c("i",{"data-feather":"x"},null,-1),N7e=[R7e],D7e=c("i",{"data-feather":"refresh-ccw"},null,-1),L7e=[D7e],I7e={class:"slider-container ml-2 mr-2"},P7e=c("h3",{class:"text-gray-600"},"Temperature",-1),F7e={class:"slider-value text-gray-500"},B7e={class:"slider-container ml-2 mr-2"},$7e=c("h3",{class:"text-gray-600"},"Top K",-1),z7e={class:"slider-value text-gray-500"},j7e={class:"slider-container ml-2 mr-2"},U7e=c("h3",{class:"text-gray-600"},"Top P",-1),q7e={class:"slider-value text-gray-500"},H7e={class:"slider-container ml-2 mr-2"},V7e=c("h3",{class:"text-gray-600"},"Repeat Penalty",-1),G7e={class:"slider-value text-gray-500"},K7e={class:"slider-container ml-2 mr-2"},W7e=c("h3",{class:"text-gray-600"},"Repeat Last N",-1),Z7e={class:"slider-value text-gray-500"},Y7e={class:"slider-container ml-2 mr-2"},J7e=c("h3",{class:"text-gray-600"},"Number of tokens to crop the text to",-1),Q7e={class:"slider-value text-gray-500"},X7e={class:"slider-container ml-2 mr-2"},eMe=c("h3",{class:"text-gray-600"},"Number of tokens to generate",-1),tMe={class:"slider-value text-gray-500"},nMe={class:"slider-container ml-2 mr-2"},sMe=c("h3",{class:"text-gray-600"},"Seed",-1),oMe={class:"slider-value text-gray-500"};function rMe(t,e,n,s,o,r){const i=qe("MarkdownRenderer"),a=qe("Card"),l=qe("Toast");return k(),C(Re,null,[c("div",JTe,[c("div",QTe,[c("div",XTe,[c("div",e7e,[se(c("button",{id:"generate-button",onClick:e[0]||(e[0]=(...d)=>r.generate&&r.generate(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},n7e,512),[[Ye,!o.generating]]),se(c("button",{id:"generate-next-button",onClick:e[1]||(e[1]=(...d)=>r.generate_in_placeholder&&r.generate_in_placeholder(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},o7e,512),[[Ye,!o.generating]]),r7e,se(c("button",{id:"stop-button",onClick:e[2]||(e[2]=(...d)=>r.stopGeneration&&r.stopGeneration(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},a7e,512),[[Ye,o.generating]]),c("button",{type:"button",onClick:e[3]||(e[3]=(...d)=>r.startSpeechRecognition&&r.startSpeechRecognition(...d)),class:Me([{"text-red-500":o.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},c7e,2),c("button",{title:"speak",onClick:e[4]||(e[4]=de(d=>r.speak(),["stop"])),class:Me([{"text-red-500":r.isTalking},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},u7e,2),se(c("button",{id:"export-button",onClick:e[5]||(e[5]=(...d)=>r.exportText&&r.exportText(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},f7e,512),[[Ye,!o.generating]]),se(c("button",{id:"import-button",onClick:e[6]||(e[6]=(...d)=>r.importText&&r.importText(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},g7e,512),[[Ye,!o.generating]]),m7e]),c("div",_7e,[c("div",b7e,[c("div",{class:Me(["border-2 dark:bg-blue-700 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":o.tab_id=="source"}]),onClick:e[7]||(e[7]=d=>o.tab_id="source")}," Source ",2),c("div",{class:Me(["border-2 dark:bg-blue-700 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":o.tab_id=="render"}]),onClick:e[8]||(e[8]=d=>o.tab_id="render")}," Render ",2)]),o.tab_id==="source"?(k(),C("div",y7e,[se(c("textarea",{onClick:e[9]||(e[9]=(...d)=>r.text_element_clicked&&r.text_element_clicked(...d)),onKeyup:e[10]||(e[10]=(...d)=>r.text_element_changed&&r.text_element_changed(...d)),"onUpdate:modelValue":e[11]||(e[11]=d=>o.text=d),ref:"text_element",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full mt-4 h-64 p-2 rounded shadow-lg 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",type:"text"},null,544),[[Oe,o.text]]),c("span",null,"Cursor position "+H(o.cursorPosition),1)])):P("",!0),o.tab_id==="render"?(k(),C("div",v7e,[ue(i,{ref:"mdRender","markdown-text":o.text,class:"mt-4 p-2 rounded shadow-lg dark:bg-bg-dark"},null,8,["markdown-text"])])):P("",!0)])]),ue(a,{title:"settings",class:"slider-container ml-0 mr-0 max-width",isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[ue(a,{title:"Model",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[se(c("select",{"onUpdate:modelValue":e[12]||(e[12]=d=>o.selectedModel=d),onChange:e[13]||(e[13]=(...d)=>r.setModel&&r.setModel(...d)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(k(!0),C(Re,null,Ge(o.models,d=>(k(),C("option",{key:d,value:d},H(d),9,w7e))),128))],544),[[on,o.selectedModel]]),o.selecting_model?(k(),C("div",x7e,E7e)):P("",!0)]),_:1}),ue(a,{title:"Presets",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[se(c("select",{"onUpdate:modelValue":e[14]||(e[14]=d=>o.selectedPreset=d),class:"bg-white dark:bg-black mb-2 border-2 rounded-md shadow-sm w-full"},[(k(!0),C(Re,null,Ge(o.presets,d=>(k(),C("option",{key:d,value:d},H(d.name),9,C7e))),128))],512),[[on,o.selectedPreset]]),A7e,c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[15]||(e[15]=(...d)=>r.setPreset&&r.setPreset(...d)),title:"Use preset"},T7e),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[16]||(e[16]=(...d)=>r.addPreset&&r.addPreset(...d)),title:"Add this text as a preset"},O7e),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[17]||(e[17]=(...d)=>r.removePreset&&r.removePreset(...d)),title:"Remove preset"},N7e),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[18]||(e[18]=(...d)=>r.reloadPresets&&r.reloadPresets(...d)),title:"Reload presets list"},L7e)]),_:1}),ue(a,{title:"Generation params",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[c("div",I7e,[P7e,se(c("input",{type:"range","onUpdate:modelValue":e[19]||(e[19]=d=>o.temperature=d),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[Oe,o.temperature]]),c("span",F7e,"Current value: "+H(o.temperature),1)]),c("div",B7e,[$7e,se(c("input",{type:"range","onUpdate:modelValue":e[20]||(e[20]=d=>o.top_k=d),min:"1",max:"100",step:"1",class:"w-full"},null,512),[[Oe,o.top_k]]),c("span",z7e,"Current value: "+H(o.top_k),1)]),c("div",j7e,[U7e,se(c("input",{type:"range","onUpdate:modelValue":e[21]||(e[21]=d=>o.top_p=d),min:"0",max:"1",step:"0.1",class:"w-full"},null,512),[[Oe,o.top_p]]),c("span",q7e,"Current value: "+H(o.top_p),1)]),c("div",H7e,[V7e,se(c("input",{type:"range","onUpdate:modelValue":e[22]||(e[22]=d=>o.repeat_penalty=d),min:"0",max:"5",step:"0.1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Oe,o.repeat_penalty]]),c("span",G7e,"Current value: "+H(o.repeat_penalty),1)]),c("div",K7e,[W7e,se(c("input",{type:"range","onUpdate:modelValue":e[23]||(e[23]=d=>o.repeat_last_n=d),min:"0",max:"100",step:"1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Oe,o.repeat_last_n]]),c("span",Z7e,"Current value: "+H(o.repeat_last_n),1)]),c("div",Y7e,[J7e,se(c("input",{type:"number","onUpdate:modelValue":e[24]||(e[24]=d=>o.n_crop=d),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Oe,o.n_crop]]),c("span",Q7e,"Current value: "+H(o.n_crop),1)]),c("div",X7e,[eMe,se(c("input",{type:"number","onUpdate:modelValue":e[25]||(e[25]=d=>o.n_predicts=d),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Oe,o.n_predicts]]),c("span",tMe,"Current value: "+H(o.n_predicts),1)]),c("div",nMe,[sMe,se(c("input",{type:"number","onUpdate:modelValue":e[26]||(e[26]=d=>o.seed=d),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Oe,o.seed]]),c("span",oMe,"Current value: "+H(o.seed),1)])]),_:1})]),_:1})])]),ue(l,{ref:"toast"},null,512)],64)}const iMe=Ue(YTe,[["render",rMe]]);const aMe={data(){return{activeExtension:null}},computed:{activeExtensions(){return this.$store.state.extensionsZoo.filter(t=>t.is_active)}},methods:{showExtensionPage(t){this.activeExtension=t}}},lMe={key:0},cMe=["onClick"],dMe={key:0},uMe=["src"],hMe={key:1},fMe=c("p",null,"No extension is active. Please install and activate an extension.",-1),pMe=[fMe];function gMe(t,e,n,s,o,r){return k(),C("div",null,[r.activeExtensions.length>0?(k(),C("div",lMe,[(k(!0),C(Re,null,Ge(r.activeExtensions,i=>(k(),C("div",{key:i.name,onClick:a=>r.showExtensionPage(i)},[c("div",{class:Me({"active-tab":i===o.activeExtension})},H(i.name),3)],8,cMe))),128)),o.activeExtension?(k(),C("div",dMe,[c("iframe",{src:o.activeExtension.page,width:"100%",height:"500px",frameborder:"0"},null,8,uMe)])):P("",!0)])):(k(),C("div",hMe,pMe))])}const mMe=Ue(aMe,[["render",gMe]]);var Bg={exports:{}};/* @license +`];let a=-1;return i.forEach(l=>{const d=r.lastIndexOf(l);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+o+1},s=()=>{const o=n(t),r=this.text.substring(t,o);this.msg.text=r,t=o+1,this.msg.onend=i=>{t{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",o))},this.speechSynthesis.speak(this.msg)};s()},getCursorPosition(){return this.cursorPosition},appendToOutput(t){this.pre_text+=t,this.text=this.pre_text+this.post_text},generate_in_placeholder(){console.log("Finding cursor position");let t=this.text.indexOf("@@");if(t<0){this.$refs.toast.showToast("No generation placeholder found",4,!1);return}this.text=this.text.substring(0,t)+this.text.substring(t+26,this.text.length),this.pre_text=this.text.substring(0,t),this.post_text=this.text.substring(t,this.text.length);var e=this.text.substring(0,t);console.log(e),Ee.emit("generate_text",{prompt:e,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},generate(){console.log("Finding cursor position"),this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length);var t=this.text.substring(0,this.getCursorPosition());console.log(t),Ee.emit("generate_text",{prompt:t,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},stopGeneration(){Ee.emit("cancel_text_generation",{})},exportText(){const t=this.text,e=document.createElement("a"),n=new Blob([t],{type:"text/plain"});e.href=URL.createObjectURL(n),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const t=document.getElementById("import-input");t&&(t.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const n=new FileReader;n.onload=()=>{this.text=n.result},n.readAsText(e.target.files[0])}else alert("Please select a file.")}),t.click())},setPreset(){console.log("Setting preset"),console.log(this.selectedPreset),this.tab_id="render",this.text=ZTe(this.selectedPreset.content,t=>{console.log("Done"),console.log(t),this.text=t})},addPreset(){let t=prompt("Enter the title of the preset:");this.presets[t]={name:t,content:this.text},ye.post("./add_preset",this.presets[t]).then(e=>{console.log(e.data)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset.name]},reloadPresets(){ye.get("./get_presets").then(t=>{console.log(t.data),this.presets=t.data,this.selectedPreset=this.presets[0]}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,4,!1)})},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.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length),this.recognition.onresult=t=>{this.generated="";for(let e=t.resultIndex;e{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=t=>{console.error("Speech recognition error:",t.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,this.pre_text=this.pre_text+this.generated,this.cursorPosition=this.pre_text.length,clearTimeout(this.silenceTimer)},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")}}},JTe={class:"container bg-bg-light dark:bg-bg-dark shadow-lg 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"},QTe={class:"container flex flex-row m-2"},XTe={class:"flex-grow m-2"},e7e={class:"flex gap-3 flex-1 items-center flex-grow flex-row m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},t7e=c("i",{"data-feather":"pen-tool"},null,-1),n7e=[t7e],s7e=c("i",{"data-feather":"archive"},null,-1),o7e=[s7e],r7e=c("span",{class:"w-80"},null,-1),i7e=c("i",{"data-feather":"x"},null,-1),a7e=[i7e],l7e=c("i",{"data-feather":"mic"},null,-1),c7e=[l7e],d7e=c("i",{"data-feather":"volume-2"},null,-1),u7e=[d7e],h7e=c("i",{"data-feather":"upload"},null,-1),f7e=[h7e],p7e=c("i",{"data-feather":"download"},null,-1),g7e=[p7e],m7e={class:"flex gap-3 flex-1 items-center flex-grow justify-end"},_7e=c("input",{type:"file",id:"import-input",class:"hidden"},null,-1),b7e={class:"flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},y7e={key:0},v7e={key:1},w7e=["value"],x7e={key:0,title:"Selecting model",class:"flex flex-row flex-grow justify-end"},k7e=c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Selecting model...")],-1),E7e=[k7e],C7e=["value"],A7e=c("br",null,null,-1),S7e=c("i",{"data-feather":"check"},null,-1),T7e=[S7e],M7e=c("i",{"data-feather":"plus"},null,-1),O7e=[M7e],R7e=c("i",{"data-feather":"x"},null,-1),N7e=[R7e],D7e=c("i",{"data-feather":"refresh-ccw"},null,-1),L7e=[D7e],I7e={class:"slider-container ml-2 mr-2"},P7e=c("h3",{class:"text-gray-600"},"Temperature",-1),F7e={class:"slider-value text-gray-500"},B7e={class:"slider-container ml-2 mr-2"},$7e=c("h3",{class:"text-gray-600"},"Top K",-1),z7e={class:"slider-value text-gray-500"},j7e={class:"slider-container ml-2 mr-2"},U7e=c("h3",{class:"text-gray-600"},"Top P",-1),q7e={class:"slider-value text-gray-500"},H7e={class:"slider-container ml-2 mr-2"},V7e=c("h3",{class:"text-gray-600"},"Repeat Penalty",-1),G7e={class:"slider-value text-gray-500"},K7e={class:"slider-container ml-2 mr-2"},W7e=c("h3",{class:"text-gray-600"},"Repeat Last N",-1),Z7e={class:"slider-value text-gray-500"},Y7e={class:"slider-container ml-2 mr-2"},J7e=c("h3",{class:"text-gray-600"},"Number of tokens to crop the text to",-1),Q7e={class:"slider-value text-gray-500"},X7e={class:"slider-container ml-2 mr-2"},eMe=c("h3",{class:"text-gray-600"},"Number of tokens to generate",-1),tMe={class:"slider-value text-gray-500"},nMe={class:"slider-container ml-2 mr-2"},sMe=c("h3",{class:"text-gray-600"},"Seed",-1),oMe={class:"slider-value text-gray-500"};function rMe(t,e,n,s,o,r){const i=qe("MarkdownRenderer"),a=qe("Card"),l=qe("Toast");return k(),C(Re,null,[c("div",JTe,[c("div",QTe,[c("div",XTe,[c("div",e7e,[se(c("button",{id:"generate-button",onClick:e[0]||(e[0]=(...d)=>r.generate&&r.generate(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},n7e,512),[[Ye,!o.generating]]),se(c("button",{id:"generate-next-button",onClick:e[1]||(e[1]=(...d)=>r.generate_in_placeholder&&r.generate_in_placeholder(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},o7e,512),[[Ye,!o.generating]]),r7e,se(c("button",{id:"stop-button",onClick:e[2]||(e[2]=(...d)=>r.stopGeneration&&r.stopGeneration(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},a7e,512),[[Ye,o.generating]]),c("button",{type:"button",onClick:e[3]||(e[3]=(...d)=>r.startSpeechRecognition&&r.startSpeechRecognition(...d)),class:Me([{"text-red-500":o.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},c7e,2),c("button",{title:"speak",onClick:e[4]||(e[4]=de(d=>r.speak(),["stop"])),class:Me([{"text-red-500":r.isTalking},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},u7e,2),se(c("button",{id:"export-button",onClick:e[5]||(e[5]=(...d)=>r.exportText&&r.exportText(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},f7e,512),[[Ye,!o.generating]]),se(c("button",{id:"import-button",onClick:e[6]||(e[6]=(...d)=>r.importText&&r.importText(...d)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},g7e,512),[[Ye,!o.generating]]),c("div",m7e,[c("button",{class:Me(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":o.tab_id=="source"}]),onClick:e[7]||(e[7]=d=>o.tab_id="source")}," Source ",2),c("button",{class:Me(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":o.tab_id=="render"}]),onClick:e[8]||(e[8]=d=>o.tab_id="render")}," Render ",2)]),_7e]),c("div",b7e,[o.tab_id==="source"?(k(),C("div",y7e,[se(c("textarea",{onClick:e[9]||(e[9]=(...d)=>r.text_element_clicked&&r.text_element_clicked(...d)),onKeyup:e[10]||(e[10]=(...d)=>r.text_element_changed&&r.text_element_changed(...d)),"onUpdate:modelValue":e[11]||(e[11]=d=>o.text=d),ref:"text_element",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full mt-4 h-64 p-2 rounded shadow-lg 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",type:"text"},null,544),[[Oe,o.text]]),c("span",null,"Cursor position "+H(o.cursorPosition),1)])):P("",!0),o.tab_id==="render"?(k(),C("div",v7e,[ue(i,{ref:"mdRender","markdown-text":o.text,class:"mt-4 p-2 rounded shadow-lg dark:bg-bg-dark"},null,8,["markdown-text"])])):P("",!0)])]),ue(a,{title:"settings",class:"slider-container ml-0 mr-0 max-width",isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[ue(a,{title:"Model",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[se(c("select",{"onUpdate:modelValue":e[12]||(e[12]=d=>o.selectedModel=d),onChange:e[13]||(e[13]=(...d)=>r.setModel&&r.setModel(...d)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(k(!0),C(Re,null,Ge(o.models,d=>(k(),C("option",{key:d,value:d},H(d),9,w7e))),128))],544),[[on,o.selectedModel]]),o.selecting_model?(k(),C("div",x7e,E7e)):P("",!0)]),_:1}),ue(a,{title:"Presets",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[se(c("select",{"onUpdate:modelValue":e[14]||(e[14]=d=>o.selectedPreset=d),class:"bg-white dark:bg-black mb-2 border-2 rounded-md shadow-sm w-full"},[(k(!0),C(Re,null,Ge(o.presets,d=>(k(),C("option",{key:d,value:d},H(d.name),9,C7e))),128))],512),[[on,o.selectedPreset]]),A7e,c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[15]||(e[15]=(...d)=>r.setPreset&&r.setPreset(...d)),title:"Use preset"},T7e),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[16]||(e[16]=(...d)=>r.addPreset&&r.addPreset(...d)),title:"Add this text as a preset"},O7e),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[17]||(e[17]=(...d)=>r.removePreset&&r.removePreset(...d)),title:"Remove preset"},N7e),c("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[18]||(e[18]=(...d)=>r.reloadPresets&&r.reloadPresets(...d)),title:"Reload presets list"},L7e)]),_:1}),ue(a,{title:"Generation params",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[c("div",I7e,[P7e,se(c("input",{type:"range","onUpdate:modelValue":e[19]||(e[19]=d=>o.temperature=d),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[Oe,o.temperature]]),c("span",F7e,"Current value: "+H(o.temperature),1)]),c("div",B7e,[$7e,se(c("input",{type:"range","onUpdate:modelValue":e[20]||(e[20]=d=>o.top_k=d),min:"1",max:"100",step:"1",class:"w-full"},null,512),[[Oe,o.top_k]]),c("span",z7e,"Current value: "+H(o.top_k),1)]),c("div",j7e,[U7e,se(c("input",{type:"range","onUpdate:modelValue":e[21]||(e[21]=d=>o.top_p=d),min:"0",max:"1",step:"0.1",class:"w-full"},null,512),[[Oe,o.top_p]]),c("span",q7e,"Current value: "+H(o.top_p),1)]),c("div",H7e,[V7e,se(c("input",{type:"range","onUpdate:modelValue":e[22]||(e[22]=d=>o.repeat_penalty=d),min:"0",max:"5",step:"0.1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Oe,o.repeat_penalty]]),c("span",G7e,"Current value: "+H(o.repeat_penalty),1)]),c("div",K7e,[W7e,se(c("input",{type:"range","onUpdate:modelValue":e[23]||(e[23]=d=>o.repeat_last_n=d),min:"0",max:"100",step:"1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Oe,o.repeat_last_n]]),c("span",Z7e,"Current value: "+H(o.repeat_last_n),1)]),c("div",Y7e,[J7e,se(c("input",{type:"number","onUpdate:modelValue":e[24]||(e[24]=d=>o.n_crop=d),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Oe,o.n_crop]]),c("span",Q7e,"Current value: "+H(o.n_crop),1)]),c("div",X7e,[eMe,se(c("input",{type:"number","onUpdate:modelValue":e[25]||(e[25]=d=>o.n_predicts=d),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Oe,o.n_predicts]]),c("span",tMe,"Current value: "+H(o.n_predicts),1)]),c("div",nMe,[sMe,se(c("input",{type:"number","onUpdate:modelValue":e[26]||(e[26]=d=>o.seed=d),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Oe,o.seed]]),c("span",oMe,"Current value: "+H(o.seed),1)])]),_:1})]),_:1})])]),ue(l,{ref:"toast"},null,512)],64)}const iMe=Ue(YTe,[["render",rMe]]);const aMe={data(){return{activeExtension:null}},computed:{activeExtensions(){return this.$store.state.extensionsZoo.filter(t=>t.is_active)}},methods:{showExtensionPage(t){this.activeExtension=t}}},lMe={key:0},cMe=["onClick"],dMe={key:0},uMe=["src"],hMe={key:1},fMe=c("p",null,"No extension is active. Please install and activate an extension.",-1),pMe=[fMe];function gMe(t,e,n,s,o,r){return k(),C("div",null,[r.activeExtensions.length>0?(k(),C("div",lMe,[(k(!0),C(Re,null,Ge(r.activeExtensions,i=>(k(),C("div",{key:i.name,onClick:a=>r.showExtensionPage(i)},[c("div",{class:Me({"active-tab":i===o.activeExtension})},H(i.name),3)],8,cMe))),128)),o.activeExtension?(k(),C("div",dMe,[c("iframe",{src:o.activeExtension.page,width:"100%",height:"500px",frameborder:"0"},null,8,uMe)])):P("",!0)])):(k(),C("div",hMe,pMe))])}const mMe=Ue(aMe,[["render",gMe]]);var Bg={exports:{}};/* @license Papa Parse v5.4.1 https://github.com/mholt/PapaParse @@ -115,7 +115,7 @@ License: MIT `:"\r"}(X,w)),L=!1,v.delimiter)D(v.delimiter)&&(v.delimiter=v.delimiter(X),ee.meta.delimiter=v.delimiter);else{var A=function($,z,ne,ae,j){var re,U,Y,le;j=j||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var pe=0;pe=I)return We(!0)}else for(fe=T,T++;;){if((fe=G.indexOf(E,fe+1))===-1)return _e||te.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:V.length,index:T}),Te();if(fe===ee-1)return Te(G.substring(T,fe).replace(pe,E));if(E!==Z||G[fe+1]!==Z){if(E===Z||fe===0||G[fe-1]!==Z){Y!==-1&&Y=I)return We(!0);break}te.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:V.length,index:T}),fe++}}else fe++}return Te();function ie(et){V.push(et),ge=T}function me(et){var nt=0;if(et!==-1){var ct=G.substring(fe+1,et);ct&&ct.trim()===""&&(nt=ct.length)}return nt}function Te(et){return _e||(et===void 0&&(et=G.substring(T)),X.push(et),T=ee,ie(X),Q&&Pe()),We()}function Be(et){T=et,ie(X),X=[],le=G.indexOf(L,T)}function We(et){return{data:V,errors:te,meta:{delimiter:M,linebreak:L,aborted:q,truncated:!!et,cursor:ge+(we||0)}}}function Pe(){J(We()),V=[],te=[]}},this.abort=function(){q=!0},this.getCharIndex=function(){return T}}function y(v){var E=v.data,M=i[E.workerId],L=!1;if(E.error)M.userError(E.error,E.file);else if(E.results&&E.results.data){var B={abort:function(){L=!0,x(E.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:S,resume:S};if(D(M.userStep)){for(var J=0;J{this.lollmsVersion=t})},computed:{async fetchLollmsVersion(){return await ye.get("/get_lollms_version")}},async created(){},methods:{async api_get_req(t){try{const e=await ye.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},loadFAQs(){fetch("/help/faqs.csv").then(t=>t.text()).then(t=>{const{data:e}=bMe.parse(t,{header:!0});console.log("Recovered data"),console.log(e),this.faqs=e}).catch(t=>{console.error("Error loading FAQs:",t)})},parseMultiline(t){return t.replace(/\n/g,"
")}}},wi=t=>(ss("data-v-6f1a11a2"),t=t(),os(),t),vMe={class:"container mx-auto p-4 bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},wMe=wi(()=>c("h2",{class:"text-2xl font-bold mb-2"},"About Lord of large Language Models",-1)),xMe={class:"mb-4"},kMe=wi(()=>c("p",null,[xe("Discord link: "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/C73K7hjy"},"https://discord.gg/C73K7hjy")],-1)),EMe={class:"mb-8 overflow-y-auto max-h-96 scrollbar"},CMe=wi(()=>c("h2",{class:"text-2xl font-bold mb-2"},"Frequently Asked Questions",-1)),AMe={class:"list-disc pl-4"},SMe={class:"text-xl font-bold mb-1"},TMe=["innerHTML"],MMe=wi(()=>c("div",null,[c("h2",{class:"text-2xl font-bold mb-2"},"Contact Us"),c("p",{class:"mb-4"},"If you have any further questions or need assistance, feel free to reach out to me."),c("p",null,[xe("Discord link: "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/C73K7hjy"},"https://discord.gg/C73K7hjy")])],-1)),OMe={class:"mt-8"},RMe=rs('

Credits

This project is developed by ParisNeo With help from the community.

Check out the full list of developers here and show them some love.

',3),NMe=["href"];function DMe(t,e,n,s,o,r){return k(),C("div",vMe,[c("div",null,[wMe,c("p",xMe," Lollms version "+H(o.lollmsVersion),1),kMe]),c("div",EMe,[CMe,c("ul",AMe,[(k(!0),C(Re,null,Ge(o.faqs,(i,a)=>(k(),C("li",{key:a},[c("h3",SMe,H(i.question),1),c("p",{class:"mb-4",innerHTML:r.parseMultiline(i.answer)},null,8,TMe)]))),128))])]),MMe,c("div",OMe,[RMe,c("p",null,[xe("Check out the project on "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:o.githubLink,target:"_blank",rel:"noopener noreferrer"},"GitHub",8,NMe),xe(".")])])])}const LMe=Ue(yMe,[["render",DMe],["__scopeId","data-v-6f1a11a2"]]);function Gt(t,e=!0,n=1){const s=e?1e3:1024;if(Math.abs(t)=s&&rr.hide&&r.hide(...i)),class:"bg-primary hover:bg-primary-light active:scale-95 duration-150 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-secondary-dark"}," OK ")])])])):P("",!0)}const $g=Ue(IMe,[["render",zMe]]),jMe={data(){return{show:!1,message:"",resolve:null,ConfirmButtonText:"Yes, I'm sure",DenyButtonText:"No, cancel"}},methods:{hide(t){this.show=!1,this.resolve&&(this.resolve(t),this.resolve=null)},askQuestion(t,e,n){return this.ConfirmButtonText=e||this.ConfirmButtonText,this.DenyButtonText=n||this.DenyButtonText,new Promise(s=>{this.message=t,this.show=!0,this.resolve=s})}}},UMe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},qMe={class:"relative w-full max-w-md max-h-full"},HMe={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},VMe=c("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[c("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),GMe=c("span",{class:"sr-only"},"Close modal",-1),KMe=[VMe,GMe],WMe={class:"p-4 text-center"},ZMe=c("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"},[c("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),YMe={class:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400 select-none break-all"};function JMe(t,e,n,s,o,r){return o.show?(k(),C("div",UMe,[c("div",qMe,[c("div",HMe,[c("button",{type:"button",onClick:e[0]||(e[0]=i=>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"},KMe),c("div",WMe,[ZMe,c("h3",YMe,H(o.message),1),c("button",{onClick:e[1]||(e[1]=i=>r.hide(!0)),type:"button",class:"text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"},H(o.ConfirmButtonText),1),c("button",{onClick:e[2]||(e[2]=i=>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"},H(o.DenyButtonText),1)])])])])):P("",!0)}const QMe=Ue(jMe,[["render",JMe]]),Rr="/assets/default_model-9e24e852.png",XMe={props:{title:String,icon:String,path:String,owner:String,owner_link:String,license:String,description:String,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(){be(()=>{ve.replace()})},methods:{formatFileSize(t){return t<1024?t+" bytes":t<1024*1024?(t/1024).toFixed(2)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(2)+" MB":(t/(1024*1024*1024)).toFixed(2)+" GB"},computedFileSize(t){return Gt(t)},async getFileSize(t){if(this.model_type!="api")try{const e=await ye.head(t);return e?e.headers["content-length"]?this.computedFileSize(e.headers["content-length"]):this.model.filesize?this.computedFileSize(this.model.filesize):"Could not be determined":this.model.filesize?this.computedFileSize(this.model.filesize):"Could not be determined"}catch(e){return console.log(e.message,"getFileSize"),"Could not be determined"}},getImgUrl(){return this.icon==="/images/default_model.png"?Rr:this.icon},defaultImg(t){t.target.src=Rr},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(){this.onSelected(this)},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this)},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const t=this.model.variants[0].size;return this.formatFileSize(t)}return null}},speed_computed(){return Gt(this.speed)},total_size_computed(){return Gt(this.total_size)},downloaded_size_computed(){return Gt(this.downloaded_size)}},watch:{linkNotValid(){be(()=>{ve.replace()})}}},eOe=["title"],tOe={key:0,class:"flex flex-row"},nOe={class:"max-w-[300px] overflow-x-auto"},sOe={class:"flex gap-3 items-center grow"},oOe=["src"],rOe={class:"flex-1 overflow-hidden"},iOe={class:"font-bold font-large text-lg truncate"},aOe={key:1,class:"flex items-center flex-row gap-2 my-1"},lOe={class:"flex grow items-center"},cOe=c("i",{"data-feather":"box",class:"w-5"},null,-1),dOe=c("span",{class:"sr-only"},"Custom model / local model",-1),uOe=[cOe,dOe],hOe=c("span",{class:"sr-only"},"Remove",-1),fOe={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"},pOe={class:"relative flex flex-col items-center justify-center flex-grow h-full"},gOe=c("div",{role:"status",class:"justify-center"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1),mOe={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},_Oe={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},bOe={class:"flex justify-between mb-1"},yOe=c("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),vOe={class:"text-sm font-medium text-blue-700 dark:text-white"},wOe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},xOe={class:"flex justify-between mb-1"},kOe={class:"text-base font-medium text-blue-700 dark:text-white"},EOe={class:"text-sm font-medium text-blue-700 dark:text-white"},COe={class:"flex flex-grow"},AOe={class:"flex flex-row flex-grow gap-3"},SOe={class:"p-2 text-center grow"},TOe={key:3},MOe={class:"flex flex-row items-center gap-3"},OOe=["src"],ROe={class:"font-bold font-large text-lg truncate"},NOe=c("div",{class:"grow"},null,-1),DOe=c("div",{class:"flex-none gap-1"},null,-1),LOe={class:"flex items-center flex-row-reverse gap-2 my-1"},IOe=c("span",{class:"sr-only"},"Copy info",-1),POe={class:"flex flex-row items-center"},FOe={key:0,class:"text-base text-red-600 flex items-center mt-1"},BOe=c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),$Oe=c("span",{class:"sr-only"},"Click to install",-1),zOe=c("span",{class:"sr-only"},"Remove",-1),jOe=["title"],UOe={class:""},qOe={class:"flex flex-row items-center"},HOe=c("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),VOe=c("b",null,"Manual download: ",-1),GOe=["href","title"],KOe=c("div",{class:"grow"},null,-1),WOe=c("i",{"data-feather":"clipboard",class:"w-5"},null,-1),ZOe=[WOe],YOe={class:"flex items-center"},JOe=c("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),QOe=c("b",null,"File size: ",-1),XOe={class:"flex items-center"},eRe=c("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),tRe=c("b",null,"License: ",-1),nRe={class:"flex items-center"},sRe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),oRe=c("b",null,"Owner: ",-1),rRe=["href"],iRe=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),aRe=["title"];function lRe(t,e,n,s,o,r){return k(),C("div",{class:Me(["relative items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",n.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[11]||(e[11]=de((...i)=>r.toggleSelected&&r.toggleSelected(...i),["stop"])),title:n.title},[n.model.isCustomModel?(k(),C("div",tOe,[c("div",nOe,[c("div",sOe,[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=i=>r.defaultImg(i)),class:"w-10 h-10 rounded-lg object-fill"},null,40,oOe),c("div",rOe,[c("h3",iOe,H(n.title),1)])])])])):P("",!0),n.model.isCustomModel?(k(),C("div",aOe,[c("div",lOe,[c("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]=de(()=>{},["stop"]))},uOe),xe(" Custom model ")]),c("div",null,[n.model.isInstalled?(k(),C("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Uninstall "),hOe])):P("",!0)])])):P("",!0),o.installing?(k(),C("div",fOe,[c("div",pOe,[gOe,c("div",mOe,[c("div",_Oe,[c("div",bOe,[yOe,c("span",vOe,H(Math.floor(o.progress))+"%",1)]),c("div",wOe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:yt({width:o.progress+"%"})},null,4)]),c("div",xOe,[c("span",kOe,"Download speed: "+H(r.speed_computed)+"/s",1),c("span",EOe,H(r.downloaded_size_computed)+"/"+H(r.total_size_computed),1)])])]),c("div",COe,[c("div",AOe,[c("div",SOe,[c("button",{onClick:e[3]||(e[3]=de((...i)=>r.toggleCancelInstall&&r.toggleCancelInstall(...i),["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 ")])])])])])):P("",!0),n.model.isCustomModel?P("",!0):(k(),C("div",TOe,[c("div",MOe,[c("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=i=>r.defaultImg(i)),class:Me(["w-10 h-10 rounded-lg object-fill",o.linkNotValid?"grayscale":""])},null,42,OOe),c("h3",ROe,H(n.title),1),NOe,DOe]),c("div",LOe,[c("button",{type:"button",title:"Copy model info to clipboard",onClick:e[5]||(e[5]=de(i=>r.toggleCopy(),["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"},[xe(" Copy info "),IOe]),c("div",POe,[o.linkNotValid?(k(),C("div",FOe,[BOe,xe(" Link is not valid ")])):P("",!0)]),!n.model.isInstalled&&!o.linkNotValid?(k(),C("button",{key:0,title:"Click to install",type:"button",onClick:e[6]||(e[6]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Install "),$Oe])):P("",!0),n.model.isInstalled?(k(),C("button",{key:1,title:"Delete file from disk",type:"button",onClick:e[7]||(e[7]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Uninstall "),zOe])):P("",!0)]),c("div",{class:"",title:n.model.isInstalled?n.title:"Not installed"},[c("div",UOe,[c("div",qOe,[HOe,VOe,c("a",{href:n.path,onClick:e[8]||(e[8]=de(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:o.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," Click here to download ",8,GOe),KOe,c("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[9]||(e[9]=de(i=>r.toggleCopyLink(),["stop"]))},ZOe)]),c("div",YOe,[c("div",{class:Me(["flex flex-shrink-0 items-center",o.linkNotValid?"text-red-600":""])},[JOe,QOe,xe(" "+H(r.fileSize),1)],2)]),c("div",XOe,[eRe,tRe,xe(" "+H(n.license),1)]),c("div",nRe,[sRe,oRe,c("a",{href:n.owner_link,target:"_blank",rel:"noopener noreferrer",onClick:e[10]||(e[10]=de(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"Owner's profile"},H(n.owner),9,rRe)])]),iRe,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.description},H(n.description.replace(/<\/?[^>]+>/ig," ")),9,aRe)],8,jOe)]))],10,eOe)}const cRe=Ue(XMe,[["render",lRe]]),dRe={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}}},uRe={class:"p-4"},hRe={class:"flex items-center mb-4"},fRe=["src"],pRe={class:"text-lg font-semibold"},gRe=c("strong",null,"Author:",-1),mRe=c("strong",null,"Description:",-1),_Re=c("strong",null,"Category:",-1),bRe={key:0},yRe=c("strong",null,"Disclaimer:",-1),vRe=c("strong",null,"Conditioning Text:",-1),wRe=c("strong",null,"AI Prefix:",-1),xRe=c("strong",null,"User Prefix:",-1),kRe=c("strong",null,"Antiprompts:",-1);function ERe(t,e,n,s,o,r){return k(),C("div",uRe,[c("div",hRe,[c("img",{src:o.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,fRe),c("h2",pRe,H(o.personalityName),1)]),c("p",null,[gRe,xe(" "+H(o.personalityAuthor),1)]),c("p",null,[mRe,xe(" "+H(o.personalityDescription),1)]),c("p",null,[_Re,xe(" "+H(o.personalityCategory),1)]),o.disclaimer?(k(),C("p",bRe,[yRe,xe(" "+H(o.disclaimer),1)])):P("",!0),c("p",null,[vRe,xe(" "+H(o.conditioningText),1)]),c("p",null,[wRe,xe(" "+H(o.aiPrefix),1)]),c("p",null,[xRe,xe(" "+H(o.userPrefix),1)]),c("div",null,[kRe,c("ul",null,[(k(!0),C(Re,null,Ge(o.antipromptsList,i=>(k(),C("li",{key:i.id},H(i.text),1))),128))])]),c("button",{onClick:e[0]||(e[0]=i=>o.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),o.editMode?(k(),C("button",{key:1,onClick:e[1]||(e[1]=(...i)=>r.commitChanges&&r.commitChanges(...i)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):P("",!0)])}const CRe=Ue(dRe,[["render",ERe]]),es="/assets/logo-9d653710.svg";const ARe={props:{icon:{type:String,required:!1,value:"feather:command"},commands:{type:Array,required:!0},force_position:{required:!1,value:0},execute_cmd:{type:Function,required:!1}},data(){return{isMenuOpen:!1,menuPosition:{bottom:"auto",top:"calc(100% + 10px)"}}},methods:{handleClickOutside(t){const e=this.$refs.menu,n=this.$refs.menuButton;e&&!e.contains(t.target)&&!n.contains(t.target)&&(this.isMenuOpen=!1,window.removeEventListener("click",this.handleClickOutside))},toggleMenu(){this.positionMenu(),this.isMenuOpen=!this.isMenuOpen,this.isMenuOpen?window.addEventListener("click",this.handleClickOutside):window.removeEventListener("click",this.handleClickOutside),be(()=>{ve.replace()})},executeCommand(t){this.isMenuOpen=!1,console.log("Selected"),console.log(t.value),typeof t.value=="function"&&(console.log("Command detected"),t.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(t))},positionMenu(){var t;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClientRect(),n=window.innerHeight;t=e.bottom>n/2}else this.force_position==1?t=!0:t=!1;this.menuPosition.top=t?"auto":"calc(100% + 10px)",this.menuPosition.bottom=t?"100%":"auto"}}},mounted(){window.addEventListener("resize",this.positionMenu),this.positionMenu(),be(()=>{ve.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},SRe={class:"menu-container"},TRe=["src","alt"],MRe=["data-feather"],ORe=c("i",{"data-feather":"command"},null,-1),RRe={class:"flex-grow menu-ul"},NRe=["onClick"],DRe=["src","alt"],LRe=["data-feather"],IRe={key:2,class:"menu-icon"};function PRe(t,e,n,s,o,r){return k(),C("div",SRe,[c("button",{onClick:e[0]||(e[0]=de((...i)=>r.toggleMenu&&r.toggleMenu(...i),["prevent"])),class:"menu-button bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded-full flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 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-gray-300 border-secondary cursor-pointer",ref:"menuButton"},[n.icon&&!n.icon.includes("feather")?(k(),C("img",{key:0,src:t.command.icon,alt:t.command.name,class:"w-5 h-5"},null,8,TRe)):P("",!0),n.icon&&n.icon.includes("feather")?(k(),C("i",{key:1,"data-feather":t.command.icon.split(":")[1],class:"w-5 h-5"},null,8,MRe)):P("",!0),ORe],512),ue(Ts,{name:"slide"},{default:Ne(()=>[o.isMenuOpen?(k(),C("div",{key:0,class:"menu-list flex-grow",style:yt(o.menuPosition),ref:"menu"},[c("ul",RRe,[(k(!0),C(Re,null,Ge(n.commands,(i,a)=>(k(),C("li",{key:a,onClick:l=>r.executeCommand(i),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[i.icon&&!i.icon.includes("feather")&&!i.is_file?(k(),C("img",{key:0,src:i.icon,alt:i.name,class:"menu-icon"},null,8,DRe)):P("",!0),i.icon&&i.icon.includes("feather")&&!i.is_file?(k(),C("i",{key:1,"data-feather":i.icon.split(":")[1],class:"mr-2"},null,8,LRe)):(k(),C("span",IRe)),c("span",null,H(i.name),1)],8,NRe))),128))])],4)):P("",!0)]),_:1})])}const zg=Ue(ARe,[["render",PRe]]),FRe="/",BRe={props:{personality:{},selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMounted:Function,onRemount:Function,onReinstall:Function,onSettings:Function},components:{InteractiveMenu:zg},data(){return{isMounted:!1,name:this.personality.name}},computed:{commandsList(){let t=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.toggleMounted},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return this.selected&&t.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),t},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,be(()=>{ve.replace()})},methods:{getImgUrl(){return FRe+this.personality.avatar},defaultImg(t){t.target.src=es},toggleTalk(){this.onTalk(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},reMount(){this.onRemount(this)},toggleMounted(){console.log("Mounting/unmounting"),this.onMounted(this)},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){be(()=>{ve.replace()})}}},$Re=["title"],zRe={class:"flex flex-row items-center flex-shrink-0 gap-3"},jRe=["src"],URe={class:"font-bold font-large text-lg line-clamp-3"},qRe=c("i",{"data-feather":"check",class:"w-5"},null,-1),HRe=c("span",{class:"sr-only"},"Select",-1),VRe=[qRe,HRe],GRe=c("i",{"data-feather":"send",class:"w-5"},null,-1),KRe=c("span",{class:"sr-only"},"Talk",-1),WRe=[GRe,KRe],ZRe={class:""},YRe={class:""},JRe={class:"flex items-center"},QRe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),XRe=c("b",null,"Author: ",-1),eNe={key:0,class:"flex items-center"},tNe=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),nNe=c("b",null,"Languages: ",-1),sNe=["selected"],oNe={class:"flex items-center"},rNe=c("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),iNe=c("b",null,"Category: ",-1),aNe=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),lNe=["title"];function cNe(t,e,n,s,o,r){const i=qe("InteractiveMenu");return k(),C("div",{class:Me(["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",o.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:n.personality.installed?"":"Not installed"},[c("div",{class:Me(n.personality.installed?"":"opacity-50")},[c("div",zRe,[c("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-red-700"},null,40,jRe),c("h3",URe,H(n.personality.name),1),o.isMounted?(k(),C("button",{key:0,type:"button",title:"Select",onClick:[e[1]||(e[1]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[2]||(e[2]=de(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},VRe)):P("",!0),o.isMounted?(k(),C("button",{key:1,type:"button",title:"Talk",onClick:[e[3]||(e[3]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[4]||(e[4]=de(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},WRe)):P("",!0),ue(i,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),c("div",ZRe,[c("div",YRe,[c("div",JRe,[QRe,XRe,xe(" "+H(n.personality.author),1)]),n.personality.languages?(k(),C("div",eNe,[tNe,nNe,se(c("select",{id:"languages","onUpdate:modelValue":e[5]||(e[5]=a=>n.personality.lang=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"},[(k(!0),C(Re,null,Ge(n.personality.languages,(a,l)=>(k(),C("option",{key:l,selected:a==n.personality.languages[0]},H(a),9,sNe))),128))],512),[[on,n.personality.lang]])])):P("",!0),c("div",oNe,[rNe,iNe,xe(" "+H(n.personality.category),1)])]),aNe,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.personality.description},H(n.personality.description),9,lNe)])],2)],10,$Re)}const jg=Ue(BRe,[["render",cNe]]),dNe="/",uNe={props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){be(()=>{ve.replace()})},methods:{getImgUrl(){return dNe+this.binding.icon},defaultImg(t){t.target.src=es},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(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(){be(()=>{ve.replace()})}}},hNe=["title"],fNe={class:"flex flex-row items-center gap-3"},pNe=["src"],gNe={class:"font-bold font-large text-lg truncate"},mNe=c("div",{class:"grow"},null,-1),_Ne={class:"flex-none gap-1"},bNe=c("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),yNe=c("span",{class:"sr-only"},"Help",-1),vNe=[bNe,yNe],wNe={class:"flex items-center flex-row-reverse gap-2 my-1"},xNe=c("span",{class:"sr-only"},"Click to install",-1),kNe=c("span",{class:"sr-only"},"Reinstall binding",-1),ENe=c("span",{class:"sr-only"},"Settings",-1),CNe={class:""},ANe={class:""},SNe={class:"flex items-center"},TNe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),MNe=c("b",null,"Author: ",-1),ONe={class:"flex items-center"},RNe=c("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),NNe=c("b",null,"Folder: ",-1),DNe={class:"flex items-center"},LNe=c("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),INe=c("b",null,"Version: ",-1),PNe={class:"flex items-center"},FNe=c("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),BNe=c("b",null,"Link: ",-1),$Ne=["href"],zNe=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),jNe=["title"];function UNe(t,e,n,s,o,r){return k(),C("div",{class:Me(["items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",n.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[6]||(e[6]=de((...i)=>r.toggleSelected&&r.toggleSelected(...i),["stop"])),title:n.binding.installed?n.binding.name:"Not installed"},[c("div",null,[c("div",fNe,[c("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=i=>r.defaultImg(i)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,pNe),c("h3",gNe,H(n.binding.name),1),mNe,c("div",_Ne,[n.selected?(k(),C("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...i)=>r.toggleReloadBinding&&r.toggleReloadBinding(...i)),e[2]||(e[2]=de(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},vNe)):P("",!0)])]),c("div",wNe,[n.binding.installed?P("",!0):(k(),C("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Install "),xNe])),n.binding.installed?(k(),C("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=de((...i)=>r.toggleReinstall&&r.toggleReinstall(...i),["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"},[xe(" Reinstall binding "),kNe])):P("",!0),n.selected?(k(),C("button",{key:2,title:"Click to open Settings",type:"button",onClick:e[5]||(e[5]=de((...i)=>r.toggleSettings&&r.toggleSettings(...i),["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"},[xe(" Settings "),ENe])):P("",!0)]),c("div",CNe,[c("div",ANe,[c("div",SNe,[TNe,MNe,xe(" "+H(n.binding.author),1)]),c("div",ONe,[RNe,NNe,xe(" "+H(n.binding.folder),1)]),c("div",DNe,[LNe,INe,xe(" "+H(n.binding.version),1)]),c("div",PNe,[FNe,BNe,c("a",{href:n.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},H(n.binding.link),9,$Ne)])]),zNe,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.binding.description},H(n.binding.description),9,jNe)])])],10,hNe)}const qNe=Ue(uNe,[["render",UNe]]),HNe={data(){return{show:!1,model_path:"",resolve:null}},methods:{cancel(){this.resolve(null)},openInputBox(){return new Promise(t=>{this.resolve=t})},hide(t){this.show=!1,this.resolve&&(this.resolve(t),this.resolve=null)},showDialog(t){return new Promise(e=>{this.model_path=t,this.show=!0,this.resolve=e})}}},VNe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},GNe={class:"relative w-full max-w-md max-h-full"},KNe={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},WNe=c("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[c("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),ZNe=c("span",{class:"sr-only"},"Close modal",-1),YNe=[WNe,ZNe],JNe={class:"p-4 text-center"},QNe=c("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"},[c("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),XNe={class:"p-4 text-center mx-auto mb-4"},eDe=c("label",{class:"mr-2"},"Model path",-1);function tDe(t,e,n,s,o,r){return o.show?(k(),C("div",VNe,[c("div",GNe,[c("div",KNe,[c("button",{type:"button",onClick:e[0]||(e[0]=i=>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"},YNe),c("div",JNe,[QNe,c("div",XNe,[eDe,se(c("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>o.model_path=i),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[Oe,o.model_path]])]),c("button",{onClick:e[2]||(e[2]=i=>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 "),c("button",{onClick:e[3]||(e[3]=i=>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")])])])])):P("",!0)}const nDe=Ue(HNe,[["render",tDe]]),sDe={setup(){return{}},name:"UniversalForm",data(){return{show:!1,resolve:null,controls_array:[],title:"Universal form",ConfirmButtonText:"Submit",DenyButtonText:"Cancel"}},mounted(){be(()=>{ve.replace()})},methods:{hide(t){this.show=!1,this.resolve&&t&&(this.resolve(this.controls_array),this.resolve=null)},showForm(t,e,n,s){this.ConfirmButtonText=n||this.ConfirmButtonText,this.DenyButtonText=s||this.DenyButtonText;for(let o=0;o{this.controls_array=t,this.show=!0,this.title=e||this.title,this.resolve=o,console.log("show foam",this.controls_array)})}},watch:{show(){be(()=>{ve.replace()})}}},oDe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 p-4"},rDe={class:"relative w-full max-w-md"},iDe={class:"flex flex-col rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel duration-150 shadow-lg max-h-screen"},aDe={class:"flex flex-row flex-grow items-center m-2 p-1"},lDe={class:"grow flex items-center"},cDe=c("i",{"data-feather":"sliders",class:"mr-2 flex-shrink-0"},null,-1),dDe={class:"text-lg font-semibold select-none mr-2"},uDe={class:"items-end"},hDe=c("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[c("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),fDe=c("span",{class:"sr-only"},"Close form modal",-1),pDe=[hDe,fDe],gDe={class:"flex flex-col relative no-scrollbar overflow-y-scroll p-2"},mDe={class:"px-2"},_De={key:0},bDe={key:0},yDe={class:"text-base font-semibold"},vDe={key:0,class:"relative inline-flex"},wDe=["onUpdate:modelValue"],xDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),kDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},EDe=["onUpdate:modelValue"],CDe={key:1},ADe={class:"text-base font-semibold"},SDe={key:0,class:"relative inline-flex"},TDe=["onUpdate:modelValue"],MDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),ODe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},RDe=["onUpdate:modelValue"],NDe=["value","selected"],DDe={key:1},LDe={class:"text-base font-semibold"},IDe={key:0,class:"relative inline-flex"},PDe=["onUpdate:modelValue"],FDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),BDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},$De=["onUpdate:modelValue"],zDe=["onUpdate:modelValue","min","max"],jDe={key:2},UDe={class:"mb-2 relative flex items-center gap-2"},qDe={for:"default-checkbox",class:"text-base font-semibold"},HDe=["onUpdate:modelValue"],VDe={key:0,class:"relative inline-flex"},GDe=["onUpdate:modelValue"],KDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),WDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},ZDe={key:3},YDe={class:"text-base font-semibold"},JDe={key:0,class:"relative inline-flex"},QDe=["onUpdate:modelValue"],XDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),eLe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},tLe=["onUpdate:modelValue"],nLe=c("hr",{class:"h-px my-4 bg-gray-200 border-0 dark:bg-gray-700"},null,-1),sLe={class:"flex flex-row flex-grow gap-3"},oLe={class:"p-2 text-center grow"};function rLe(t,e,n,s,o,r){return o.show?(k(),C("div",oDe,[c("div",rDe,[c("div",iDe,[c("div",aDe,[c("div",lDe,[cDe,c("h3",dDe,H(o.title),1)]),c("div",uDe,[c("button",{type:"button",onClick:e[0]||(e[0]=de(i=>r.hide(!1),["stop"])),title:"Close",class:"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"},pDe)])]),c("div",gDe,[(k(!0),C(Re,null,Ge(o.controls_array,(i,a)=>(k(),C("div",mDe,[i.type=="str"?(k(),C("div",_De,[i.options?P("",!0):(k(),C("div",bDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",yDe,H(i.name)+": ",1),i.help?(k(),C("label",vDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,wDe),[[rt,i.isHelp]]),xDe])):P("",!0)],2),i.isHelp?(k(),C("p",kDe,H(i.help),1)):P("",!0),se(c("input",{type:"text","onUpdate:modelValue":l=>i.value=l,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter string"},null,8,EDe),[[Oe,i.value]])])),i.options?(k(),C("div",CDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",ADe,H(i.name)+": ",1),i.help?(k(),C("label",SDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,TDe),[[rt,i.isHelp]]),MDe])):P("",!0)],2),i.isHelp?(k(),C("p",ODe,H(i.help),1)):P("",!0),se(c("select",{"onUpdate:modelValue":l=>i.value=l,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"},[(k(!0),C(Re,null,Ge(i.options,l=>(k(),C("option",{value:l,selected:i.value===l},H(l),9,NDe))),256))],8,RDe),[[on,i.value]])])):P("",!0)])):P("",!0),i.type=="int"||i.type=="float"?(k(),C("div",DDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",LDe,H(i.name)+": ",1),i.help?(k(),C("label",IDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,PDe),[[rt,i.isHelp]]),FDe])):P("",!0)],2),i.isHelp?(k(),C("p",BDe,H(i.help),1)):P("",!0),se(c("input",{type:"number","onUpdate:modelValue":l=>i.value=l,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter number"},null,8,$De),[[Oe,i.value]]),i.min!=null&&i.max!=null?se((k(),C("input",{key:1,type:"range","onUpdate:modelValue":l=>i.value=l,min:i.min,max:i.max,step:"0.1",class:"flex-none h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,8,zDe)),[[Oe,i.value]]):P("",!0)])):P("",!0),i.type=="bool"?(k(),C("div",jDe,[c("div",UDe,[c("label",qDe,H(i.name)+": ",1),se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.value=l,class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"},null,8,HDe),[[rt,i.value]]),i.help?(k(),C("label",VDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,GDe),[[rt,i.isHelp]]),KDe])):P("",!0)]),i.isHelp?(k(),C("p",WDe,H(i.help),1)):P("",!0)])):P("",!0),i.type=="list"?(k(),C("div",ZDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",YDe,H(i.name)+": ",1),i.help?(k(),C("label",JDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,QDe),[[rt,i.isHelp]]),XDe])):P("",!0)],2),i.isHelp?(k(),C("p",eLe,H(i.help),1)):P("",!0),se(c("input",{type:"text","onUpdate:modelValue":l=>i.value=l,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter comma separated values"},null,8,tLe),[[Oe,i.value]])])):P("",!0),nLe]))),256)),c("div",sLe,[c("div",oLe,[c("button",{onClick:e[1]||(e[1]=de(i=>r.hide(!0),["stop"])),type:"button",class:"mr-2 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 sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},H(o.ConfirmButtonText),1),c("button",{onClick:e[2]||(e[2]=de(i=>r.hide(!1),["stop"])),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-11 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"},H(o.DenyButtonText),1)])])])])])])):P("",!0)}const wc=Ue(sDe,[["render",rLe]]);const iLe={props:{show:{type:Boolean,required:!0},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null}},methods:{selectChoice(t){this.selectedChoice=t,this.$emit("choice-selected",t)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated")},formatSize(t){return t<1024?t+" bytes":t<1024*1024?(t/1024).toFixed(2)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(2)+" MB":(t/(1024*1024*1024)).toFixed(2)+" GB"}}},aLe={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50"},lLe={class:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96"},cLe={class:"text-xl font-semibold mb-4"},dLe={class:"h-48 overflow-y-auto"},uLe=["onClick"],hLe={class:"font-bold"},fLe=c("br",null,null,-1),pLe={class:"text-xs text-gray-500"},gLe={class:"flex justify-end mt-4"},mLe=["disabled"];function _Le(t,e,n,s,o,r){return k(),st(Ts,{name:"fade"},{default:Ne(()=>[n.show?(k(),C("div",aLe,[c("div",lLe,[c("h2",cLe,H(n.title),1),c("div",dLe,[c("ul",null,[(k(!0),C(Re,null,Ge(n.choices,(i,a)=>(k(),C("li",{key:a,onClick:l=>r.selectChoice(i),class:Me([{"selected-choice":i===o.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700"])},[c("span",hLe,H(i.name),1),fLe,c("span",pLe,H(this.formatSize(i.size)),1)],10,uLe))),128))])]),c("div",gLe,[c("button",{onClick:e[0]||(e[0]=(...i)=>r.closeDialog&&r.closeDialog(...i)),class:"py-2 px-4 mr-2 bg-red-500 hover:bg-red-600 text-white rounded-lg transition duration-300"}," Cancel "),c("button",{onClick:e[1]||(e[1]=(...i)=>r.validateChoice&&r.validateChoice(...i)),class:Me([{"bg-gray-400 cursor-not-allowed":!o.selectedChoice,"bg-blue-500 hover:bg-blue-600":o.selectedChoice,"text-white":o.selectedChoice,"text-gray-500":!o.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!o.selectedChoice}," Validate ",10,mLe)])])])):P("",!0)]),_:1})}const bLe=Ue(iLe,[["render",_Le]]);const yLe="/";ye.defaults.baseURL="/";const vLe={components:{AddModelDialog:nDe,MessageBox:$g,YesNoDialog:QMe,ModelEntry:cRe,PersonalityViewer:CRe,Toast:Ks,PersonalityEntry:jg,BindingEntry:qNe,UniversalForm:wc,ChoiceDialog:bLe,Card:vi},data(){return{reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],collapsedArr:[],all_collapsed:!0,minconf_collapsed:!0,bec_collapsed:!0,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,bzl_collapsed:!1,persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:yLe,searchPersonality:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){Ee.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{getVoices(){"speechSynthesis"in window&&(this.audioVoices=speechSynthesis.getVoices(),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let t=await this.api_get_req("check_update");this.has_updates=t.update_availability,console.log("has_updates",this.has_updates)},onVariantChoiceSelected(t){this.selected_variant=t},oncloseVariantChoiceDialog(){this.variantSelectionDialogVisible=!1},onvalidateVariantChoice(){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let t=this.currenModelToInstall;if(t.linkNotValid){t.installing=!1,this.$refs.toast.showToast("Link is not valid, file does not exist",4,!1);return}let e=t.path;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:t.path},console.log("installing...",this.addModel);const n=s=>{if(console.log("received something"),s.status&&s.progress<=100){if(this.addModel=s,console.log("Progress",s),t.progress=s.progress,t.speed=s.speed,t.total_size=s.total_size,t.downloaded_size=s.downloaded_size,t.start_time=s.start_time,t.installing=!0,t.progress==100){const o=this.models.findIndex(r=>r.path===e);this.models[o].isInstalled=!0,this.showProgress=!1,t.installing=!1,console.log("Received succeeded"),Ee.off("install_progress",n),console.log("Installed successfully"),this.$refs.toast.showToast(`Model: +`);var T=0,q=!1;this.parse=function(G,we,_e){if(typeof G!="string")throw new Error("Input must be a string");var ee=G.length,ke=M.length,Se=L.length,N=B.length,Q=D(J),V=[],te=[],X=[],ge=T=0;if(!G)return We();if(v.header&&!we){var he=G.split(L)[0].split(M),w=[],A={},F=!1;for(var $ in he){var z=he[$];D(v.transformHeader)&&(z=v.transformHeader(z,$));var ne=z,ae=A[z]||0;for(0=I)return We(!0)}else for(fe=T,T++;;){if((fe=G.indexOf(E,fe+1))===-1)return _e||te.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:V.length,index:T}),Te();if(fe===ee-1)return Te(G.substring(T,fe).replace(pe,E));if(E!==Z||G[fe+1]!==Z){if(E===Z||fe===0||G[fe-1]!==Z){Y!==-1&&Y=I)return We(!0);break}te.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:V.length,index:T}),fe++}}else fe++}return Te();function ie(et){V.push(et),ge=T}function me(et){var nt=0;if(et!==-1){var ct=G.substring(fe+1,et);ct&&ct.trim()===""&&(nt=ct.length)}return nt}function Te(et){return _e||(et===void 0&&(et=G.substring(T)),X.push(et),T=ee,ie(X),Q&&Pe()),We()}function Be(et){T=et,ie(X),X=[],le=G.indexOf(L,T)}function We(et){return{data:V,errors:te,meta:{delimiter:M,linebreak:L,aborted:q,truncated:!!et,cursor:ge+(we||0)}}}function Pe(){J(We()),V=[],te=[]}},this.abort=function(){q=!0},this.getCharIndex=function(){return T}}function y(v){var E=v.data,M=i[E.workerId],L=!1;if(E.error)M.userError(E.error,E.file);else if(E.results&&E.results.data){var B={abort:function(){L=!0,x(E.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:S,resume:S};if(D(M.userStep)){for(var J=0;J{this.lollmsVersion=t})},computed:{async fetchLollmsVersion(){return await ye.get("/get_lollms_version")}},async created(){},methods:{async api_get_req(t){try{const e=await ye.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},loadFAQs(){fetch("/help/faqs.csv").then(t=>t.text()).then(t=>{const{data:e}=bMe.parse(t,{header:!0});console.log("Recovered data"),console.log(e),this.faqs=e}).catch(t=>{console.error("Error loading FAQs:",t)})},parseMultiline(t){return t.replace(/\n/g,"
")}}},wi=t=>(ss("data-v-6f1a11a2"),t=t(),os(),t),vMe={class:"container mx-auto p-4 bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},wMe=wi(()=>c("h2",{class:"text-2xl font-bold mb-2"},"About Lord of large Language Models",-1)),xMe={class:"mb-4"},kMe=wi(()=>c("p",null,[xe("Discord link: "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/C73K7hjy"},"https://discord.gg/C73K7hjy")],-1)),EMe={class:"mb-8 overflow-y-auto max-h-96 scrollbar"},CMe=wi(()=>c("h2",{class:"text-2xl font-bold mb-2"},"Frequently Asked Questions",-1)),AMe={class:"list-disc pl-4"},SMe={class:"text-xl font-bold mb-1"},TMe=["innerHTML"],MMe=wi(()=>c("div",null,[c("h2",{class:"text-2xl font-bold mb-2"},"Contact Us"),c("p",{class:"mb-4"},"If you have any further questions or need assistance, feel free to reach out to me."),c("p",null,[xe("Discord link: "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/C73K7hjy"},"https://discord.gg/C73K7hjy")])],-1)),OMe={class:"mt-8"},RMe=rs('

Credits

This project is developed by ParisNeo With help from the community.

Check out the full list of developers here and show them some love.

',3),NMe=["href"];function DMe(t,e,n,s,o,r){return k(),C("div",vMe,[c("div",null,[wMe,c("p",xMe," Lollms version "+H(o.lollmsVersion),1),kMe]),c("div",EMe,[CMe,c("ul",AMe,[(k(!0),C(Re,null,Ge(o.faqs,(i,a)=>(k(),C("li",{key:a},[c("h3",SMe,H(i.question),1),c("p",{class:"mb-4",innerHTML:r.parseMultiline(i.answer)},null,8,TMe)]))),128))])]),MMe,c("div",OMe,[RMe,c("p",null,[xe("Check out the project on "),c("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:o.githubLink,target:"_blank",rel:"noopener noreferrer"},"GitHub",8,NMe),xe(".")])])])}const LMe=Ue(yMe,[["render",DMe],["__scopeId","data-v-6f1a11a2"]]);function Gt(t,e=!0,n=1){const s=e?1e3:1024;if(Math.abs(t)=s&&rr.hide&&r.hide(...i)),class:"bg-primary hover:bg-primary-light active:scale-95 duration-150 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-secondary-dark"}," OK ")])])])):P("",!0)}const $g=Ue(IMe,[["render",zMe]]),jMe={data(){return{show:!1,message:"",resolve:null,ConfirmButtonText:"Yes, I'm sure",DenyButtonText:"No, cancel"}},methods:{hide(t){this.show=!1,this.resolve&&(this.resolve(t),this.resolve=null)},askQuestion(t,e,n){return this.ConfirmButtonText=e||this.ConfirmButtonText,this.DenyButtonText=n||this.DenyButtonText,new Promise(s=>{this.message=t,this.show=!0,this.resolve=s})}}},UMe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},qMe={class:"relative w-full max-w-md max-h-full"},HMe={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},VMe=c("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[c("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),GMe=c("span",{class:"sr-only"},"Close modal",-1),KMe=[VMe,GMe],WMe={class:"p-4 text-center"},ZMe=c("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"},[c("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),YMe={class:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400 select-none break-all"};function JMe(t,e,n,s,o,r){return o.show?(k(),C("div",UMe,[c("div",qMe,[c("div",HMe,[c("button",{type:"button",onClick:e[0]||(e[0]=i=>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"},KMe),c("div",WMe,[ZMe,c("h3",YMe,H(o.message),1),c("button",{onClick:e[1]||(e[1]=i=>r.hide(!0)),type:"button",class:"text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"},H(o.ConfirmButtonText),1),c("button",{onClick:e[2]||(e[2]=i=>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"},H(o.DenyButtonText),1)])])])])):P("",!0)}const QMe=Ue(jMe,[["render",JMe]]),Rr="/assets/default_model-9e24e852.png",XMe={props:{title:String,icon:String,path:String,owner:String,owner_link:String,license:String,description:String,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(){be(()=>{ve.replace()})},methods:{formatFileSize(t){return t<1024?t+" bytes":t<1024*1024?(t/1024).toFixed(2)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(2)+" MB":(t/(1024*1024*1024)).toFixed(2)+" GB"},computedFileSize(t){return Gt(t)},async getFileSize(t){if(this.model_type!="api")try{const e=await ye.head(t);return e?e.headers["content-length"]?this.computedFileSize(e.headers["content-length"]):this.model.filesize?this.computedFileSize(this.model.filesize):"Could not be determined":this.model.filesize?this.computedFileSize(this.model.filesize):"Could not be determined"}catch(e){return console.log(e.message,"getFileSize"),"Could not be determined"}},getImgUrl(){return this.icon==="/images/default_model.png"?Rr:this.icon},defaultImg(t){t.target.src=Rr},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(){this.onSelected(this)},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this)},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const t=this.model.variants[0].size;return this.formatFileSize(t)}return null}},speed_computed(){return Gt(this.speed)},total_size_computed(){return Gt(this.total_size)},downloaded_size_computed(){return Gt(this.downloaded_size)}},watch:{linkNotValid(){be(()=>{ve.replace()})}}},eOe=["title"],tOe={key:0,class:"flex flex-row"},nOe={class:"max-w-[300px] overflow-x-auto"},sOe={class:"flex gap-3 items-center grow"},oOe=["src"],rOe={class:"flex-1 overflow-hidden"},iOe={class:"font-bold font-large text-lg truncate"},aOe={key:1,class:"flex items-center flex-row gap-2 my-1"},lOe={class:"flex grow items-center"},cOe=c("i",{"data-feather":"box",class:"w-5"},null,-1),dOe=c("span",{class:"sr-only"},"Custom model / local model",-1),uOe=[cOe,dOe],hOe=c("span",{class:"sr-only"},"Remove",-1),fOe={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"},pOe={class:"relative flex flex-col items-center justify-center flex-grow h-full"},gOe=c("div",{role:"status",class:"justify-center"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1),mOe={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},_Oe={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},bOe={class:"flex justify-between mb-1"},yOe=c("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),vOe={class:"text-sm font-medium text-blue-700 dark:text-white"},wOe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},xOe={class:"flex justify-between mb-1"},kOe={class:"text-base font-medium text-blue-700 dark:text-white"},EOe={class:"text-sm font-medium text-blue-700 dark:text-white"},COe={class:"flex flex-grow"},AOe={class:"flex flex-row flex-grow gap-3"},SOe={class:"p-2 text-center grow"},TOe={key:3},MOe={class:"flex flex-row items-center gap-3"},OOe=["src"],ROe={class:"font-bold font-large text-lg truncate"},NOe=c("div",{class:"grow"},null,-1),DOe=c("div",{class:"flex-none gap-1"},null,-1),LOe={class:"flex items-center flex-row-reverse gap-2 my-1"},IOe=c("span",{class:"sr-only"},"Copy info",-1),POe={class:"flex flex-row items-center"},FOe={key:0,class:"text-base text-red-600 flex items-center mt-1"},BOe=c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),$Oe=c("span",{class:"sr-only"},"Click to install",-1),zOe=c("span",{class:"sr-only"},"Remove",-1),jOe=["title"],UOe={class:""},qOe={class:"flex flex-row items-center"},HOe=c("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),VOe=c("b",null,"Manual download: ",-1),GOe=["href","title"],KOe=c("div",{class:"grow"},null,-1),WOe=c("i",{"data-feather":"clipboard",class:"w-5"},null,-1),ZOe=[WOe],YOe={class:"flex items-center"},JOe=c("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),QOe=c("b",null,"File size: ",-1),XOe={class:"flex items-center"},eRe=c("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),tRe=c("b",null,"License: ",-1),nRe={class:"flex items-center"},sRe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),oRe=c("b",null,"Owner: ",-1),rRe=["href"],iRe=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),aRe=["title"];function lRe(t,e,n,s,o,r){return k(),C("div",{class:Me(["relative items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",n.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[11]||(e[11]=de((...i)=>r.toggleSelected&&r.toggleSelected(...i),["stop"])),title:n.title},[n.model.isCustomModel?(k(),C("div",tOe,[c("div",nOe,[c("div",sOe,[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=i=>r.defaultImg(i)),class:"w-10 h-10 rounded-lg object-fill"},null,40,oOe),c("div",rOe,[c("h3",iOe,H(n.title),1)])])])])):P("",!0),n.model.isCustomModel?(k(),C("div",aOe,[c("div",lOe,[c("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]=de(()=>{},["stop"]))},uOe),xe(" Custom model ")]),c("div",null,[n.model.isInstalled?(k(),C("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Uninstall "),hOe])):P("",!0)])])):P("",!0),o.installing?(k(),C("div",fOe,[c("div",pOe,[gOe,c("div",mOe,[c("div",_Oe,[c("div",bOe,[yOe,c("span",vOe,H(Math.floor(o.progress))+"%",1)]),c("div",wOe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:yt({width:o.progress+"%"})},null,4)]),c("div",xOe,[c("span",kOe,"Download speed: "+H(r.speed_computed)+"/s",1),c("span",EOe,H(r.downloaded_size_computed)+"/"+H(r.total_size_computed),1)])])]),c("div",COe,[c("div",AOe,[c("div",SOe,[c("button",{onClick:e[3]||(e[3]=de((...i)=>r.toggleCancelInstall&&r.toggleCancelInstall(...i),["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 ")])])])])])):P("",!0),n.model.isCustomModel?P("",!0):(k(),C("div",TOe,[c("div",MOe,[c("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=i=>r.defaultImg(i)),class:Me(["w-10 h-10 rounded-lg object-fill",o.linkNotValid?"grayscale":""])},null,42,OOe),c("h3",ROe,H(n.title),1),NOe,DOe]),c("div",LOe,[c("button",{type:"button",title:"Copy model info to clipboard",onClick:e[5]||(e[5]=de(i=>r.toggleCopy(),["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"},[xe(" Copy info "),IOe]),c("div",POe,[o.linkNotValid?(k(),C("div",FOe,[BOe,xe(" Link is not valid ")])):P("",!0)]),!n.model.isInstalled&&!o.linkNotValid?(k(),C("button",{key:0,title:"Click to install",type:"button",onClick:e[6]||(e[6]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Install "),$Oe])):P("",!0),n.model.isInstalled?(k(),C("button",{key:1,title:"Delete file from disk",type:"button",onClick:e[7]||(e[7]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Uninstall "),zOe])):P("",!0)]),c("div",{class:"",title:n.model.isInstalled?n.title:"Not installed"},[c("div",UOe,[c("div",qOe,[HOe,VOe,c("a",{href:n.path,onClick:e[8]||(e[8]=de(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:o.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," Click here to download ",8,GOe),KOe,c("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[9]||(e[9]=de(i=>r.toggleCopyLink(),["stop"]))},ZOe)]),c("div",YOe,[c("div",{class:Me(["flex flex-shrink-0 items-center",o.linkNotValid?"text-red-600":""])},[JOe,QOe,xe(" "+H(r.fileSize),1)],2)]),c("div",XOe,[eRe,tRe,xe(" "+H(n.license),1)]),c("div",nRe,[sRe,oRe,c("a",{href:n.owner_link,target:"_blank",rel:"noopener noreferrer",onClick:e[10]||(e[10]=de(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"Owner's profile"},H(n.owner),9,rRe)])]),iRe,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.description},H(n.description.replace(/<\/?[^>]+>/ig," ")),9,aRe)],8,jOe)]))],10,eOe)}const cRe=Ue(XMe,[["render",lRe]]),dRe={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}}},uRe={class:"p-4"},hRe={class:"flex items-center mb-4"},fRe=["src"],pRe={class:"text-lg font-semibold"},gRe=c("strong",null,"Author:",-1),mRe=c("strong",null,"Description:",-1),_Re=c("strong",null,"Category:",-1),bRe={key:0},yRe=c("strong",null,"Disclaimer:",-1),vRe=c("strong",null,"Conditioning Text:",-1),wRe=c("strong",null,"AI Prefix:",-1),xRe=c("strong",null,"User Prefix:",-1),kRe=c("strong",null,"Antiprompts:",-1);function ERe(t,e,n,s,o,r){return k(),C("div",uRe,[c("div",hRe,[c("img",{src:o.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,fRe),c("h2",pRe,H(o.personalityName),1)]),c("p",null,[gRe,xe(" "+H(o.personalityAuthor),1)]),c("p",null,[mRe,xe(" "+H(o.personalityDescription),1)]),c("p",null,[_Re,xe(" "+H(o.personalityCategory),1)]),o.disclaimer?(k(),C("p",bRe,[yRe,xe(" "+H(o.disclaimer),1)])):P("",!0),c("p",null,[vRe,xe(" "+H(o.conditioningText),1)]),c("p",null,[wRe,xe(" "+H(o.aiPrefix),1)]),c("p",null,[xRe,xe(" "+H(o.userPrefix),1)]),c("div",null,[kRe,c("ul",null,[(k(!0),C(Re,null,Ge(o.antipromptsList,i=>(k(),C("li",{key:i.id},H(i.text),1))),128))])]),c("button",{onClick:e[0]||(e[0]=i=>o.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),o.editMode?(k(),C("button",{key:1,onClick:e[1]||(e[1]=(...i)=>r.commitChanges&&r.commitChanges(...i)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):P("",!0)])}const CRe=Ue(dRe,[["render",ERe]]),es="/assets/logo-9d653710.svg";const ARe={props:{icon:{type:String,required:!1,value:"feather:command"},commands:{type:Array,required:!0},force_position:{required:!1,value:0},execute_cmd:{type:Function,required:!1}},data(){return{isMenuOpen:!1,menuPosition:{bottom:"auto",top:"calc(100% + 10px)"}}},methods:{handleClickOutside(t){const e=this.$refs.menu,n=this.$refs.menuButton;e&&!e.contains(t.target)&&!n.contains(t.target)&&(this.isMenuOpen=!1,window.removeEventListener("click",this.handleClickOutside))},toggleMenu(){this.positionMenu(),this.isMenuOpen=!this.isMenuOpen,this.isMenuOpen?window.addEventListener("click",this.handleClickOutside):window.removeEventListener("click",this.handleClickOutside),be(()=>{ve.replace()})},executeCommand(t){this.isMenuOpen=!1,console.log("Selected"),console.log(t.value),typeof t.value=="function"&&(console.log("Command detected"),t.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(t))},positionMenu(){var t;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClientRect(),n=window.innerHeight;t=e.bottom>n/2}else this.force_position==1?t=!0:t=!1;this.menuPosition.top=t?"auto":"calc(100% + 10px)",this.menuPosition.bottom=t?"100%":"auto"}}},mounted(){window.addEventListener("resize",this.positionMenu),this.positionMenu(),be(()=>{ve.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},SRe={class:"menu-container"},TRe=["src","alt"],MRe=["data-feather"],ORe=c("i",{"data-feather":"command"},null,-1),RRe={class:"flex-grow menu-ul"},NRe=["onClick"],DRe=["src","alt"],LRe=["data-feather"],IRe={key:2,class:"menu-icon"};function PRe(t,e,n,s,o,r){return k(),C("div",SRe,[c("button",{onClick:e[0]||(e[0]=de((...i)=>r.toggleMenu&&r.toggleMenu(...i),["prevent"])),class:"menu-button bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded-full flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 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-gray-300 border-secondary cursor-pointer",ref:"menuButton"},[n.icon&&!n.icon.includes("feather")?(k(),C("img",{key:0,src:t.command.icon,alt:t.command.name,class:"w-5 h-5"},null,8,TRe)):P("",!0),n.icon&&n.icon.includes("feather")?(k(),C("i",{key:1,"data-feather":t.command.icon.split(":")[1],class:"w-5 h-5"},null,8,MRe)):P("",!0),ORe],512),ue(Ts,{name:"slide"},{default:Ne(()=>[o.isMenuOpen?(k(),C("div",{key:0,class:"menu-list flex-grow",style:yt(o.menuPosition),ref:"menu"},[c("ul",RRe,[(k(!0),C(Re,null,Ge(n.commands,(i,a)=>(k(),C("li",{key:a,onClick:l=>r.executeCommand(i),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[i.icon&&!i.icon.includes("feather")&&!i.is_file?(k(),C("img",{key:0,src:i.icon,alt:i.name,class:"menu-icon"},null,8,DRe)):P("",!0),i.icon&&i.icon.includes("feather")&&!i.is_file?(k(),C("i",{key:1,"data-feather":i.icon.split(":")[1],class:"mr-2"},null,8,LRe)):(k(),C("span",IRe)),c("span",null,H(i.name),1)],8,NRe))),128))])],4)):P("",!0)]),_:1})])}const zg=Ue(ARe,[["render",PRe]]),FRe="/",BRe={props:{personality:{},selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMounted:Function,onRemount:Function,onReinstall:Function,onSettings:Function},components:{InteractiveMenu:zg},data(){return{isMounted:!1,name:this.personality.name}},computed:{commandsList(){let t=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.toggleMounted},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return this.selected&&t.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),t},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,be(()=>{ve.replace()})},methods:{getImgUrl(){return FRe+this.personality.avatar},defaultImg(t){t.target.src=es},toggleTalk(){this.onTalk(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},reMount(){this.onRemount(this)},toggleMounted(){console.log("Mounting/unmounting"),this.onMounted(this)},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){be(()=>{ve.replace()})}}},$Re=["title"],zRe={class:"flex flex-row items-center flex-shrink-0 gap-3"},jRe=["src"],URe=c("i",{"data-feather":"check",class:"w-5"},null,-1),qRe=c("span",{class:"sr-only"},"Select",-1),HRe=[URe,qRe],VRe=c("i",{"data-feather":"send",class:"w-5"},null,-1),GRe=c("span",{class:"sr-only"},"Talk",-1),KRe=[VRe,GRe],WRe={class:""},ZRe={class:""},YRe={class:"flex items-center"},JRe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),QRe=c("b",null,"Author: ",-1),XRe={key:0,class:"flex items-center"},eNe=c("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),tNe=c("b",null,"Languages: ",-1),nNe=["selected"],sNe={class:"flex items-center"},oNe=c("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),rNe=c("b",null,"Category: ",-1),iNe=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),aNe=["title"];function lNe(t,e,n,s,o,r){const i=qe("InteractiveMenu");return k(),C("div",{class:Me(["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",o.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:n.personality.installed?"":"Not installed"},[c("div",{class:Me(n.personality.installed?"":"opacity-50")},[c("div",zRe,[c("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,jRe),c("h3",{onClick:e[2]||(e[2]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},H(n.personality.name),1),o.isMounted?(k(),C("button",{key:0,type:"button",title:"Select",onClick:[e[3]||(e[3]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[4]||(e[4]=de(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},HRe)):P("",!0),o.isMounted?(k(),C("button",{key:1,type:"button",title:"Talk",onClick:[e[5]||(e[5]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[6]||(e[6]=de(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},KRe)):P("",!0),ue(i,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),c("div",WRe,[c("div",ZRe,[c("div",YRe,[JRe,QRe,xe(" "+H(n.personality.author),1)]),n.personality.languages?(k(),C("div",XRe,[eNe,tNe,se(c("select",{id:"languages","onUpdate:modelValue":e[7]||(e[7]=a=>n.personality.lang=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"},[(k(!0),C(Re,null,Ge(n.personality.languages,(a,l)=>(k(),C("option",{key:l,selected:a==n.personality.languages[0]},H(a),9,nNe))),128))],512),[[on,n.personality.lang]])])):P("",!0),c("div",sNe,[oNe,rNe,xe(" "+H(n.personality.category),1)])]),iNe,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.personality.description},H(n.personality.description),9,aNe)])],2)],10,$Re)}const jg=Ue(BRe,[["render",lNe]]),cNe="/",dNe={props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){be(()=>{ve.replace()})},methods:{getImgUrl(){return cNe+this.binding.icon},defaultImg(t){t.target.src=es},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(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(){be(()=>{ve.replace()})}}},uNe=["title"],hNe={class:"flex flex-row items-center gap-3"},fNe=["src"],pNe={class:"font-bold font-large text-lg truncate"},gNe=c("div",{class:"grow"},null,-1),mNe={class:"flex-none gap-1"},_Ne=c("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),bNe=c("span",{class:"sr-only"},"Help",-1),yNe=[_Ne,bNe],vNe={class:"flex items-center flex-row-reverse gap-2 my-1"},wNe=c("span",{class:"sr-only"},"Click to install",-1),xNe=c("span",{class:"sr-only"},"Reinstall binding",-1),kNe=c("span",{class:"sr-only"},"Settings",-1),ENe={class:""},CNe={class:""},ANe={class:"flex items-center"},SNe=c("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),TNe=c("b",null,"Author: ",-1),MNe={class:"flex items-center"},ONe=c("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),RNe=c("b",null,"Folder: ",-1),NNe={class:"flex items-center"},DNe=c("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),LNe=c("b",null,"Version: ",-1),INe={class:"flex items-center"},PNe=c("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),FNe=c("b",null,"Link: ",-1),BNe=["href"],$Ne=c("div",{class:"flex items-center"},[c("i",{"data-feather":"info",class:"w-5 m-1"}),c("b",null,"Description: "),c("br")],-1),zNe=["title"];function jNe(t,e,n,s,o,r){return k(),C("div",{class:Me(["items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",n.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[6]||(e[6]=de((...i)=>r.toggleSelected&&r.toggleSelected(...i),["stop"])),title:n.binding.installed?n.binding.name:"Not installed"},[c("div",null,[c("div",hNe,[c("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=i=>r.defaultImg(i)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,fNe),c("h3",pNe,H(n.binding.name),1),gNe,c("div",mNe,[n.selected?(k(),C("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...i)=>r.toggleReloadBinding&&r.toggleReloadBinding(...i)),e[2]||(e[2]=de(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},yNe)):P("",!0)])]),c("div",vNe,[n.binding.installed?P("",!0):(k(),C("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=de((...i)=>r.toggleInstall&&r.toggleInstall(...i),["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"},[xe(" Install "),wNe])),n.binding.installed?(k(),C("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=de((...i)=>r.toggleReinstall&&r.toggleReinstall(...i),["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"},[xe(" Reinstall binding "),xNe])):P("",!0),n.selected?(k(),C("button",{key:2,title:"Click to open Settings",type:"button",onClick:e[5]||(e[5]=de((...i)=>r.toggleSettings&&r.toggleSettings(...i),["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"},[xe(" Settings "),kNe])):P("",!0)]),c("div",ENe,[c("div",CNe,[c("div",ANe,[SNe,TNe,xe(" "+H(n.binding.author),1)]),c("div",MNe,[ONe,RNe,xe(" "+H(n.binding.folder),1)]),c("div",NNe,[DNe,LNe,xe(" "+H(n.binding.version),1)]),c("div",INe,[PNe,FNe,c("a",{href:n.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},H(n.binding.link),9,BNe)])]),$Ne,c("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.binding.description},H(n.binding.description),9,zNe)])])],10,uNe)}const UNe=Ue(dNe,[["render",jNe]]),qNe={data(){return{show:!1,model_path:"",resolve:null}},methods:{cancel(){this.resolve(null)},openInputBox(){return new Promise(t=>{this.resolve=t})},hide(t){this.show=!1,this.resolve&&(this.resolve(t),this.resolve=null)},showDialog(t){return new Promise(e=>{this.model_path=t,this.show=!0,this.resolve=e})}}},HNe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},VNe={class:"relative w-full max-w-md max-h-full"},GNe={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},KNe=c("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[c("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),WNe=c("span",{class:"sr-only"},"Close modal",-1),ZNe=[KNe,WNe],YNe={class:"p-4 text-center"},JNe=c("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"},[c("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),QNe={class:"p-4 text-center mx-auto mb-4"},XNe=c("label",{class:"mr-2"},"Model path",-1);function eDe(t,e,n,s,o,r){return o.show?(k(),C("div",HNe,[c("div",VNe,[c("div",GNe,[c("button",{type:"button",onClick:e[0]||(e[0]=i=>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"},ZNe),c("div",YNe,[JNe,c("div",QNe,[XNe,se(c("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>o.model_path=i),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[Oe,o.model_path]])]),c("button",{onClick:e[2]||(e[2]=i=>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 "),c("button",{onClick:e[3]||(e[3]=i=>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")])])])])):P("",!0)}const tDe=Ue(qNe,[["render",eDe]]),nDe={setup(){return{}},name:"UniversalForm",data(){return{show:!1,resolve:null,controls_array:[],title:"Universal form",ConfirmButtonText:"Submit",DenyButtonText:"Cancel"}},mounted(){be(()=>{ve.replace()})},methods:{hide(t){this.show=!1,this.resolve&&t&&(this.resolve(this.controls_array),this.resolve=null)},showForm(t,e,n,s){this.ConfirmButtonText=n||this.ConfirmButtonText,this.DenyButtonText=s||this.DenyButtonText;for(let o=0;o{this.controls_array=t,this.show=!0,this.title=e||this.title,this.resolve=o,console.log("show foam",this.controls_array)})}},watch:{show(){be(()=>{ve.replace()})}}},sDe={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50 p-4"},oDe={class:"relative w-full max-w-md"},rDe={class:"flex flex-col rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel duration-150 shadow-lg max-h-screen"},iDe={class:"flex flex-row flex-grow items-center m-2 p-1"},aDe={class:"grow flex items-center"},lDe=c("i",{"data-feather":"sliders",class:"mr-2 flex-shrink-0"},null,-1),cDe={class:"text-lg font-semibold select-none mr-2"},dDe={class:"items-end"},uDe=c("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[c("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),hDe=c("span",{class:"sr-only"},"Close form modal",-1),fDe=[uDe,hDe],pDe={class:"flex flex-col relative no-scrollbar overflow-y-scroll p-2"},gDe={class:"px-2"},mDe={key:0},_De={key:0},bDe={class:"text-base font-semibold"},yDe={key:0,class:"relative inline-flex"},vDe=["onUpdate:modelValue"],wDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),xDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},kDe=["onUpdate:modelValue"],EDe={key:1},CDe={class:"text-base font-semibold"},ADe={key:0,class:"relative inline-flex"},SDe=["onUpdate:modelValue"],TDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),MDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},ODe=["onUpdate:modelValue"],RDe=["value","selected"],NDe={key:1},DDe={class:"text-base font-semibold"},LDe={key:0,class:"relative inline-flex"},IDe=["onUpdate:modelValue"],PDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),FDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},BDe=["onUpdate:modelValue"],$De=["onUpdate:modelValue","min","max"],zDe={key:2},jDe={class:"mb-2 relative flex items-center gap-2"},UDe={for:"default-checkbox",class:"text-base font-semibold"},qDe=["onUpdate:modelValue"],HDe={key:0,class:"relative inline-flex"},VDe=["onUpdate:modelValue"],GDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),KDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},WDe={key:3},ZDe={class:"text-base font-semibold"},YDe={key:0,class:"relative inline-flex"},JDe=["onUpdate:modelValue"],QDe=c("div",{class:"hover:text-secondary duration-75 active:scale-90 peer-checked:text-primary"},[c("i",{"data-feather":"help-circle",class:"w-5 h-5"})],-1),XDe={key:0,class:"text-sm font-normal text-gray-700 dark:text-gray-400 mb-2"},eLe=["onUpdate:modelValue"],tLe=c("hr",{class:"h-px my-4 bg-gray-200 border-0 dark:bg-gray-700"},null,-1),nLe={class:"flex flex-row flex-grow gap-3"},sLe={class:"p-2 text-center grow"};function oLe(t,e,n,s,o,r){return o.show?(k(),C("div",sDe,[c("div",oDe,[c("div",rDe,[c("div",iDe,[c("div",aDe,[lDe,c("h3",cDe,H(o.title),1)]),c("div",dDe,[c("button",{type:"button",onClick:e[0]||(e[0]=de(i=>r.hide(!1),["stop"])),title:"Close",class:"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"},fDe)])]),c("div",pDe,[(k(!0),C(Re,null,Ge(o.controls_array,(i,a)=>(k(),C("div",gDe,[i.type=="str"?(k(),C("div",mDe,[i.options?P("",!0):(k(),C("div",_De,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",bDe,H(i.name)+": ",1),i.help?(k(),C("label",yDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,vDe),[[rt,i.isHelp]]),wDe])):P("",!0)],2),i.isHelp?(k(),C("p",xDe,H(i.help),1)):P("",!0),se(c("input",{type:"text","onUpdate:modelValue":l=>i.value=l,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter string"},null,8,kDe),[[Oe,i.value]])])),i.options?(k(),C("div",EDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",CDe,H(i.name)+": ",1),i.help?(k(),C("label",ADe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,SDe),[[rt,i.isHelp]]),TDe])):P("",!0)],2),i.isHelp?(k(),C("p",MDe,H(i.help),1)):P("",!0),se(c("select",{"onUpdate:modelValue":l=>i.value=l,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"},[(k(!0),C(Re,null,Ge(i.options,l=>(k(),C("option",{value:l,selected:i.value===l},H(l),9,RDe))),256))],8,ODe),[[on,i.value]])])):P("",!0)])):P("",!0),i.type=="int"||i.type=="float"?(k(),C("div",NDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",DDe,H(i.name)+": ",1),i.help?(k(),C("label",LDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,IDe),[[rt,i.isHelp]]),PDe])):P("",!0)],2),i.isHelp?(k(),C("p",FDe,H(i.help),1)):P("",!0),se(c("input",{type:"number","onUpdate:modelValue":l=>i.value=l,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter number"},null,8,BDe),[[Oe,i.value]]),i.min!=null&&i.max!=null?se((k(),C("input",{key:1,type:"range","onUpdate:modelValue":l=>i.value=l,min:i.min,max:i.max,step:"0.1",class:"flex-none h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"},null,8,$De)),[[Oe,i.value]]):P("",!0)])):P("",!0),i.type=="bool"?(k(),C("div",zDe,[c("div",jDe,[c("label",UDe,H(i.name)+": ",1),se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.value=l,class:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"},null,8,qDe),[[rt,i.value]]),i.help?(k(),C("label",HDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,VDe),[[rt,i.isHelp]]),GDe])):P("",!0)]),i.isHelp?(k(),C("p",KDe,H(i.help),1)):P("",!0)])):P("",!0),i.type=="list"?(k(),C("div",WDe,[c("label",{class:Me(["mb-2 relative flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white select-none",i.help?"cursor-pointer ":""])},[c("div",ZDe,H(i.name)+": ",1),i.help?(k(),C("label",YDe,[se(c("input",{type:"checkbox","onUpdate:modelValue":l=>i.isHelp=l,class:"sr-only peer"},null,8,JDe),[[rt,i.isHelp]]),QDe])):P("",!0)],2),i.isHelp?(k(),C("p",XDe,H(i.help),1)):P("",!0),se(c("input",{type:"text","onUpdate:modelValue":l=>i.value=l,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Enter comma separated values"},null,8,eLe),[[Oe,i.value]])])):P("",!0),tLe]))),256)),c("div",nLe,[c("div",sLe,[c("button",{onClick:e[1]||(e[1]=de(i=>r.hide(!0),["stop"])),type:"button",class:"mr-2 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 sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},H(o.ConfirmButtonText),1),c("button",{onClick:e[2]||(e[2]=de(i=>r.hide(!1),["stop"])),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-11 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"},H(o.DenyButtonText),1)])])])])])])):P("",!0)}const wc=Ue(nDe,[["render",oLe]]);const rLe={props:{show:{type:Boolean,required:!0},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null}},methods:{selectChoice(t){this.selectedChoice=t,this.$emit("choice-selected",t)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated")},formatSize(t){return t<1024?t+" bytes":t<1024*1024?(t/1024).toFixed(2)+" KB":t<1024*1024*1024?(t/(1024*1024)).toFixed(2)+" MB":(t/(1024*1024*1024)).toFixed(2)+" GB"}}},iLe={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50"},aLe={class:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96"},lLe={class:"text-xl font-semibold mb-4"},cLe={class:"h-48 overflow-y-auto"},dLe=["onClick"],uLe={class:"font-bold"},hLe=c("br",null,null,-1),fLe={class:"text-xs text-gray-500"},pLe={class:"flex justify-end mt-4"},gLe=["disabled"];function mLe(t,e,n,s,o,r){return k(),st(Ts,{name:"fade"},{default:Ne(()=>[n.show?(k(),C("div",iLe,[c("div",aLe,[c("h2",lLe,H(n.title),1),c("div",cLe,[c("ul",null,[(k(!0),C(Re,null,Ge(n.choices,(i,a)=>(k(),C("li",{key:a,onClick:l=>r.selectChoice(i),class:Me([{"selected-choice":i===o.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700"])},[c("span",uLe,H(i.name),1),hLe,c("span",fLe,H(this.formatSize(i.size)),1)],10,dLe))),128))])]),c("div",pLe,[c("button",{onClick:e[0]||(e[0]=(...i)=>r.closeDialog&&r.closeDialog(...i)),class:"py-2 px-4 mr-2 bg-red-500 hover:bg-red-600 text-white rounded-lg transition duration-300"}," Cancel "),c("button",{onClick:e[1]||(e[1]=(...i)=>r.validateChoice&&r.validateChoice(...i)),class:Me([{"bg-gray-400 cursor-not-allowed":!o.selectedChoice,"bg-blue-500 hover:bg-blue-600":o.selectedChoice,"text-white":o.selectedChoice,"text-gray-500":!o.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!o.selectedChoice}," Validate ",10,gLe)])])])):P("",!0)]),_:1})}const _Le=Ue(rLe,[["render",mLe]]);const bLe="/";ye.defaults.baseURL="/";const yLe={components:{AddModelDialog:tDe,MessageBox:$g,YesNoDialog:QMe,ModelEntry:cRe,PersonalityViewer:CRe,Toast:Ks,PersonalityEntry:jg,BindingEntry:UNe,UniversalForm:wc,ChoiceDialog:_Le,Card:vi},data(){return{reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],collapsedArr:[],all_collapsed:!0,minconf_collapsed:!0,bec_collapsed:!0,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,bzl_collapsed:!1,persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:bLe,searchPersonality:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){Ee.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{getVoices(){"speechSynthesis"in window&&(this.audioVoices=speechSynthesis.getVoices(),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let t=await this.api_get_req("check_update");this.has_updates=t.update_availability,console.log("has_updates",this.has_updates)},onVariantChoiceSelected(t){this.selected_variant=t},oncloseVariantChoiceDialog(){this.variantSelectionDialogVisible=!1},onvalidateVariantChoice(){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let t=this.currenModelToInstall;if(t.linkNotValid){t.installing=!1,this.$refs.toast.showToast("Link is not valid, file does not exist",4,!1);return}let e=t.path;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:t.path},console.log("installing...",this.addModel);const n=s=>{if(console.log("received something"),s.status&&s.progress<=100){if(this.addModel=s,console.log("Progress",s),t.progress=s.progress,t.speed=s.speed,t.total_size=s.total_size,t.downloaded_size=s.downloaded_size,t.start_time=s.start_time,t.installing=!0,t.progress==100){const o=this.models.findIndex(r=>r.path===e);this.models[o].isInstalled=!0,this.showProgress=!1,t.installing=!1,console.log("Received succeeded"),Ee.off("install_progress",n),console.log("Installed successfully"),this.$refs.toast.showToast(`Model: `+t.title+` installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}}else Ee.off("install_progress",n),console.log("Install failed"),t.installing=!1,this.showProgress=!1,console.error("Installation failed:",s.error),this.$refs.toast.showToast(`Model: `+t.title+` @@ -169,10 +169,10 @@ Response: Error: `+e.error,4,!1);this.isLoading=!1},onPersonalityReinstall(t){console.log("on reinstall ",t),this.isLoading=!0,ye.post("/reinstall_personality",{name:t.personality.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}))},onPersonalityMounted(t){console.log("on sel ",t),this.configFile.personalities.includes(t.full_path)?this.configFile.personalities.length==1?this.$refs.toast.showToast("Can't unmount last personality",4,!1):this.unmountPersonality(t):this.mountPersonality(t)},personalityImgPlacehodler(t){t.target.src=es},searchPersonality_func(){clearTimeout(this.searchPersonalityTimer),this.searchPersonality&&(this.searchPersonalityInProgress=!0,setTimeout(this.filterPersonalities,this.searchPersonalityTimerInterval))},searchModel_func(){clearTimeout(this.searchModelTimer),this.searchModel&&(this.searchModelInProgress=!0,setTimeout(this.filterModels,this.searchModelTimer))}},async mounted(){this.constructor(),console.log("Getting voices"),this.getVoices()},activated(){this.isMounted&&this.constructor()},computed:{audio_out_voice:{get(){return this.$store.state.config.audio_out_voice},set(t){this.$store.state.config.audio_out_voice=t}},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(t){this.$store.commit("setConfig",t)}},userName:{get(){return this.$store.state.config.user_name},set(t){this.$store.state.config.user_name=t}},user_avatar:{get(){return"/user_infos/"+this.$store.state.config.user_avatar},set(t){this.$store.state.config.user_avatar=t}},enable_gpu:{get(){return this.$store.state.config.enable_gpu},set(t){this.$store.state.config.enable_gpu=t}},auto_update:{get(){return this.$store.state.config.auto_update},set(t){this.$store.state.config.auto_update=t}},auto_speak:{get(){return this.$store.state.config.auto_speak},set(t){this.$store.state.config.auto_speak=t}},audio_pitch:{get(){return this.$store.state.config.audio_pitch},set(t){this.$store.state.config.audio_pitch=t}},audio_in_language:{get(){return this.$store.state.config.audio_in_language},set(t){this.$store.state.config.audio_in_language=t}},use_user_name_in_discussions:{get(){return this.$store.state.config.use_user_name_in_discussions},set(t){this.$store.state.config.use_user_name_in_discussions=t}},db_path:{get(){return this.$store.state.config.db_path},set(t){this.$store.state.config.db_path=t}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}},bindingsArr:{get(){return this.$store.state.bindingsArr},set(t){this.$store.commit("setBindingsArr",t)}},modelsArr:{get(){return this.$store.state.modelsArr},set(t){this.$store.commit("setModelsArr",t)}},models:{get(){return this.$store.state.models_zoo},set(t){this.$store.commit("setModelsZoo",t)}},diskUsage:{get(){return this.$store.state.diskUsage},set(t){this.$store.commit("setDiskUsage",t)}},ramUsage:{get(){return this.$store.state.ramUsage},set(t){this.$store.commit("setRamUsage",t)}},vramUsage:{get(){return this.$store.state.vramUsage},set(t){this.$store.commit("setVramUsage",t)}},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)},imgBinding(){if(this.isMounted)try{return this.$refs.bindingZoo[this.$refs.bindingZoo.findIndex(t=>t.binding.folder==this.configFile.binding_name)].$refs.imgElement.src}catch{return Rr}},imgModel(){if(this.isMounted)try{return this.$refs.modelZoo[this.$refs.modelZoo.findIndex(t=>t.title==this.configFile.model_name)].$refs.imgElement.src}catch{return Rr}},model_name(){if(this.isMounted)return this.configFile.model_name},binding_name(){if(!this.isMounted)return;const t=this.bindingsArr.findIndex(e=>e.folder===this.configFile.binding_name);if(t>-1)return this.bindingsArr[t].name},active_pesonality(){if(!this.isMounted)return;const t=this.personalities.findIndex(e=>e.full_path===this.configFile.personalities[this.configFile.active_personality_id]);if(t>-1)return this.personalities[t].name},speed_computed(){return Gt(this.addModel.speed)},total_size_computed(){return Gt(this.addModel.total_size)},downloaded_size_computed(){return Gt(this.addModel.downloaded_size)}},watch:{bec_collapsed(){be(()=>{ve.replace()})},pc_collapsed(){be(()=>{ve.replace()})},mc_collapsed(){be(()=>{ve.replace()})},sc_collapsed(){be(()=>{ve.replace()})},showConfirmation(){be(()=>{ve.replace()})},mzl_collapsed(){be(()=>{ve.replace()})},pzl_collapsed(){be(()=>{ve.replace()})},bzl_collapsed(){be(()=>{ve.replace()})},all_collapsed(t){this.collapseAll(t),be(()=>{ve.replace()})},settingsChanged(t){this.$store.state.settingsChanged=t,be(()=>{ve.replace()})},isLoading(){be(()=>{ve.replace()})},searchPersonality(t){t==""&&this.filterPersonalities()},searchModel(t){t==""&&this.filterModels()},mzdc_collapsed(){be(()=>{ve.replace()})}},async beforeRouteLeave(t){if(await this.$router.isReady(),this.settingsChanged)return await this.$refs.yesNoDialog.askQuestion(`Did You forget to apply changes? You need to apply changes before you leave, or else.`,"Apply configuration","Cancel")&&this.applyConfiguration(),!1;if(!this.isModelSelected)return await this.$refs.yesNoDialog.askQuestion(`Did You forgot to select model? -You need to select model before you leave, or else.`,"Ok","Cancel"),!1}},oe=t=>(ss("data-v-3dabeccc"),t=t(),os(),t),wLe={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-0"},xLe={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"},kLe={key:0,class:"flex gap-3 flex-1 items-center duration-75"},ELe=oe(()=>c("i",{"data-feather":"x"},null,-1)),CLe=[ELe],ALe=oe(()=>c("i",{"data-feather":"check"},null,-1)),SLe=[ALe],TLe={key:1,class:"flex gap-3 flex-1 items-center"},MLe=oe(()=>c("i",{"data-feather":"save"},null,-1)),OLe=[MLe],RLe=oe(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),NLe=[RLe],DLe=oe(()=>c("i",{"data-feather":"list"},null,-1)),LLe=[DLe],ILe={class:"flex gap-3 flex-1 items-center justify-end"},PLe=oe(()=>c("i",{"data-feather":"trash-2"},null,-1)),FLe=[PLe],BLe=oe(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),$Le=[BLe],zLe=oe(()=>c("i",{"data-feather":"arrow-up-circle"},null,-1)),jLe={key:0},ULe=oe(()=>c("i",{"data-feather":"alert-circle"},null,-1)),qLe=[ULe],HLe={class:"flex gap-3 items-center"},VLe={key:0,class:"flex gap-3 items-center"},GLe=oe(()=>c("i",{"data-feather":"check"},null,-1)),KLe=[GLe],WLe={key:1,role:"status"},ZLe=oe(()=>c("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"},[c("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"}),c("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)),YLe=oe(()=>c("span",{class:"sr-only"},"Loading...",-1)),JLe={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"},QLe={class:"flex flex-row p-3"},XLe=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),eIe=[XLe],tIe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),nIe=[tIe],sIe=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),oIe=oe(()=>c("div",{class:"mr-2"},"|",-1)),rIe={class:"text-base font-semibold cursor-pointer select-none items-center"},iIe={class:"flex gap-2 items-center"},aIe={key:0},lIe={class:"flex gap-2 items-center"},cIe=["title"],dIe=rs('',34),uIe=[dIe],hIe={class:"font-bold font-large text-lg"},fIe={key:1},pIe={class:"flex gap-2 items-center"},gIe=rs('',1),mIe={class:"font-bold font-large text-lg"},_Ie=oe(()=>c("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),bIe={class:"font-bold font-large text-lg"},yIe=oe(()=>c("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),vIe={class:"font-bold font-large text-lg"},wIe={class:"mb-2"},xIe=oe(()=>c("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[c("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"})]),xe(" CPU Ram usage: ")],-1)),kIe={class:"flex flex-col mx-2"},EIe=oe(()=>c("b",null,"Avaliable ram: ",-1)),CIe=oe(()=>c("b",null,"Ram usage: ",-1)),AIe={class:"p-2"},SIe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},TIe={class:"mb-2"},MIe=oe(()=>c("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[c("i",{"data-feather":"hard-drive",class:"w-5 h-5"}),xe(" Disk usage: ")],-1)),OIe={class:"flex flex-col mx-2"},RIe=oe(()=>c("b",null,"Avaliable disk space: ",-1)),NIe=oe(()=>c("b",null,"Disk usage: ",-1)),DIe={class:"p-2"},LIe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},IIe={class:"mb-2"},PIe=rs('',1),FIe={class:"flex flex-col mx-2"},BIe=oe(()=>c("b",null,"Model: ",-1)),$Ie=oe(()=>c("b",null,"Avaliable vram: ",-1)),zIe=oe(()=>c("b",null,"GPU usage: ",-1)),jIe={class:"p-2"},UIe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},qIe={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"},HIe={class:"flex flex-row p-3"},VIe=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),GIe=[VIe],KIe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),WIe=[KIe],ZIe=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1)),YIe={class:"flex flex-col mb-2 px-3 pb-2"},JIe={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"},QIe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Host:")],-1)),XIe={style:{width:"100%"}},ePe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Port:")],-1)),tPe={style:{width:"100%"}},nPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),sPe={style:{width:"100%"}},oPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_gpu",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable GPU:")],-1)),rPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_save",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto save:")],-1)),iPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),aPe={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"},lPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),cPe={style:{width:"100%"}},dPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User description:")],-1)),uPe={style:{width:"100%"}},hPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),fPe={style:{width:"100%"}},pPe={for:"avatar-upload"},gPe=["src"],mPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_user_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use User Name in discussions:")],-1)),_Pe={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"},bPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_files",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate files support:")],-1)),yPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_activate",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate files vectorization:")],-1)),vPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_build_keys_words",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Build keywords when querying the vectorized database:")],-1)),wPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization method:")],-1)),xPe=oe(()=>c("option",{value:"ftidf_vectorizer"},"ftidf Vectorizer",-1)),kPe=oe(()=>c("option",{value:"model_embedding"},"Model Embedding",-1)),EPe=[xPe,kPe],CPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_visualization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data visualization method:")],-1)),APe=oe(()=>c("option",{value:"PCA"},"PCA",-1)),SPe=oe(()=>c("option",{value:"TSNE"},"TSNE",-1)),TPe=[APe,SPe],MPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("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)),OPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization chunk size(tokens):")],-1)),RPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization overlap size(tokens):")],-1)),NPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Number of chunks to use for each message:")],-1)),DPe={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"},LPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_auto_send_input",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Send audio input automatically:")],-1)),IPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),PPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),FPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_silenceTimer",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio in silence timer (ms):")],-1)),BPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_in_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Input Audio Language:")],-1)),$Pe=["value"],zPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_out_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Output Audio Voice:")],-1)),jPe=["value"],UPe={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"},qPe={class:"flex flex-row p-3"},HPe=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),VPe=[HPe],GPe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),KPe=[GPe],WPe=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),ZPe={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},YPe=oe(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),JPe={key:1,class:"mr-2"},QPe={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},XPe={class:"flex gap-1 items-center"},eFe=["src"],tFe={class:"font-bold font-large text-lg line-clamp-1"},nFe={key:0,class:"mb-2"},sFe={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},oFe=oe(()=>c("i",{"data-feather":"chevron-up"},null,-1)),rFe=[oFe],iFe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),aFe=[iFe],lFe={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"},cFe={class:"flex flex-row p-3"},dFe=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),uFe=[dFe],hFe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),fFe=[hFe],pFe=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),gFe={class:"flex flex-row items-center"},mFe={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},_Fe=oe(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),bFe={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},yFe=oe(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),vFe={key:2,class:"mr-2"},wFe={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},xFe={class:"flex gap-1 items-center"},kFe=["src"],EFe={class:"font-bold font-large text-lg line-clamp-1"},CFe={class:"mx-2 mb-4"},AFe={class:"relative"},SFe={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},TFe={key:0},MFe=oe(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),OFe=[MFe],RFe={key:1},NFe=oe(()=>c("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"},[c("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)),DFe=[NFe],LFe={key:0},IFe={key:0,class:"mb-2"},PFe={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},FFe={key:1},BFe={key:0,class:"mb-2"},$Fe={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},zFe=oe(()=>c("i",{"data-feather":"chevron-up"},null,-1)),jFe=[zFe],UFe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),qFe=[UFe],HFe={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"},VFe={class:"flex flex-row p-3"},GFe=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),KFe=[GFe],WFe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),ZFe=[WFe],YFe=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Add models for binding",-1)),JFe={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},QFe=oe(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),XFe={key:1,class:"mr-2"},eBe={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},tBe={class:"flex gap-1 items-center"},nBe=["src"],sBe={class:"font-bold font-large text-lg line-clamp-1"},oBe={class:"mb-2"},rBe={class:"p-2"},iBe={class:"mb-3"},aBe=oe(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),lBe={key:0},cBe={class:"mb-3"},dBe=oe(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),uBe={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},hBe=oe(()=>c("div",{role:"status",class:"justify-center"},null,-1)),fBe={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},pBe={class:"w-full p-2"},gBe={class:"flex justify-between mb-1"},mBe=rs(' Downloading Loading...',1),_Be={class:"text-sm font-medium text-blue-700 dark:text-white"},bBe=["title"],yBe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},vBe={class:"flex justify-between mb-1"},wBe={class:"text-base font-medium text-blue-700 dark:text-white"},xBe={class:"text-sm font-medium text-blue-700 dark:text-white"},kBe={class:"flex flex-grow"},EBe={class:"flex flex-row flex-grow gap-3"},CBe={class:"p-2 text-center grow"},ABe={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"},SBe={class:"flex flex-row p-3 items-center"},TBe=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),MBe=[TBe],OBe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),RBe=[OBe],NBe=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),DBe={key:0,class:"mr-2"},LBe={class:"mr-2 font-bold font-large text-lg line-clamp-1"},IBe={key:1,class:"mr-2"},PBe={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},FBe={key:0,class:"flex -space-x-4 items-center"},BBe={class:"group items-center flex flex-row"},$Be=["onClick"],zBe=["src","title"],jBe=["onClick"],UBe=oe(()=>c("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"},[c("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"},[c("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)),qBe=[UBe],HBe={class:"mx-2 mb-4"},VBe=oe(()=>c("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),GBe={class:"relative"},KBe={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},WBe={key:0},ZBe=oe(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),YBe=[ZBe],JBe={key:1},QBe=oe(()=>c("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"},[c("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)),XBe=[QBe],e$e={key:0,class:"mx-2 mb-4"},t$e={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},n$e=["selected"],s$e={key:0,class:"mb-2"},o$e={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},r$e=oe(()=>c("i",{"data-feather":"chevron-up"},null,-1)),i$e=[r$e],a$e=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),l$e=[a$e],c$e={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"},d$e={class:"flex flex-row"},u$e=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),h$e=[u$e],f$e=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),p$e=[f$e],g$e=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1)),m$e={class:"m-2"},_$e={class:"flex flex-row gap-2 items-center"},b$e=oe(()=>c("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1)),y$e={class:"m-2"},v$e=oe(()=>c("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),w$e={class:"m-2"},x$e={class:"flex flex-col align-bottom"},k$e={class:"relative"},E$e=oe(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),C$e={class:"absolute right-0"},A$e={class:"m-2"},S$e={class:"flex flex-col align-bottom"},T$e={class:"relative"},M$e=oe(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),O$e={class:"absolute right-0"},R$e={class:"m-2"},N$e={class:"flex flex-col align-bottom"},D$e={class:"relative"},L$e=oe(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),I$e={class:"absolute right-0"},P$e={class:"m-2"},F$e={class:"flex flex-col align-bottom"},B$e={class:"relative"},$$e=oe(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),z$e={class:"absolute right-0"},j$e={class:"m-2"},U$e={class:"flex flex-col align-bottom"},q$e={class:"relative"},H$e=oe(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),V$e={class:"absolute right-0"},G$e={class:"m-2"},K$e={class:"flex flex-col align-bottom"},W$e={class:"relative"},Z$e=oe(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),Y$e={class:"absolute right-0"};function J$e(t,e,n,s,o,r){const i=qe("Card"),a=qe("BindingEntry"),l=qe("model-entry"),d=qe("personality-entry"),u=qe("YesNoDialog"),h=qe("AddModelDialog"),f=qe("MessageBox"),g=qe("Toast"),m=qe("UniversalForm"),_=qe("ChoiceDialog");return k(),C(Re,null,[c("div",wLe,[c("div",xLe,[o.showConfirmation?(k(),C("div",kLe,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=de(p=>o.showConfirmation=!1,["stop"]))},CLe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=de(p=>r.save_configuration(),["stop"]))},SLe)])):P("",!0),o.showConfirmation?P("",!0):(k(),C("div",TLe,[c("button",{title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=p=>o.showConfirmation=!0)},OLe),c("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[3]||(e[3]=p=>r.reset_configuration())},NLe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Collapse / Expand all panels",type:"button",onClick:e[4]||(e[4]=de(p=>o.all_collapsed=!o.all_collapsed,["stop"]))},LLe)])),c("div",ILe,[c("button",{title:"Clear uploads",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[5]||(e[5]=p=>r.api_get_req("clear_uploads").then(b=>{b.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast(["failed!"],4,!1)}))},FLe),c("button",{title:"Restart program",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[6]||(e[6]=p=>r.api_get_req("restart_program").then(b=>{b.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast(["failed!"],4,!1)}))},$Le),c("button",{title:"Upgrade program ",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[7]||(e[7]=p=>r.api_get_req("update_software").then(b=>{b.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast("Success!",4,!0)}))},[zLe,o.has_updates?(k(),C("div",jLe,qLe)):P("",!0)]),c("div",HLe,[o.settingsChanged?(k(),C("div",VLe,[xe(" Apply changes: "),o.isLoading?P("",!0):(k(),C("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[8]||(e[8]=de(p=>r.applyConfiguration(),["stop"]))},KLe))])):P("",!0),o.isLoading?(k(),C("div",WLe,[c("p",null,H(o.loading_text),1),ZLe,YLe])):P("",!0)])])]),c("div",{class:Me(o.isLoading?"pointer-events-none opacity-30":"")},[c("div",JLe,[c("div",QLe,[c("button",{onClick:e[9]||(e[9]=de(p=>o.sc_collapsed=!o.sc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[se(c("div",null,eIe,512),[[Ye,o.sc_collapsed]]),se(c("div",null,nIe,512),[[Ye,!o.sc_collapsed]]),sIe,oIe,c("div",rIe,[c("div",iIe,[c("div",null,[r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(k(),C("div",aIe,[(k(!0),C(Re,null,Ge(r.vramUsage.gpus,p=>(k(),C("div",lIe,[(k(),C("svg",{title:p.gpu_model,"aria-hidden":"true",class:"w-10 h-10 fill-secondary",viewBox:"0 -3 82 66",fill:"none",xmlns:"http://www.w3.org/2000/svg"},uIe,8,cIe)),c("h3",hIe,[c("div",null,H(r.computedFileSize(p.used_vram))+" / "+H(r.computedFileSize(p.total_vram))+" ("+H(p.percentage)+"%) ",1)])]))),256))])):P("",!0),r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(k(),C("div",fIe,[c("div",pIe,[gIe,c("h3",mIe,[c("div",null,H(r.vramUsage.gpus.length)+"x ",1)])])])):P("",!0)]),_Ie,c("h3",bIe,[c("div",null,H(r.ram_usage)+" / "+H(r.ram_total_space)+" ("+H(r.ram_percent_usage)+"%)",1)]),yIe,c("h3",vIe,[c("div",null,H(r.disk_binding_models_usage)+" / "+H(r.disk_total_space)+" ("+H(r.disk_percent_usage)+"%)",1)])])])])]),c("div",{class:Me([{hidden:o.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",wIe,[xIe,c("div",kIe,[c("div",null,[EIe,xe(H(r.ram_available_space),1)]),c("div",null,[CIe,xe(" "+H(r.ram_usage)+" / "+H(r.ram_total_space)+" ("+H(r.ram_percent_usage)+")% ",1)])]),c("div",AIe,[c("div",SIe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:yt("width: "+r.ram_percent_usage+"%;")},null,4)])])]),c("div",TIe,[MIe,c("div",OIe,[c("div",null,[RIe,xe(H(r.disk_available_space),1)]),c("div",null,[NIe,xe(" "+H(r.disk_binding_models_usage)+" / "+H(r.disk_total_space)+" ("+H(r.disk_percent_usage)+"%)",1)])]),c("div",DIe,[c("div",LIe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:yt("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(k(!0),C(Re,null,Ge(r.vramUsage.gpus,p=>(k(),C("div",IIe,[PIe,c("div",FIe,[c("div",null,[BIe,xe(H(p.gpu_model),1)]),c("div",null,[$Ie,xe(H(this.computedFileSize(p.available_space)),1)]),c("div",null,[zIe,xe(" "+H(this.computedFileSize(p.used_vram))+" / "+H(this.computedFileSize(p.total_vram))+" ("+H(p.percentage)+"%)",1)])]),c("div",jIe,[c("div",UIe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:yt("width: "+p.percentage+"%;")},null,4)])])]))),256))],2)]),c("div",qIe,[c("div",HIe,[c("button",{onClick:e[10]||(e[10]=de(p=>o.minconf_collapsed=!o.minconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[se(c("div",null,GIe,512),[[Ye,o.minconf_collapsed]]),se(c("div",null,WIe,512),[[Ye,!o.minconf_collapsed]]),ZIe])]),c("div",{class:Me([{hidden:o.minconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",YIe,[ue(i,{title:"General",is_subcard:"True",class:"pb-2 m-2"},{default:Ne(()=>[c("table",JIe,[c("tr",null,[QIe,c("td",XIe,[se(c("input",{type:"text",id:"host",required:"","onUpdate:modelValue":e[11]||(e[11]=p=>r.configFile.host=p),onChange:e[12]||(e[12]=p=>o.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),[[Oe,r.configFile.host]])])]),c("tr",null,[ePe,c("td",tPe,[se(c("input",{type:"number",step:"1",id:"port",required:"","onUpdate:modelValue":e[13]||(e[13]=p=>r.configFile.port=p),onChange:e[14]||(e[14]=p=>o.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),[[Oe,r.configFile.port]])])]),c("tr",null,[nPe,c("td",sPe,[se(c("input",{type:"text",id:"db_path",required:"","onUpdate:modelValue":e[15]||(e[15]=p=>r.configFile.db_path=p),onChange:e[16]||(e[16]=p=>o.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),[[Oe,r.configFile.db_path]])])]),c("tr",null,[oPe,c("td",null,[se(c("input",{type:"checkbox",id:"enable_gpu",required:"","onUpdate:modelValue":e[17]||(e[17]=p=>r.configFile.enable_gpu=p),onChange:e[18]||(e[18]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.enable_gpu]])])]),c("tr",null,[rPe,c("td",null,[se(c("input",{type:"checkbox",id:"auto_save",required:"","onUpdate:modelValue":e[19]||(e[19]=p=>r.configFile.auto_save=p),onChange:e[20]||(e[20]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.auto_save]])])]),c("tr",null,[iPe,c("td",null,[se(c("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[21]||(e[21]=p=>r.configFile.auto_update=p),onChange:e[22]||(e[22]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.auto_update]])])])])]),_:1}),ue(i,{title:"User",is_subcard:"True",class:"pb-2 m-2"},{default:Ne(()=>[c("table",aPe,[c("tr",null,[lPe,c("td",cPe,[se(c("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[23]||(e[23]=p=>r.configFile.user_name=p),onChange:e[24]||(e[24]=p=>o.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.user_name]])])]),c("tr",null,[dPe,c("td",uPe,[se(c("textarea",{id:"user_description",required:"","onUpdate:modelValue":e[25]||(e[25]=p=>r.configFile.user_description=p),onChange:e[26]||(e[26]=p=>o.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.user_description]])])]),c("tr",null,[hPe,c("td",fPe,[c("label",pPe,[c("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,gPe)]),c("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[27]||(e[27]=(...p)=>r.uploadAvatar&&r.uploadAvatar(...p))},null,32)])]),c("tr",null,[mPe,c("td",null,[se(c("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[28]||(e[28]=p=>r.configFile.use_user_name_in_discussions=p),onChange:e[29]||(e[29]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.use_user_name_in_discussions]])])])])]),_:1}),ue(i,{title:"Files Vectorization",is_subcard:"True",class:"pb-2 m-2"},{default:Ne(()=>[c("table",_Pe,[c("tr",null,[bPe,c("td",null,[se(c("input",{type:"checkbox",id:"use_files",required:"","onUpdate:modelValue":e[30]||(e[30]=p=>r.configFile.use_files=p),onChange:e[31]||(e[31]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.use_files]])])]),c("tr",null,[yPe,c("td",null,[se(c("input",{type:"checkbox",id:"data_vectorization_activate",required:"","onUpdate:modelValue":e[32]||(e[32]=p=>r.configFile.data_vectorization_activate=p),onChange:e[33]||(e[33]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.data_vectorization_activate]])])]),c("tr",null,[vPe,c("td",null,[se(c("input",{type:"checkbox",id:"data_vectorization_build_keys_words",required:"","onUpdate:modelValue":e[34]||(e[34]=p=>r.configFile.data_vectorization_build_keys_words=p),onChange:e[35]||(e[35]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.data_vectorization_build_keys_words]])])]),c("tr",null,[wPe,c("td",null,[se(c("select",{id:"data_vectorization_method",required:"","onUpdate:modelValue":e[36]||(e[36]=p=>r.configFile.data_vectorization_method=p),onChange:e[37]||(e[37]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},EPe,544),[[on,r.configFile.data_vectorization_method]])])]),c("tr",null,[CPe,c("td",null,[se(c("select",{id:"data_visualization_method",required:"","onUpdate:modelValue":e[38]||(e[38]=p=>r.configFile.data_visualization_method=p),onChange:e[39]||(e[39]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},TPe,544),[[on,r.configFile.data_visualization_method]])])]),c("tr",null,[MPe,c("td",null,[se(c("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[40]||(e[40]=p=>r.configFile.data_vectorization_save_db=p),onChange:e[41]||(e[41]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.data_vectorization_save_db]])])]),c("tr",null,[OPe,c("td",null,[se(c("input",{id:"data_vectorization_chunk_size","onUpdate:modelValue":e[42]||(e[42]=p=>r.configFile.data_vectorization_chunk_size=p),onChange:e[43]||(e[43]=p=>o.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),[[Oe,r.configFile.data_vectorization_chunk_size]]),se(c("input",{"onUpdate:modelValue":e[44]||(e[44]=p=>r.configFile.data_vectorization_chunk_size=p),onChange:e[45]||(e[45]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.data_vectorization_chunk_size]])])]),c("tr",null,[RPe,c("td",null,[se(c("input",{id:"data_vectorization_overlap_size","onUpdate:modelValue":e[46]||(e[46]=p=>r.configFile.data_vectorization_overlap_size=p),onChange:e[47]||(e[47]=p=>o.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),[[Oe,r.configFile.data_vectorization_overlap_size]]),se(c("input",{"onUpdate:modelValue":e[48]||(e[48]=p=>r.configFile.data_vectorization_overlap_size=p),onChange:e[49]||(e[49]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.data_vectorization_overlap_size]])])]),c("tr",null,[NPe,c("td",null,[se(c("input",{id:"data_vectorization_nb_chunks","onUpdate:modelValue":e[50]||(e[50]=p=>r.configFile.data_vectorization_nb_chunks=p),onChange:e[51]||(e[51]=p=>o.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),[[Oe,r.configFile.data_vectorization_nb_chunks]]),se(c("input",{"onUpdate:modelValue":e[52]||(e[52]=p=>r.configFile.data_vectorization_nb_chunks=p),onChange:e[53]||(e[53]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.data_vectorization_nb_chunks]])])])])]),_:1}),ue(i,{title:"Audio",is_subcard:"True",class:"pb-2 m-2"},{default:Ne(()=>[c("table",DPe,[c("tr",null,[LPe,c("td",null,[se(c("input",{type:"checkbox",id:"audio_auto_send_input",required:"","onUpdate:modelValue":e[54]||(e[54]=p=>r.configFile.audio_auto_send_input=p),onChange:e[55]||(e[55]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.audio_auto_send_input]])])]),c("tr",null,[IPe,c("td",null,[se(c("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[56]||(e[56]=p=>r.configFile.auto_speak=p),onChange:e[57]||(e[57]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.auto_speak]])])]),c("tr",null,[PPe,c("td",null,[se(c("input",{id:"audio_pitch","onUpdate:modelValue":e[58]||(e[58]=p=>r.configFile.audio_pitch=p),onChange:e[59]||(e[59]=p=>o.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),[[Oe,r.configFile.audio_pitch]]),se(c("input",{"onUpdate:modelValue":e[60]||(e[60]=p=>r.configFile.audio_pitch=p),onChange:e[61]||(e[61]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.audio_pitch]])])]),c("tr",null,[FPe,c("td",null,[se(c("input",{id:"audio_silenceTimer","onUpdate:modelValue":e[62]||(e[62]=p=>r.configFile.audio_silenceTimer=p),onChange:e[63]||(e[63]=p=>o.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),[[Oe,r.configFile.audio_silenceTimer]]),se(c("input",{"onUpdate:modelValue":e[64]||(e[64]=p=>r.configFile.audio_silenceTimer=p),onChange:e[65]||(e[65]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.audio_silenceTimer]])])]),c("tr",null,[BPe,c("td",null,[se(c("select",{id:"audio_in_language","onUpdate:modelValue":e[66]||(e[66]=p=>r.configFile.audio_in_language=p),onChange:e[67]||(e[67]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(k(!0),C(Re,null,Ge(r.audioLanguages,p=>(k(),C("option",{key:p.code,value:p.code},H(p.name),9,$Pe))),128))],544),[[on,r.configFile.audio_in_language]])])]),c("tr",null,[zPe,c("td",null,[se(c("select",{id:"audio_out_voice","onUpdate:modelValue":e[68]||(e[68]=p=>r.configFile.audio_out_voice=p),onChange:e[69]||(e[69]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(k(!0),C(Re,null,Ge(o.audioVoices,p=>(k(),C("option",{key:p.name,value:p.name},H(p.name),9,jPe))),128))],544),[[on,r.configFile.audio_out_voice]])])])])]),_:1})])],2)]),c("div",UPe,[c("div",qPe,[c("button",{onClick:e[70]||(e[70]=de(p=>o.bzc_collapsed=!o.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[se(c("div",null,VPe,512),[[Ye,o.bzc_collapsed]]),se(c("div",null,KPe,512),[[Ye,!o.bzc_collapsed]]),WPe,r.configFile.binding_name?P("",!0):(k(),C("div",ZPe,[YPe,xe(" No binding selected! ")])),r.configFile.binding_name?(k(),C("div",JPe,"|")):P("",!0),r.configFile.binding_name?(k(),C("div",QPe,[c("div",XPe,[c("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,eFe),c("h3",tFe,H(r.binding_name),1)])])):P("",!0)])]),c("div",{class:Me([{hidden:o.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsArr&&r.bindingsArr.length>0?(k(),C("div",nFe,[c("label",sFe," Bindings: ("+H(r.bindingsArr.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.bzl_collapsed?"":"max-h-96"])},[ue(Ut,{name:"list"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(r.bindingsArr,(p,b)=>(k(),st(a,{ref_for:!0,ref:"bindingZoo",key:"index-"+b+"-"+p.folder,binding:p,"on-selected":r.onSelectedBinding,"on-reinstall":r.onReinstallBinding,"on-install":r.onInstallBinding,"on-settings":r.onSettingsBinding,"on-reload-binding":r.onReloadBinding,selected:p.folder===r.configFile.binding_name},null,8,["binding","on-selected","on-reinstall","on-install","on-settings","on-reload-binding","selected"]))),128))]),_:1})],2)])):P("",!0),o.bzl_collapsed?(k(),C("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[71]||(e[71]=p=>o.bzl_collapsed=!o.bzl_collapsed)},rFe)):(k(),C("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[72]||(e[72]=p=>o.bzl_collapsed=!o.bzl_collapsed)},aFe))],2)]),c("div",lFe,[c("div",cFe,[c("button",{onClick:e[73]||(e[73]=de(p=>o.mzc_collapsed=!o.mzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[se(c("div",null,uFe,512),[[Ye,o.mzc_collapsed]]),se(c("div",null,fFe,512),[[Ye,!o.mzc_collapsed]]),pFe,c("div",gFe,[r.configFile.binding_name?P("",!0):(k(),C("div",mFe,[_Fe,xe(" Select binding first! ")])),!o.isModelSelected&&r.configFile.binding_name?(k(),C("div",bFe,[yFe,xe(" No model selected! ")])):P("",!0),r.configFile.model_name?(k(),C("div",vFe,"|")):P("",!0),r.configFile.model_name?(k(),C("div",wFe,[c("div",xFe,[c("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,kFe),c("h3",EFe,H(r.model_name),1)])])):P("",!0)])])]),c("div",{class:Me([{hidden:o.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",CFe,[c("div",AFe,[c("div",SFe,[o.searchModelInProgress?(k(),C("div",TFe,OFe)):P("",!0),o.searchModelInProgress?P("",!0):(k(),C("div",RFe,DFe))]),se(c("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[74]||(e[74]=p=>o.searchModel=p),onKeyup:e[75]||(e[75]=de((...p)=>r.searchModel_func&&r.searchModel_func(...p),["stop"]))},null,544),[[Oe,o.searchModel]]),o.searchModel?(k(),C("button",{key:0,onClick:e[76]||(e[76]=de(p=>o.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")):P("",!0)])]),o.searchModel?(k(),C("div",LFe,[o.modelsFiltered.length>0?(k(),C("div",IFe,[c("label",PFe," Search results: ("+H(o.modelsFiltered.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.mzl_collapsed?"":"max-h-96"])},[ue(Ut,{name:"list"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(o.modelsFiltered,(p,b)=>(k(),st(l,{ref_for:!0,ref:"modelZoo",key:"index-"+b+"-"+p.title,title:p.title,icon:p.icon,path:p.path,owner:p.owner,owner_link:p.owner_link,license:p.license,description:p.description,"is-installed":p.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onSelected,selected:p.title===r.configFile.model_name,model:p,model_type:p.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["title","icon","path","owner","owner_link","license","description","is-installed","on-install","on-uninstall","on-selected","selected","model","model_type","on-copy","on-copy-link","on-cancel-install"]))),128))]),_:1})],2)])):P("",!0)])):P("",!0),o.searchModel?P("",!0):(k(),C("div",FFe,[r.models&&r.models.length>0?(k(),C("div",BFe,[c("label",$Fe," Models: ("+H(r.models.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.mzl_collapsed?"":"max-h-96"])},[ue(Ut,{name:"list"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(r.models,(p,b)=>(k(),st(l,{ref_for:!0,ref:"modelZoo",key:"index-"+b+"-"+p.title,title:p.title,icon:p.icon,path:p.path,owner:p.owner,owner_link:p.owner_link,license:p.license,description:p.description,"is-installed":p.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onSelected,selected:p.title===r.configFile.model_name,model:p,model_type:p.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["title","icon","path","owner","owner_link","license","description","is-installed","on-install","on-uninstall","on-selected","selected","model","model_type","on-copy","on-copy-link","on-cancel-install"]))),128))]),_:1})],2)])):P("",!0)])),o.mzl_collapsed?(k(),C("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[77]||(e[77]=(...p)=>r.open_mzl&&r.open_mzl(...p))},jFe)):(k(),C("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[78]||(e[78]=(...p)=>r.open_mzl&&r.open_mzl(...p))},qFe))],2)]),c("div",HFe,[c("div",VFe,[c("button",{onClick:e[79]||(e[79]=de(p=>o.mzdc_collapsed=!o.mzdc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[se(c("div",null,KFe,512),[[Ye,o.mzdc_collapsed]]),se(c("div",null,ZFe,512),[[Ye,!o.mzdc_collapsed]]),YFe,r.binding_name?P("",!0):(k(),C("div",JFe,[QFe,xe(" No binding selected! ")])),r.configFile.binding_name?(k(),C("div",XFe,"|")):P("",!0),r.configFile.binding_name?(k(),C("div",eBe,[c("div",tBe,[c("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,nBe),c("h3",sBe,H(r.binding_name),1)])])):P("",!0)])]),c("div",{class:Me([{hidden:o.mzdc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",oBe,[c("div",rBe,[c("div",null,[c("div",iBe,[aBe,se(c("input",{type:"text","onUpdate:modelValue":e[80]||(e[80]=p=>o.reference_path=p),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),[[Oe,o.reference_path]])]),c("button",{type:"button",onClick:e[81]||(e[81]=de(p=>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")]),o.modelDownlaodInProgress?P("",!0):(k(),C("div",lBe,[c("div",cBe,[dBe,se(c("input",{type:"text","onUpdate:modelValue":e[82]||(e[82]=p=>o.addModel.url=p),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),[[Oe,o.addModel.url]])]),c("button",{type:"button",onClick:e[83]||(e[83]=de(p=>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")])),o.modelDownlaodInProgress?(k(),C("div",uBe,[hBe,c("div",fBe,[c("div",pBe,[c("div",gBe,[mBe,c("span",_Be,H(Math.floor(o.addModel.progress))+"%",1)]),c("div",{class:"mx-1 opacity-80 line-clamp-1",title:o.addModel.url},H(o.addModel.url),9,bBe),c("div",yBe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:yt({width:o.addModel.progress+"%"})},null,4)]),c("div",vBe,[c("span",wBe,"Download speed: "+H(r.speed_computed)+"/s",1),c("span",xBe,H(r.downloaded_size_computed)+"/"+H(r.total_size_computed),1)])])]),c("div",kBe,[c("div",EBe,[c("div",CBe,[c("button",{onClick:e[84]||(e[84]=de((...p)=>r.onCancelInstall&&r.onCancelInstall(...p),["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 ")])])])])):P("",!0)])])],2)]),c("div",ABe,[c("div",SBe,[c("button",{onClick:e[86]||(e[86]=de(p=>o.pzc_collapsed=!o.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[se(c("div",null,MBe,512),[[Ye,o.pzc_collapsed]]),se(c("div",null,RBe,512),[[Ye,!o.pzc_collapsed]]),NBe,r.configFile.personalities?(k(),C("div",DBe,"|")):P("",!0),c("div",LBe,H(r.active_pesonality),1),r.configFile.personalities?(k(),C("div",IBe,"|")):P("",!0),r.configFile.personalities?(k(),C("div",PBe,[r.mountedPersArr.length>0?(k(),C("div",FBe,[(k(!0),C(Re,null,Ge(r.mountedPersArr,(p,b)=>(k(),C("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:b+"-"+p.name,ref_for:!0,ref:"mountedPersonalities"},[c("div",BBe,[c("button",{onClick:de(y=>r.onPersonalitySelected(p),["stop"])},[c("img",{src:o.bUrl+p.avatar,onError:e[85]||(e[85]=(...y)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...y)),class:Me(["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(p.full_path)?"border-secondary":"border-transparent z-0"]),title:p.name},null,42,zBe)],8,$Be),c("button",{onClick:de(y=>r.onPersonalityMounted(p),["stop"])},qBe,8,jBe)])]))),128))])):P("",!0)])):P("",!0)])]),c("div",{class:Me([{hidden:o.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",HBe,[VBe,c("div",GBe,[c("div",KBe,[o.searchPersonalityInProgress?(k(),C("div",WBe,YBe)):P("",!0),o.searchPersonalityInProgress?P("",!0):(k(),C("div",JBe,XBe))]),se(c("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[87]||(e[87]=p=>o.searchPersonality=p),onKeyup:e[88]||(e[88]=de((...p)=>r.searchPersonality_func&&r.searchPersonality_func(...p),["stop"]))},null,544),[[Oe,o.searchPersonality]]),o.searchPersonality?(k(),C("button",{key:0,onClick:e[89]||(e[89]=de(p=>o.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")):P("",!0)])]),o.searchPersonality?P("",!0):(k(),C("div",e$e,[c("label",t$e," Personalities Category: ("+H(o.persCatgArr.length)+") ",1),c("select",{id:"persCat",onChange:e[90]||(e[90]=p=>r.update_personality_category(p.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"},[(k(!0),C(Re,null,Ge(o.persCatgArr,(p,b)=>(k(),C("option",{key:b,selected:p==this.configFile.personality_category},H(p),9,n$e))),128))],32)])),c("div",null,[o.personalitiesFiltered.length>0?(k(),C("div",s$e,[c("label",o$e,H(o.searchPersonality?"Search results":"Personalities")+": ("+H(o.personalitiesFiltered.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.pzl_collapsed?"":"max-h-96"])},[ue(Ut,{name:"bounce"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(o.personalitiesFiltered,(p,b)=>(k(),st(d,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+b+"-"+p.name,personality:p,full_path:p.full_path,"on-remount":r.onRemount,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(y=>y===p.full_path),"on-selected":r.onPersonalitySelected,"on-mounted":r.onPersonalityMounted,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality},null,8,["personality","full_path","on-remount","selected","on-selected","on-mounted","on-reinstall","on-settings"]))),128))]),_:1})],2)])):P("",!0)]),o.pzl_collapsed?(k(),C("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[91]||(e[91]=p=>o.pzl_collapsed=!o.pzl_collapsed)},i$e)):(k(),C("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[92]||(e[92]=p=>o.pzl_collapsed=!o.pzl_collapsed)},l$e))],2)]),c("div",c$e,[c("div",d$e,[c("button",{onClick:e[93]||(e[93]=de(p=>o.mc_collapsed=!o.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[se(c("div",null,h$e,512),[[Ye,o.mc_collapsed]]),se(c("div",null,p$e,512),[[Ye,!o.mc_collapsed]]),g$e])]),c("div",{class:Me([{hidden:o.mc_collapsed},"flex flex-col mb-2 p-2"])},[c("div",m$e,[c("div",_$e,[se(c("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[94]||(e[94]=de(()=>{},["stop"])),"onUpdate:modelValue":e[95]||(e[95]=p=>r.configFile.override_personality_model_parameters=p),onChange:e[96]||(e[96]=p=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[rt,r.configFile.override_personality_model_parameters]]),b$e])]),c("div",{class:Me(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[c("div",y$e,[v$e,se(c("input",{type:"text",id:"seed","onUpdate:modelValue":e[97]||(e[97]=p=>r.configFile.seed=p),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),[[Oe,r.configFile.seed]])]),c("div",w$e,[c("div",x$e,[c("div",k$e,[E$e,c("p",C$e,[se(c("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[98]||(e[98]=p=>r.configFile.temperature=p),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,512),[[Oe,r.configFile.temperature]])])]),se(c("input",{id:"temperature",type:"range","onUpdate:modelValue":e[99]||(e[99]=p=>r.configFile.temperature=p),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,512),[[Oe,r.configFile.temperature]])])]),c("div",A$e,[c("div",S$e,[c("div",T$e,[M$e,c("p",O$e,[se(c("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[100]||(e[100]=p=>r.configFile.n_predict=p),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,512),[[Oe,r.configFile.n_predict]])])]),se(c("input",{id:"predict",type:"range","onUpdate:modelValue":e[101]||(e[101]=p=>r.configFile.n_predict=p),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,512),[[Oe,r.configFile.n_predict]])])]),c("div",R$e,[c("div",N$e,[c("div",D$e,[L$e,c("p",I$e,[se(c("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[102]||(e[102]=p=>r.configFile.top_k=p),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,512),[[Oe,r.configFile.top_k]])])]),se(c("input",{id:"top_k",type:"range","onUpdate:modelValue":e[103]||(e[103]=p=>r.configFile.top_k=p),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,512),[[Oe,r.configFile.top_k]])])]),c("div",P$e,[c("div",F$e,[c("div",B$e,[$$e,c("p",z$e,[se(c("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[104]||(e[104]=p=>r.configFile.top_p=p),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,512),[[Oe,r.configFile.top_p]])])]),se(c("input",{id:"top_p",type:"range","onUpdate:modelValue":e[105]||(e[105]=p=>r.configFile.top_p=p),min:"0",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,512),[[Oe,r.configFile.top_p]])])]),c("div",j$e,[c("div",U$e,[c("div",q$e,[H$e,c("p",V$e,[se(c("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[106]||(e[106]=p=>r.configFile.repeat_penalty=p),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,512),[[Oe,r.configFile.repeat_penalty]])])]),se(c("input",{id:"repeat_penalty",type:"range","onUpdate:modelValue":e[107]||(e[107]=p=>r.configFile.repeat_penalty=p),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,512),[[Oe,r.configFile.repeat_penalty]])])]),c("div",G$e,[c("div",K$e,[c("div",W$e,[Z$e,c("p",Y$e,[se(c("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[108]||(e[108]=p=>r.configFile.repeat_last_n=p),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,512),[[Oe,r.configFile.repeat_last_n]])])]),se(c("input",{id:"repeat_last_n",type:"range","onUpdate:modelValue":e[109]||(e[109]=p=>r.configFile.repeat_last_n=p),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,512),[[Oe,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),ue(u,{ref:"yesNoDialog",class:"z-20"},null,512),ue(h,{ref:"addmodeldialog"},null,512),ue(f,{ref:"messageBox"},null,512),ue(g,{ref:"toast"},null,512),ue(m,{ref:"universalForm",class:"z-20"},null,512),ue(_,{class:"z-20",show:o.variantSelectionDialogVisible,choices:o.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const Q$e=Ue(vLe,[["render",J$e],["__scopeId","data-v-3dabeccc"]]),X$e={components:{ClipBoardTextInput:vc,Card:vi},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:"",selectedDataset:""}},methods:{submitForm(){const t={model_name:this.model_name,tokenizer_name:this.tokenizer_name,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};ye.post("/start_training",t).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(t){var n;console.log("here");const e=(n=t.target.files[0])==null?void 0:n.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(t){const e=t.target.files;e.length>0&&(this.selectedDataset=e[0])}},watch:{model_name(t){console.log("watching model_name",t),this.$refs.clipboardInput.inputValue=t}}},eze={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"},tze={class:"mb-4"},nze=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),sze={class:"mb-4"},oze=c("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),rze={class:"mb-4"},ize=c("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),aze={class:"mb-4"},lze=c("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),cze={class:"mb-4"},dze=c("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),uze={class:"mb-4"},hze=c("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),fze={class:"mb-4"},pze=c("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),gze={class:"mb-4"},mze=c("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),_ze=c("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Train LLM",-1);function bze(t,e,n,s,o,r){const i=qe("ClipBoardTextInput"),a=qe("Card");return k(),C("div",eze,[c("form",{onSubmit:e[0]||(e[0]=de((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[ue(a,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[ue(a,{title:"Model",class:"",isHorizontal:!1},{default:Ne(()=>[c("div",tze,[nze,ue(i,{id:"model_path",inputType:"text",value:o.model_name},null,8,["value"])]),c("div",sze,[oze,ue(i,{id:"model_path",inputType:"text",value:o.tokenizer_name},null,8,["value"])])]),_:1}),ue(a,{title:"Data",isHorizontal:!1},{default:Ne(()=>[c("div",rze,[ize,ue(i,{id:"model_path",inputType:"file",value:o.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),ue(a,{title:"Training",isHorizontal:!1},{default:Ne(()=>[c("div",aze,[lze,ue(i,{id:"model_path",inputType:"integer",value:o.lr},null,8,["value"])]),c("div",cze,[dze,ue(i,{id:"model_path",inputType:"integer",value:o.num_epochs},null,8,["value"])]),c("div",uze,[hze,ue(i,{id:"model_path",inputType:"integer",value:o.max_length},null,8,["value"])]),c("div",fze,[pze,ue(i,{id:"model_path",inputType:"integer",value:o.batch_size},null,8,["value"])])]),_:1}),ue(a,{title:"Output",isHorizontal:!1},{default:Ne(()=>[c("div",gze,[mze,ue(i,{id:"model_path",inputType:"text",value:t.output_dir},null,8,["value"])])]),_:1})]),_:1}),ue(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[_ze]),_:1})],32)])}const yze=Ue(X$e,[["render",bze]]),vze={components:{ClipBoardTextInput:vc,Card:vi},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(t){var n;console.log("here");const e=(n=t.target.files[0])==null?void 0:n.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(t){const e=t.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},wze={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"},xze={class:"mb-4"},kze=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),Eze={class:"mb-4"},Cze=c("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),Aze=c("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function Sze(t,e,n,s,o,r){const i=qe("ClipBoardTextInput"),a=qe("Card");return k(),C("div",wze,[c("form",{onSubmit:e[0]||(e[0]=de((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[ue(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[ue(a,{title:"Model",class:"",isHorizontal:!1},{default:Ne(()=>[c("div",xze,[kze,ue(i,{id:"model_path",inputType:"text",value:o.model_name},null,8,["value"])]),c("div",Eze,[Cze,ue(i,{id:"model_path",inputType:"text",value:o.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),ue(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[Aze]),_:1})],32)])}const Tze=Ue(vze,[["render",Sze]]),Mze={name:"Discussion",emits:["delete","select","editTitle","checked"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,editTitle:!1,newTitle:String,checkBoxValue_local:!1}},methods:{deleteEvent(){this.showConfirmation=!1,this.$emit("delete")},selectEvent(){this.$emit("select")},editTitleEvent(){this.editTitle=!1,this.editTitleMode=!1,this.showConfirmation=!1,this.$emit("editTitle",{title:this.newTitle,id:this.id})},chnageTitle(t){this.newTitle=t},checkedChangeEvent(t,e){this.$emit("checked",t,e)}},mounted(){this.newTitle=this.title,be(()=>{ve.replace()})},watch:{showConfirmation(){be(()=>{ve.replace()})},editTitleMode(t){this.showConfirmation=t,this.editTitle=t,t&&be(()=>{this.$refs.titleBox.focus()})},checkBoxValue(t,e){this.checkBoxValue_local=t}}},Oze=["id"],Rze={class:"flex flex-row items-center gap-2"},Nze={key:0},Dze=["title"],Lze=["value"],Ize={class:"flex items-center flex-1 max-h-6"},Pze={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},Fze=c("i",{"data-feather":"check"},null,-1),Bze=[Fze],$ze=c("i",{"data-feather":"x"},null,-1),zze=[$ze],jze={key:1,class:"flex gap-3 flex-1 items-center justify-end duration-75"},Uze=c("i",{"data-feather":"x"},null,-1),qze=[Uze],Hze=c("i",{"data-feather":"check"},null,-1),Vze=[Hze],Gze={key:2,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"},Kze=c("i",{"data-feather":"edit-2"},null,-1),Wze=[Kze],Zze=c("i",{"data-feather":"trash"},null,-1),Yze=[Zze];function Jze(t,e,n,s,o,r){return k(),C("div",{class:Me([n.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-"+n.id,onClick:e[13]||(e[13]=de(i=>r.selectEvent(),["stop"]))},[c("div",Rze,[n.isCheckbox?(k(),C("div",Nze,[se(c("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]=de(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=i=>o.checkBoxValue_local=i),onInput:e[2]||(e[2]=i=>r.checkedChangeEvent(i,n.id))},null,544),[[rt,o.checkBoxValue_local]])])):P("",!0),n.selected?(k(),C("div",{key:1,class:Me(["min-h-full w-2 rounded-xl self-stretch",n.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):P("",!0),n.selected?P("",!0):(k(),C("div",{key:2,class:Me(["w-2",n.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),o.editTitle?P("",!0):(k(),C("p",{key:0,title:n.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},H(n.title?n.title==="untitled"?"New discussion":n.title:"New discussion"),9,Dze)),o.editTitle?(k(),C("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:n.title,required:"",onKeydown:[e[3]||(e[3]=Ja(de(i=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=Ja(de(i=>o.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=i=>r.chnageTitle(i.target.value)),onClick:e[6]||(e[6]=de(()=>{},["stop"]))},null,40,Lze)):P("",!0),c("div",Ize,[o.showConfirmation&&!o.editTitleMode?(k(),C("div",Pze,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:e[7]||(e[7]=de(i=>r.deleteEvent(),["stop"]))},Bze),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:e[8]||(e[8]=de(i=>o.showConfirmation=!1,["stop"]))},zze)])):P("",!0),o.showConfirmation&&o.editTitleMode?(k(),C("div",jze,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[9]||(e[9]=de(i=>o.editTitleMode=!1,["stop"]))},qze),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[10]||(e[10]=de(i=>r.editTitleEvent(),["stop"]))},Vze)])):P("",!0),o.showConfirmation?P("",!0):(k(),C("div",Gze,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[11]||(e[11]=de(i=>o.editTitleMode=!0,["stop"]))},Wze),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[12]||(e[12]=de(i=>o.showConfirmation=!0,["stop"]))},Yze)]))])],10,Oze)}const Ug=Ue(Mze,[["render",Jze]]),Qze={props:{htmlContent:{type:String,required:!0}}},Xze=["innerHTML"];function eje(t,e,n,s,o,r){return k(),C("div",null,[c("div",{innerHTML:n.htmlContent},null,8,Xze)])}const tje=Ue(Qze,[["render",eje]]);const nje={props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Form"}},data(){return{collapsed:!0}},computed:{formattedJson(){if(console.log(typeof this.jsonData),typeof this.jsonData=="string"){let t=JSON.stringify(JSON.parse(this.jsonData),null," ").replace(/\n/g,"
");return console.log(t),console.log(this.jsonFormText),t}else{let t=JSON.stringify(this.jsonData,null," ").replace(/\n/g,"
");return console.log(t),console.log(this.jsonFormText),t}},isObject(){return console.log(typeof this.jsonData),console.log(this.jsonData),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}}},sje={key:0},oje={class:"toggle-icon mr-1"},rje={key:0,class:"fas fa-plus-circle text-gray-600"},ije={key:1,class:"fas fa-minus-circle text-gray-600"},aje={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},lje={key:0,class:"fas fa-plus-circle text-gray-600"},cje={key:1,class:"fas fa-minus-circle text-gray-600"},dje=["innerHTML"];function uje(t,e,n,s,o,r){return r.isContentPresent?(k(),C("div",sje,[c("div",{class:"collapsible-section cursor-pointer mb-4 font-bold hover:text-gray-900",onClick:e[0]||(e[0]=(...i)=>r.toggleCollapsible&&r.toggleCollapsible(...i))},[c("span",oje,[o.collapsed?(k(),C("i",rje)):(k(),C("i",ije))]),xe(" "+H(n.jsonFormText),1)]),se(c("div",null,[c("div",aje,[r.isObject?(k(),C("span",{key:0,onClick:e[1]||(e[1]=(...i)=>r.toggleCollapsed&&r.toggleCollapsed(...i)),class:"toggle-icon cursor-pointer mr-1"},[o.collapsed?(k(),C("i",lje)):(k(),C("i",cje))])):P("",!0),c("pre",{innerHTML:r.formattedJson},null,8,dje)])],512),[[Ye,!o.collapsed]])])):P("",!0)}const hje=Ue(nje,[["render",uje]]),fje={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0}}},pje={class:"step flex items-center mb-4"},gje={class:"flex items-center justify-center w-6 h-6 mr-2"},mje={key:0},_je=c("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),bje=[_je],yje={key:1},vje=c("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),wje=[vje],xje={key:2},kje=c("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),Eje=[kje],Cje={key:0,role:"status"},Aje=c("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"},[c("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"}),c("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),Sje=[Aje];function Tje(t,e,n,s,o,r){return k(),C("div",pje,[c("div",gje,[n.done?P("",!0):(k(),C("div",mje,bje)),n.done&&n.status?(k(),C("div",yje,wje)):P("",!0),n.done&&!n.status?(k(),C("div",xje,Eje)):P("",!0)]),n.done?P("",!0):(k(),C("div",Cje,Sje)),c("div",{class:Me(["content flex-1 px-2",{"text-green-500":n.done,"text-yellow-500":!n.done}])},H(n.message),3)])}const Mje=Ue(fje,[["render",Tje]]);const Oje="/",Rje={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:Fg,Step:Mje,RenderHTMLJS:tje,JsonViewer:hje},props:{message:Object,avatar:""},data(){return{msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){"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."),be(()=>{ve.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight})},methods:{onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let t=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(o=>o.name===this.$store.state.config.audio_out_voice)[0]);const n=o=>{let r=this.message.content.substring(o,o+e);const i=[".","!","?",` -`];let a=-1;return i.forEach(l=>{const d=r.lastIndexOf(l);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+o+1},s=()=>{if(this.message.content.includes(".")){const o=n(t),r=this.message.content.substring(t,o);this.msg.text=r,t=o+1,this.msg.onend=i=>{t{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",o))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{s()},1)};s()},toggleModel(){this.expanded=!this.expanded},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.editMsgMode=!1},resendMessage(){this.$emit("resendMessage",this.message.id,this.message.content)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?Oje+this.avatar:es},defaultImg(t){t.target.src=es},parseDate(t){let e=new Date(Date.parse(t)),s=Math.floor((new Date-e)/1e3);return s<=1?"just now":s<20?s+" seconds ago":s<40?"half a minute ago":s<60?"less than a minute ago":s<=90?"one minute ago":s<=3540?Math.round(s/60)+" minutes ago":s<=5400?"1 hour ago":s<=86400?Math.round(s/3600)+" hours ago":s<=129600?"1 day ago":s<604800?Math.round(s/86400)+" days ago":s<=777600?"1 week ago":t},prettyDate(t){let e=new Date((t||"").replace(/-/g,"/").replace(/[TZ]/g," ")),n=(new Date().getTime()-e.getTime())/1e3,s=Math.floor(n/86400);if(!(isNaN(s)||s<0||s>=31))return s==0&&(n<60&&"just now"||n<120&&"1 minute ago"||n<3600&&Math.floor(n/60)+" minutes ago"||n<7200&&"1 hour ago"||n<86400&&Math.floor(n/3600)+" hours ago")||s==1&&"Yesterday"||s<7&&s+" days ago"||s<31&&Math.ceil(s/7)+" weeks ago"},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{"message.content":function(t){this.$store.state.config.auto_speak&&(this.isSpeaking||this.checkForFullSentence())},showConfirmation(){be(()=>{ve.replace()})},editMsgMode(t){be(()=>{ve.replace()})},deleteMsgMode(){be(()=>{ve.replace()})}},computed:{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 t=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===t.getTime()||!e.getTime())return;let s=e.getTime()-t.getTime();const o=Math.floor(s/(1e3*60*60));s-=o*(1e3*60*60);const r=Math.floor(s/(1e3*60));s-=r*(1e3*60);const i=Math.floor(s/1e3);s-=i*1e3;function a(d){return d<10&&(d="0"+d),d}return a(o)+"h:"+a(r)+"m:"+a(i)+"s"}}},Nje={class:"relative 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"},Dje={class:"flex flex-row gap-2"},Lje={class:"flex-shrink-0"},Ije={class:"group/avatar"},Pje=["src","data-popover-target"],Fje={class:"flex flex-col w-full flex-grow-0"},Bje={class:"flex flex-row flex-grow items-start"},$je={class:"flex flex-col mb-2"},zje={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},jje=["title"],Uje=c("div",{class:"flex-grow"},null,-1),qje={class:"flex-row justify-end mx-2"},Hje={class:"invisible group-hover:visible flex flex-row"},Vje={key:0,class:"flex items-center duration-75"},Gje=c("i",{"data-feather":"x"},null,-1),Kje=[Gje],Wje=c("i",{"data-feather":"check"},null,-1),Zje=[Wje],Yje=c("i",{"data-feather":"edit"},null,-1),Jje=[Yje],Qje=c("i",{"data-feather":"copy"},null,-1),Xje=[Qje],eUe=c("i",{"data-feather":"refresh-cw"},null,-1),tUe=[eUe],nUe=c("i",{"data-feather":"fast-forward"},null,-1),sUe=[nUe],oUe={key:4,class:"flex items-center duration-75"},rUe=c("i",{"data-feather":"x"},null,-1),iUe=[rUe],aUe=c("i",{"data-feather":"check"},null,-1),lUe=[aUe],cUe=c("i",{"data-feather":"trash"},null,-1),dUe=[cUe],uUe=c("i",{"data-feather":"thumbs-up"},null,-1),hUe=[uUe],fUe={class:"flex flex-row items-center"},pUe=c("i",{"data-feather":"thumbs-down"},null,-1),gUe=[pUe],mUe={class:"flex flex-row items-center"},_Ue=c("i",{"data-feather":"volume-2"},null,-1),bUe=[_Ue],yUe={class:"overflow-x-auto w-full"},vUe={class:"flex flex-col items-start w-full"},wUe={class:"flex flex-col items-start w-full"},xUe={key:2},kUe={class:"text-sm text-gray-400 mt-2"},EUe={class:"flex flex-row items-center gap-2"},CUe={key:0},AUe={class:"font-thin"},SUe={key:1},TUe={class:"font-thin"},MUe={key:2},OUe={class:"font-thin"},RUe={key:3},NUe=["title"];function DUe(t,e,n,s,o,r){const i=qe("Step"),a=qe("RenderHTMLJS"),l=qe("MarkdownRenderer"),d=qe("JsonViewer");return k(),C("div",Nje,[c("div",Dje,[c("div",Lje,[c("div",Ije,[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=u=>r.defaultImg(u)),"data-popover-target":"avatar"+n.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,Pje)])]),c("div",Fje,[c("div",Bje,[c("div",$je,[c("div",zje,H(n.message.sender)+" ",1),n.message.created_at?(k(),C("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},H(r.created_at),9,jje)):P("",!0)]),Uje,c("div",qje,[c("div",Hje,[o.editMsgMode?(k(),C("div",Vje,[c("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]=de(u=>o.editMsgMode=!1,["stop"]))},Kje),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Update message",type:"button",onClick:e[2]||(e[2]=de((...u)=>r.updateMessage&&r.updateMessage(...u),["stop"]))},Zje)])):P("",!0),o.editMsgMode?P("",!0):(k(),C("div",{key:1,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Edit message",onClick:e[3]||(e[3]=de(u=>o.editMsgMode=!0,["stop"]))},Jje)),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Copy message to clipboard",onClick:e[4]||(e[4]=de(u=>r.copyContentToClipboard(),["stop"]))},Xje),n.message.sender!=this.$store.state.mountedPers.name?(k(),C("div",{key:2,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Resend message",onClick:e[5]||(e[5]=de(u=>r.resendMessage(),["stop"]))},tUe)):P("",!0),n.message.sender==this.$store.state.mountedPers.name?(k(),C("div",{key:3,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Resend message",onClick:e[6]||(e[6]=de(u=>r.continueMessage(),["stop"]))},sUe)):P("",!0),o.deleteMsgMode?(k(),C("div",oUe,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2",title:"Cancel removal",type:"button",onClick:e[7]||(e[7]=de(u=>o.deleteMsgMode=!1,["stop"]))},iUe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Confirm removal",type:"button",onClick:e[8]||(e[8]=de(u=>r.deleteMsg(),["stop"]))},lUe)])):P("",!0),o.deleteMsgMode?P("",!0):(k(),C("div",{key:5,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2",title:"Remove message",onClick:e[9]||(e[9]=u=>o.deleteMsgMode=!0)},dUe)),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Upvote",onClick:e[10]||(e[10]=de(u=>r.rankUp(),["stop"]))},hUe),c("div",fUe,[c("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2",title:"Downvote",onClick:e[11]||(e[11]=de(u=>r.rankDown(),["stop"]))},gUe),n.message.rank!=0?(k(),C("div",{key:0,class:Me(["rounded-full px-2 text-sm flex items-center justify-center font-bold",n.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},H(n.message.rank),3)):P("",!0)]),c("div",mUe,[c("div",{class:Me(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[12]||(e[12]=de(u=>r.speak(),["stop"]))},bUe,2)])])])]),c("div",yUe,[c("div",vUe,[(k(!0),C(Re,null,Ge(n.message.steps,(u,h)=>(k(),C("div",{key:"step-"+n.message.id+"-"+h,class:"step font-bold",style:yt({backgroundColor:u.done?"transparent":"inherit"})},[ue(i,{done:u.done,message:u.message,status:u.status},null,8,["done","message","status"])],4))),128))]),c("div",wUe,[(k(!0),C(Re,null,Ge(n.message.html_js_s,(u,h)=>(k(),C("div",{key:"htmljs-"+n.message.id+"-"+h,class:"htmljs font-bold",style:yt({backgroundColor:t.step.done?"transparent":"inherit"})},[ue(a,{htmlContent:u},null,8,["htmlContent"])],4))),128))]),o.editMsgMode?P("",!0):(k(),st(l,{key:0,ref:"mdRender","markdown-text":n.message.content},null,8,["markdown-text"])),o.editMsgMode?se((k(),C("textarea",{key:1,ref:"mdTextarea",rows:4,class:"block p-2.5 w-full text-sm 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",style:yt({minHeight:o.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[13]||(e[13]=u=>this.message.content=u)},null,4)),[[Oe,this.message.content]]):P("",!0),n.message.metadata!==null?(k(),C("div",xUe,[(k(!0),C(Re,null,Ge(n.message.metadata,(u,h)=>(k(),C("div",{key:"json-"+n.message.id+"-"+h,class:"json font-bold"},[ue(d,{jsonFormText:u.title,jsonData:u.content},null,8,["jsonFormText","jsonData"])]))),128))])):P("",!0)]),c("div",kUe,[c("div",EUe,[n.message.binding?(k(),C("p",CUe,[xe("Binding: "),c("span",AUe,H(n.message.binding),1)])):P("",!0),n.message.model?(k(),C("p",SUe,[xe("Model: "),c("span",TUe,H(n.message.model),1)])):P("",!0),n.message.seed?(k(),C("p",MUe,[xe("Seed: "),c("span",OUe,H(n.message.seed),1)])):P("",!0),r.time_spent?(k(),C("p",RUe,[xe("Time spent: "),c("span",{class:"font-thin",title:"Finished generating: "+r.finished_generating_at_parsed},H(r.time_spent),9,NUe)])):P("",!0)])])])])])}const qg=Ue(Rje,[["render",DUe]]),LUe="/";ye.defaults.baseURL="/";const IUe={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{UniversalForm:wc},data(){return{bUrl:LUe,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(t){this.$store.commit("setConfig",t)}},mountedPers:{get(){return this.$store.state.mountedPers},set(t){this.$store.commit("setMountedPers",t)}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}}},methods:{onSettingsPersonality(t){try{ye.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 - "+t.name,"Save changes","Cancel").then(n=>{try{ye.post("/set_active_personality_settings",n).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. +You need to select model before you leave, or else.`,"Ok","Cancel"),!1}},oe=t=>(ss("data-v-3dabeccc"),t=t(),os(),t),vLe={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-0"},wLe={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"},xLe={key:0,class:"flex gap-3 flex-1 items-center duration-75"},kLe=oe(()=>c("i",{"data-feather":"x"},null,-1)),ELe=[kLe],CLe=oe(()=>c("i",{"data-feather":"check"},null,-1)),ALe=[CLe],SLe={key:1,class:"flex gap-3 flex-1 items-center"},TLe=oe(()=>c("i",{"data-feather":"save"},null,-1)),MLe=[TLe],OLe=oe(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),RLe=[OLe],NLe=oe(()=>c("i",{"data-feather":"list"},null,-1)),DLe=[NLe],LLe={class:"flex gap-3 flex-1 items-center justify-end"},ILe=oe(()=>c("i",{"data-feather":"trash-2"},null,-1)),PLe=[ILe],FLe=oe(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),BLe=[FLe],$Le=oe(()=>c("i",{"data-feather":"arrow-up-circle"},null,-1)),zLe={key:0},jLe=oe(()=>c("i",{"data-feather":"alert-circle"},null,-1)),ULe=[jLe],qLe={class:"flex gap-3 items-center"},HLe={key:0,class:"flex gap-3 items-center"},VLe=oe(()=>c("i",{"data-feather":"check"},null,-1)),GLe=[VLe],KLe={key:1,role:"status"},WLe=oe(()=>c("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"},[c("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"}),c("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)),ZLe=oe(()=>c("span",{class:"sr-only"},"Loading...",-1)),YLe={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"},JLe={class:"flex flex-row p-3"},QLe=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),XLe=[QLe],eIe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),tIe=[eIe],nIe=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),sIe=oe(()=>c("div",{class:"mr-2"},"|",-1)),oIe={class:"text-base font-semibold cursor-pointer select-none items-center"},rIe={class:"flex gap-2 items-center"},iIe={key:0},aIe={class:"flex gap-2 items-center"},lIe=["title"],cIe=rs('',34),dIe=[cIe],uIe={class:"font-bold font-large text-lg"},hIe={key:1},fIe={class:"flex gap-2 items-center"},pIe=rs('',1),gIe={class:"font-bold font-large text-lg"},mIe=oe(()=>c("i",{"data-feather":"cpu",title:"CPU Ram",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),_Ie={class:"font-bold font-large text-lg"},bIe=oe(()=>c("i",{"data-feather":"hard-drive",title:"Hard drive",class:"w-5 h-5 mx-1 flex-shrink-0"},null,-1)),yIe={class:"font-bold font-large text-lg"},vIe={class:"mb-2"},wIe=oe(()=>c("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[c("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"})]),xe(" CPU Ram usage: ")],-1)),xIe={class:"flex flex-col mx-2"},kIe=oe(()=>c("b",null,"Avaliable ram: ",-1)),EIe=oe(()=>c("b",null,"Ram usage: ",-1)),CIe={class:"p-2"},AIe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},SIe={class:"mb-2"},TIe=oe(()=>c("label",{class:"flex items-center gap-1 ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},[c("i",{"data-feather":"hard-drive",class:"w-5 h-5"}),xe(" Disk usage: ")],-1)),MIe={class:"flex flex-col mx-2"},OIe=oe(()=>c("b",null,"Avaliable disk space: ",-1)),RIe=oe(()=>c("b",null,"Disk usage: ",-1)),NIe={class:"p-2"},DIe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},LIe={class:"mb-2"},IIe=rs('',1),PIe={class:"flex flex-col mx-2"},FIe=oe(()=>c("b",null,"Model: ",-1)),BIe=oe(()=>c("b",null,"Avaliable vram: ",-1)),$Ie=oe(()=>c("b",null,"GPU usage: ",-1)),zIe={class:"p-2"},jIe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},UIe={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"},qIe={class:"flex flex-row p-3"},HIe=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),VIe=[HIe],GIe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),KIe=[GIe],WIe=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Main configurations",-1)),ZIe={class:"flex flex-col mb-2 px-3 pb-2"},YIe={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"},JIe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Host:")],-1)),QIe={style:{width:"100%"}},XIe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Port:")],-1)),ePe={style:{width:"100%"}},tPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"db_path",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Database path:")],-1)),nPe={style:{width:"100%"}},sPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"enable_gpu",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable GPU:")],-1)),oPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_save",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto save:")],-1)),rPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_update",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Auto update:")],-1)),iPe={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"},aPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User name:")],-1)),lPe={style:{width:"100%"}},cPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_description",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User description:")],-1)),dPe={style:{width:"100%"}},uPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"user_name",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"User avatar:")],-1)),hPe={style:{width:"100%"}},fPe={for:"avatar-upload"},pPe=["src"],gPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_user_name_in_discussions",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Use User Name in discussions:")],-1)),mPe={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"},_Pe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"use_files",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate files support:")],-1)),bPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_activate",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Activate files vectorization:")],-1)),yPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_build_keys_words",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Build keywords when querying the vectorized database:")],-1)),vPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization method:")],-1)),wPe=oe(()=>c("option",{value:"ftidf_vectorizer"},"ftidf Vectorizer",-1)),xPe=oe(()=>c("option",{value:"model_embedding"},"Model Embedding",-1)),kPe=[wPe,xPe],EPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_visualization_method",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data visualization method:")],-1)),CPe=oe(()=>c("option",{value:"PCA"},"PCA",-1)),APe=oe(()=>c("option",{value:"TSNE"},"TSNE",-1)),SPe=[CPe,APe],TPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("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)),MPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_chunk_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization chunk size(tokens):")],-1)),OPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Data vectorization overlap size(tokens):")],-1)),RPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"data_vectorization_overlap_size",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Number of chunks to use for each message:")],-1)),NPe={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"},DPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_auto_send_input",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Send audio input automatically:")],-1)),LPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"auto_speak",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Enable auto speak:")],-1)),IPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_pitch",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio pitch:")],-1)),PPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_silenceTimer",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"audio in silence timer (ms):")],-1)),FPe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_in_language",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Input Audio Language:")],-1)),BPe=["value"],$Pe=oe(()=>c("td",{style:{"min-width":"200px"}},[c("label",{for:"audio_out_voice",class:"text-sm font-bold",style:{"margin-right":"1rem"}},"Output Audio Voice:")],-1)),zPe=["value"],jPe={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"},UPe={class:"flex flex-row p-3"},qPe=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),HPe=[qPe],VPe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),GPe=[VPe],KPe=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Binding zoo",-1)),WPe={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},ZPe=oe(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),YPe={key:1,class:"mr-2"},JPe={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},QPe={class:"flex gap-1 items-center"},XPe=["src"],eFe={class:"font-bold font-large text-lg line-clamp-1"},tFe={key:0,class:"mb-2"},nFe={for:"binding",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},sFe=oe(()=>c("i",{"data-feather":"chevron-up"},null,-1)),oFe=[sFe],rFe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),iFe=[rFe],aFe={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"},lFe={class:"flex flex-row p-3"},cFe=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),dFe=[cFe],uFe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),hFe=[uFe],fFe=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Models zoo",-1)),pFe={class:"flex flex-row items-center"},gFe={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},mFe=oe(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),_Fe={key:1,class:"text-base text-red-600 flex gap-3 items-center mr-2"},bFe=oe(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),yFe={key:2,class:"mr-2"},vFe={key:3,class:"text-base font-semibold cursor-pointer select-none items-center"},wFe={class:"flex gap-1 items-center"},xFe=["src"],kFe={class:"font-bold font-large text-lg line-clamp-1"},EFe={class:"mx-2 mb-4"},CFe={class:"relative"},AFe={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},SFe={key:0},TFe=oe(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),MFe=[TFe],OFe={key:1},RFe=oe(()=>c("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"},[c("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)),NFe=[RFe],DFe={key:0},LFe={key:0,class:"mb-2"},IFe={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},PFe={key:1},FFe={key:0,class:"mb-2"},BFe={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},$Fe=oe(()=>c("i",{"data-feather":"chevron-up"},null,-1)),zFe=[$Fe],jFe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),UFe=[jFe],qFe={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"},HFe={class:"flex flex-row p-3"},VFe=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),GFe=[VFe],KFe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),WFe=[KFe],ZFe=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Add models for binding",-1)),YFe={key:0,class:"text-base text-red-600 flex gap-3 items-center mr-2"},JFe=oe(()=>c("i",{"data-feather":"alert-triangle",class:"flex-shrink-0"},null,-1)),QFe={key:1,class:"mr-2"},XFe={key:2,class:"text-base font-semibold cursor-pointer select-none items-center"},eBe={class:"flex gap-1 items-center"},tBe=["src"],nBe={class:"font-bold font-large text-lg line-clamp-1"},sBe={class:"mb-2"},oBe={class:"p-2"},rBe={class:"mb-3"},iBe=oe(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Create a reference from local file path:",-1)),aBe={key:0},lBe={class:"mb-3"},cBe=oe(()=>c("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Download from web:",-1)),dBe={key:1,class:"relative flex flex-col items-center justify-center flex-grow h-full"},uBe=oe(()=>c("div",{role:"status",class:"justify-center"},null,-1)),hBe={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},fBe={class:"w-full p-2"},pBe={class:"flex justify-between mb-1"},gBe=rs(' Downloading Loading...',1),mBe={class:"text-sm font-medium text-blue-700 dark:text-white"},_Be=["title"],bBe={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},yBe={class:"flex justify-between mb-1"},vBe={class:"text-base font-medium text-blue-700 dark:text-white"},wBe={class:"text-sm font-medium text-blue-700 dark:text-white"},xBe={class:"flex flex-grow"},kBe={class:"flex flex-row flex-grow gap-3"},EBe={class:"p-2 text-center grow"},CBe={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"},ABe={class:"flex flex-row p-3 items-center"},SBe=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),TBe=[SBe],MBe=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),OBe=[MBe],RBe=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," Personalities zoo",-1)),NBe={key:0,class:"mr-2"},DBe={class:"mr-2 font-bold font-large text-lg line-clamp-1"},LBe={key:1,class:"mr-2"},IBe={key:2,class:"text-base font-semibold cursor-pointer select-none items-center flex flex-row"},PBe={key:0,class:"flex -space-x-4 items-center"},FBe={class:"group items-center flex flex-row"},BBe=["onClick"],$Be=["src","title"],zBe=["onClick"],jBe=oe(()=>c("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"},[c("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"},[c("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)),UBe=[jBe],qBe={class:"mx-2 mb-4"},HBe=oe(()=>c("label",{for:"personality-search",class:"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"},"Search",-1)),VBe={class:"relative"},GBe={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},KBe={key:0},WBe=oe(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),ZBe=[WBe],YBe={key:1},JBe=oe(()=>c("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"},[c("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)),QBe=[JBe],XBe={key:0,class:"mx-2 mb-4"},e$e={for:"persCat",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},t$e=["selected"],n$e={key:0,class:"mb-2"},s$e={for:"model",class:"block ml-2 mb-2 text-sm font-medium text-gray-900 dark:text-white"},o$e=oe(()=>c("i",{"data-feather":"chevron-up"},null,-1)),r$e=[o$e],i$e=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),a$e=[i$e],l$e={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"},c$e={class:"flex flex-row"},d$e=oe(()=>c("i",{"data-feather":"chevron-right"},null,-1)),u$e=[d$e],h$e=oe(()=>c("i",{"data-feather":"chevron-down"},null,-1)),f$e=[h$e],p$e=oe(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none"}," Model Configuration",-1)),g$e={class:"m-2"},m$e={class:"flex flex-row gap-2 items-center"},_$e=oe(()=>c("label",{for:"override-model-parameters",class:"block text-sm font-medium"}," Override personality model parameters ",-1)),b$e={class:"m-2"},y$e=oe(()=>c("label",{for:"seed",class:"block mb-2 text-sm font-medium"}," Seed: ",-1)),v$e={class:"m-2"},w$e={class:"flex flex-col align-bottom"},x$e={class:"relative"},k$e=oe(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"temperature",class:"text-sm font-medium"}," Temperature: ")],-1)),E$e={class:"absolute right-0"},C$e={class:"m-2"},A$e={class:"flex flex-col align-bottom"},S$e={class:"relative"},T$e=oe(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"predict",class:"text-sm font-medium"}," N Predict: ")],-1)),M$e={class:"absolute right-0"},O$e={class:"m-2"},R$e={class:"flex flex-col align-bottom"},N$e={class:"relative"},D$e=oe(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_k",class:"text-sm font-medium"}," Top-K: ")],-1)),L$e={class:"absolute right-0"},I$e={class:"m-2"},P$e={class:"flex flex-col align-bottom"},F$e={class:"relative"},B$e=oe(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"top_p",class:"text-sm font-medium"}," Top-P: ")],-1)),$$e={class:"absolute right-0"},z$e={class:"m-2"},j$e={class:"flex flex-col align-bottom"},U$e={class:"relative"},q$e=oe(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_penalty",class:"text-sm font-medium"}," Repeat penalty: ")],-1)),H$e={class:"absolute right-0"},V$e={class:"m-2"},G$e={class:"flex flex-col align-bottom"},K$e={class:"relative"},W$e=oe(()=>c("p",{class:"absolute left-0 mt-6"},[c("label",{for:"repeat_last_n",class:"text-sm font-medium"}," Repeat last N: ")],-1)),Z$e={class:"absolute right-0"};function Y$e(t,e,n,s,o,r){const i=qe("Card"),a=qe("BindingEntry"),l=qe("model-entry"),d=qe("personality-entry"),u=qe("YesNoDialog"),h=qe("AddModelDialog"),f=qe("MessageBox"),g=qe("Toast"),m=qe("UniversalForm"),_=qe("ChoiceDialog");return k(),C(Re,null,[c("div",vLe,[c("div",wLe,[o.showConfirmation?(k(),C("div",xLe,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:e[0]||(e[0]=de(p=>o.showConfirmation=!1,["stop"]))},ELe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:e[1]||(e[1]=de(p=>r.save_configuration(),["stop"]))},ALe)])):P("",!0),o.showConfirmation?P("",!0):(k(),C("div",SLe,[c("button",{title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[2]||(e[2]=p=>o.showConfirmation=!0)},MLe),c("button",{title:"Reset configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[3]||(e[3]=p=>r.reset_configuration())},RLe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Collapse / Expand all panels",type:"button",onClick:e[4]||(e[4]=de(p=>o.all_collapsed=!o.all_collapsed,["stop"]))},DLe)])),c("div",LLe,[c("button",{title:"Clear uploads",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[5]||(e[5]=p=>r.api_get_req("clear_uploads").then(b=>{b.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast(["failed!"],4,!1)}))},PLe),c("button",{title:"Restart program",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[6]||(e[6]=p=>r.api_get_req("restart_program").then(b=>{b.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast(["failed!"],4,!1)}))},BLe),c("button",{title:"Upgrade program ",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:e[7]||(e[7]=p=>r.api_get_req("update_software").then(b=>{b.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast("Success!",4,!0)}))},[$Le,o.has_updates?(k(),C("div",zLe,ULe)):P("",!0)]),c("div",qLe,[o.settingsChanged?(k(),C("div",HLe,[xe(" Apply changes: "),o.isLoading?P("",!0):(k(),C("button",{key:0,class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Apply changes",type:"button",onClick:e[8]||(e[8]=de(p=>r.applyConfiguration(),["stop"]))},GLe))])):P("",!0),o.isLoading?(k(),C("div",KLe,[c("p",null,H(o.loading_text),1),WLe,ZLe])):P("",!0)])])]),c("div",{class:Me(o.isLoading?"pointer-events-none opacity-30":"")},[c("div",YLe,[c("div",JLe,[c("button",{onClick:e[9]||(e[9]=de(p=>o.sc_collapsed=!o.sc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[se(c("div",null,XLe,512),[[Ye,o.sc_collapsed]]),se(c("div",null,tIe,512),[[Ye,!o.sc_collapsed]]),nIe,sIe,c("div",oIe,[c("div",rIe,[c("div",null,[r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length==1?(k(),C("div",iIe,[(k(!0),C(Re,null,Ge(r.vramUsage.gpus,p=>(k(),C("div",aIe,[(k(),C("svg",{title:p.gpu_model,"aria-hidden":"true",class:"w-10 h-10 fill-secondary",viewBox:"0 -3 82 66",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dIe,8,lIe)),c("h3",uIe,[c("div",null,H(r.computedFileSize(p.used_vram))+" / "+H(r.computedFileSize(p.total_vram))+" ("+H(p.percentage)+"%) ",1)])]))),256))])):P("",!0),r.vramUsage&&r.vramUsage.gpus&&r.vramUsage.gpus.length>1?(k(),C("div",hIe,[c("div",fIe,[pIe,c("h3",gIe,[c("div",null,H(r.vramUsage.gpus.length)+"x ",1)])])])):P("",!0)]),mIe,c("h3",_Ie,[c("div",null,H(r.ram_usage)+" / "+H(r.ram_total_space)+" ("+H(r.ram_percent_usage)+"%)",1)]),bIe,c("h3",yIe,[c("div",null,H(r.disk_binding_models_usage)+" / "+H(r.disk_total_space)+" ("+H(r.disk_percent_usage)+"%)",1)])])])])]),c("div",{class:Me([{hidden:o.sc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",vIe,[wIe,c("div",xIe,[c("div",null,[kIe,xe(H(r.ram_available_space),1)]),c("div",null,[EIe,xe(" "+H(r.ram_usage)+" / "+H(r.ram_total_space)+" ("+H(r.ram_percent_usage)+")% ",1)])]),c("div",CIe,[c("div",AIe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:yt("width: "+r.ram_percent_usage+"%;")},null,4)])])]),c("div",SIe,[TIe,c("div",MIe,[c("div",null,[OIe,xe(H(r.disk_available_space),1)]),c("div",null,[RIe,xe(" "+H(r.disk_binding_models_usage)+" / "+H(r.disk_total_space)+" ("+H(r.disk_percent_usage)+"%)",1)])]),c("div",NIe,[c("div",DIe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:yt("width: "+r.disk_percent_usage+"%;")},null,4)])])]),(k(!0),C(Re,null,Ge(r.vramUsage.gpus,p=>(k(),C("div",LIe,[IIe,c("div",PIe,[c("div",null,[FIe,xe(H(p.gpu_model),1)]),c("div",null,[BIe,xe(H(this.computedFileSize(p.available_space)),1)]),c("div",null,[$Ie,xe(" "+H(this.computedFileSize(p.used_vram))+" / "+H(this.computedFileSize(p.total_vram))+" ("+H(p.percentage)+"%)",1)])]),c("div",zIe,[c("div",jIe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:yt("width: "+p.percentage+"%;")},null,4)])])]))),256))],2)]),c("div",UIe,[c("div",qIe,[c("button",{onClick:e[10]||(e[10]=de(p=>o.minconf_collapsed=!o.minconf_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[se(c("div",null,VIe,512),[[Ye,o.minconf_collapsed]]),se(c("div",null,KIe,512),[[Ye,!o.minconf_collapsed]]),WIe])]),c("div",{class:Me([{hidden:o.minconf_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",ZIe,[ue(i,{title:"General",is_subcard:"True",class:"pb-2 m-2"},{default:Ne(()=>[c("table",YIe,[c("tr",null,[JIe,c("td",QIe,[se(c("input",{type:"text",id:"host",required:"","onUpdate:modelValue":e[11]||(e[11]=p=>r.configFile.host=p),onChange:e[12]||(e[12]=p=>o.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),[[Oe,r.configFile.host]])])]),c("tr",null,[XIe,c("td",ePe,[se(c("input",{type:"number",step:"1",id:"port",required:"","onUpdate:modelValue":e[13]||(e[13]=p=>r.configFile.port=p),onChange:e[14]||(e[14]=p=>o.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),[[Oe,r.configFile.port]])])]),c("tr",null,[tPe,c("td",nPe,[se(c("input",{type:"text",id:"db_path",required:"","onUpdate:modelValue":e[15]||(e[15]=p=>r.configFile.db_path=p),onChange:e[16]||(e[16]=p=>o.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),[[Oe,r.configFile.db_path]])])]),c("tr",null,[sPe,c("td",null,[se(c("input",{type:"checkbox",id:"enable_gpu",required:"","onUpdate:modelValue":e[17]||(e[17]=p=>r.configFile.enable_gpu=p),onChange:e[18]||(e[18]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.enable_gpu]])])]),c("tr",null,[oPe,c("td",null,[se(c("input",{type:"checkbox",id:"auto_save",required:"","onUpdate:modelValue":e[19]||(e[19]=p=>r.configFile.auto_save=p),onChange:e[20]||(e[20]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.auto_save]])])]),c("tr",null,[rPe,c("td",null,[se(c("input",{type:"checkbox",id:"auto_update",required:"","onUpdate:modelValue":e[21]||(e[21]=p=>r.configFile.auto_update=p),onChange:e[22]||(e[22]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.auto_update]])])])])]),_:1}),ue(i,{title:"User",is_subcard:"True",class:"pb-2 m-2"},{default:Ne(()=>[c("table",iPe,[c("tr",null,[aPe,c("td",lPe,[se(c("input",{type:"text",id:"user_name",required:"","onUpdate:modelValue":e[23]||(e[23]=p=>r.configFile.user_name=p),onChange:e[24]||(e[24]=p=>o.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.user_name]])])]),c("tr",null,[cPe,c("td",dPe,[se(c("textarea",{id:"user_description",required:"","onUpdate:modelValue":e[25]||(e[25]=p=>r.configFile.user_description=p),onChange:e[26]||(e[26]=p=>o.settingsChanged=!0),class:"w-full w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.user_description]])])]),c("tr",null,[uPe,c("td",hPe,[c("label",fPe,[c("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,pPe)]),c("input",{type:"file",id:"avatar-upload",style:{display:"none"},onChange:e[27]||(e[27]=(...p)=>r.uploadAvatar&&r.uploadAvatar(...p))},null,32)])]),c("tr",null,[gPe,c("td",null,[se(c("input",{type:"checkbox",id:"use_user_name_in_discussions",required:"","onUpdate:modelValue":e[28]||(e[28]=p=>r.configFile.use_user_name_in_discussions=p),onChange:e[29]||(e[29]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.use_user_name_in_discussions]])])])])]),_:1}),ue(i,{title:"Files Vectorization",is_subcard:"True",class:"pb-2 m-2"},{default:Ne(()=>[c("table",mPe,[c("tr",null,[_Pe,c("td",null,[se(c("input",{type:"checkbox",id:"use_files",required:"","onUpdate:modelValue":e[30]||(e[30]=p=>r.configFile.use_files=p),onChange:e[31]||(e[31]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.use_files]])])]),c("tr",null,[bPe,c("td",null,[se(c("input",{type:"checkbox",id:"data_vectorization_activate",required:"","onUpdate:modelValue":e[32]||(e[32]=p=>r.configFile.data_vectorization_activate=p),onChange:e[33]||(e[33]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.data_vectorization_activate]])])]),c("tr",null,[yPe,c("td",null,[se(c("input",{type:"checkbox",id:"data_vectorization_build_keys_words",required:"","onUpdate:modelValue":e[34]||(e[34]=p=>r.configFile.data_vectorization_build_keys_words=p),onChange:e[35]||(e[35]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.data_vectorization_build_keys_words]])])]),c("tr",null,[vPe,c("td",null,[se(c("select",{id:"data_vectorization_method",required:"","onUpdate:modelValue":e[36]||(e[36]=p=>r.configFile.data_vectorization_method=p),onChange:e[37]||(e[37]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},kPe,544),[[on,r.configFile.data_vectorization_method]])])]),c("tr",null,[EPe,c("td",null,[se(c("select",{id:"data_visualization_method",required:"","onUpdate:modelValue":e[38]||(e[38]=p=>r.configFile.data_visualization_method=p),onChange:e[39]||(e[39]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},SPe,544),[[on,r.configFile.data_visualization_method]])])]),c("tr",null,[TPe,c("td",null,[se(c("input",{type:"checkbox",id:"data_vectorization_save_db",required:"","onUpdate:modelValue":e[40]||(e[40]=p=>r.configFile.data_vectorization_save_db=p),onChange:e[41]||(e[41]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.data_vectorization_save_db]])])]),c("tr",null,[MPe,c("td",null,[se(c("input",{id:"data_vectorization_chunk_size","onUpdate:modelValue":e[42]||(e[42]=p=>r.configFile.data_vectorization_chunk_size=p),onChange:e[43]||(e[43]=p=>o.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),[[Oe,r.configFile.data_vectorization_chunk_size]]),se(c("input",{"onUpdate:modelValue":e[44]||(e[44]=p=>r.configFile.data_vectorization_chunk_size=p),onChange:e[45]||(e[45]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.data_vectorization_chunk_size]])])]),c("tr",null,[OPe,c("td",null,[se(c("input",{id:"data_vectorization_overlap_size","onUpdate:modelValue":e[46]||(e[46]=p=>r.configFile.data_vectorization_overlap_size=p),onChange:e[47]||(e[47]=p=>o.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),[[Oe,r.configFile.data_vectorization_overlap_size]]),se(c("input",{"onUpdate:modelValue":e[48]||(e[48]=p=>r.configFile.data_vectorization_overlap_size=p),onChange:e[49]||(e[49]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.data_vectorization_overlap_size]])])]),c("tr",null,[RPe,c("td",null,[se(c("input",{id:"data_vectorization_nb_chunks","onUpdate:modelValue":e[50]||(e[50]=p=>r.configFile.data_vectorization_nb_chunks=p),onChange:e[51]||(e[51]=p=>o.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),[[Oe,r.configFile.data_vectorization_nb_chunks]]),se(c("input",{"onUpdate:modelValue":e[52]||(e[52]=p=>r.configFile.data_vectorization_nb_chunks=p),onChange:e[53]||(e[53]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.data_vectorization_nb_chunks]])])])])]),_:1}),ue(i,{title:"Audio",is_subcard:"True",class:"pb-2 m-2"},{default:Ne(()=>[c("table",NPe,[c("tr",null,[DPe,c("td",null,[se(c("input",{type:"checkbox",id:"audio_auto_send_input",required:"","onUpdate:modelValue":e[54]||(e[54]=p=>r.configFile.audio_auto_send_input=p),onChange:e[55]||(e[55]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.audio_auto_send_input]])])]),c("tr",null,[LPe,c("td",null,[se(c("input",{type:"checkbox",id:"auto_speak",required:"","onUpdate:modelValue":e[56]||(e[56]=p=>r.configFile.auto_speak=p),onChange:e[57]||(e[57]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[rt,r.configFile.auto_speak]])])]),c("tr",null,[IPe,c("td",null,[se(c("input",{id:"audio_pitch","onUpdate:modelValue":e[58]||(e[58]=p=>r.configFile.audio_pitch=p),onChange:e[59]||(e[59]=p=>o.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),[[Oe,r.configFile.audio_pitch]]),se(c("input",{"onUpdate:modelValue":e[60]||(e[60]=p=>r.configFile.audio_pitch=p),onChange:e[61]||(e[61]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.audio_pitch]])])]),c("tr",null,[PPe,c("td",null,[se(c("input",{id:"audio_silenceTimer","onUpdate:modelValue":e[62]||(e[62]=p=>r.configFile.audio_silenceTimer=p),onChange:e[63]||(e[63]=p=>o.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),[[Oe,r.configFile.audio_silenceTimer]]),se(c("input",{"onUpdate:modelValue":e[64]||(e[64]=p=>r.configFile.audio_silenceTimer=p),onChange:e[65]||(e[65]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},null,544),[[Oe,r.configFile.audio_silenceTimer]])])]),c("tr",null,[FPe,c("td",null,[se(c("select",{id:"audio_in_language","onUpdate:modelValue":e[66]||(e[66]=p=>r.configFile.audio_in_language=p),onChange:e[67]||(e[67]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(k(!0),C(Re,null,Ge(r.audioLanguages,p=>(k(),C("option",{key:p.code,value:p.code},H(p.name),9,BPe))),128))],544),[[on,r.configFile.audio_in_language]])])]),c("tr",null,[$Pe,c("td",null,[se(c("select",{id:"audio_out_voice","onUpdate:modelValue":e[68]||(e[68]=p=>r.configFile.audio_out_voice=p),onChange:e[69]||(e[69]=p=>o.settingsChanged=!0),class:"w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"},[(k(!0),C(Re,null,Ge(o.audioVoices,p=>(k(),C("option",{key:p.name,value:p.name},H(p.name),9,zPe))),128))],544),[[on,r.configFile.audio_out_voice]])])])])]),_:1})])],2)]),c("div",jPe,[c("div",UPe,[c("button",{onClick:e[70]||(e[70]=de(p=>o.bzc_collapsed=!o.bzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex flex-row items-center"},[se(c("div",null,HPe,512),[[Ye,o.bzc_collapsed]]),se(c("div",null,GPe,512),[[Ye,!o.bzc_collapsed]]),KPe,r.configFile.binding_name?P("",!0):(k(),C("div",WPe,[ZPe,xe(" No binding selected! ")])),r.configFile.binding_name?(k(),C("div",YPe,"|")):P("",!0),r.configFile.binding_name?(k(),C("div",JPe,[c("div",QPe,[c("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,XPe),c("h3",eFe,H(r.binding_name),1)])])):P("",!0)])]),c("div",{class:Me([{hidden:o.bzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[r.bindingsArr&&r.bindingsArr.length>0?(k(),C("div",tFe,[c("label",nFe," Bindings: ("+H(r.bindingsArr.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.bzl_collapsed?"":"max-h-96"])},[ue(Ut,{name:"list"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(r.bindingsArr,(p,b)=>(k(),st(a,{ref_for:!0,ref:"bindingZoo",key:"index-"+b+"-"+p.folder,binding:p,"on-selected":r.onSelectedBinding,"on-reinstall":r.onReinstallBinding,"on-install":r.onInstallBinding,"on-settings":r.onSettingsBinding,"on-reload-binding":r.onReloadBinding,selected:p.folder===r.configFile.binding_name},null,8,["binding","on-selected","on-reinstall","on-install","on-settings","on-reload-binding","selected"]))),128))]),_:1})],2)])):P("",!0),o.bzl_collapsed?(k(),C("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[71]||(e[71]=p=>o.bzl_collapsed=!o.bzl_collapsed)},oFe)):(k(),C("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[72]||(e[72]=p=>o.bzl_collapsed=!o.bzl_collapsed)},iFe))],2)]),c("div",aFe,[c("div",lFe,[c("button",{onClick:e[73]||(e[73]=de(p=>o.mzc_collapsed=!o.mzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[se(c("div",null,dFe,512),[[Ye,o.mzc_collapsed]]),se(c("div",null,hFe,512),[[Ye,!o.mzc_collapsed]]),fFe,c("div",pFe,[r.configFile.binding_name?P("",!0):(k(),C("div",gFe,[mFe,xe(" Select binding first! ")])),!o.isModelSelected&&r.configFile.binding_name?(k(),C("div",_Fe,[bFe,xe(" No model selected! ")])):P("",!0),r.configFile.model_name?(k(),C("div",yFe,"|")):P("",!0),r.configFile.model_name?(k(),C("div",vFe,[c("div",wFe,[c("img",{src:r.imgModel,class:"w-8 h-8 rounded-lg object-fill"},null,8,xFe),c("h3",kFe,H(r.model_name),1)])])):P("",!0)])])]),c("div",{class:Me([{hidden:o.mzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",EFe,[c("div",CFe,[c("div",AFe,[o.searchModelInProgress?(k(),C("div",SFe,MFe)):P("",!0),o.searchModelInProgress?P("",!0):(k(),C("div",OFe,NFe))]),se(c("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[74]||(e[74]=p=>o.searchModel=p),onKeyup:e[75]||(e[75]=de((...p)=>r.searchModel_func&&r.searchModel_func(...p),["stop"]))},null,544),[[Oe,o.searchModel]]),o.searchModel?(k(),C("button",{key:0,onClick:e[76]||(e[76]=de(p=>o.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")):P("",!0)])]),o.searchModel?(k(),C("div",DFe,[o.modelsFiltered.length>0?(k(),C("div",LFe,[c("label",IFe," Search results: ("+H(o.modelsFiltered.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.mzl_collapsed?"":"max-h-96"])},[ue(Ut,{name:"list"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(o.modelsFiltered,(p,b)=>(k(),st(l,{ref_for:!0,ref:"modelZoo",key:"index-"+b+"-"+p.title,title:p.title,icon:p.icon,path:p.path,owner:p.owner,owner_link:p.owner_link,license:p.license,description:p.description,"is-installed":p.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onSelected,selected:p.title===r.configFile.model_name,model:p,model_type:p.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["title","icon","path","owner","owner_link","license","description","is-installed","on-install","on-uninstall","on-selected","selected","model","model_type","on-copy","on-copy-link","on-cancel-install"]))),128))]),_:1})],2)])):P("",!0)])):P("",!0),o.searchModel?P("",!0):(k(),C("div",PFe,[r.models&&r.models.length>0?(k(),C("div",FFe,[c("label",BFe," Models: ("+H(r.models.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.mzl_collapsed?"":"max-h-96"])},[ue(Ut,{name:"list"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(r.models,(p,b)=>(k(),st(l,{ref_for:!0,ref:"modelZoo",key:"index-"+b+"-"+p.title,title:p.title,icon:p.icon,path:p.path,owner:p.owner,owner_link:p.owner_link,license:p.license,description:p.description,"is-installed":p.isInstalled,"on-install":r.onInstall,"on-uninstall":r.onUninstall,"on-selected":r.onSelected,selected:p.title===r.configFile.model_name,model:p,model_type:p.model_type,"on-copy":r.onCopy,"on-copy-link":r.onCopyLink,"on-cancel-install":r.onCancelInstall},null,8,["title","icon","path","owner","owner_link","license","description","is-installed","on-install","on-uninstall","on-selected","selected","model","model_type","on-copy","on-copy-link","on-cancel-install"]))),128))]),_:1})],2)])):P("",!0)])),o.mzl_collapsed?(k(),C("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[77]||(e[77]=(...p)=>r.open_mzl&&r.open_mzl(...p))},zFe)):(k(),C("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[78]||(e[78]=(...p)=>r.open_mzl&&r.open_mzl(...p))},UFe))],2)]),c("div",qFe,[c("div",HFe,[c("button",{onClick:e[79]||(e[79]=de(p=>o.mzdc_collapsed=!o.mzdc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[se(c("div",null,GFe,512),[[Ye,o.mzdc_collapsed]]),se(c("div",null,WFe,512),[[Ye,!o.mzdc_collapsed]]),ZFe,r.binding_name?P("",!0):(k(),C("div",YFe,[JFe,xe(" No binding selected! ")])),r.configFile.binding_name?(k(),C("div",QFe,"|")):P("",!0),r.configFile.binding_name?(k(),C("div",XFe,[c("div",eBe,[c("img",{src:r.imgBinding,class:"w-8 h-8 rounded-full object-fill text-blue-700"},null,8,tBe),c("h3",nBe,H(r.binding_name),1)])])):P("",!0)])]),c("div",{class:Me([{hidden:o.mzdc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",sBe,[c("div",oBe,[c("div",null,[c("div",rBe,[iBe,se(c("input",{type:"text","onUpdate:modelValue":e[80]||(e[80]=p=>o.reference_path=p),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),[[Oe,o.reference_path]])]),c("button",{type:"button",onClick:e[81]||(e[81]=de(p=>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")]),o.modelDownlaodInProgress?P("",!0):(k(),C("div",aBe,[c("div",lBe,[cBe,se(c("input",{type:"text","onUpdate:modelValue":e[82]||(e[82]=p=>o.addModel.url=p),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),[[Oe,o.addModel.url]])]),c("button",{type:"button",onClick:e[83]||(e[83]=de(p=>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")])),o.modelDownlaodInProgress?(k(),C("div",dBe,[uBe,c("div",hBe,[c("div",fBe,[c("div",pBe,[gBe,c("span",mBe,H(Math.floor(o.addModel.progress))+"%",1)]),c("div",{class:"mx-1 opacity-80 line-clamp-1",title:o.addModel.url},H(o.addModel.url),9,_Be),c("div",bBe,[c("div",{class:"bg-blue-600 h-2.5 rounded-full",style:yt({width:o.addModel.progress+"%"})},null,4)]),c("div",yBe,[c("span",vBe,"Download speed: "+H(r.speed_computed)+"/s",1),c("span",wBe,H(r.downloaded_size_computed)+"/"+H(r.total_size_computed),1)])])]),c("div",xBe,[c("div",kBe,[c("div",EBe,[c("button",{onClick:e[84]||(e[84]=de((...p)=>r.onCancelInstall&&r.onCancelInstall(...p),["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 ")])])])])):P("",!0)])])],2)]),c("div",CBe,[c("div",ABe,[c("button",{onClick:e[86]||(e[86]=de(p=>o.pzc_collapsed=!o.pzc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 text-left w-full flex items-center"},[se(c("div",null,TBe,512),[[Ye,o.pzc_collapsed]]),se(c("div",null,OBe,512),[[Ye,!o.pzc_collapsed]]),RBe,r.configFile.personalities?(k(),C("div",NBe,"|")):P("",!0),c("div",DBe,H(r.active_pesonality),1),r.configFile.personalities?(k(),C("div",LBe,"|")):P("",!0),r.configFile.personalities?(k(),C("div",IBe,[r.mountedPersArr.length>0?(k(),C("div",PBe,[(k(!0),C(Re,null,Ge(r.mountedPersArr,(p,b)=>(k(),C("div",{class:"relative hover:-translate-y-2 duration-300 hover:z-10 shrink-0",key:b+"-"+p.name,ref_for:!0,ref:"mountedPersonalities"},[c("div",FBe,[c("button",{onClick:de(y=>r.onPersonalitySelected(p),["stop"])},[c("img",{src:o.bUrl+p.avatar,onError:e[85]||(e[85]=(...y)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...y)),class:Me(["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(p.full_path)?"border-secondary":"border-transparent z-0"]),title:p.name},null,42,$Be)],8,BBe),c("button",{onClick:de(y=>r.onPersonalityMounted(p),["stop"])},UBe,8,zBe)])]))),128))])):P("",!0)])):P("",!0)])]),c("div",{class:Me([{hidden:o.pzc_collapsed},"flex flex-col mb-2 px-3 pb-0"])},[c("div",qBe,[HBe,c("div",VBe,[c("div",GBe,[o.searchPersonalityInProgress?(k(),C("div",KBe,ZBe)):P("",!0),o.searchPersonalityInProgress?P("",!0):(k(),C("div",YBe,QBe))]),se(c("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[87]||(e[87]=p=>o.searchPersonality=p),onKeyup:e[88]||(e[88]=de((...p)=>r.searchPersonality_func&&r.searchPersonality_func(...p),["stop"]))},null,544),[[Oe,o.searchPersonality]]),o.searchPersonality?(k(),C("button",{key:0,onClick:e[89]||(e[89]=de(p=>o.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")):P("",!0)])]),o.searchPersonality?P("",!0):(k(),C("div",XBe,[c("label",e$e," Personalities Category: ("+H(o.persCatgArr.length)+") ",1),c("select",{id:"persCat",onChange:e[90]||(e[90]=p=>r.update_personality_category(p.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"},[(k(!0),C(Re,null,Ge(o.persCatgArr,(p,b)=>(k(),C("option",{key:b,selected:p==this.configFile.personality_category},H(p),9,t$e))),128))],32)])),c("div",null,[o.personalitiesFiltered.length>0?(k(),C("div",n$e,[c("label",s$e,H(o.searchPersonality?"Search results":"Personalities")+": ("+H(o.personalitiesFiltered.length)+") ",1),c("div",{class:Me(["overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4",o.pzl_collapsed?"":"max-h-96"])},[ue(Ut,{name:"bounce"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(o.personalitiesFiltered,(p,b)=>(k(),st(d,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+b+"-"+p.name,personality:p,full_path:p.full_path,"on-remount":r.onRemount,selected:r.configFile.active_personality_id==r.configFile.personalities.findIndex(y=>y===p.full_path),"on-selected":r.onPersonalitySelected,"on-mounted":r.onPersonalityMounted,"on-reinstall":r.onPersonalityReinstall,"on-settings":r.onSettingsPersonality},null,8,["personality","full_path","on-remount","selected","on-selected","on-mounted","on-reinstall","on-settings"]))),128))]),_:1})],2)])):P("",!0)]),o.pzl_collapsed?(k(),C("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[91]||(e[91]=p=>o.pzl_collapsed=!o.pzl_collapsed)},r$e)):(k(),C("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[92]||(e[92]=p=>o.pzl_collapsed=!o.pzl_collapsed)},a$e))],2)]),c("div",l$e,[c("div",c$e,[c("button",{onClick:e[93]||(e[93]=de(p=>o.mc_collapsed=!o.mc_collapsed,["stop"])),class:"text-2xl hover:text-primary p-2 -m-2 w-full text-left flex items-center"},[se(c("div",null,u$e,512),[[Ye,o.mc_collapsed]]),se(c("div",null,f$e,512),[[Ye,!o.mc_collapsed]]),p$e])]),c("div",{class:Me([{hidden:o.mc_collapsed},"flex flex-col mb-2 p-2"])},[c("div",g$e,[c("div",m$e,[se(c("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[94]||(e[94]=de(()=>{},["stop"])),"onUpdate:modelValue":e[95]||(e[95]=p=>r.configFile.override_personality_model_parameters=p),onChange:e[96]||(e[96]=p=>r.update_setting("override_personality_model_parameters",r.configFile.override_personality_model_parameters))},null,544),[[rt,r.configFile.override_personality_model_parameters]]),_$e])]),c("div",{class:Me(r.configFile.override_personality_model_parameters?"":"pointer-events-none opacity-30")},[c("div",b$e,[y$e,se(c("input",{type:"text",id:"seed","onUpdate:modelValue":e[97]||(e[97]=p=>r.configFile.seed=p),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),[[Oe,r.configFile.seed]])]),c("div",v$e,[c("div",w$e,[c("div",x$e,[k$e,c("p",E$e,[se(c("input",{type:"text",id:"temp-val","onUpdate:modelValue":e[98]||(e[98]=p=>r.configFile.temperature=p),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,512),[[Oe,r.configFile.temperature]])])]),se(c("input",{id:"temperature",type:"range","onUpdate:modelValue":e[99]||(e[99]=p=>r.configFile.temperature=p),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,512),[[Oe,r.configFile.temperature]])])]),c("div",C$e,[c("div",A$e,[c("div",S$e,[T$e,c("p",M$e,[se(c("input",{type:"text",id:"predict-val","onUpdate:modelValue":e[100]||(e[100]=p=>r.configFile.n_predict=p),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,512),[[Oe,r.configFile.n_predict]])])]),se(c("input",{id:"predict",type:"range","onUpdate:modelValue":e[101]||(e[101]=p=>r.configFile.n_predict=p),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,512),[[Oe,r.configFile.n_predict]])])]),c("div",O$e,[c("div",R$e,[c("div",N$e,[D$e,c("p",L$e,[se(c("input",{type:"text",id:"top_k-val","onUpdate:modelValue":e[102]||(e[102]=p=>r.configFile.top_k=p),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,512),[[Oe,r.configFile.top_k]])])]),se(c("input",{id:"top_k",type:"range","onUpdate:modelValue":e[103]||(e[103]=p=>r.configFile.top_k=p),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,512),[[Oe,r.configFile.top_k]])])]),c("div",I$e,[c("div",P$e,[c("div",F$e,[B$e,c("p",$$e,[se(c("input",{type:"text",id:"top_p-val","onUpdate:modelValue":e[104]||(e[104]=p=>r.configFile.top_p=p),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,512),[[Oe,r.configFile.top_p]])])]),se(c("input",{id:"top_p",type:"range","onUpdate:modelValue":e[105]||(e[105]=p=>r.configFile.top_p=p),min:"0",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,512),[[Oe,r.configFile.top_p]])])]),c("div",z$e,[c("div",j$e,[c("div",U$e,[q$e,c("p",H$e,[se(c("input",{type:"text",id:"repeat_penalty-val","onUpdate:modelValue":e[106]||(e[106]=p=>r.configFile.repeat_penalty=p),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,512),[[Oe,r.configFile.repeat_penalty]])])]),se(c("input",{id:"repeat_penalty",type:"range","onUpdate:modelValue":e[107]||(e[107]=p=>r.configFile.repeat_penalty=p),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,512),[[Oe,r.configFile.repeat_penalty]])])]),c("div",V$e,[c("div",G$e,[c("div",K$e,[W$e,c("p",Z$e,[se(c("input",{type:"text",id:"repeat_last_n-val","onUpdate:modelValue":e[108]||(e[108]=p=>r.configFile.repeat_last_n=p),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,512),[[Oe,r.configFile.repeat_last_n]])])]),se(c("input",{id:"repeat_last_n",type:"range","onUpdate:modelValue":e[109]||(e[109]=p=>r.configFile.repeat_last_n=p),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,512),[[Oe,r.configFile.repeat_last_n]])])])],2)],2)])],2)]),ue(u,{ref:"yesNoDialog",class:"z-20"},null,512),ue(h,{ref:"addmodeldialog"},null,512),ue(f,{ref:"messageBox"},null,512),ue(g,{ref:"toast"},null,512),ue(m,{ref:"universalForm",class:"z-20"},null,512),ue(_,{class:"z-20",show:o.variantSelectionDialogVisible,choices:o.variant_choices,onChoiceSelected:r.onVariantChoiceSelected,onCloseDialog:r.oncloseVariantChoiceDialog,onChoiceValidated:r.onvalidateVariantChoice},null,8,["show","choices","onChoiceSelected","onCloseDialog","onChoiceValidated"])],64)}const J$e=Ue(yLe,[["render",Y$e],["__scopeId","data-v-3dabeccc"]]),Q$e={components:{ClipBoardTextInput:vc,Card:vi},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:"",selectedDataset:""}},methods:{submitForm(){const t={model_name:this.model_name,tokenizer_name:this.tokenizer_name,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};ye.post("/start_training",t).then(e=>{})},openFolderSelector(){this.$refs.folder_selector.click()},selectOutputDirectory(t){var n;console.log("here");const e=(n=t.target.files[0])==null?void 0:n.path;console.log(e),e&&(this.selectedFolder=e)},selectDataset(t){const e=t.target.files;e.length>0&&(this.selectedDataset=e[0])}},watch:{model_name(t){console.log("watching model_name",t),this.$refs.clipboardInput.inputValue=t}}},X$e={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"},eze={class:"mb-4"},tze=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),nze={class:"mb-4"},sze=c("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),oze={class:"mb-4"},rze=c("label",{for:"dataset_path",class:"text-sm"},"Dataset:",-1),ize={class:"mb-4"},aze=c("label",{for:"lr",class:"text-sm"},"Learning Rate:",-1),lze={class:"mb-4"},cze=c("label",{for:"num_epochs",class:"text-sm"},"Number of Epochs:",-1),dze={class:"mb-4"},uze=c("label",{for:"max_length",class:"text-sm"},"Max Length:",-1),hze={class:"mb-4"},fze=c("label",{for:"batch_size",class:"text-sm"},"Batch Size:",-1),pze={class:"mb-4"},gze=c("label",{for:"output_dir",class:"text-sm"},"Output Directory:",-1),mze=c("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Train LLM",-1);function _ze(t,e,n,s,o,r){const i=qe("ClipBoardTextInput"),a=qe("Card");return k(),C("div",X$e,[c("form",{onSubmit:e[0]||(e[0]=de((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:""},[ue(a,{title:"Training configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[ue(a,{title:"Model",class:"",isHorizontal:!1},{default:Ne(()=>[c("div",eze,[tze,ue(i,{id:"model_path",inputType:"text",value:o.model_name},null,8,["value"])]),c("div",nze,[sze,ue(i,{id:"model_path",inputType:"text",value:o.tokenizer_name},null,8,["value"])])]),_:1}),ue(a,{title:"Data",isHorizontal:!1},{default:Ne(()=>[c("div",oze,[rze,ue(i,{id:"model_path",inputType:"file",value:o.dataset_path,onchange:"selectDataset()"},null,8,["value"])])]),_:1}),ue(a,{title:"Training",isHorizontal:!1},{default:Ne(()=>[c("div",ize,[aze,ue(i,{id:"model_path",inputType:"integer",value:o.lr},null,8,["value"])]),c("div",lze,[cze,ue(i,{id:"model_path",inputType:"integer",value:o.num_epochs},null,8,["value"])]),c("div",dze,[uze,ue(i,{id:"model_path",inputType:"integer",value:o.max_length},null,8,["value"])]),c("div",hze,[fze,ue(i,{id:"model_path",inputType:"integer",value:o.batch_size},null,8,["value"])])]),_:1}),ue(a,{title:"Output",isHorizontal:!1},{default:Ne(()=>[c("div",pze,[gze,ue(i,{id:"model_path",inputType:"text",value:t.output_dir},null,8,["value"])])]),_:1})]),_:1}),ue(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[mze]),_:1})],32)])}const bze=Ue(Q$e,[["render",_ze]]),yze={components:{ClipBoardTextInput:vc,Card:vi},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(t){var n;console.log("here");const e=(n=t.target.files[0])==null?void 0:n.path;console.log(e),e&&(this.selectedFolder=e)},selectDatasetPath(t){const e=t.target.files;e.length>0&&(this.selectedDatasetPath=e[0].webkitRelativePath)}}},vze={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"},wze={class:"mb-4"},xze=c("label",{for:"model_name",class:"text-sm"},"Model Name:",-1),kze={class:"mb-4"},Eze=c("label",{for:"tokenizer_name",class:"text-sm"},"Tokenizer Name:",-1),Cze=c("button",{type:"submit",class:"bg-blue-500 text-white px-4 py-2 rounded"},"Quantize LLM",-1);function Aze(t,e,n,s,o,r){const i=qe("ClipBoardTextInput"),a=qe("Card");return k(),C("div",vze,[c("form",{onSubmit:e[0]||(e[0]=de((...l)=>r.submitForm&&r.submitForm(...l),["prevent"])),class:"max-w-md mx-auto"},[ue(a,{title:"Quantizing configuration",isHorizontal:!0,disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[ue(a,{title:"Model",class:"",isHorizontal:!1},{default:Ne(()=>[c("div",wze,[xze,ue(i,{id:"model_path",inputType:"text",value:o.model_name},null,8,["value"])]),c("div",kze,[Eze,ue(i,{id:"model_path",inputType:"text",value:o.tokenizer_name},null,8,["value"])])]),_:1})]),_:1}),ue(a,{disableHoverAnimation:!0,disableFocus:!0},{default:Ne(()=>[Cze]),_:1})],32)])}const Sze=Ue(yze,[["render",Aze]]),Tze={name:"Discussion",emits:["delete","select","editTitle","checked"],props:{id:Number,title:String,selected:Boolean,loading:Boolean,isCheckbox:Boolean,checkBoxValue:Boolean},setup(){},data(){return{showConfirmation:!1,editTitleMode:!1,editTitle:!1,newTitle:String,checkBoxValue_local:!1}},methods:{deleteEvent(){this.showConfirmation=!1,this.$emit("delete")},selectEvent(){this.$emit("select")},editTitleEvent(){this.editTitle=!1,this.editTitleMode=!1,this.showConfirmation=!1,this.$emit("editTitle",{title:this.newTitle,id:this.id})},chnageTitle(t){this.newTitle=t},checkedChangeEvent(t,e){this.$emit("checked",t,e)}},mounted(){this.newTitle=this.title,be(()=>{ve.replace()})},watch:{showConfirmation(){be(()=>{ve.replace()})},editTitleMode(t){this.showConfirmation=t,this.editTitle=t,t&&be(()=>{this.$refs.titleBox.focus()})},checkBoxValue(t,e){this.checkBoxValue_local=t}}},Mze=["id"],Oze={class:"flex flex-row items-center gap-2"},Rze={key:0},Nze=["title"],Dze=["value"],Lze={class:"flex items-center flex-1 max-h-6"},Ize={key:0,class:"flex gap-3 flex-1 items-center justify-end duration-75"},Pze=c("i",{"data-feather":"check"},null,-1),Fze=[Pze],Bze=c("i",{"data-feather":"x"},null,-1),$ze=[Bze],zze={key:1,class:"flex gap-3 flex-1 items-center justify-end duration-75"},jze=c("i",{"data-feather":"x"},null,-1),Uze=[jze],qze=c("i",{"data-feather":"check"},null,-1),Hze=[qze],Vze={key:2,class:"flex gap-3 flex-1 items-center justify-end invisible group-hover:visible duration-75"},Gze=c("i",{"data-feather":"edit-2"},null,-1),Kze=[Gze],Wze=c("i",{"data-feather":"trash"},null,-1),Zze=[Wze];function Yze(t,e,n,s,o,r){return k(),C("div",{class:Me([n.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-"+n.id,onClick:e[13]||(e[13]=de(i=>r.selectEvent(),["stop"]))},[c("div",Oze,[n.isCheckbox?(k(),C("div",Rze,[se(c("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]=de(()=>{},["stop"])),"onUpdate:modelValue":e[1]||(e[1]=i=>o.checkBoxValue_local=i),onInput:e[2]||(e[2]=i=>r.checkedChangeEvent(i,n.id))},null,544),[[rt,o.checkBoxValue_local]])])):P("",!0),n.selected?(k(),C("div",{key:1,class:Me(["min-h-full w-2 rounded-xl self-stretch",n.loading?"animate-bounce bg-accent ":" bg-secondary "])},null,2)):P("",!0),n.selected?P("",!0):(k(),C("div",{key:2,class:Me(["w-2",n.loading?"min-h-full w-2 rounded-xl self-stretch animate-bounce bg-accent ":" "])},null,2))]),o.editTitle?P("",!0):(k(),C("p",{key:0,title:n.title,class:"line-clamp-1 w-4/6 ml-1 -mx-5"},H(n.title?n.title==="untitled"?"New discussion":n.title:"New discussion"),9,Nze)),o.editTitle?(k(),C("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:n.title,required:"",onKeydown:[e[3]||(e[3]=Ja(de(i=>r.editTitleEvent(),["exact"]),["enter"])),e[4]||(e[4]=Ja(de(i=>o.editTitleMode=!1,["exact"]),["esc"]))],onInput:e[5]||(e[5]=i=>r.chnageTitle(i.target.value)),onClick:e[6]||(e[6]=de(()=>{},["stop"]))},null,40,Dze)):P("",!0),c("div",Lze,[o.showConfirmation&&!o.editTitleMode?(k(),C("div",Ize,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:e[7]||(e[7]=de(i=>r.deleteEvent(),["stop"]))},Fze),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:e[8]||(e[8]=de(i=>o.showConfirmation=!1,["stop"]))},$ze)])):P("",!0),o.showConfirmation&&o.editTitleMode?(k(),C("div",zze,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Discard title changes",type:"button",onClick:e[9]||(e[9]=de(i=>o.editTitleMode=!1,["stop"]))},Uze),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm title changes",type:"button",onClick:e[10]||(e[10]=de(i=>r.editTitleEvent(),["stop"]))},Hze)])):P("",!0),o.showConfirmation?P("",!0):(k(),C("div",Vze,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Edit title",type:"button",onClick:e[11]||(e[11]=de(i=>o.editTitleMode=!0,["stop"]))},Kze),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Remove discussion",type:"button",onClick:e[12]||(e[12]=de(i=>o.showConfirmation=!0,["stop"]))},Zze)]))])],10,Mze)}const Ug=Ue(Tze,[["render",Yze]]),Jze={props:{htmlContent:{type:String,required:!0}}},Qze=["innerHTML"];function Xze(t,e,n,s,o,r){return k(),C("div",null,[c("div",{innerHTML:n.htmlContent},null,8,Qze)])}const eje=Ue(Jze,[["render",Xze]]);const tje={props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Form"}},data(){return{collapsed:!0}},computed:{formattedJson(){if(console.log(typeof this.jsonData),typeof this.jsonData=="string"){let t=JSON.stringify(JSON.parse(this.jsonData),null," ").replace(/\n/g,"
");return console.log(t),console.log(this.jsonFormText),t}else{let t=JSON.stringify(this.jsonData,null," ").replace(/\n/g,"
");return console.log(t),console.log(this.jsonFormText),t}},isObject(){return console.log(typeof this.jsonData),console.log(this.jsonData),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}}},nje={key:0},sje={class:"toggle-icon mr-1"},oje={key:0,class:"fas fa-plus-circle text-gray-600"},rje={key:1,class:"fas fa-minus-circle text-gray-600"},ije={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},aje={key:0,class:"fas fa-plus-circle text-gray-600"},lje={key:1,class:"fas fa-minus-circle text-gray-600"},cje=["innerHTML"];function dje(t,e,n,s,o,r){return r.isContentPresent?(k(),C("div",nje,[c("div",{class:"collapsible-section cursor-pointer mb-4 font-bold hover:text-gray-900",onClick:e[0]||(e[0]=(...i)=>r.toggleCollapsible&&r.toggleCollapsible(...i))},[c("span",sje,[o.collapsed?(k(),C("i",oje)):(k(),C("i",rje))]),xe(" "+H(n.jsonFormText),1)]),se(c("div",null,[c("div",ije,[r.isObject?(k(),C("span",{key:0,onClick:e[1]||(e[1]=(...i)=>r.toggleCollapsed&&r.toggleCollapsed(...i)),class:"toggle-icon cursor-pointer mr-1"},[o.collapsed?(k(),C("i",aje)):(k(),C("i",lje))])):P("",!0),c("pre",{innerHTML:r.formattedJson},null,8,cje)])],512),[[Ye,!o.collapsed]])])):P("",!0)}const uje=Ue(tje,[["render",dje]]),hje={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0}}},fje={class:"step flex items-center mb-4"},pje={class:"flex items-center justify-center w-6 h-6 mr-2"},gje={key:0},mje=c("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),_je=[mje],bje={key:1},yje=c("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),vje=[yje],wje={key:2},xje=c("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),kje=[xje],Eje={key:0,role:"status"},Cje=c("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"},[c("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"}),c("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),Aje=[Cje];function Sje(t,e,n,s,o,r){return k(),C("div",fje,[c("div",pje,[n.done?P("",!0):(k(),C("div",gje,_je)),n.done&&n.status?(k(),C("div",bje,vje)):P("",!0),n.done&&!n.status?(k(),C("div",wje,kje)):P("",!0)]),n.done?P("",!0):(k(),C("div",Eje,Aje)),c("div",{class:Me(["content flex-1 px-2",{"text-green-500":n.done,"text-yellow-500":!n.done}])},H(n.message),3)])}const Tje=Ue(hje,[["render",Sje]]);const Mje="/",Oje={name:"Message",emits:["copy","delete","rankUp","rankDown","updateMessage","resendMessage","continueMessage"],components:{MarkdownRenderer:Fg,Step:Tje,RenderHTMLJS:eje,JsonViewer:uje},props:{message:Object,avatar:""},data(){return{msg:null,isSpeaking:!1,speechSynthesis:null,voices:[],expanded:!1,showConfirmation:!1,editMsgMode:!1,deleteMsgMode:!1,mdRenderHeight:Number}},mounted(){"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."),be(()=>{ve.replace(),this.mdRenderHeight=this.$refs.mdRender.$el.offsetHeight})},methods:{onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let t=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(o=>o.name===this.$store.state.config.audio_out_voice)[0]);const n=o=>{let r=this.message.content.substring(o,o+e);const i=[".","!","?",` +`];let a=-1;return i.forEach(l=>{const d=r.lastIndexOf(l);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+o+1},s=()=>{if(this.message.content.includes(".")){const o=n(t),r=this.message.content.substring(t,o);this.msg.text=r,t=o+1,this.msg.onend=i=>{t{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",o))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{s()},1)};s()},toggleModel(){this.expanded=!this.expanded},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.editMsgMode=!1},resendMessage(){this.$emit("resendMessage",this.message.id,this.message.content)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?Mje+this.avatar:es},defaultImg(t){t.target.src=es},parseDate(t){let e=new Date(Date.parse(t)),s=Math.floor((new Date-e)/1e3);return s<=1?"just now":s<20?s+" seconds ago":s<40?"half a minute ago":s<60?"less than a minute ago":s<=90?"one minute ago":s<=3540?Math.round(s/60)+" minutes ago":s<=5400?"1 hour ago":s<=86400?Math.round(s/3600)+" hours ago":s<=129600?"1 day ago":s<604800?Math.round(s/86400)+" days ago":s<=777600?"1 week ago":t},prettyDate(t){let e=new Date((t||"").replace(/-/g,"/").replace(/[TZ]/g," ")),n=(new Date().getTime()-e.getTime())/1e3,s=Math.floor(n/86400);if(!(isNaN(s)||s<0||s>=31))return s==0&&(n<60&&"just now"||n<120&&"1 minute ago"||n<3600&&Math.floor(n/60)+" minutes ago"||n<7200&&"1 hour ago"||n<86400&&Math.floor(n/3600)+" hours ago")||s==1&&"Yesterday"||s<7&&s+" days ago"||s<31&&Math.ceil(s/7)+" weeks ago"},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{"message.content":function(t){this.$store.state.config.auto_speak&&(this.isSpeaking||this.checkForFullSentence())},showConfirmation(){be(()=>{ve.replace()})},editMsgMode(t){be(()=>{ve.replace()})},deleteMsgMode(){be(()=>{ve.replace()})}},computed:{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 t=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===t.getTime()||!e.getTime())return;let s=e.getTime()-t.getTime();const o=Math.floor(s/(1e3*60*60));s-=o*(1e3*60*60);const r=Math.floor(s/(1e3*60));s-=r*(1e3*60);const i=Math.floor(s/1e3);s-=i*1e3;function a(d){return d<10&&(d="0"+d),d}return a(o)+"h:"+a(r)+"m:"+a(i)+"s"}}},Rje={class:"relative 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"},Nje={class:"flex flex-row gap-2"},Dje={class:"flex-shrink-0"},Lje={class:"group/avatar"},Ije=["src","data-popover-target"],Pje={class:"flex flex-col w-full flex-grow-0"},Fje={class:"flex flex-row flex-grow items-start"},Bje={class:"flex flex-col mb-2"},$je={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},zje=["title"],jje=c("div",{class:"flex-grow"},null,-1),Uje={class:"flex-row justify-end mx-2"},qje={class:"invisible group-hover:visible flex flex-row"},Hje={key:0,class:"flex items-center duration-75"},Vje=c("i",{"data-feather":"x"},null,-1),Gje=[Vje],Kje=c("i",{"data-feather":"check"},null,-1),Wje=[Kje],Zje=c("i",{"data-feather":"edit"},null,-1),Yje=[Zje],Jje=c("i",{"data-feather":"copy"},null,-1),Qje=[Jje],Xje=c("i",{"data-feather":"refresh-cw"},null,-1),eUe=[Xje],tUe=c("i",{"data-feather":"fast-forward"},null,-1),nUe=[tUe],sUe={key:4,class:"flex items-center duration-75"},oUe=c("i",{"data-feather":"x"},null,-1),rUe=[oUe],iUe=c("i",{"data-feather":"check"},null,-1),aUe=[iUe],lUe=c("i",{"data-feather":"trash"},null,-1),cUe=[lUe],dUe=c("i",{"data-feather":"thumbs-up"},null,-1),uUe=[dUe],hUe={class:"flex flex-row items-center"},fUe=c("i",{"data-feather":"thumbs-down"},null,-1),pUe=[fUe],gUe={class:"flex flex-row items-center"},mUe=c("i",{"data-feather":"volume-2"},null,-1),_Ue=[mUe],bUe={class:"overflow-x-auto w-full"},yUe={class:"flex flex-col items-start w-full"},vUe={class:"flex flex-col items-start w-full"},wUe={key:2},xUe={class:"text-sm text-gray-400 mt-2"},kUe={class:"flex flex-row items-center gap-2"},EUe={key:0},CUe={class:"font-thin"},AUe={key:1},SUe={class:"font-thin"},TUe={key:2},MUe={class:"font-thin"},OUe={key:3},RUe=["title"];function NUe(t,e,n,s,o,r){const i=qe("Step"),a=qe("RenderHTMLJS"),l=qe("MarkdownRenderer"),d=qe("JsonViewer");return k(),C("div",Rje,[c("div",Nje,[c("div",Dje,[c("div",Lje,[c("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=u=>r.defaultImg(u)),"data-popover-target":"avatar"+n.message.id,"data-popover-placement":"bottom",class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,Ije)])]),c("div",Pje,[c("div",Fje,[c("div",Bje,[c("div",$je,H(n.message.sender)+" ",1),n.message.created_at?(k(),C("div",{key:0,class:"text-sm text-gray-400 font-thin",title:"Created at: "+r.created_at_parsed},H(r.created_at),9,zje)):P("",!0)]),jje,c("div",Uje,[c("div",qje,[o.editMsgMode?(k(),C("div",Hje,[c("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]=de(u=>o.editMsgMode=!1,["stop"]))},Gje),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Update message",type:"button",onClick:e[2]||(e[2]=de((...u)=>r.updateMessage&&r.updateMessage(...u),["stop"]))},Wje)])):P("",!0),o.editMsgMode?P("",!0):(k(),C("div",{key:1,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Edit message",onClick:e[3]||(e[3]=de(u=>o.editMsgMode=!0,["stop"]))},Yje)),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Copy message to clipboard",onClick:e[4]||(e[4]=de(u=>r.copyContentToClipboard(),["stop"]))},Qje),n.message.sender!=this.$store.state.mountedPers.name?(k(),C("div",{key:2,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Resend message",onClick:e[5]||(e[5]=de(u=>r.resendMessage(),["stop"]))},eUe)):P("",!0),n.message.sender==this.$store.state.mountedPers.name?(k(),C("div",{key:3,class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Resend message",onClick:e[6]||(e[6]=de(u=>r.continueMessage(),["stop"]))},nUe)):P("",!0),o.deleteMsgMode?(k(),C("div",sUe,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90 p-2",title:"Cancel removal",type:"button",onClick:e[7]||(e[7]=de(u=>o.deleteMsgMode=!1,["stop"]))},rUe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 p-2",title:"Confirm removal",type:"button",onClick:e[8]||(e[8]=de(u=>r.deleteMsg(),["stop"]))},aUe)])):P("",!0),o.deleteMsgMode?P("",!0):(k(),C("div",{key:5,class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2",title:"Remove message",onClick:e[9]||(e[9]=u=>o.deleteMsgMode=!0)},cUe)),c("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Upvote",onClick:e[10]||(e[10]=de(u=>r.rankUp(),["stop"]))},uUe),c("div",hUe,[c("div",{class:"text-lg hover:text-red-600 duration-75 active:scale-90 p-2",title:"Downvote",onClick:e[11]||(e[11]=de(u=>r.rankDown(),["stop"]))},pUe),n.message.rank!=0?(k(),C("div",{key:0,class:Me(["rounded-full px-2 text-sm flex items-center justify-center font-bold",n.message.rank>0?"bg-secondary":"bg-red-600"]),title:"Rank"},H(n.message.rank),3)):P("",!0)]),c("div",gUe,[c("div",{class:Me(["text-lg hover:text-red-600 duration-75 active:scale-90 p-2",{"text-red-500":r.isTalking}]),title:"speak",onClick:e[12]||(e[12]=de(u=>r.speak(),["stop"]))},_Ue,2)])])])]),c("div",bUe,[c("div",yUe,[(k(!0),C(Re,null,Ge(n.message.steps,(u,h)=>(k(),C("div",{key:"step-"+n.message.id+"-"+h,class:"step font-bold",style:yt({backgroundColor:u.done?"transparent":"inherit"})},[ue(i,{done:u.done,message:u.message,status:u.status},null,8,["done","message","status"])],4))),128))]),c("div",vUe,[(k(!0),C(Re,null,Ge(n.message.html_js_s,(u,h)=>(k(),C("div",{key:"htmljs-"+n.message.id+"-"+h,class:"htmljs font-bold",style:yt({backgroundColor:t.step.done?"transparent":"inherit"})},[ue(a,{htmlContent:u},null,8,["htmlContent"])],4))),128))]),o.editMsgMode?P("",!0):(k(),st(l,{key:0,ref:"mdRender","markdown-text":n.message.content},null,8,["markdown-text"])),o.editMsgMode?se((k(),C("textarea",{key:1,ref:"mdTextarea",rows:4,class:"block p-2.5 w-full text-sm 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",style:yt({minHeight:o.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[13]||(e[13]=u=>this.message.content=u)},null,4)),[[Oe,this.message.content]]):P("",!0),n.message.metadata!==null?(k(),C("div",wUe,[(k(!0),C(Re,null,Ge(n.message.metadata,(u,h)=>(k(),C("div",{key:"json-"+n.message.id+"-"+h,class:"json font-bold"},[ue(d,{jsonFormText:u.title,jsonData:u.content},null,8,["jsonFormText","jsonData"])]))),128))])):P("",!0)]),c("div",xUe,[c("div",kUe,[n.message.binding?(k(),C("p",EUe,[xe("Binding: "),c("span",CUe,H(n.message.binding),1)])):P("",!0),n.message.model?(k(),C("p",AUe,[xe("Model: "),c("span",SUe,H(n.message.model),1)])):P("",!0),n.message.seed?(k(),C("p",TUe,[xe("Seed: "),c("span",MUe,H(n.message.seed),1)])):P("",!0),r.time_spent?(k(),C("p",OUe,[xe("Time spent: "),c("span",{class:"font-thin",title:"Finished generating: "+r.finished_generating_at_parsed},H(r.time_spent),9,RUe)])):P("",!0)])])])])])}const qg=Ue(Oje,[["render",NUe]]),DUe="/";ye.defaults.baseURL="/";const LUe={name:"MountedPersonalities",props:{onShowPersList:Function,onReady:Function},components:{UniversalForm:wc},data(){return{bUrl:DUe,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(t){this.$store.commit("setConfig",t)}},mountedPers:{get(){return this.$store.state.mountedPers},set(t){this.$store.commit("setMountedPers",t)}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}}},methods:{onSettingsPersonality(t){try{ye.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 - "+t.name,"Save changes","Cancel").then(n=>{try{ye.post("/set_active_personality_settings",n).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. `+s,4,!1)})}catch(s){this.$refs.toast.showToast(`Did not get Personality settings responses. - Endpoint error: `+s.message,4,!1)}}):this.$refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},toggleShowPersList(){this.onShowPersList()},async constructor(){for(be(()=>{ve.replace()});this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));this.onReady()},async api_get_req(t){try{const e=await ye.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=es}}},PUe={class:"w-fit select-none"},FUe={key:0,class:"flex -space-x-4"},BUe=["src","title"],$Ue={key:1,class:"flex -space-x-4"},zUe=["src","title"],jUe={key:2,title:"Loading personalities"},UUe=c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1),qUe=[UUe];function HUe(t,e,n,s,o,r){const i=qe("UniversalForm");return k(),C(Re,null,[c("div",PUe,[r.mountedPersArr.length>1?(k(),C("div",FUe,[c("img",{src:o.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,BUe),c("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]=de((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+H(r.mountedPersArr.length-1),1)])):P("",!0),r.mountedPersArr.length==1?(k(),C("div",$Ue,[c("img",{src:o.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]=de((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"]))},null,40,zUe)])):P("",!0),r.mountedPersArr.length==0?(k(),C("div",jUe,qUe)):P("",!0)]),ue(i,{ref:"universalForm",class:"z-20"},null,512)],64)}const VUe=Ue(IUe,[["render",HUe]]);const GUe="/";ye.defaults.baseURL="/";const KUe={props:{onTalk:Function,onMountUnmount:Function,onRemount:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:jg,Toast:Ks,UniversalForm:wc},name:"MountedPersonalitiesList",data(){return{bUrl:GUe,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(t){this.$store.commit("setConfig",t)}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}}},methods:{toggleShowPersList(){this.onShowPersList()},toggleMountUnmount(){this.onMountUnmount(this)},async constructor(){},async api_get_req(t){try{const e=await ye.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=es},onPersonalityReinstall(t){console.log("on reinstall ",t),this.isLoading=!0,ye.post("/reinstall_personality",{name:t.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: `+s.message,4,!1)}}):this.$refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},toggleShowPersList(){this.onShowPersList()},async constructor(){for(be(()=>{ve.replace()});this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));this.onReady()},async api_get_req(t){try{const e=await ye.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=es}}},IUe={class:"w-fit select-none"},PUe={key:0,class:"flex -space-x-4"},FUe=["src","title"],BUe={key:1,class:"flex -space-x-4"},$Ue=["src","title"],zUe={key:2,title:"Loading personalities"},jUe=c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1),UUe=[jUe];function qUe(t,e,n,s,o,r){const i=qe("UniversalForm");return k(),C(Re,null,[c("div",IUe,[r.mountedPersArr.length>1?(k(),C("div",PUe,[c("img",{src:o.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,FUe),c("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]=de((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+H(r.mountedPersArr.length-1),1)])):P("",!0),r.mountedPersArr.length==1?(k(),C("div",BUe,[c("img",{src:o.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]=de((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"]))},null,40,$Ue)])):P("",!0),r.mountedPersArr.length==0?(k(),C("div",zUe,UUe)):P("",!0)]),ue(i,{ref:"universalForm",class:"z-20"},null,512)],64)}const HUe=Ue(LUe,[["render",qUe]]);const VUe="/";ye.defaults.baseURL="/";const GUe={props:{onTalk:Function,onMountUnmount:Function,onRemount:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:jg,Toast:Ks,UniversalForm:wc},name:"MountedPersonalitiesList",data(){return{bUrl:VUe,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(t){this.$store.commit("setConfig",t)}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return this.$store.state.mountedPersArr},set(t){this.$store.commit("setMountedPers",t)}}},methods:{toggleShowPersList(){this.onShowPersList()},toggleMountUnmount(){this.onMountUnmount(this)},async constructor(){},async api_get_req(t){try{const e=await ye.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=es},onPersonalityReinstall(t){console.log("on reinstall ",t),this.isLoading=!0,ye.post("/reinstall_personality",{name:t.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}))},onPersonalityMounted(t){this.configFile.personalities.includes(t.full_path)?this.configFile.personalities.length==1?this.$refs.toast.showToast("Can't unmount last personality",4,!1):this.unmountPersonality(t):this.mountPersonality(t)},onPersonalityRemount(t){this.reMountPersonality(t)},async handleOnTalk(t){if(ve.replace(),console.log("ppa",t),t){if(t.isMounted){const e=await this.select_personality(t);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality: `+t.name,4,!0))}else this.onPersonalityMounted(t);this.onTalk(t)}},async onPersonalitySelected(t){if(ve.replace(),console.log("ppa",t),t){if(t.selected){this.$refs.toast.showToast("Personality already selected",4,!0);return}if(t.isMounted){const e=await this.select_personality(t);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality: `+t.name,4,!0))}else this.onPersonalityMounted(t)}},onSettingsPersonality(t){try{ye.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 - "+t.personality.name,"Save changes","Cancel").then(n=>{try{ye.post("/set_active_personality_settings",n).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses. @@ -183,12 +183,12 @@ Error: `+e.error,4,!1))},async reMountPersonality(t){if(console.log("remount per `+t.personality.name,4,!0),this.getMountedPersonalities()):(t.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality Error: `+e.error,4,!1))},async unmountPersonality(t){if(!t)return;const e=await this.unmount_personality(t.personality||t);if(e.status){this.toggleMountUnmount(),console.log("unmount response",e),this.configFile.active_personality_id=e.active_personality_id,this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality unmounted",4,!0);const n=this.configFile.personalities[this.configFile.active_personality_id];console.log();const s=this.personalities.findIndex(a=>a.full_path==n),o=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==t.full_path);console.log("ppp",this.personalities[s]);const r=this.personalities[s];r.isMounted=!1,r.selected=!0,this.$refs.personalitiesZoo[o].isMounted=!1,this.getMountedPersonalities(),(await this.select_personality(r)).status&&this.$refs.toast.showToast(`Selected personality: `+r.name,4,!0)}else this.$refs.toast.showToast(`Could not unmount personality -Error: `+e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let t=[];console.log(this.configFile.personalities.length);for(let e=0;er.full_path==n),o=this.personalities[s];if(o)console.log("adding from config"),t.push(o);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),i=this.personalities[r];t.push(i)}}if(this.mountedPersArr=[],this.mountedPersArr=t,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;eo.full_path==n);if(console.log("discussionPersonalities -includes",s),console.log("discussionPersonalities -mounted list",this.mountedPersArr),s==-1){const o=this.personalities.findIndex(i=>i.full_path==n),r=this.personalities[o];console.log("adding discucc121",r,n),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},xc=t=>(ss("data-v-d93302b0"),t=t(),os(),t),WUe={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"},ZUe={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},YUe=xc(()=>c("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"},[c("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"}),c("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)),JUe=xc(()=>c("span",{class:"sr-only"},"Loading...",-1)),QUe=[YUe,JUe],XUe=xc(()=>c("i",{"data-feather":"chevron-down"},null,-1)),eqe=[XUe],tqe={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},nqe={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function sqe(t,e,n,s,o,r){const i=qe("personality-entry"),a=qe("Toast"),l=qe("UniversalForm");return k(),C("div",WUe,[o.isLoading?(k(),C("div",ZUe,QUe)):P("",!0),c("div",null,[r.mountedPersArr.length>0?(k(),C("div",{key:0,class:Me(o.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[c("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]=de((...d)=>r.toggleShowPersList&&r.toggleShowPersList(...d),["stop"]))},eqe),c("label",tqe," Mounted Personalities: ("+H(r.mountedPersArr.length)+") ",1),c("div",nqe,[ue(Ut,{name:"bounce"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(this.$store.state.mountedPersArr,(d,u)=>(k(),st(i,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+u+"-"+d.name,personality:d,full_path:d.full_path,selected:r.configFile.personalities[r.configFile.active_personality_id]===d.full_path,"on-selected":r.onPersonalitySelected,"on-mounted":r.onPersonalityMounted,"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-mounted","on-remount","on-settings","on-reinstall","on-talk"]))),128))]),_:1})])],2)):P("",!0)]),ue(a,{ref:"toast"},null,512),ue(l,{ref:"universalForm",class:"z-20"},null,512)])}const oqe=Ue(KUe,[["render",sqe],["__scopeId","data-v-d93302b0"]]);const rqe={components:{InteractiveMenu:zg},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(()=>{ve.replace()})},methods:{isHTML(t){const n=new DOMParser().parseFromString(t,"text/html");return Array.from(n.body.childNodes).some(s=>s.nodeType===Node.ELEMENT_NODE)},selectFile(t,e){const n=document.createElement("input");n.type="file",n.accept=t,n.onchange=s=>{this.selectedFile=s.target.files[0],console.log("File selected"),e()},n.click()},uploadFile(){new FormData().append("file",this.selectedFile),console.log("Uploading file"),this.loading=!0;const e=new FileReader;e.onload=()=>{const n={filename:this.selectedFile.name,fileData:e.result};Ee.on("file_received",s=>{s.status?this.onShowToastMessage("File uploaded successfully",4,!0):this.onShowToastMessage(`Couldn't upload file -`+s.error,4,!1),this.loading=!1,Ee.off("file_received")}),Ee.emit("send_file",n)},e.readAsDataURL(this.selectedFile)},async constructor(){nextTick(()=>{ve.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(t){this.showMenu=!this.showMenu,t.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(t.hasOwnProperty("file_types")?t.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(t.value)},handleClickOutside(t){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(t.target)&&(this.showMenu=!1)}},mounted(){this.commands=this.commandsList,document.addEventListener("click",this.handleClickOutside)},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},iqe=t=>(ss("data-v-52cfa09c"),t=t(),os(),t),aqe={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},lqe=iqe(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),cqe=[lqe];function dqe(t,e,n,s,o,r){const i=qe("InteractiveMenu");return o.loading?(k(),C("div",aqe,cqe)):(k(),st(i,{key:1,commands:n.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const uqe=Ue(rqe,[["render",dqe],["__scopeId","data-v-52cfa09c"]]);const hqe={name:"ChatBox",emits:["messageSentEvent","stopGenerating"],props:{onTalk:Function,discussionList:Array,loading:!1,onShowToastMessage:Function},components:{Toast:Ks,MountedPersonalities:VUe,MountedPersonalitiesList:oqe,PersonalitiesCommands:uqe},setup(){},data(){return{message:"",selecting_model:!1,selectedModel:"",models:{},isLesteningToVoice:!1,fileList:[],isFileSentList:[],totalSize:0,showFileList:!0,showPersonalities:!1,personalities_ready:!1}},computed:{config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},allDiscussionPersonalities(){if(this.discussionList.length>0){let t=[];for(let e=0;e{console.log(t),this.$refs.toast.showToast(`Model changed to ${this.selectedModel}`,4,!0),this.selecting_model=!1}).catch(t=>{this.$refs.toast.showToast(`Error ${t}`,4,!0),this.selecting_model=!1})},clear_files(){fileList=[],isFileSentList=[]},send_file(t){new FormData().append("file",t),console.log("Uploading file");const n=new FileReader;n.onload=()=>{const s={filename:t.name,fileData:n.result};Ee.on("file_received",o=>{if(o.status){console.log(o.filename);let r=this.fileList.findIndex(i=>i.name===o.filename);r>=0?(this.isFileSentList[r]=!0,console.log(this.isFileSentList)):console.log("Not found"),this.onShowToastMessage("File uploaded successfully",4,!0)}else this.onShowToastMessage(`Couldn't upload file -`+o.error,4,!1);Ee.off("file_received")}),Ee.emit("send_file",s)},n.readAsDataURL(t)},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=t=>{let e="";for(let n=t.resultIndex;n{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=t=>{console.error("Speech recognition error:",t.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(t){this.showPersonalities=!this.showPersonalities},handleOnTalk(t){this.showPersonalities=!1,this.onTalk(t)},onMountUnmountFun(t){console.log("Mounting/unmounting chat"),this.$refs.mountedPers.constructor()},onRemount(t){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(t){return be(()=>{ve.replace()}),Gt(t)},removeItem(t){this.fileList=this.fileList.filter(e=>e!=t)},sendMessageEvent(t){this.fileList=[],this.$emit("messageSentEvent",t)},submitOnEnter(t){t.which===13&&(t.preventDefault(),t.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(t){this.fileList=this.fileList.concat([...t.target.files]),this.isFileSentList=this.isFileSentList.concat([!1]*this.fileList.length),this.send_file(this.fileList[this.fileList.length-1])}},watch:{showFileList(){be(()=>{ve.replace()})},loading(t,e){be(()=>{ve.replace()})},fileList:{handler(t,e){let n=0;if(t.length>0)for(let s=0;s{console.log("List models "+t.data),this.models=t.data,ye.get("get_active_model").then(e=>{console.log("Active model "+JSON.stringify(e.data)),e.data!=null&&(this.selectedModel=e.data.model)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,4,!1)}),be(()=>{ve.replace()})},activated(){be(()=>{ve.replace()})}},ht=t=>(ss("data-v-5cc493ac"),t=t(),os(),t),fqe={class:"absolute bottom-0 min-w-96 w-full justify-center text-center p-4"},pqe={key:0,class:"flex items-center justify-center w-full"},gqe={class:"flex flex-row p-2 rounded-t-lg"},mqe=ht(()=>c("label",{for:"chat",class:"sr-only"},"Send message",-1)),_qe={class:"px-3 py-3 rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel shadow-lg"},bqe={class:"flex flex-col gap-2"},yqe={class:"flex"},vqe=["title"],wqe=ht(()=>c("i",{"data-feather":"list"},null,-1)),xqe=[wqe],kqe={key:0},Eqe={key:0,class:"flex flex-col max-h-64"},Cqe=["title"],Aqe={class:"flex flex-row items-center gap-1 text-left p-2 text-sm font-medium bg-bg-dark-tone-panel dark:bg-bg-dark-tone rounded-lg hover:bg-primary dark:hover:bg-primary"},Sqe={key:0,fileList:"",role:"status"},Tqe=ht(()=>c("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"},[c("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"}),c("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)),Mqe=ht(()=>c("span",{class:"sr-only"},"Loading...",-1)),Oqe=[Tqe,Mqe],Rqe=ht(()=>c("div",null,[c("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),Nqe={class:"line-clamp-1 w-3/5"},Dqe=ht(()=>c("div",{class:"grow"},null,-1)),Lqe={class:"flex flex-row items-center"},Iqe={class:"whitespace-nowrap"},Pqe=["onClick"],Fqe=ht(()=>c("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)),Bqe=[Fqe],$qe={key:1,class:"flex items-center mx-1"},zqe={class:"whitespace-nowrap flex flex-row gap-2"},jqe=ht(()=>c("p",{class:"font-bold"}," Total size: ",-1)),Uqe=ht(()=>c("div",{class:"grow"},null,-1)),qqe=ht(()=>c("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)),Hqe=[qqe],Vqe={key:2,class:"mx-1"},Gqe={class:"flex flex-row flex-grow items-center gap-2 overflow-visible"},Kqe=["value"],Wqe={key:0,title:"Selecting model",class:"flex flex-row flex-grow justify-end"},Zqe=ht(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Selecting model...")],-1)),Yqe=[Zqe],Jqe={class:"w-fit"},Qqe={class:"w-fit"},Xqe={class:"relative grow"},eHe=ht(()=>c("i",{"data-feather":"file-plus"},null,-1)),tHe=[eHe],nHe={class:"inline-flex justify-center rounded-full"},sHe=ht(()=>c("i",{"data-feather":"mic"},null,-1)),oHe=[sHe],rHe=ht(()=>c("i",{"data-feather":"send"},null,-1)),iHe=ht(()=>c("span",{class:"sr-only"},"Send message",-1)),aHe=[rHe,iHe],lHe={key:1,title:"Waiting for reply"},cHe=ht(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),dHe=[cHe];function uHe(t,e,n,s,o,r){const i=qe("MountedPersonalitiesList"),a=qe("MountedPersonalities"),l=qe("PersonalitiesCommands"),d=qe("Toast");return k(),C(Re,null,[c("div",fqe,[n.loading?(k(),C("div",pqe,[c("div",gqe,[c("button",{type:"button",class:"bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel hover:bg-bg-light-tone 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[0]||(e[0]=de((...u)=>r.stopGenerating&&r.stopGenerating(...u),["stop"]))}," Stop generating ")])])):P("",!0),c("form",null,[mqe,c("div",_qe,[c("div",bqe,[c("div",yqe,[o.fileList.length>0?(k(),C("button",{key:0,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:o.showFileList?"Hide file list":"Show file list",type:"button",onClick:e[1]||(e[1]=de(u=>o.showFileList=!o.showFileList,["stop"]))},xqe,8,vqe)):P("",!0)]),o.fileList.length>0&&o.showFileList==!0?(k(),C("div",kqe,[o.fileList.length>0?(k(),C("div",Eqe,[ue(Ut,{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:Ne(()=>[(k(!0),C(Re,null,Ge(o.fileList,(u,h)=>(k(),C("div",{key:h+"-"+u.name},[c("div",{class:"m-1",title:u.name},[c("div",Aqe,[o.isFileSentList[h]?P("",!0):(k(),C("div",Sqe,Oqe)),Rqe,c("div",Nqe,H(u.name),1),Dqe,c("div",Lqe,[c("p",Iqe,H(r.computedFileSize(u.size)),1),c("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(u)},Bqe,8,Pqe)])])],8,Cqe)]))),128))]),_:1})])):P("",!0)])):P("",!0),o.fileList.length>0?(k(),C("div",$qe,[c("div",zqe,[jqe,xe(" "+H(o.totalSize)+" ("+H(o.fileList.length)+") ",1)]),Uqe,c("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[2]||(e[2]=(...u)=>r.clear_files&&r.clear_files(...u))},Hqe)])):P("",!0),o.showPersonalities?(k(),C("div",Vqe,[ue(i,{ref:"mountedPersList",onShowPersList:r.onShowPersListFun,"on-mount-unmount":r.onMountUnmountFun,"on-remount":r.onRemount,"on-talk":r.handleOnTalk,discussionPersonalities:r.allDiscussionPersonalities},null,8,["onShowPersList","on-mount-unmount","on-remount","on-talk","discussionPersonalities"])])):P("",!0),c("div",Gqe,[se(c("select",{"onUpdate:modelValue":e[3]||(e[3]=u=>o.selectedModel=u),onChange:e[4]||(e[4]=(...u)=>r.setModel&&r.setModel(...u)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-0"},[(k(!0),C(Re,null,Ge(o.models,u=>(k(),C("option",{key:u,value:u},H(u),9,Kqe))),128))],544),[[on,o.selectedModel]]),o.selecting_model?(k(),C("div",Wqe,Yqe)):P("",!0),c("div",Jqe,[ue(a,{ref:"mountedPers",onShowPersList:r.onShowPersListFun,onReady:r.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])]),c("div",Qqe,[o.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(k(),st(l,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:r.sendMessageEvent,"on-show-toast-message":n.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):P("",!0)]),c("div",Xqe,[se(c("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[5]||(e[5]=u=>o.message=u),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]=Ja(de(u=>r.submitOnEnter(u),["exact"]),["enter"]))},`\r +Error: `+e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let t=[];console.log(this.configFile.personalities.length);for(let e=0;er.full_path==n),o=this.personalities[s];if(o)console.log("adding from config"),t.push(o);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),i=this.personalities[r];t.push(i)}}if(this.mountedPersArr=[],this.mountedPersArr=t,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;eo.full_path==n);if(console.log("discussionPersonalities -includes",s),console.log("discussionPersonalities -mounted list",this.mountedPersArr),s==-1){const o=this.personalities.findIndex(i=>i.full_path==n),r=this.personalities[o];console.log("adding discucc121",r,n),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},xc=t=>(ss("data-v-d93302b0"),t=t(),os(),t),KUe={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"},WUe={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},ZUe=xc(()=>c("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"},[c("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"}),c("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)),YUe=xc(()=>c("span",{class:"sr-only"},"Loading...",-1)),JUe=[ZUe,YUe],QUe=xc(()=>c("i",{"data-feather":"chevron-down"},null,-1)),XUe=[QUe],eqe={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},tqe={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function nqe(t,e,n,s,o,r){const i=qe("personality-entry"),a=qe("Toast"),l=qe("UniversalForm");return k(),C("div",KUe,[o.isLoading?(k(),C("div",WUe,JUe)):P("",!0),c("div",null,[r.mountedPersArr.length>0?(k(),C("div",{key:0,class:Me(o.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[c("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]=de((...d)=>r.toggleShowPersList&&r.toggleShowPersList(...d),["stop"]))},XUe),c("label",eqe," Mounted Personalities: ("+H(r.mountedPersArr.length)+") ",1),c("div",tqe,[ue(Ut,{name:"bounce"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(this.$store.state.mountedPersArr,(d,u)=>(k(),st(i,{ref_for:!0,ref:"personalitiesZoo",key:"index-"+u+"-"+d.name,personality:d,full_path:d.full_path,selected:r.configFile.personalities[r.configFile.active_personality_id]===d.full_path,"on-selected":r.onPersonalitySelected,"on-mounted":r.onPersonalityMounted,"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-mounted","on-remount","on-settings","on-reinstall","on-talk"]))),128))]),_:1})])],2)):P("",!0)]),ue(a,{ref:"toast"},null,512),ue(l,{ref:"universalForm",class:"z-20"},null,512)])}const sqe=Ue(GUe,[["render",nqe],["__scopeId","data-v-d93302b0"]]);const oqe={components:{InteractiveMenu:zg},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(()=>{ve.replace()})},methods:{isHTML(t){const n=new DOMParser().parseFromString(t,"text/html");return Array.from(n.body.childNodes).some(s=>s.nodeType===Node.ELEMENT_NODE)},selectFile(t,e){const n=document.createElement("input");n.type="file",n.accept=t,n.onchange=s=>{this.selectedFile=s.target.files[0],console.log("File selected"),e()},n.click()},uploadFile(){new FormData().append("file",this.selectedFile),console.log("Uploading file"),this.loading=!0;const e=new FileReader;e.onload=()=>{const n={filename:this.selectedFile.name,fileData:e.result};Ee.on("file_received",s=>{s.status?this.onShowToastMessage("File uploaded successfully",4,!0):this.onShowToastMessage(`Couldn't upload file +`+s.error,4,!1),this.loading=!1,Ee.off("file_received")}),Ee.emit("send_file",n)},e.readAsDataURL(this.selectedFile)},async constructor(){nextTick(()=>{ve.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(t){this.showMenu=!this.showMenu,t.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(t.hasOwnProperty("file_types")?t.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(t.value)},handleClickOutside(t){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(t.target)&&(this.showMenu=!1)}},mounted(){this.commands=this.commandsList,document.addEventListener("click",this.handleClickOutside)},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},rqe=t=>(ss("data-v-52cfa09c"),t=t(),os(),t),iqe={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},aqe=rqe(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),lqe=[aqe];function cqe(t,e,n,s,o,r){const i=qe("InteractiveMenu");return o.loading?(k(),C("div",iqe,lqe)):(k(),st(i,{key:1,commands:n.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const dqe=Ue(oqe,[["render",cqe],["__scopeId","data-v-52cfa09c"]]);const uqe={name:"ChatBox",emits:["messageSentEvent","stopGenerating"],props:{onTalk:Function,discussionList:Array,loading:!1,onShowToastMessage:Function},components:{Toast:Ks,MountedPersonalities:HUe,MountedPersonalitiesList:sqe,PersonalitiesCommands:dqe},setup(){},data(){return{message:"",selecting_model:!1,selectedModel:"",models:{},isLesteningToVoice:!1,fileList:[],isFileSentList:[],totalSize:0,showFileList:!0,showPersonalities:!1,personalities_ready:!1}},computed:{config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},allDiscussionPersonalities(){if(this.discussionList.length>0){let t=[];for(let e=0;e{console.log(t),this.$refs.toast.showToast(`Model changed to ${this.selectedModel}`,4,!0),this.selecting_model=!1}).catch(t=>{this.$refs.toast.showToast(`Error ${t}`,4,!0),this.selecting_model=!1})},clear_files(){fileList=[],isFileSentList=[]},send_file(t){new FormData().append("file",t),console.log("Uploading file");const n=new FileReader;n.onload=()=>{const s={filename:t.name,fileData:n.result};Ee.on("file_received",o=>{if(o.status){console.log(o.filename);let r=this.fileList.findIndex(i=>i.name===o.filename);r>=0?(this.isFileSentList[r]=!0,console.log(this.isFileSentList)):console.log("Not found"),this.onShowToastMessage("File uploaded successfully",4,!0)}else this.onShowToastMessage(`Couldn't upload file +`+o.error,4,!1);Ee.off("file_received")}),Ee.emit("send_file",s)},n.readAsDataURL(t)},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=t=>{let e="";for(let n=t.resultIndex;n{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=t=>{console.error("Speech recognition error:",t.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(t){this.showPersonalities=!this.showPersonalities},handleOnTalk(t){this.showPersonalities=!1,this.onTalk(t)},onMountUnmountFun(t){console.log("Mounting/unmounting chat"),this.$refs.mountedPers.constructor()},onRemount(t){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(t){return be(()=>{ve.replace()}),Gt(t)},removeItem(t){this.fileList=this.fileList.filter(e=>e!=t)},sendMessageEvent(t){this.fileList=[],this.$emit("messageSentEvent",t)},submitOnEnter(t){t.which===13&&(t.preventDefault(),t.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(t){this.fileList=this.fileList.concat([...t.target.files]),this.isFileSentList=this.isFileSentList.concat([!1]*this.fileList.length),this.send_file(this.fileList[this.fileList.length-1])}},watch:{showFileList(){be(()=>{ve.replace()})},loading(t,e){be(()=>{ve.replace()})},fileList:{handler(t,e){let n=0;if(t.length>0)for(let s=0;s{console.log("List models "+t.data),this.models=t.data,ye.get("get_active_model").then(e=>{console.log("Active model "+JSON.stringify(e.data)),e.data!=null&&(this.selectedModel=e.data.model)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,4,!1)}),be(()=>{ve.replace()})},activated(){be(()=>{ve.replace()})}},ht=t=>(ss("data-v-5cc493ac"),t=t(),os(),t),hqe={class:"absolute bottom-0 min-w-96 w-full justify-center text-center p-4"},fqe={key:0,class:"flex items-center justify-center w-full"},pqe={class:"flex flex-row p-2 rounded-t-lg"},gqe=ht(()=>c("label",{for:"chat",class:"sr-only"},"Send message",-1)),mqe={class:"px-3 py-3 rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel shadow-lg"},_qe={class:"flex flex-col gap-2"},bqe={class:"flex"},yqe=["title"],vqe=ht(()=>c("i",{"data-feather":"list"},null,-1)),wqe=[vqe],xqe={key:0},kqe={key:0,class:"flex flex-col max-h-64"},Eqe=["title"],Cqe={class:"flex flex-row items-center gap-1 text-left p-2 text-sm font-medium bg-bg-dark-tone-panel dark:bg-bg-dark-tone rounded-lg hover:bg-primary dark:hover:bg-primary"},Aqe={key:0,fileList:"",role:"status"},Sqe=ht(()=>c("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"},[c("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"}),c("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)),Tqe=ht(()=>c("span",{class:"sr-only"},"Loading...",-1)),Mqe=[Sqe,Tqe],Oqe=ht(()=>c("div",null,[c("i",{"data-feather":"file",class:"w-5 h-5"})],-1)),Rqe={class:"line-clamp-1 w-3/5"},Nqe=ht(()=>c("div",{class:"grow"},null,-1)),Dqe={class:"flex flex-row items-center"},Lqe={class:"whitespace-nowrap"},Iqe=["onClick"],Pqe=ht(()=>c("i",{"data-feather":"x",class:"w-5 h-5"},null,-1)),Fqe=[Pqe],Bqe={key:1,class:"flex items-center mx-1"},$qe={class:"whitespace-nowrap flex flex-row gap-2"},zqe=ht(()=>c("p",{class:"font-bold"}," Total size: ",-1)),jqe=ht(()=>c("div",{class:"grow"},null,-1)),Uqe=ht(()=>c("i",{"data-feather":"trash",class:"w-5 h-5"},null,-1)),qqe=[Uqe],Hqe={key:2,class:"mx-1"},Vqe={class:"flex flex-row flex-grow items-center gap-2 overflow-visible"},Gqe=["value"],Kqe={key:0,title:"Selecting model",class:"flex flex-row flex-grow justify-end"},Wqe=ht(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Selecting model...")],-1)),Zqe=[Wqe],Yqe={class:"w-fit"},Jqe={class:"w-fit"},Qqe={class:"relative grow"},Xqe=ht(()=>c("i",{"data-feather":"file-plus"},null,-1)),eHe=[Xqe],tHe={class:"inline-flex justify-center rounded-full"},nHe=ht(()=>c("i",{"data-feather":"mic"},null,-1)),sHe=[nHe],oHe=ht(()=>c("i",{"data-feather":"send"},null,-1)),rHe=ht(()=>c("span",{class:"sr-only"},"Send message",-1)),iHe=[oHe,rHe],aHe={key:1,title:"Waiting for reply"},lHe=ht(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),cHe=[lHe];function dHe(t,e,n,s,o,r){const i=qe("MountedPersonalitiesList"),a=qe("MountedPersonalities"),l=qe("PersonalitiesCommands"),d=qe("Toast");return k(),C(Re,null,[c("div",hqe,[n.loading?(k(),C("div",fqe,[c("div",pqe,[c("button",{type:"button",class:"bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel hover:bg-bg-light-tone 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[0]||(e[0]=de((...u)=>r.stopGenerating&&r.stopGenerating(...u),["stop"]))}," Stop generating ")])])):P("",!0),c("form",null,[gqe,c("div",mqe,[c("div",_qe,[c("div",bqe,[o.fileList.length>0?(k(),C("button",{key:0,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:o.showFileList?"Hide file list":"Show file list",type:"button",onClick:e[1]||(e[1]=de(u=>o.showFileList=!o.showFileList,["stop"]))},wqe,8,yqe)):P("",!0)]),o.fileList.length>0&&o.showFileList==!0?(k(),C("div",xqe,[o.fileList.length>0?(k(),C("div",kqe,[ue(Ut,{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:Ne(()=>[(k(!0),C(Re,null,Ge(o.fileList,(u,h)=>(k(),C("div",{key:h+"-"+u.name},[c("div",{class:"m-1",title:u.name},[c("div",Cqe,[o.isFileSentList[h]?P("",!0):(k(),C("div",Aqe,Mqe)),Oqe,c("div",Rqe,H(u.name),1),Nqe,c("div",Dqe,[c("p",Lqe,H(r.computedFileSize(u.size)),1),c("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(u)},Fqe,8,Iqe)])])],8,Eqe)]))),128))]),_:1})])):P("",!0)])):P("",!0),o.fileList.length>0?(k(),C("div",Bqe,[c("div",$qe,[zqe,xe(" "+H(o.totalSize)+" ("+H(o.fileList.length)+") ",1)]),jqe,c("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[2]||(e[2]=(...u)=>r.clear_files&&r.clear_files(...u))},qqe)])):P("",!0),o.showPersonalities?(k(),C("div",Hqe,[ue(i,{ref:"mountedPersList",onShowPersList:r.onShowPersListFun,"on-mount-unmount":r.onMountUnmountFun,"on-remount":r.onRemount,"on-talk":r.handleOnTalk,discussionPersonalities:r.allDiscussionPersonalities},null,8,["onShowPersList","on-mount-unmount","on-remount","on-talk","discussionPersonalities"])])):P("",!0),c("div",Vqe,[se(c("select",{"onUpdate:modelValue":e[3]||(e[3]=u=>o.selectedModel=u),onChange:e[4]||(e[4]=(...u)=>r.setModel&&r.setModel(...u)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-0"},[(k(!0),C(Re,null,Ge(o.models,u=>(k(),C("option",{key:u,value:u},H(u),9,Gqe))),128))],544),[[on,o.selectedModel]]),o.selecting_model?(k(),C("div",Kqe,Zqe)):P("",!0),c("div",Yqe,[ue(a,{ref:"mountedPers",onShowPersList:r.onShowPersListFun,onReady:r.onPersonalitiesReadyFun},null,8,["onShowPersList","onReady"])]),c("div",Jqe,[o.personalities_ready&&this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands!=""?(k(),st(l,{key:0,commandsList:this.$store.state.mountedPersArr[this.$store.state.config.active_personality_id].commands,sendCommand:r.sendMessageEvent,"on-show-toast-message":n.onShowToastMessage,ref:"personalityCMD"},null,8,["commandsList","sendCommand","on-show-toast-message"])):P("",!0)]),c("div",Qqe,[se(c("textarea",{id:"chat",rows:"1","onUpdate:modelValue":e[5]||(e[5]=u=>o.message=u),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]=Ja(de(u=>r.submitOnEnter(u),["exact"]),["enter"]))},`\r \r \r - `,544),[[Oe,o.message]]),c("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:e[7]||(e[7]=(...u)=>r.addFiles&&r.addFiles(...u)),multiple:""},null,544),c("button",{type:"button",onClick:e[8]||(e[8]=de(u=>t.$refs.fileDialog.click(),["stop"])),title:"Add files",class:"absolute inset-y-0 right-0 flex items-center mr-2 w-6 hover:text-secondary duration-75 active:scale-90"},tHe)]),c("div",nHe,[c("button",{type:"button",onClick:e[9]||(e[9]=(...u)=>r.startSpeechRecognition&&r.startSpeechRecognition(...u)),class:Me([{"text-red-500":o.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},oHe,2),n.loading?P("",!0):(k(),C("button",{key:0,type:"button",onClick:e[10]||(e[10]=(...u)=>r.submit&&r.submit(...u)),class:"w-6 hover:text-secondary duration-75 active:scale-90"},aHe)),n.loading?(k(),C("div",lHe,dHe)):P("",!0)])])])])])]),ue(d,{ref:"toast"},null,512)],64)}const Hg=Ue(hqe,[["render",uHe],["__scopeId","data-v-5cc493ac"]]),hHe={name:"WelcomeComponent",setup(){return{}}},fHe={class:"flex flex-col text-center"},pHe=rs('
Logo

Lord of Large Language Models

One tool to rule them all


Welcome

Please create a new discussion or select existing one to start

',1),gHe=[pHe];function mHe(t,e,n,s,o,r){return k(),C("div",fHe,gHe)}const Vg=Ue(hHe,[["render",mHe]]);const _He={setup(){return{}},name:"DragDrop",emits:["panelLeave","panelDrop"],data(){return{fileList:[],show:!1,dropRelease:!1}},mounted(){be(()=>{ve.replace()})},methods:{async panelDrop(t){const e="getAsFileSystemHandle"in DataTransferItem.prototype,n="webkitGetAsEntry"in DataTransferItem.prototype;if(!e&&!n)return;const s=[...t.dataTransfer.items].filter(r=>r.kind==="file").map(r=>e?r.getAsFileSystemHandle():r.webkitGetAsEntry());let o=[];for await(const r of s)(r.kind==="directory"||r.isDirectory)&&o.push(r.name);this.dropRelease=!0,t.dataTransfer.files.length>0&&[...t.dataTransfer.files].forEach(r=>{o.includes(r.name)||this.fileList.push(r)}),be(()=>{ve.replace()}),this.$emit("panelDrop",this.fileList),this.fileList=[],this.show=!1},panelLeave(){this.$emit("panelLeave"),console.log("exit/leave"),this.dropRelease=!1,this.show=!1,be(()=>{ve.replace()})}}},bHe={class:"text-4xl text-center"};function yHe(t,e,n,s,o,r){return k(),st(Ut,{name:"list",tag:"div"},{default:Ne(()=>[o.show?(k(),C("div",{key:"dropmenu",class:"select-none text-slate-50 absolute top-0 left-0 right-0 bottom-0 flex flex-col items-center justify-center bg-black bg-opacity-50 duration-200 backdrop-blur-sm",onDragleave:e[0]||(e[0]=de(i=>r.panelLeave(i),["prevent"])),onDrop:e[1]||(e[1]=de(i=>r.panelDrop(i),["stop","prevent"]))},[c("div",{class:Me(["flex flex-col items-center justify-center p-8 rounded-lg shadow-lg border-dashed border-4 border-secondary w-4/5 h-4/5",o.dropRelease?"":"pointer-events-none"])},[c("div",bHe,[xr(t.$slots,"default",{},()=>[xe(" Drop your files here ")])])],2)],32)):P("",!0)]),_:3})}const bl=Ue(_He,[["render",yHe]]);var vHe=function(){function t(e,n){n===void 0&&(n=[]),this._eventType=e,this._eventFunctions=n}return t.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(n){typeof window<"u"&&window.addEventListener(e._eventType,n)})},t}(),Nr=globalThis&&globalThis.__assign||function(){return Nr=Object.assign||function(t){for(var e,n=1,s=arguments.length;n"u")return!1;var e=wt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function DHe(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var s=e.styles[n]||{},o=e.attributes[n]||{},r=e.elements[n];!Tt(r)||!Jt(r)||(Object.assign(r.style,s),Object.keys(o).forEach(function(i){var a=o[i];a===!1?r.removeAttribute(i):r.setAttribute(i,a===!0?"":a)}))})}function LHe(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(s){var o=e.elements[s],r=e.attributes[s]||{},i=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:n[s]),a=i.reduce(function(l,d){return l[d]="",l},{});!Tt(o)||!Jt(o)||(Object.assign(o.style,a),Object.keys(r).forEach(function(l){o.removeAttribute(l)}))})}}const IHe={name:"applyStyles",enabled:!0,phase:"write",fn:DHe,effect:LHe,requires:["computeStyles"]};function Wt(t){return t.split("-")[0]}var Qn=Math.max,Pr=Math.min,Ps=Math.round;function yl(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function nm(){return!/^((?!chrome|android).)*safari/i.test(yl())}function Fs(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var s=t.getBoundingClientRect(),o=1,r=1;e&&Tt(t)&&(o=t.offsetWidth>0&&Ps(s.width)/t.offsetWidth||1,r=t.offsetHeight>0&&Ps(s.height)/t.offsetHeight||1);var i=ts(t)?wt(t):window,a=i.visualViewport,l=!nm()&&n,d=(s.left+(l&&a?a.offsetLeft:0))/o,u=(s.top+(l&&a?a.offsetTop:0))/r,h=s.width/o,f=s.height/r;return{width:h,height:f,top:u,right:d+h,bottom:u+f,left:d,x:d,y:u}}function Cc(t){var e=Fs(t),n=t.offsetWidth,s=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:s}}function sm(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Ec(n)){var s=e;do{if(s&&t.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function un(t){return wt(t).getComputedStyle(t)}function PHe(t){return["table","td","th"].indexOf(Jt(t))>=0}function Ln(t){return((ts(t)?t.ownerDocument:t.document)||window.document).documentElement}function xi(t){return Jt(t)==="html"?t:t.assignedSlot||t.parentNode||(Ec(t)?t.host:null)||Ln(t)}function Nh(t){return!Tt(t)||un(t).position==="fixed"?null:t.offsetParent}function FHe(t){var e=/firefox/i.test(yl()),n=/Trident/i.test(yl());if(n&&Tt(t)){var s=un(t);if(s.position==="fixed")return null}var o=xi(t);for(Ec(o)&&(o=o.host);Tt(o)&&["html","body"].indexOf(Jt(o))<0;){var r=un(o);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 o;o=o.parentNode}return null}function zo(t){for(var e=wt(t),n=Nh(t);n&&PHe(n)&&un(n).position==="static";)n=Nh(n);return n&&(Jt(n)==="html"||Jt(n)==="body"&&un(n).position==="static")?e:n||FHe(t)||e}function Ac(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function fo(t,e,n){return Qn(t,Pr(e,n))}function BHe(t,e,n){var s=fo(t,e,n);return s>n?n:s}function om(){return{top:0,right:0,bottom:0,left:0}}function rm(t){return Object.assign({},om(),t)}function im(t,e){return e.reduce(function(n,s){return n[s]=t,n},{})}var $He=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,rm(typeof e!="number"?e:im(e,$o))};function zHe(t){var e,n=t.state,s=t.name,o=t.options,r=n.elements.arrow,i=n.modifiersData.popperOffsets,a=Wt(n.placement),l=Ac(a),d=[mt,Rt].indexOf(a)>=0,u=d?"height":"width";if(!(!r||!i)){var h=$He(o.padding,n),f=Cc(r),g=l==="y"?gt:mt,m=l==="y"?Ot:Rt,_=n.rects.reference[u]+n.rects.reference[l]-i[l]-n.rects.popper[u],p=i[l]-n.rects.reference[l],b=zo(r),y=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,x=_/2-p/2,S=h[g],R=y-f[u]-h[m],O=y/2-f[u]/2+x,D=fo(S,O,R),v=l;n.modifiersData[s]=(e={},e[v]=D,e.centerOffset=D-O,e)}}function jHe(t){var e=t.state,n=t.options,s=n.element,o=s===void 0?"[data-popper-arrow]":s;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||sm(e.elements.popper,o)&&(e.elements.arrow=o))}const UHe={name:"arrow",enabled:!0,phase:"main",fn:zHe,effect:jHe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Bs(t){return t.split("-")[1]}var qHe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function HHe(t,e){var n=t.x,s=t.y,o=e.devicePixelRatio||1;return{x:Ps(n*o)/o||0,y:Ps(s*o)/o||0}}function Dh(t){var e,n=t.popper,s=t.popperRect,o=t.placement,r=t.variation,i=t.offsets,a=t.position,l=t.gpuAcceleration,d=t.adaptive,u=t.roundOffsets,h=t.isFixed,f=i.x,g=f===void 0?0:f,m=i.y,_=m===void 0?0:m,p=typeof u=="function"?u({x:g,y:_}):{x:g,y:_};g=p.x,_=p.y;var b=i.hasOwnProperty("x"),y=i.hasOwnProperty("y"),x=mt,S=gt,R=window;if(d){var O=zo(n),D="clientHeight",v="clientWidth";if(O===wt(n)&&(O=Ln(n),un(O).position!=="static"&&a==="absolute"&&(D="scrollHeight",v="scrollWidth")),O=O,o===gt||(o===mt||o===Rt)&&r===Ro){S=Ot;var E=h&&O===R&&R.visualViewport?R.visualViewport.height:O[D];_-=E-s.height,_*=l?1:-1}if(o===mt||(o===gt||o===Ot)&&r===Ro){x=Rt;var M=h&&O===R&&R.visualViewport?R.visualViewport.width:O[v];g-=M-s.width,g*=l?1:-1}}var L=Object.assign({position:a},d&&qHe),B=u===!0?HHe({x:g,y:_},wt(n)):{x:g,y:_};if(g=B.x,_=B.y,l){var J;return Object.assign({},L,(J={},J[S]=y?"0":"",J[x]=b?"0":"",J.transform=(R.devicePixelRatio||1)<=1?"translate("+g+"px, "+_+"px)":"translate3d("+g+"px, "+_+"px, 0)",J))}return Object.assign({},L,(e={},e[S]=y?_+"px":"",e[x]=b?g+"px":"",e.transform="",e))}function VHe(t){var e=t.state,n=t.options,s=n.gpuAcceleration,o=s===void 0?!0:s,r=n.adaptive,i=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,d={placement:Wt(e.placement),variation:Bs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Dh(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:i,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Dh(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 GHe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:VHe,data:{}};var Xo={passive:!0};function KHe(t){var e=t.state,n=t.instance,s=t.options,o=s.scroll,r=o===void 0?!0:o,i=s.resize,a=i===void 0?!0:i,l=wt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&d.forEach(function(u){u.addEventListener("scroll",n.update,Xo)}),a&&l.addEventListener("resize",n.update,Xo),function(){r&&d.forEach(function(u){u.removeEventListener("scroll",n.update,Xo)}),a&&l.removeEventListener("resize",n.update,Xo)}}const WHe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:KHe,data:{}};var ZHe={left:"right",right:"left",bottom:"top",top:"bottom"};function _r(t){return t.replace(/left|right|bottom|top/g,function(e){return ZHe[e]})}var YHe={start:"end",end:"start"};function Lh(t){return t.replace(/start|end/g,function(e){return YHe[e]})}function Sc(t){var e=wt(t),n=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:n,scrollTop:s}}function Tc(t){return Fs(Ln(t)).left+Sc(t).scrollLeft}function JHe(t,e){var n=wt(t),s=Ln(t),o=n.visualViewport,r=s.clientWidth,i=s.clientHeight,a=0,l=0;if(o){r=o.width,i=o.height;var d=nm();(d||!d&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:i,x:a+Tc(t),y:l}}function QHe(t){var e,n=Ln(t),s=Sc(t),o=(e=t.ownerDocument)==null?void 0:e.body,r=Qn(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=Qn(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-s.scrollLeft+Tc(t),l=-s.scrollTop;return un(o||n).direction==="rtl"&&(a+=Qn(n.clientWidth,o?o.clientWidth:0)-r),{width:r,height:i,x:a,y:l}}function Mc(t){var e=un(t),n=e.overflow,s=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+s)}function am(t){return["html","body","#document"].indexOf(Jt(t))>=0?t.ownerDocument.body:Tt(t)&&Mc(t)?t:am(xi(t))}function po(t,e){var n;e===void 0&&(e=[]);var s=am(t),o=s===((n=t.ownerDocument)==null?void 0:n.body),r=wt(s),i=o?[r].concat(r.visualViewport||[],Mc(s)?s:[]):s,a=e.concat(i);return o?a:a.concat(po(xi(i)))}function vl(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function XHe(t,e){var n=Fs(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Ih(t,e,n){return e===em?vl(JHe(t,n)):ts(e)?XHe(e,n):vl(QHe(Ln(t)))}function eVe(t){var e=po(xi(t)),n=["absolute","fixed"].indexOf(un(t).position)>=0,s=n&&Tt(t)?zo(t):t;return ts(s)?e.filter(function(o){return ts(o)&&sm(o,s)&&Jt(o)!=="body"}):[]}function tVe(t,e,n,s){var o=e==="clippingParents"?eVe(t):[].concat(e),r=[].concat(o,[n]),i=r[0],a=r.reduce(function(l,d){var u=Ih(t,d,s);return l.top=Qn(u.top,l.top),l.right=Pr(u.right,l.right),l.bottom=Pr(u.bottom,l.bottom),l.left=Qn(u.left,l.left),l},Ih(t,i,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function lm(t){var e=t.reference,n=t.element,s=t.placement,o=s?Wt(s):null,r=s?Bs(s):null,i=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case gt:l={x:i,y:e.y-n.height};break;case Ot:l={x:i,y:e.y+e.height};break;case Rt:l={x:e.x+e.width,y:a};break;case mt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var d=o?Ac(o):null;if(d!=null){var u=d==="y"?"height":"width";switch(r){case Is:l[d]=l[d]-(e[u]/2-n[u]/2);break;case Ro:l[d]=l[d]+(e[u]/2-n[u]/2);break}}return l}function No(t,e){e===void 0&&(e={});var n=e,s=n.placement,o=s===void 0?t.placement:s,r=n.strategy,i=r===void 0?t.strategy:r,a=n.boundary,l=a===void 0?wHe:a,d=n.rootBoundary,u=d===void 0?em:d,h=n.elementContext,f=h===void 0?no:h,g=n.altBoundary,m=g===void 0?!1:g,_=n.padding,p=_===void 0?0:_,b=rm(typeof p!="number"?p:im(p,$o)),y=f===no?xHe:no,x=t.rects.popper,S=t.elements[m?y:f],R=tVe(ts(S)?S:S.contextElement||Ln(t.elements.popper),l,u,i),O=Fs(t.elements.reference),D=lm({reference:O,element:x,strategy:"absolute",placement:o}),v=vl(Object.assign({},x,D)),E=f===no?v:O,M={top:R.top-E.top+b.top,bottom:E.bottom-R.bottom+b.bottom,left:R.left-E.left+b.left,right:E.right-R.right+b.right},L=t.modifiersData.offset;if(f===no&&L){var B=L[o];Object.keys(M).forEach(function(J){var I=[Rt,Ot].indexOf(J)>=0?1:-1,ce=[gt,Ot].indexOf(J)>=0?"y":"x";M[J]+=B[ce]*I})}return M}function nVe(t,e){e===void 0&&(e={});var n=e,s=n.placement,o=n.boundary,r=n.rootBoundary,i=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,d=l===void 0?tm:l,u=Bs(s),h=u?a?Rh:Rh.filter(function(m){return Bs(m)===u}):$o,f=h.filter(function(m){return d.indexOf(m)>=0});f.length===0&&(f=h);var g=f.reduce(function(m,_){return m[_]=No(t,{placement:_,boundary:o,rootBoundary:r,padding:i})[Wt(_)],m},{});return Object.keys(g).sort(function(m,_){return g[m]-g[_]})}function sVe(t){if(Wt(t)===kc)return[];var e=_r(t);return[Lh(t),e,Lh(e)]}function oVe(t){var e=t.state,n=t.options,s=t.name;if(!e.modifiersData[s]._skip){for(var o=n.mainAxis,r=o===void 0?!0:o,i=n.altAxis,a=i===void 0?!0:i,l=n.fallbackPlacements,d=n.padding,u=n.boundary,h=n.rootBoundary,f=n.altBoundary,g=n.flipVariations,m=g===void 0?!0:g,_=n.allowedAutoPlacements,p=e.options.placement,b=Wt(p),y=b===p,x=l||(y||!m?[_r(p)]:sVe(p)),S=[p].concat(x).reduce(function(Se,N){return Se.concat(Wt(N)===kc?nVe(e,{placement:N,boundary:u,rootBoundary:h,padding:d,flipVariations:m,allowedAutoPlacements:_}):N)},[]),R=e.rects.reference,O=e.rects.popper,D=new Map,v=!0,E=S[0],M=0;M=0,ce=I?"width":"height",Z=No(e,{placement:L,boundary:u,rootBoundary:h,altBoundary:f,padding:d}),T=I?J?Rt:mt:J?Ot:gt;R[ce]>O[ce]&&(T=_r(T));var q=_r(T),G=[];if(r&&G.push(Z[B]<=0),a&&G.push(Z[T]<=0,Z[q]<=0),G.every(function(Se){return Se})){E=L,v=!1;break}D.set(L,G)}if(v)for(var we=m?3:1,_e=function(N){var Q=S.find(function(V){var te=D.get(V);if(te)return te.slice(0,N).every(function(X){return X})});if(Q)return E=Q,"break"},ee=we;ee>0;ee--){var ke=_e(ee);if(ke==="break")break}e.placement!==E&&(e.modifiersData[s]._skip=!0,e.placement=E,e.reset=!0)}}const rVe={name:"flip",enabled:!0,phase:"main",fn:oVe,requiresIfExists:["offset"],data:{_skip:!1}};function Ph(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Fh(t){return[gt,Rt,Ot,mt].some(function(e){return t[e]>=0})}function iVe(t){var e=t.state,n=t.name,s=e.rects.reference,o=e.rects.popper,r=e.modifiersData.preventOverflow,i=No(e,{elementContext:"reference"}),a=No(e,{altBoundary:!0}),l=Ph(i,s),d=Ph(a,o,r),u=Fh(l),h=Fh(d);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}const aVe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:iVe};function lVe(t,e,n){var s=Wt(t),o=[mt,gt].indexOf(s)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,i=r[0],a=r[1];return i=i||0,a=(a||0)*o,[mt,Rt].indexOf(s)>=0?{x:a,y:i}:{x:i,y:a}}function cVe(t){var e=t.state,n=t.options,s=t.name,o=n.offset,r=o===void 0?[0,0]:o,i=tm.reduce(function(u,h){return u[h]=lVe(h,e.rects,r),u},{}),a=i[e.placement],l=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=d),e.modifiersData[s]=i}const dVe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:cVe};function uVe(t){var e=t.state,n=t.name;e.modifiersData[n]=lm({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const hVe={name:"popperOffsets",enabled:!0,phase:"read",fn:uVe,data:{}};function fVe(t){return t==="x"?"y":"x"}function pVe(t){var e=t.state,n=t.options,s=t.name,o=n.mainAxis,r=o===void 0?!0:o,i=n.altAxis,a=i===void 0?!1:i,l=n.boundary,d=n.rootBoundary,u=n.altBoundary,h=n.padding,f=n.tether,g=f===void 0?!0:f,m=n.tetherOffset,_=m===void 0?0:m,p=No(e,{boundary:l,rootBoundary:d,padding:h,altBoundary:u}),b=Wt(e.placement),y=Bs(e.placement),x=!y,S=Ac(b),R=fVe(S),O=e.modifiersData.popperOffsets,D=e.rects.reference,v=e.rects.popper,E=typeof _=="function"?_(Object.assign({},e.rects,{placement:e.placement})):_,M=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),L=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(O){if(r){var J,I=S==="y"?gt:mt,ce=S==="y"?Ot:Rt,Z=S==="y"?"height":"width",T=O[S],q=T+p[I],G=T-p[ce],we=g?-v[Z]/2:0,_e=y===Is?D[Z]:v[Z],ee=y===Is?-v[Z]:-D[Z],ke=e.elements.arrow,Se=g&&ke?Cc(ke):{width:0,height:0},N=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:om(),Q=N[I],V=N[ce],te=fo(0,D[Z],Se[Z]),X=x?D[Z]/2-we-te-Q-M.mainAxis:_e-te-Q-M.mainAxis,ge=x?-D[Z]/2+we+te+V+M.mainAxis:ee+te+V+M.mainAxis,he=e.elements.arrow&&zo(e.elements.arrow),w=he?S==="y"?he.clientTop||0:he.clientLeft||0:0,A=(J=L==null?void 0:L[S])!=null?J:0,F=T+X-A-w,$=T+ge-A,z=fo(g?Pr(q,F):q,T,g?Qn(G,$):G);O[S]=z,B[S]=z-T}if(a){var ne,ae=S==="x"?gt:mt,j=S==="x"?Ot:Rt,re=O[R],U=R==="y"?"height":"width",Y=re+p[ae],le=re-p[j],pe=[gt,mt].indexOf(b)!==-1,fe=(ne=L==null?void 0:L[R])!=null?ne:0,Ce=pe?Y:re-D[U]-v[U]-fe+M.altAxis,W=pe?re+D[U]+v[U]-fe-M.altAxis:le,ie=g&&pe?BHe(Ce,re,W):fo(g?Ce:Y,re,g?W:le);O[R]=ie,B[R]=ie-re}e.modifiersData[s]=B}}const gVe={name:"preventOverflow",enabled:!0,phase:"main",fn:pVe,requiresIfExists:["offset"]};function mVe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function _Ve(t){return t===wt(t)||!Tt(t)?Sc(t):mVe(t)}function bVe(t){var e=t.getBoundingClientRect(),n=Ps(e.width)/t.offsetWidth||1,s=Ps(e.height)/t.offsetHeight||1;return n!==1||s!==1}function yVe(t,e,n){n===void 0&&(n=!1);var s=Tt(e),o=Tt(e)&&bVe(e),r=Ln(e),i=Fs(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!n)&&((Jt(e)!=="body"||Mc(r))&&(a=_Ve(e)),Tt(e)?(l=Fs(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=Tc(r))),{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function vVe(t){var e=new Map,n=new Set,s=[];t.forEach(function(r){e.set(r.name,r)});function o(r){n.add(r.name);var i=[].concat(r.requires||[],r.requiresIfExists||[]);i.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),s.push(r)}return t.forEach(function(r){n.has(r.name)||o(r)}),s}function wVe(t){var e=vVe(t);return NHe.reduce(function(n,s){return n.concat(e.filter(function(o){return o.phase===s}))},[])}function xVe(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function kVe(t){var e=t.reduce(function(n,s){var o=n[s.name];return n[s.name]=o?Object.assign({},o,s,{options:Object.assign({},o.options,s.options),data:Object.assign({},o.data,s.data)}):s,n},{});return Object.keys(e).map(function(n){return e[n]})}var Bh={placement:"bottom",modifiers:[],strategy:"absolute"};function $h(){for(var t=arguments.length,e=new Array(t),n=0;n(ss("data-v-7e498efe"),t=t(),os(),t),TVe={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center"},MVe={class:"flex flex-col text-center"},OVe={class:"flex flex-col text-center items-center"},RVe={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},NVe=Ke(()=>c("img",{class:"w-24 animate-bounce",title:"LoLLMS WebUI",src:sc,alt:"Logo"},null,-1)),DVe={class:"flex flex-col items-start"},LVe={class:"text-2xl"},IVe=Ke(()=>c("p",{class:"text-gray-400 text-base"},"One tool to rule them all",-1)),PVe=Ke(()=>c("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)),FVe=Ke(()=>c("p",{class:"text-2xl"},"Welcome",-1)),BVe=Ke(()=>c("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"},[c("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"}),c("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)),$Ve=Ke(()=>c("span",{class:"text-2xl font-bold ml-4"},"Loading ...",-1)),zVe=Ke(()=>c("i",{"data-feather":"chevron-right"},null,-1)),jVe=[zVe],UVe=Ke(()=>c("i",{"data-feather":"chevron-left"},null,-1)),qVe=[UVe],HVe={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"},VVe={class:"sticky z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md"},GVe={class:"flex-row p-4 flex items-center gap-3 flex-0"},KVe=Ke(()=>c("i",{"data-feather":"plus"},null,-1)),WVe=[KVe],ZVe=Ke(()=>c("i",{"data-feather":"check-square"},null,-1)),YVe=[ZVe],JVe=Ke(()=>c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Reset database, remove all discussions"},[c("i",{"data-feather":"refresh-ccw"})],-1)),QVe=Ke(()=>c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Export database",type:"button"},[c("i",{"data-feather":"database"})],-1)),XVe=Ke(()=>c("i",{"data-feather":"log-in"},null,-1)),eGe=[XVe],tGe={key:0,class:"dropdown"},nGe=Ke(()=>c("i",{"data-feather":"search"},null,-1)),sGe=[nGe],oGe=Ke(()=>c("i",{"data-feather":"save"},null,-1)),rGe=[oGe],iGe={key:2,class:"flex gap-3 flex-1 items-center duration-75"},aGe=Ke(()=>c("i",{"data-feather":"x"},null,-1)),lGe=[aGe],cGe=Ke(()=>c("i",{"data-feather":"check"},null,-1)),dGe=[cGe],uGe={key:3,title:"Loading..",class:"flex flex-row flex-grow justify-end"},hGe=Ke(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),fGe=[hGe],pGe={key:0,class:"flex-row items-center gap-3 flex-0 w-full"},gGe={class:"p-4 pt-2"},mGe={class:"relative"},_Ge=Ke(()=>c("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[c("div",{class:"scale-75"},[c("i",{"data-feather":"search"})])],-1)),bGe={class:"absolute inset-y-0 right-0 flex items-center pr-3"},yGe=Ke(()=>c("i",{"data-feather":"x"},null,-1)),vGe=[yGe],wGe={key:1,class:"h-px bg-bg-light p-0 mb-4 px-4 mx-4 border-0 dark:bg-bg-dark"},xGe={key:2,class:"flex flex-row flex-grow p-4 pt-0 items-center"},kGe={class:"flex flex-row flex-grow"},EGe={key:0},CGe={class:"flex flex-row"},AGe={key:0,class:"flex gap-3"},SGe=Ke(()=>c("i",{"data-feather":"trash"},null,-1)),TGe=[SGe],MGe={key:1,class:"flex gap-3 mx-3 flex-1 items-center justify-end group-hover:visible duration-75"},OGe=Ke(()=>c("i",{"data-feather":"check"},null,-1)),RGe=[OGe],NGe=Ke(()=>c("i",{"data-feather":"x"},null,-1)),DGe=[NGe],LGe={class:"flex gap-3"},IGe=Ke(()=>c("i",{"data-feather":"log-out"},null,-1)),PGe=[IGe],FGe=Ke(()=>c("i",{"data-feather":"list"},null,-1)),BGe=[FGe],$Ge={class:"z-5"},zGe={class:"relative flex flex-row flex-grow mb-10 z-0"},jGe={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"},UGe=Ke(()=>c("p",{class:"px-3"},"No discussions are found",-1)),qGe=[UGe],HGe=Ke(()=>c("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)),VGe={class:"z-20 h-max"},GGe={class:"container pt-4 pb-10 mb-28"},KGe=Ke(()=>c("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)),WGe={key:0,class:"bottom-0 container flex flex-row items-center justify-center"},ZGe={setup(){},data(){return{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},version:"5.0",list:[],tempList:[],currentDiscussion:{},discussionArr:[],loading:!1,filterTitle:"",filterInProgress:!1,isCreated:!1,isGenerating:!1,isCheckbox:!1,isSelectAll:!1,showConfirmation:!1,chime:new Audio("chime_aud.wav"),showToast:!1,isSearch:!1,isDiscussionBottom:!1,personalityAvatars:[],fileList:[],isDragOverDiscussion:!1,isDragOverChat:!1,panelCollapsed:!1,isOpen:!1}},methods:{save_configuration(){this.showConfirmation=!1,ye.post("/save_settings",{}).then(t=>{if(t)return t.status?this.$refs.toast.showToast("Settings saved!",4,!0):this.$refs.messageBox.showMessage("Error: Couldn't save settings!"),t.data}).catch(t=>(console.log(t.message,"save_configuration"),this.$refs.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},showToastMessage(t,e,n){console.log("sending",t),this.$refs.toast.showToast(t,e,n)},togglePanel(){this.panelCollapsed=!this.panelCollapsed},toggleDropdown(){this.isOpen=!this.isOpen},importChatGPT(){},async api_get_req(t){try{const e=await ye.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},async list_discussions(){try{const t=await ye.get("/list_discussions");if(t)return this.createDiscussionList(t.data),t.data}catch(t){return console.log("Error: Could not list discussions",t.message),[]}},load_discussion(t,e){t&&(console.log("Loading discussion",t),this.loading=!0,this.discussionArr=[],this.setDiscussionLoading(t,this.loading),Ee.on("discussion",n=>{this.loading=!1,this.setDiscussionLoading(t,this.loading),n&&(console.log("received discussion"),console.log(n),this.discussionArr=n.filter(s=>s.message_type==this.msgTypes.MSG_TYPE_CHUNK||s.message_type==this.msgTypes.MSG_TYPE_FULL||s.message_type==this.msgTypes.MSG_TYPE_FULL_INVISIBLE_TO_AI||s.message_type==this.msgTypes.MSG_TYPE_CODE||s.message_type==this.msgTypes.MSG_TYPE_JSON_INFOS||s.message_type==this.msgTypes.MSG_TYPE_UI),console.log("this.discussionArr"),console.log(this.discussionArr),e&&e()),Ee.off("discussion")}),Ee.emit("load_discussion",{id:t}))},new_discussion(t){try{this.loading=!0,Ee.on("discussion_created",e=>{Ee.off("discussion_created"),this.list_discussions().then(()=>{const n=this.list.findIndex(o=>o.id==e.id),s=this.list[n];this.selectDiscussion(s),this.load_discussion(e.id,()=>{this.loading=!1,be(()=>{const o=document.getElementById("dis-"+e.id);this.scrollToElement(o),console.log("Scrolling tp "+o)})})})}),console.log("new_discussion ",t),Ee.emit("new_discussion",{title:t})}catch(e){return console.log("Error: Could not create new discussion",e.message),{}}},async delete_discussion(t){try{t&&(this.loading=!0,this.setDiscussionLoading(t,this.loading),await ye.post("/delete_discussion",{client_id:this.client_id,id:t}),this.loading=!1,this.setDiscussionLoading(t,this.loading))}catch(e){console.log("Error: Could not delete discussion",e.message),this.loading=!1,this.setDiscussionLoading(t,this.loading)}},async edit_title(t,e){try{if(t){this.loading=!0,this.setDiscussionLoading(t,this.loading);const n=await ye.post("/edit_title",{client_id:this.client_id,id:t,title:e});if(this.loading=!1,this.setDiscussionLoading(t,this.loading),n.status==200){const s=this.list.findIndex(r=>r.id==t),o=this.list[s];o.title=e,this.tempList=this.list}}}catch(n){console.log("Error: Could not edit title",n.message),this.loading=!1,this.setDiscussionLoading(t,this.loading)}},async delete_message(t){try{const e=await ye.get("/delete_message",{params:{client_id:this.client_id,id:t}});if(e)return e.data}catch(e){return console.log("Error: Could delete message",e.message),{}}},async stop_gen(){try{if(Ee.emit("cancel_generation"),res)return res.data}catch(t){return console.log("Error: Could not stop generating",t.message),{}}},async message_rank_up(t){try{const e=await ye.get("/message_rank_up",{params:{client_id:this.client_id,id:t}});if(e)return e.data}catch(e){return console.log("Error: Could not rank up message",e.message),{}}},async message_rank_down(t){try{const e=await ye.get("/message_rank_down",{params:{client_id:this.client_id,id:t}});if(e)return e.data}catch(e){return console.log("Error: Could not rank down message",e.message),{}}},async edit_message(t,e){try{const n=await ye.get("/edit_message",{params:{client_id:this.client_id,id:t,message:e}});if(n)return n.data}catch(n){return console.log("Error: Could not update message",n.message),{}}},async export_multiple_discussions(t){try{if(t.length>0){const e=await ye.post("/export_multiple_discussions",{discussion_ids:t});if(e)return e.data}}catch(e){return console.log("Error: Could not export multiple discussions",e.message),{}}},async import_multiple_discussions(t){try{if(t.length>0){console.log("sending import",t);const e=await ye.post("/import_multiple_discussions",{jArray:t});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(t=>t.title&&t.title.includes(this.filterTitle)):this.list=this.tempList,this.filterInProgress=!1},100))},async selectDiscussion(t){t&&(console.log("this.currentDiscussion",this.currentDiscussion),this.currentDiscussion===void 0?(this.currentDiscussion=t,this.setPageTitle(t),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(t.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)})):this.currentDiscussion.id!=t.id&&(this.currentDiscussion=t,this.setPageTitle(t),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(t.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)})),be(()=>{const e=document.getElementById("dis-"+this.currentDiscussion.id);this.scrollToElementInContainer(e,"leftPanel");const n=document.getElementById("messages-list");this.scrollBottom(n)}))},scrollToElement(t){t?t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}):console.log("Error: scrollToElement")},scrollToElementInContainer(t,e){try{const n=t.offsetTop;document.getElementById(e).scrollTo({top:n,behavior:"smooth"})}catch{}},scrollBottom(t){t?t.scrollTo({top:t.scrollHeight,behavior:"smooth"}):console.log("Error: scrollBottom")},scrollTop(t){t?t.scrollTo({top:0,behavior:"smooth"}):console.log("Error: scrollTop")},createUserMsg(t){let e={content:t.message,id:t.id,rank:0,sender:t.user,created_at:t.created_at,steps:[],html_js_s:[]};this.discussionArr.push(e),be(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)})},updateLastUserMsg(t){const e=this.discussionArr.indexOf(s=>s.id=t.user_id),n={binding:t.binding,content:t.message,created_at:t.created_at,type:t.type,finished_generating_at:t.finished_generating_at,id:t.user_id,model:t.model,personality:t.personality,sender:t.user,steps:[]};e!==-1&&(this.discussionArr[e]=n)},socketIOConnected(){return console.log("socketIOConnected"),this.$store.state.isConnected=!0,!0},socketIODisconnected(){return console.log("socketIOConnected"),this.$store.state.isConnected=!1,!0},new_message(t){console.log("create bot",t);let e={sender:t.sender,message_type:t.message_type,sender_type:t.sender_type,content:t.content,id:t.id,parent_id:t.parent_id,binding:t.binding,model:t.model,personality:t.personality,created_at:t.created_at,finished_generating_at:t.finished_generating_at,rank:0,steps:[],parameters:t.parameters,metadata:t.metadata};console.log(e),this.discussionArr.push(e),(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,t.message),console.log("infos",t)},talk(t){this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),ye.get("/get_generation_status",{}).then(e=>{e&&(e.data.status?console.log("Already generating"):(console.log("Generating message from ",e.data.status),Ee.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)})},sendMsg(t){if(!t){this.$refs.toast.showToast("Message contains no content!",4,!1);return}this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),ye.get("/get_generation_status",{}).then(e=>{if(e)if(e.data.status)console.log("Already generating");else{Ee.emit("generate_msg",{prompt:t});let n=0;this.discussionArr.length>0&&(n=Number(this.discussionArr[this.discussionArr.length-1].id)+1);let s={message:t,id:n,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:t,id:n,parent_id:n,binding:"",model:"",personality:"",created_at:new Date().toLocaleString(),finished_generating_at:new Date().toLocaleString(),rank:0,steps:[],parameters:null,metadata:[]};this.createUserMsg(s)}}).catch(e=>{console.log("Error: Could not get generation status",e)})},notify(t){self.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),be(()=>{const e=document.getElementById("messages-list");this.scrollBottom(e)}),this.$refs.toast.showToast(t.content,5,t.status),this.chime.play()},streamMessageContent(t){const e=t.discussion_id;if(this.setDiscussionLoading(e,!0),this.currentDiscussion.id==e){this.isGenerating=!0;const n=this.discussionArr.findIndex(o=>o.id==t.id),s=this.discussionArr[n];if(s&&(t.message_type==this.msgTypes.MSG_TYPE_FULL||t.message_type==this.msgTypes.MSG_TYPE_FULL_INVISIBLE_TO_AI))s.content=t.content,s.finished_generating_at=t.finished_generating_at;else if(s&&t.message_type==this.msgTypes.MSG_TYPE_CHUNK)s.content+=t.content;else if(t.message_type==this.msgTypes.MSG_TYPE_STEP_START)s.steps.push({message:t.content,done:!1,status:!0});else if(t.message_type==this.msgTypes.MSG_TYPE_STEP_END){const o=s.steps.find(r=>r.message===t.content);if(o){o.done=!0;try{console.log(t.parameters);const r=t.parameters;o.status=r.status,console.log(r)}catch(r){console.error("Error parsing JSON:",r.message)}}}else t.message_type==this.msgTypes.MSG_TYPE_JSON_INFOS?(console.log("JSON message"),console.log(t.metadata),s.metadata=t.metadata):t.message_type==this.msgTypes.MSG_TYPE_EXCEPTION&&this.$refs.toast.showToast(t.content,5,!1)}this.$nextTick(()=>{ve.replace()})},async changeTitleUsingUserMSG(t,e){const n=this.list.findIndex(o=>o.id==t),s=this.list[n];e&&(s.title=e,this.tempList=this.list,await this.edit_title(t,e))},async createNewDiscussion(){this.new_discussion(null)},loadLastUsedDiscussion(){console.log("Loading last discussion");const t=localStorage.getItem("selected_discussion");if(console.log("Last discussion id: ",t),t){const e=this.list.findIndex(s=>s.id==t),n=this.list[e];n&&this.selectDiscussion(n)}},async deleteDiscussion(t){await this.delete_discussion(t),this.currentDiscussion.id==t&&(this.currentDiscussion={},this.discussionArr=[],this.setPageTitle()),this.list.splice(this.list.findIndex(e=>e.id==t),1),this.createDiscussionList(this.list)},async deleteDiscussionMulti(){const t=this.selectedDiscussions;for(let e=0;es.id==n.id),1)}this.tempList=this.list,this.isCheckbox=!1,this.$refs.toast.showToast("Removed ("+t.length+") items",4,!0),this.showConfirmation=!1,console.log("Multi delete done")},async deleteMessage(t){await this.delete_message(t).then(()=>{this.discussionArr.splice(this.discussionArr.findIndex(e=>e.id==t),1)}).catch(()=>{this.$refs.toast.showToast("Could not remove message",4,!1),console.log("Error: Could not delete message")})},async editTitle(t){const e=this.list.findIndex(s=>s.id==t.id),n=this.list[e];n.title=t.title,n.loading=!0,await this.edit_title(t.id,t.title),n.loading=!1},checkUncheckDiscussion(t,e){const n=this.list.findIndex(o=>o.id==e),s=this.list[n];s.checkBoxValue=t.target.checked,this.tempList=this.list},selectAllDiscussions(){this.isSelectAll=!this.tempList.filter(t=>t.checkBoxValue==!1).length>0;for(let t=0;t({id:n.id,title:n.title,selected:!1,loading:!1,checkBoxValue:!1})).sort(function(n,s){return s.id-n.id});this.list=e,this.tempList=e,console.log("List created")}},setDiscussionLoading(t,e){const n=this.list.findIndex(o=>o.id==t),s=this.list[n];s.loading=e},setPageTitle(t){if(t)if(t.id){const e=t.title?t.title==="untitled"?"New discussion":t.title:"New discussion";document.title="LoLLMS WebUI - "+e}else{const e=t||"Welcome";document.title="LoLLMS WebUI - "+e}else{const e=t||"Welcome";document.title="LoLLMS WebUI - "+e}},async rankUpMessage(t){await this.message_rank_up(t).then(e=>{const n=this.discussionArr[this.discussionArr.findIndex(s=>s.id==t)];n.rank=e.new_rank}).catch(()=>{this.$refs.toast.showToast("Could not rank up message",4,!1),console.log("Error: Could not rank up message")})},async rankDownMessage(t){await this.message_rank_down(t).then(e=>{const n=this.discussionArr[this.discussionArr.findIndex(s=>s.id==t)];n.rank=e.new_rank}).catch(()=>{this.$refs.toast.showToast("Could not rank down message",4,!1),console.log("Error: Could not rank down message")})},async updateMessage(t,e){await this.edit_message(t,e).then(()=>{const n=this.discussionArr[this.discussionArr.findIndex(s=>s.id==t)];n.content=e}).catch(()=>{this.$refs.toast.showToast("Could not update message",4,!1),console.log("Error: Could not update message")})},resendMessage(t,e){be(()=>{ve.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),ye.get("/get_generation_status",{}).then(n=>{n&&(console.log("--------------------"),console.log(t),n.data.status?console.log("Already generating"):(console.log("generate_msg_from"),Ee.emit("generate_msg_from",{prompt:e,id:t})))}).catch(n=>{console.log("Error: Could not get generation status",n)})},continueMessage(t,e){be(()=>{ve.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),ye.get("/get_generation_status",{}).then(n=>{n&&(console.log(n),n.data.status?console.log("Already generating"):Ee.emit("continue_generate_msg_from",{prompt:e,id:t}))}).catch(n=>{console.log("Error: Could not get generation status",n)})},stopGenerating(){this.stop_gen(),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),console.log("Stopped generating"),be(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},finalMsgEvent(t){console.log("final",t),t.parent_id;const e=t.discussion_id;if(this.currentDiscussion.id==e){const n=this.discussionArr.findIndex(s=>s.id==t.id);this.discussionArr[n].content=t.content,this.discussionArr[n].finished_generating_at=t.finished_generating_at}be(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)}),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),this.chime.play()},copyToClipBoard(t){this.$refs.toast.showToast("Copied to clipboard successfully",4,!0);let e="";t.message.binding&&(e=`Binding: ${t.message.binding}`);let n="";t.message.personality&&(n=` + `,544),[[Oe,o.message]]),c("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:e[7]||(e[7]=(...u)=>r.addFiles&&r.addFiles(...u)),multiple:""},null,544),c("button",{type:"button",onClick:e[8]||(e[8]=de(u=>t.$refs.fileDialog.click(),["stop"])),title:"Add files",class:"absolute inset-y-0 right-0 flex items-center mr-2 w-6 hover:text-secondary duration-75 active:scale-90"},eHe)]),c("div",tHe,[c("button",{type:"button",onClick:e[9]||(e[9]=(...u)=>r.startSpeechRecognition&&r.startSpeechRecognition(...u)),class:Me([{"text-red-500":o.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},sHe,2),n.loading?P("",!0):(k(),C("button",{key:0,type:"button",onClick:e[10]||(e[10]=(...u)=>r.submit&&r.submit(...u)),class:"w-6 hover:text-secondary duration-75 active:scale-90"},iHe)),n.loading?(k(),C("div",aHe,cHe)):P("",!0)])])])])])]),ue(d,{ref:"toast"},null,512)],64)}const Hg=Ue(uqe,[["render",dHe],["__scopeId","data-v-5cc493ac"]]),uHe={name:"WelcomeComponent",setup(){return{}}},hHe={class:"flex flex-col text-center"},fHe=rs('
Logo

Lord of Large Language Models

One tool to rule them all


Welcome

Please create a new discussion or select existing one to start

',1),pHe=[fHe];function gHe(t,e,n,s,o,r){return k(),C("div",hHe,pHe)}const Vg=Ue(uHe,[["render",gHe]]);const mHe={setup(){return{}},name:"DragDrop",emits:["panelLeave","panelDrop"],data(){return{fileList:[],show:!1,dropRelease:!1}},mounted(){be(()=>{ve.replace()})},methods:{async panelDrop(t){const e="getAsFileSystemHandle"in DataTransferItem.prototype,n="webkitGetAsEntry"in DataTransferItem.prototype;if(!e&&!n)return;const s=[...t.dataTransfer.items].filter(r=>r.kind==="file").map(r=>e?r.getAsFileSystemHandle():r.webkitGetAsEntry());let o=[];for await(const r of s)(r.kind==="directory"||r.isDirectory)&&o.push(r.name);this.dropRelease=!0,t.dataTransfer.files.length>0&&[...t.dataTransfer.files].forEach(r=>{o.includes(r.name)||this.fileList.push(r)}),be(()=>{ve.replace()}),this.$emit("panelDrop",this.fileList),this.fileList=[],this.show=!1},panelLeave(){this.$emit("panelLeave"),console.log("exit/leave"),this.dropRelease=!1,this.show=!1,be(()=>{ve.replace()})}}},_He={class:"text-4xl text-center"};function bHe(t,e,n,s,o,r){return k(),st(Ut,{name:"list",tag:"div"},{default:Ne(()=>[o.show?(k(),C("div",{key:"dropmenu",class:"select-none text-slate-50 absolute top-0 left-0 right-0 bottom-0 flex flex-col items-center justify-center bg-black bg-opacity-50 duration-200 backdrop-blur-sm",onDragleave:e[0]||(e[0]=de(i=>r.panelLeave(i),["prevent"])),onDrop:e[1]||(e[1]=de(i=>r.panelDrop(i),["stop","prevent"]))},[c("div",{class:Me(["flex flex-col items-center justify-center p-8 rounded-lg shadow-lg border-dashed border-4 border-secondary w-4/5 h-4/5",o.dropRelease?"":"pointer-events-none"])},[c("div",_He,[xr(t.$slots,"default",{},()=>[xe(" Drop your files here ")])])],2)],32)):P("",!0)]),_:3})}const bl=Ue(mHe,[["render",bHe]]);var yHe=function(){function t(e,n){n===void 0&&(n=[]),this._eventType=e,this._eventFunctions=n}return t.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(n){typeof window<"u"&&window.addEventListener(e._eventType,n)})},t}(),Nr=globalThis&&globalThis.__assign||function(){return Nr=Object.assign||function(t){for(var e,n=1,s=arguments.length;n"u")return!1;var e=wt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function NHe(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var s=e.styles[n]||{},o=e.attributes[n]||{},r=e.elements[n];!Tt(r)||!Jt(r)||(Object.assign(r.style,s),Object.keys(o).forEach(function(i){var a=o[i];a===!1?r.removeAttribute(i):r.setAttribute(i,a===!0?"":a)}))})}function DHe(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(s){var o=e.elements[s],r=e.attributes[s]||{},i=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:n[s]),a=i.reduce(function(l,d){return l[d]="",l},{});!Tt(o)||!Jt(o)||(Object.assign(o.style,a),Object.keys(r).forEach(function(l){o.removeAttribute(l)}))})}}const LHe={name:"applyStyles",enabled:!0,phase:"write",fn:NHe,effect:DHe,requires:["computeStyles"]};function Wt(t){return t.split("-")[0]}var Qn=Math.max,Pr=Math.min,Ps=Math.round;function yl(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function nm(){return!/^((?!chrome|android).)*safari/i.test(yl())}function Fs(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var s=t.getBoundingClientRect(),o=1,r=1;e&&Tt(t)&&(o=t.offsetWidth>0&&Ps(s.width)/t.offsetWidth||1,r=t.offsetHeight>0&&Ps(s.height)/t.offsetHeight||1);var i=ts(t)?wt(t):window,a=i.visualViewport,l=!nm()&&n,d=(s.left+(l&&a?a.offsetLeft:0))/o,u=(s.top+(l&&a?a.offsetTop:0))/r,h=s.width/o,f=s.height/r;return{width:h,height:f,top:u,right:d+h,bottom:u+f,left:d,x:d,y:u}}function Cc(t){var e=Fs(t),n=t.offsetWidth,s=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:s}}function sm(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Ec(n)){var s=e;do{if(s&&t.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function un(t){return wt(t).getComputedStyle(t)}function IHe(t){return["table","td","th"].indexOf(Jt(t))>=0}function Ln(t){return((ts(t)?t.ownerDocument:t.document)||window.document).documentElement}function xi(t){return Jt(t)==="html"?t:t.assignedSlot||t.parentNode||(Ec(t)?t.host:null)||Ln(t)}function Nh(t){return!Tt(t)||un(t).position==="fixed"?null:t.offsetParent}function PHe(t){var e=/firefox/i.test(yl()),n=/Trident/i.test(yl());if(n&&Tt(t)){var s=un(t);if(s.position==="fixed")return null}var o=xi(t);for(Ec(o)&&(o=o.host);Tt(o)&&["html","body"].indexOf(Jt(o))<0;){var r=un(o);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 o;o=o.parentNode}return null}function zo(t){for(var e=wt(t),n=Nh(t);n&&IHe(n)&&un(n).position==="static";)n=Nh(n);return n&&(Jt(n)==="html"||Jt(n)==="body"&&un(n).position==="static")?e:n||PHe(t)||e}function Ac(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function fo(t,e,n){return Qn(t,Pr(e,n))}function FHe(t,e,n){var s=fo(t,e,n);return s>n?n:s}function om(){return{top:0,right:0,bottom:0,left:0}}function rm(t){return Object.assign({},om(),t)}function im(t,e){return e.reduce(function(n,s){return n[s]=t,n},{})}var BHe=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,rm(typeof e!="number"?e:im(e,$o))};function $He(t){var e,n=t.state,s=t.name,o=t.options,r=n.elements.arrow,i=n.modifiersData.popperOffsets,a=Wt(n.placement),l=Ac(a),d=[mt,Rt].indexOf(a)>=0,u=d?"height":"width";if(!(!r||!i)){var h=BHe(o.padding,n),f=Cc(r),g=l==="y"?gt:mt,m=l==="y"?Ot:Rt,_=n.rects.reference[u]+n.rects.reference[l]-i[l]-n.rects.popper[u],p=i[l]-n.rects.reference[l],b=zo(r),y=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,x=_/2-p/2,S=h[g],R=y-f[u]-h[m],O=y/2-f[u]/2+x,D=fo(S,O,R),v=l;n.modifiersData[s]=(e={},e[v]=D,e.centerOffset=D-O,e)}}function zHe(t){var e=t.state,n=t.options,s=n.element,o=s===void 0?"[data-popper-arrow]":s;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||sm(e.elements.popper,o)&&(e.elements.arrow=o))}const jHe={name:"arrow",enabled:!0,phase:"main",fn:$He,effect:zHe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Bs(t){return t.split("-")[1]}var UHe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qHe(t,e){var n=t.x,s=t.y,o=e.devicePixelRatio||1;return{x:Ps(n*o)/o||0,y:Ps(s*o)/o||0}}function Dh(t){var e,n=t.popper,s=t.popperRect,o=t.placement,r=t.variation,i=t.offsets,a=t.position,l=t.gpuAcceleration,d=t.adaptive,u=t.roundOffsets,h=t.isFixed,f=i.x,g=f===void 0?0:f,m=i.y,_=m===void 0?0:m,p=typeof u=="function"?u({x:g,y:_}):{x:g,y:_};g=p.x,_=p.y;var b=i.hasOwnProperty("x"),y=i.hasOwnProperty("y"),x=mt,S=gt,R=window;if(d){var O=zo(n),D="clientHeight",v="clientWidth";if(O===wt(n)&&(O=Ln(n),un(O).position!=="static"&&a==="absolute"&&(D="scrollHeight",v="scrollWidth")),O=O,o===gt||(o===mt||o===Rt)&&r===Ro){S=Ot;var E=h&&O===R&&R.visualViewport?R.visualViewport.height:O[D];_-=E-s.height,_*=l?1:-1}if(o===mt||(o===gt||o===Ot)&&r===Ro){x=Rt;var M=h&&O===R&&R.visualViewport?R.visualViewport.width:O[v];g-=M-s.width,g*=l?1:-1}}var L=Object.assign({position:a},d&&UHe),B=u===!0?qHe({x:g,y:_},wt(n)):{x:g,y:_};if(g=B.x,_=B.y,l){var J;return Object.assign({},L,(J={},J[S]=y?"0":"",J[x]=b?"0":"",J.transform=(R.devicePixelRatio||1)<=1?"translate("+g+"px, "+_+"px)":"translate3d("+g+"px, "+_+"px, 0)",J))}return Object.assign({},L,(e={},e[S]=y?_+"px":"",e[x]=b?g+"px":"",e.transform="",e))}function HHe(t){var e=t.state,n=t.options,s=n.gpuAcceleration,o=s===void 0?!0:s,r=n.adaptive,i=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,d={placement:Wt(e.placement),variation:Bs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Dh(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:i,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Dh(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 VHe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:HHe,data:{}};var Xo={passive:!0};function GHe(t){var e=t.state,n=t.instance,s=t.options,o=s.scroll,r=o===void 0?!0:o,i=s.resize,a=i===void 0?!0:i,l=wt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&d.forEach(function(u){u.addEventListener("scroll",n.update,Xo)}),a&&l.addEventListener("resize",n.update,Xo),function(){r&&d.forEach(function(u){u.removeEventListener("scroll",n.update,Xo)}),a&&l.removeEventListener("resize",n.update,Xo)}}const KHe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:GHe,data:{}};var WHe={left:"right",right:"left",bottom:"top",top:"bottom"};function _r(t){return t.replace(/left|right|bottom|top/g,function(e){return WHe[e]})}var ZHe={start:"end",end:"start"};function Lh(t){return t.replace(/start|end/g,function(e){return ZHe[e]})}function Sc(t){var e=wt(t),n=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:n,scrollTop:s}}function Tc(t){return Fs(Ln(t)).left+Sc(t).scrollLeft}function YHe(t,e){var n=wt(t),s=Ln(t),o=n.visualViewport,r=s.clientWidth,i=s.clientHeight,a=0,l=0;if(o){r=o.width,i=o.height;var d=nm();(d||!d&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:i,x:a+Tc(t),y:l}}function JHe(t){var e,n=Ln(t),s=Sc(t),o=(e=t.ownerDocument)==null?void 0:e.body,r=Qn(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=Qn(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-s.scrollLeft+Tc(t),l=-s.scrollTop;return un(o||n).direction==="rtl"&&(a+=Qn(n.clientWidth,o?o.clientWidth:0)-r),{width:r,height:i,x:a,y:l}}function Mc(t){var e=un(t),n=e.overflow,s=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+s)}function am(t){return["html","body","#document"].indexOf(Jt(t))>=0?t.ownerDocument.body:Tt(t)&&Mc(t)?t:am(xi(t))}function po(t,e){var n;e===void 0&&(e=[]);var s=am(t),o=s===((n=t.ownerDocument)==null?void 0:n.body),r=wt(s),i=o?[r].concat(r.visualViewport||[],Mc(s)?s:[]):s,a=e.concat(i);return o?a:a.concat(po(xi(i)))}function vl(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function QHe(t,e){var n=Fs(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Ih(t,e,n){return e===em?vl(YHe(t,n)):ts(e)?QHe(e,n):vl(JHe(Ln(t)))}function XHe(t){var e=po(xi(t)),n=["absolute","fixed"].indexOf(un(t).position)>=0,s=n&&Tt(t)?zo(t):t;return ts(s)?e.filter(function(o){return ts(o)&&sm(o,s)&&Jt(o)!=="body"}):[]}function eVe(t,e,n,s){var o=e==="clippingParents"?XHe(t):[].concat(e),r=[].concat(o,[n]),i=r[0],a=r.reduce(function(l,d){var u=Ih(t,d,s);return l.top=Qn(u.top,l.top),l.right=Pr(u.right,l.right),l.bottom=Pr(u.bottom,l.bottom),l.left=Qn(u.left,l.left),l},Ih(t,i,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function lm(t){var e=t.reference,n=t.element,s=t.placement,o=s?Wt(s):null,r=s?Bs(s):null,i=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case gt:l={x:i,y:e.y-n.height};break;case Ot:l={x:i,y:e.y+e.height};break;case Rt:l={x:e.x+e.width,y:a};break;case mt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var d=o?Ac(o):null;if(d!=null){var u=d==="y"?"height":"width";switch(r){case Is:l[d]=l[d]-(e[u]/2-n[u]/2);break;case Ro:l[d]=l[d]+(e[u]/2-n[u]/2);break}}return l}function No(t,e){e===void 0&&(e={});var n=e,s=n.placement,o=s===void 0?t.placement:s,r=n.strategy,i=r===void 0?t.strategy:r,a=n.boundary,l=a===void 0?vHe:a,d=n.rootBoundary,u=d===void 0?em:d,h=n.elementContext,f=h===void 0?no:h,g=n.altBoundary,m=g===void 0?!1:g,_=n.padding,p=_===void 0?0:_,b=rm(typeof p!="number"?p:im(p,$o)),y=f===no?wHe:no,x=t.rects.popper,S=t.elements[m?y:f],R=eVe(ts(S)?S:S.contextElement||Ln(t.elements.popper),l,u,i),O=Fs(t.elements.reference),D=lm({reference:O,element:x,strategy:"absolute",placement:o}),v=vl(Object.assign({},x,D)),E=f===no?v:O,M={top:R.top-E.top+b.top,bottom:E.bottom-R.bottom+b.bottom,left:R.left-E.left+b.left,right:E.right-R.right+b.right},L=t.modifiersData.offset;if(f===no&&L){var B=L[o];Object.keys(M).forEach(function(J){var I=[Rt,Ot].indexOf(J)>=0?1:-1,ce=[gt,Ot].indexOf(J)>=0?"y":"x";M[J]+=B[ce]*I})}return M}function tVe(t,e){e===void 0&&(e={});var n=e,s=n.placement,o=n.boundary,r=n.rootBoundary,i=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,d=l===void 0?tm:l,u=Bs(s),h=u?a?Rh:Rh.filter(function(m){return Bs(m)===u}):$o,f=h.filter(function(m){return d.indexOf(m)>=0});f.length===0&&(f=h);var g=f.reduce(function(m,_){return m[_]=No(t,{placement:_,boundary:o,rootBoundary:r,padding:i})[Wt(_)],m},{});return Object.keys(g).sort(function(m,_){return g[m]-g[_]})}function nVe(t){if(Wt(t)===kc)return[];var e=_r(t);return[Lh(t),e,Lh(e)]}function sVe(t){var e=t.state,n=t.options,s=t.name;if(!e.modifiersData[s]._skip){for(var o=n.mainAxis,r=o===void 0?!0:o,i=n.altAxis,a=i===void 0?!0:i,l=n.fallbackPlacements,d=n.padding,u=n.boundary,h=n.rootBoundary,f=n.altBoundary,g=n.flipVariations,m=g===void 0?!0:g,_=n.allowedAutoPlacements,p=e.options.placement,b=Wt(p),y=b===p,x=l||(y||!m?[_r(p)]:nVe(p)),S=[p].concat(x).reduce(function(Se,N){return Se.concat(Wt(N)===kc?tVe(e,{placement:N,boundary:u,rootBoundary:h,padding:d,flipVariations:m,allowedAutoPlacements:_}):N)},[]),R=e.rects.reference,O=e.rects.popper,D=new Map,v=!0,E=S[0],M=0;M=0,ce=I?"width":"height",Z=No(e,{placement:L,boundary:u,rootBoundary:h,altBoundary:f,padding:d}),T=I?J?Rt:mt:J?Ot:gt;R[ce]>O[ce]&&(T=_r(T));var q=_r(T),G=[];if(r&&G.push(Z[B]<=0),a&&G.push(Z[T]<=0,Z[q]<=0),G.every(function(Se){return Se})){E=L,v=!1;break}D.set(L,G)}if(v)for(var we=m?3:1,_e=function(N){var Q=S.find(function(V){var te=D.get(V);if(te)return te.slice(0,N).every(function(X){return X})});if(Q)return E=Q,"break"},ee=we;ee>0;ee--){var ke=_e(ee);if(ke==="break")break}e.placement!==E&&(e.modifiersData[s]._skip=!0,e.placement=E,e.reset=!0)}}const oVe={name:"flip",enabled:!0,phase:"main",fn:sVe,requiresIfExists:["offset"],data:{_skip:!1}};function Ph(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Fh(t){return[gt,Rt,Ot,mt].some(function(e){return t[e]>=0})}function rVe(t){var e=t.state,n=t.name,s=e.rects.reference,o=e.rects.popper,r=e.modifiersData.preventOverflow,i=No(e,{elementContext:"reference"}),a=No(e,{altBoundary:!0}),l=Ph(i,s),d=Ph(a,o,r),u=Fh(l),h=Fh(d);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}const iVe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:rVe};function aVe(t,e,n){var s=Wt(t),o=[mt,gt].indexOf(s)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,i=r[0],a=r[1];return i=i||0,a=(a||0)*o,[mt,Rt].indexOf(s)>=0?{x:a,y:i}:{x:i,y:a}}function lVe(t){var e=t.state,n=t.options,s=t.name,o=n.offset,r=o===void 0?[0,0]:o,i=tm.reduce(function(u,h){return u[h]=aVe(h,e.rects,r),u},{}),a=i[e.placement],l=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=d),e.modifiersData[s]=i}const cVe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:lVe};function dVe(t){var e=t.state,n=t.name;e.modifiersData[n]=lm({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const uVe={name:"popperOffsets",enabled:!0,phase:"read",fn:dVe,data:{}};function hVe(t){return t==="x"?"y":"x"}function fVe(t){var e=t.state,n=t.options,s=t.name,o=n.mainAxis,r=o===void 0?!0:o,i=n.altAxis,a=i===void 0?!1:i,l=n.boundary,d=n.rootBoundary,u=n.altBoundary,h=n.padding,f=n.tether,g=f===void 0?!0:f,m=n.tetherOffset,_=m===void 0?0:m,p=No(e,{boundary:l,rootBoundary:d,padding:h,altBoundary:u}),b=Wt(e.placement),y=Bs(e.placement),x=!y,S=Ac(b),R=hVe(S),O=e.modifiersData.popperOffsets,D=e.rects.reference,v=e.rects.popper,E=typeof _=="function"?_(Object.assign({},e.rects,{placement:e.placement})):_,M=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),L=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(O){if(r){var J,I=S==="y"?gt:mt,ce=S==="y"?Ot:Rt,Z=S==="y"?"height":"width",T=O[S],q=T+p[I],G=T-p[ce],we=g?-v[Z]/2:0,_e=y===Is?D[Z]:v[Z],ee=y===Is?-v[Z]:-D[Z],ke=e.elements.arrow,Se=g&&ke?Cc(ke):{width:0,height:0},N=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:om(),Q=N[I],V=N[ce],te=fo(0,D[Z],Se[Z]),X=x?D[Z]/2-we-te-Q-M.mainAxis:_e-te-Q-M.mainAxis,ge=x?-D[Z]/2+we+te+V+M.mainAxis:ee+te+V+M.mainAxis,he=e.elements.arrow&&zo(e.elements.arrow),w=he?S==="y"?he.clientTop||0:he.clientLeft||0:0,A=(J=L==null?void 0:L[S])!=null?J:0,F=T+X-A-w,$=T+ge-A,z=fo(g?Pr(q,F):q,T,g?Qn(G,$):G);O[S]=z,B[S]=z-T}if(a){var ne,ae=S==="x"?gt:mt,j=S==="x"?Ot:Rt,re=O[R],U=R==="y"?"height":"width",Y=re+p[ae],le=re-p[j],pe=[gt,mt].indexOf(b)!==-1,fe=(ne=L==null?void 0:L[R])!=null?ne:0,Ce=pe?Y:re-D[U]-v[U]-fe+M.altAxis,W=pe?re+D[U]+v[U]-fe-M.altAxis:le,ie=g&&pe?FHe(Ce,re,W):fo(g?Ce:Y,re,g?W:le);O[R]=ie,B[R]=ie-re}e.modifiersData[s]=B}}const pVe={name:"preventOverflow",enabled:!0,phase:"main",fn:fVe,requiresIfExists:["offset"]};function gVe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function mVe(t){return t===wt(t)||!Tt(t)?Sc(t):gVe(t)}function _Ve(t){var e=t.getBoundingClientRect(),n=Ps(e.width)/t.offsetWidth||1,s=Ps(e.height)/t.offsetHeight||1;return n!==1||s!==1}function bVe(t,e,n){n===void 0&&(n=!1);var s=Tt(e),o=Tt(e)&&_Ve(e),r=Ln(e),i=Fs(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!n)&&((Jt(e)!=="body"||Mc(r))&&(a=mVe(e)),Tt(e)?(l=Fs(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):r&&(l.x=Tc(r))),{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function yVe(t){var e=new Map,n=new Set,s=[];t.forEach(function(r){e.set(r.name,r)});function o(r){n.add(r.name);var i=[].concat(r.requires||[],r.requiresIfExists||[]);i.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),s.push(r)}return t.forEach(function(r){n.has(r.name)||o(r)}),s}function vVe(t){var e=yVe(t);return RHe.reduce(function(n,s){return n.concat(e.filter(function(o){return o.phase===s}))},[])}function wVe(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function xVe(t){var e=t.reduce(function(n,s){var o=n[s.name];return n[s.name]=o?Object.assign({},o,s,{options:Object.assign({},o.options,s.options),data:Object.assign({},o.data,s.data)}):s,n},{});return Object.keys(e).map(function(n){return e[n]})}var Bh={placement:"bottom",modifiers:[],strategy:"absolute"};function $h(){for(var t=arguments.length,e=new Array(t),n=0;n(ss("data-v-7e498efe"),t=t(),os(),t),SVe={key:0,class:"fixed top-0 left-0 w-screen h-screen flex items-center justify-center"},TVe={class:"flex flex-col text-center"},MVe={class:"flex flex-col text-center items-center"},OVe={class:"flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"},RVe=Ke(()=>c("img",{class:"w-24 animate-bounce",title:"LoLLMS WebUI",src:sc,alt:"Logo"},null,-1)),NVe={class:"flex flex-col items-start"},DVe={class:"text-2xl"},LVe=Ke(()=>c("p",{class:"text-gray-400 text-base"},"One tool to rule them all",-1)),IVe=Ke(()=>c("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)),PVe=Ke(()=>c("p",{class:"text-2xl"},"Welcome",-1)),FVe=Ke(()=>c("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"},[c("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"}),c("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)),BVe=Ke(()=>c("span",{class:"text-2xl font-bold ml-4"},"Loading ...",-1)),$Ve=Ke(()=>c("i",{"data-feather":"chevron-right"},null,-1)),zVe=[$Ve],jVe=Ke(()=>c("i",{"data-feather":"chevron-left"},null,-1)),UVe=[jVe],qVe={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"},HVe={class:"sticky z-10 top-0 bg-bg-light-tone dark:bg-bg-dark-tone shadow-md"},VVe={class:"flex-row p-4 flex items-center gap-3 flex-0"},GVe=Ke(()=>c("i",{"data-feather":"plus"},null,-1)),KVe=[GVe],WVe=Ke(()=>c("i",{"data-feather":"check-square"},null,-1)),ZVe=[WVe],YVe=Ke(()=>c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Reset database, remove all discussions"},[c("i",{"data-feather":"refresh-ccw"})],-1)),JVe=Ke(()=>c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Export database",type:"button"},[c("i",{"data-feather":"database"})],-1)),QVe=Ke(()=>c("i",{"data-feather":"log-in"},null,-1)),XVe=[QVe],eGe={key:0,class:"dropdown"},tGe=Ke(()=>c("i",{"data-feather":"search"},null,-1)),nGe=[tGe],sGe=Ke(()=>c("i",{"data-feather":"save"},null,-1)),oGe=[sGe],rGe={key:2,class:"flex gap-3 flex-1 items-center duration-75"},iGe=Ke(()=>c("i",{"data-feather":"x"},null,-1)),aGe=[iGe],lGe=Ke(()=>c("i",{"data-feather":"check"},null,-1)),cGe=[lGe],dGe={key:3,title:"Loading..",class:"flex flex-row flex-grow justify-end"},uGe=Ke(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),hGe=[uGe],fGe={key:0,class:"flex-row items-center gap-3 flex-0 w-full"},pGe={class:"p-4 pt-2"},gGe={class:"relative"},mGe=Ke(()=>c("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[c("div",{class:"scale-75"},[c("i",{"data-feather":"search"})])],-1)),_Ge={class:"absolute inset-y-0 right-0 flex items-center pr-3"},bGe=Ke(()=>c("i",{"data-feather":"x"},null,-1)),yGe=[bGe],vGe={key:1,class:"h-px bg-bg-light p-0 mb-4 px-4 mx-4 border-0 dark:bg-bg-dark"},wGe={key:2,class:"flex flex-row flex-grow p-4 pt-0 items-center"},xGe={class:"flex flex-row flex-grow"},kGe={key:0},EGe={class:"flex flex-row"},CGe={key:0,class:"flex gap-3"},AGe=Ke(()=>c("i",{"data-feather":"trash"},null,-1)),SGe=[AGe],TGe={key:1,class:"flex gap-3 mx-3 flex-1 items-center justify-end group-hover:visible duration-75"},MGe=Ke(()=>c("i",{"data-feather":"check"},null,-1)),OGe=[MGe],RGe=Ke(()=>c("i",{"data-feather":"x"},null,-1)),NGe=[RGe],DGe={class:"flex gap-3"},LGe=Ke(()=>c("i",{"data-feather":"log-out"},null,-1)),IGe=[LGe],PGe=Ke(()=>c("i",{"data-feather":"list"},null,-1)),FGe=[PGe],BGe={class:"z-5"},$Ge={class:"relative flex flex-row flex-grow mb-10 z-0"},zGe={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"},jGe=Ke(()=>c("p",{class:"px-3"},"No discussions are found",-1)),UGe=[jGe],qGe=Ke(()=>c("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)),HGe={class:"z-20 h-max"},VGe={class:"container pt-4 pb-10 mb-28"},GGe=Ke(()=>c("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)),KGe={key:0,class:"bottom-0 container flex flex-row items-center justify-center"},WGe={setup(){},data(){return{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},version:"5.0",list:[],tempList:[],currentDiscussion:{},discussionArr:[],loading:!1,filterTitle:"",filterInProgress:!1,isCreated:!1,isGenerating:!1,isCheckbox:!1,isSelectAll:!1,showConfirmation:!1,chime:new Audio("chime_aud.wav"),showToast:!1,isSearch:!1,isDiscussionBottom:!1,personalityAvatars:[],fileList:[],isDragOverDiscussion:!1,isDragOverChat:!1,panelCollapsed:!1,isOpen:!1}},methods:{save_configuration(){this.showConfirmation=!1,ye.post("/save_settings",{}).then(t=>{if(t)return t.status?this.$refs.toast.showToast("Settings saved!",4,!0):this.$refs.messageBox.showMessage("Error: Couldn't save settings!"),t.data}).catch(t=>(console.log(t.message,"save_configuration"),this.$refs.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},showToastMessage(t,e,n){console.log("sending",t),this.$refs.toast.showToast(t,e,n)},togglePanel(){this.panelCollapsed=!this.panelCollapsed},toggleDropdown(){this.isOpen=!this.isOpen},importChatGPT(){},async api_get_req(t){try{const e=await ye.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req");return}},async list_discussions(){try{const t=await ye.get("/list_discussions");if(t)return this.createDiscussionList(t.data),t.data}catch(t){return console.log("Error: Could not list discussions",t.message),[]}},load_discussion(t,e){t&&(console.log("Loading discussion",t),this.loading=!0,this.discussionArr=[],this.setDiscussionLoading(t,this.loading),Ee.on("discussion",n=>{this.loading=!1,this.setDiscussionLoading(t,this.loading),n&&(console.log("received discussion"),console.log(n),this.discussionArr=n.filter(s=>s.message_type==this.msgTypes.MSG_TYPE_CHUNK||s.message_type==this.msgTypes.MSG_TYPE_FULL||s.message_type==this.msgTypes.MSG_TYPE_FULL_INVISIBLE_TO_AI||s.message_type==this.msgTypes.MSG_TYPE_CODE||s.message_type==this.msgTypes.MSG_TYPE_JSON_INFOS||s.message_type==this.msgTypes.MSG_TYPE_UI),console.log("this.discussionArr"),console.log(this.discussionArr),e&&e()),Ee.off("discussion")}),Ee.emit("load_discussion",{id:t}))},new_discussion(t){try{this.loading=!0,Ee.on("discussion_created",e=>{Ee.off("discussion_created"),this.list_discussions().then(()=>{const n=this.list.findIndex(o=>o.id==e.id),s=this.list[n];this.selectDiscussion(s),this.load_discussion(e.id,()=>{this.loading=!1,be(()=>{const o=document.getElementById("dis-"+e.id);this.scrollToElement(o),console.log("Scrolling tp "+o)})})})}),console.log("new_discussion ",t),Ee.emit("new_discussion",{title:t})}catch(e){return console.log("Error: Could not create new discussion",e.message),{}}},async delete_discussion(t){try{t&&(this.loading=!0,this.setDiscussionLoading(t,this.loading),await ye.post("/delete_discussion",{client_id:this.client_id,id:t}),this.loading=!1,this.setDiscussionLoading(t,this.loading))}catch(e){console.log("Error: Could not delete discussion",e.message),this.loading=!1,this.setDiscussionLoading(t,this.loading)}},async edit_title(t,e){try{if(t){this.loading=!0,this.setDiscussionLoading(t,this.loading);const n=await ye.post("/edit_title",{client_id:this.client_id,id:t,title:e});if(this.loading=!1,this.setDiscussionLoading(t,this.loading),n.status==200){const s=this.list.findIndex(r=>r.id==t),o=this.list[s];o.title=e,this.tempList=this.list}}}catch(n){console.log("Error: Could not edit title",n.message),this.loading=!1,this.setDiscussionLoading(t,this.loading)}},async delete_message(t){try{const e=await ye.get("/delete_message",{params:{client_id:this.client_id,id:t}});if(e)return e.data}catch(e){return console.log("Error: Could delete message",e.message),{}}},async stop_gen(){try{if(Ee.emit("cancel_generation"),res)return res.data}catch(t){return console.log("Error: Could not stop generating",t.message),{}}},async message_rank_up(t){try{const e=await ye.get("/message_rank_up",{params:{client_id:this.client_id,id:t}});if(e)return e.data}catch(e){return console.log("Error: Could not rank up message",e.message),{}}},async message_rank_down(t){try{const e=await ye.get("/message_rank_down",{params:{client_id:this.client_id,id:t}});if(e)return e.data}catch(e){return console.log("Error: Could not rank down message",e.message),{}}},async edit_message(t,e){try{const n=await ye.get("/edit_message",{params:{client_id:this.client_id,id:t,message:e}});if(n)return n.data}catch(n){return console.log("Error: Could not update message",n.message),{}}},async export_multiple_discussions(t){try{if(t.length>0){const e=await ye.post("/export_multiple_discussions",{discussion_ids:t});if(e)return e.data}}catch(e){return console.log("Error: Could not export multiple discussions",e.message),{}}},async import_multiple_discussions(t){try{if(t.length>0){console.log("sending import",t);const e=await ye.post("/import_multiple_discussions",{jArray:t});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(t=>t.title&&t.title.includes(this.filterTitle)):this.list=this.tempList,this.filterInProgress=!1},100))},async selectDiscussion(t){t&&(console.log("this.currentDiscussion",this.currentDiscussion),this.currentDiscussion===void 0?(this.currentDiscussion=t,this.setPageTitle(t),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(t.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)})):this.currentDiscussion.id!=t.id&&(this.currentDiscussion=t,this.setPageTitle(t),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(t.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)})),be(()=>{const e=document.getElementById("dis-"+this.currentDiscussion.id);this.scrollToElementInContainer(e,"leftPanel");const n=document.getElementById("messages-list");this.scrollBottom(n)}))},scrollToElement(t){t?t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}):console.log("Error: scrollToElement")},scrollToElementInContainer(t,e){try{const n=t.offsetTop;document.getElementById(e).scrollTo({top:n,behavior:"smooth"})}catch{}},scrollBottom(t){t?t.scrollTo({top:t.scrollHeight,behavior:"smooth"}):console.log("Error: scrollBottom")},scrollTop(t){t?t.scrollTo({top:0,behavior:"smooth"}):console.log("Error: scrollTop")},createUserMsg(t){let e={content:t.message,id:t.id,rank:0,sender:t.user,created_at:t.created_at,steps:[],html_js_s:[]};this.discussionArr.push(e),be(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)})},updateLastUserMsg(t){const e=this.discussionArr.indexOf(s=>s.id=t.user_id),n={binding:t.binding,content:t.message,created_at:t.created_at,type:t.type,finished_generating_at:t.finished_generating_at,id:t.user_id,model:t.model,personality:t.personality,sender:t.user,steps:[]};e!==-1&&(this.discussionArr[e]=n)},socketIOConnected(){return console.log("socketIOConnected"),this.$store.state.isConnected=!0,!0},socketIODisconnected(){return console.log("socketIOConnected"),this.$store.state.isConnected=!1,!0},new_message(t){console.log("create bot",t);let e={sender:t.sender,message_type:t.message_type,sender_type:t.sender_type,content:t.content,id:t.id,parent_id:t.parent_id,binding:t.binding,model:t.model,personality:t.personality,created_at:t.created_at,finished_generating_at:t.finished_generating_at,rank:0,steps:[],parameters:t.parameters,metadata:t.metadata};console.log(e),this.discussionArr.push(e),(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,t.message),console.log("infos",t)},talk(t){this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),ye.get("/get_generation_status",{}).then(e=>{e&&(e.data.status?console.log("Already generating"):(console.log("Generating message from ",e.data.status),Ee.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)})},sendMsg(t){if(!t){this.$refs.toast.showToast("Message contains no content!",4,!1);return}this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),ye.get("/get_generation_status",{}).then(e=>{if(e)if(e.data.status)console.log("Already generating");else{Ee.emit("generate_msg",{prompt:t});let n=0;this.discussionArr.length>0&&(n=Number(this.discussionArr[this.discussionArr.length-1].id)+1);let s={message:t,id:n,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:t,id:n,parent_id:n,binding:"",model:"",personality:"",created_at:new Date().toLocaleString(),finished_generating_at:new Date().toLocaleString(),rank:0,steps:[],parameters:null,metadata:[]};this.createUserMsg(s)}}).catch(e=>{console.log("Error: Could not get generation status",e)})},notify(t){self.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),be(()=>{const e=document.getElementById("messages-list");this.scrollBottom(e)}),this.$refs.toast.showToast(t.content,5,t.status),this.chime.play()},streamMessageContent(t){const e=t.discussion_id;if(this.setDiscussionLoading(e,!0),this.currentDiscussion.id==e){this.isGenerating=!0;const n=this.discussionArr.findIndex(o=>o.id==t.id),s=this.discussionArr[n];if(s&&(t.message_type==this.msgTypes.MSG_TYPE_FULL||t.message_type==this.msgTypes.MSG_TYPE_FULL_INVISIBLE_TO_AI))s.content=t.content,s.finished_generating_at=t.finished_generating_at;else if(s&&t.message_type==this.msgTypes.MSG_TYPE_CHUNK)s.content+=t.content;else if(t.message_type==this.msgTypes.MSG_TYPE_STEP_START)s.steps.push({message:t.content,done:!1,status:!0});else if(t.message_type==this.msgTypes.MSG_TYPE_STEP_END){const o=s.steps.find(r=>r.message===t.content);if(o){o.done=!0;try{console.log(t.parameters);const r=t.parameters;o.status=r.status,console.log(r)}catch(r){console.error("Error parsing JSON:",r.message)}}}else t.message_type==this.msgTypes.MSG_TYPE_JSON_INFOS?(console.log("JSON message"),console.log(t.metadata),s.metadata=t.metadata):t.message_type==this.msgTypes.MSG_TYPE_EXCEPTION&&this.$refs.toast.showToast(t.content,5,!1)}this.$nextTick(()=>{ve.replace()})},async changeTitleUsingUserMSG(t,e){const n=this.list.findIndex(o=>o.id==t),s=this.list[n];e&&(s.title=e,this.tempList=this.list,await this.edit_title(t,e))},async createNewDiscussion(){this.new_discussion(null)},loadLastUsedDiscussion(){console.log("Loading last discussion");const t=localStorage.getItem("selected_discussion");if(console.log("Last discussion id: ",t),t){const e=this.list.findIndex(s=>s.id==t),n=this.list[e];n&&this.selectDiscussion(n)}},async deleteDiscussion(t){await this.delete_discussion(t),this.currentDiscussion.id==t&&(this.currentDiscussion={},this.discussionArr=[],this.setPageTitle()),this.list.splice(this.list.findIndex(e=>e.id==t),1),this.createDiscussionList(this.list)},async deleteDiscussionMulti(){const t=this.selectedDiscussions;for(let e=0;es.id==n.id),1)}this.tempList=this.list,this.isCheckbox=!1,this.$refs.toast.showToast("Removed ("+t.length+") items",4,!0),this.showConfirmation=!1,console.log("Multi delete done")},async deleteMessage(t){await this.delete_message(t).then(()=>{this.discussionArr.splice(this.discussionArr.findIndex(e=>e.id==t),1)}).catch(()=>{this.$refs.toast.showToast("Could not remove message",4,!1),console.log("Error: Could not delete message")})},async editTitle(t){const e=this.list.findIndex(s=>s.id==t.id),n=this.list[e];n.title=t.title,n.loading=!0,await this.edit_title(t.id,t.title),n.loading=!1},checkUncheckDiscussion(t,e){const n=this.list.findIndex(o=>o.id==e),s=this.list[n];s.checkBoxValue=t.target.checked,this.tempList=this.list},selectAllDiscussions(){this.isSelectAll=!this.tempList.filter(t=>t.checkBoxValue==!1).length>0;for(let t=0;t({id:n.id,title:n.title,selected:!1,loading:!1,checkBoxValue:!1})).sort(function(n,s){return s.id-n.id});this.list=e,this.tempList=e,console.log("List created")}},setDiscussionLoading(t,e){const n=this.list.findIndex(o=>o.id==t),s=this.list[n];s.loading=e},setPageTitle(t){if(t)if(t.id){const e=t.title?t.title==="untitled"?"New discussion":t.title:"New discussion";document.title="LoLLMS WebUI - "+e}else{const e=t||"Welcome";document.title="LoLLMS WebUI - "+e}else{const e=t||"Welcome";document.title="LoLLMS WebUI - "+e}},async rankUpMessage(t){await this.message_rank_up(t).then(e=>{const n=this.discussionArr[this.discussionArr.findIndex(s=>s.id==t)];n.rank=e.new_rank}).catch(()=>{this.$refs.toast.showToast("Could not rank up message",4,!1),console.log("Error: Could not rank up message")})},async rankDownMessage(t){await this.message_rank_down(t).then(e=>{const n=this.discussionArr[this.discussionArr.findIndex(s=>s.id==t)];n.rank=e.new_rank}).catch(()=>{this.$refs.toast.showToast("Could not rank down message",4,!1),console.log("Error: Could not rank down message")})},async updateMessage(t,e){await this.edit_message(t,e).then(()=>{const n=this.discussionArr[this.discussionArr.findIndex(s=>s.id==t)];n.content=e}).catch(()=>{this.$refs.toast.showToast("Could not update message",4,!1),console.log("Error: Could not update message")})},resendMessage(t,e){be(()=>{ve.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),ye.get("/get_generation_status",{}).then(n=>{n&&(console.log("--------------------"),console.log(t),n.data.status?console.log("Already generating"):(console.log("generate_msg_from"),Ee.emit("generate_msg_from",{prompt:e,id:t})))}).catch(n=>{console.log("Error: Could not get generation status",n)})},continueMessage(t,e){be(()=>{ve.replace()}),this.isGenerating=!0,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),ye.get("/get_generation_status",{}).then(n=>{n&&(console.log(n),n.data.status?console.log("Already generating"):Ee.emit("continue_generate_msg_from",{prompt:e,id:t}))}).catch(n=>{console.log("Error: Could not get generation status",n)})},stopGenerating(){this.stop_gen(),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),console.log("Stopped generating"),be(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},finalMsgEvent(t){console.log("final",t),t.parent_id;const e=t.discussion_id;if(this.currentDiscussion.id==e){const n=this.discussionArr.findIndex(s=>s.id==t.id);this.discussionArr[n].content=t.content,this.discussionArr[n].finished_generating_at=t.finished_generating_at}be(()=>{const n=document.getElementById("messages-list");this.scrollBottom(n)}),this.isGenerating=!1,this.setDiscussionLoading(this.currentDiscussion.id,this.isGenerating),this.chime.play()},copyToClipBoard(t){this.$refs.toast.showToast("Copied to clipboard successfully",4,!0);let e="";t.message.binding&&(e=`Binding: ${t.message.binding}`);let n="";t.message.personality&&(n=` Personality: ${t.message.personality}`);let s="";t.created_at_parsed&&(s=` Created: ${t.created_at_parsed}`);let o="";t.message.content&&(o=t.message.content);let r="";t.message.model&&(r=`Model: ${t.message.model}`);let i="";t.message.seed&&(i=`Seed: ${t.message.seed}`);let a="";t.time_spent&&(a=` Time spent: ${t.time_spent}`);let l="";l=`${e} ${r} ${i} ${a}`.trim();const d=`${t.message.sender}${n}${s} @@ -197,4 +197,4 @@ ${o} ${l}`;navigator.clipboard.writeText(d),be(()=>{ve.replace()})},closeToast(){this.showToast=!1},saveJSONtoFile(t,e){e=e||"data.json";const n=document.createElement("a");n.href=URL.createObjectURL(new Blob([JSON.stringify(t,null,2)],{type:"text/plain"})),n.setAttribute("download",e),document.body.appendChild(n),n.click(),document.body.removeChild(n)},parseJsonObj(t){try{return JSON.parse(t)}catch(e){return this.$refs.toast.showToast(`Could not parse JSON. `+e.message,4,!1),null}},async parseJsonFile(t){return new Promise((e,n)=>{const s=new FileReader;s.onload=o=>e(this.parseJsonObj(o.target.result)),s.onerror=o=>n(o),s.readAsText(t)})},async exportDiscussions(){const t=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(t.length>0){console.log("export",t);let e=new Date;const n=e.getFullYear(),s=(e.getMonth()+1).toString().padStart(2,"0"),o=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),i=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),d="discussions_export_"+(n+"."+s+"."+o+"."+r+i+a)+".json";this.loading=!0;const u=await this.export_multiple_discussions(t);u?(this.saveJSONtoFile(u,d),this.$refs.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this.$refs.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async importDiscussions(t){const e=await this.parseJsonFile(t.target.files[0]);await this.import_multiple_discussions(e)?(this.$refs.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$refs.toast.showToast("Failed to import discussions",4,!1)},async getPersonalityAvatars(){for(;this.$store.state.personalities===null;)await new Promise(e=>setTimeout(e,100));let t=this.$store.state.personalities;this.personalityAvatars=t.map(e=>({name:e.name,avatar:e.avatar}))},getAvatar(t){if(t.toLowerCase().trim()==this.$store.state.config.user_name.toLowerCase().trim())return"user_infos/"+this.$store.state.config.user_avatar;const e=this.personalityAvatars.findIndex(s=>s.name===t),n=this.personalityAvatars[e];if(n)return console.log("Avatar",n.avatar),n.avatar},setFileListChat(t){try{this.$refs.chatBox.fileList=this.$refs.chatBox.fileList.concat(t)}catch(e){this.$refs.toast.showToast(`Failed to set filelist in chatbox -`+e.message,4,!1)}this.isDragOverChat=!1},setDropZoneChat(){this.isDragOverChat=!0,this.$refs.dragdropChat.show=!0},async setFileListDiscussion(t){if(t.length>1){this.$refs.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(t[0]);await this.import_multiple_discussions(e)?(this.$refs.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$refs.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1},setDropZoneDiscussion(){this.isDragOverDiscussion=!0,this.$refs.dragdropDiscussion.show=!0}},async created(){for(this.$store.state.isConnected=!1,ye.get("/get_lollms_webui_version",{}).then(t=>{t&&(this.version=t.data.version)}).catch(t=>{console.log("Error: Could not get generation status",t)}),this.$nextTick(()=>{ve.replace()}),Ee.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},Ee.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),Ee.disconnect()},Ee.on("connected",this.socketIOConnected),Ee.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("Setting title"),this.setPageTitle(),console.log("listing discussions"),await this.list_discussions(),console.log("loading last discussion"),this.loadLastUsedDiscussion(),console.log("Discussions view is ready"),Ee.on("notification",this.notify),Ee.on("new_message",this.new_message),Ee.on("update_message",this.streamMessageContent),Ee.on("close_message",this.finalMsgEvent),console.log("Setting events"),Ee.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},mounted(){this.$nextTick(()=>{ve.replace()})},async activated(){await this.getPersonalityAvatars(),this.isCreated&&be(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},components:{Discussion:Ug,Message:qg,ChatBox:Hg,WelcomeComponent:Vg,Toast:Ks,DragDrop:bl},watch:{filterTitle(t){t==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(t){be(()=>{ve.replace()}),t||(this.isSelectAll=!1)},socketConnected(t){console.log("Websocket connected (watch)",t)},showConfirmation(){be(()=>{ve.replace()})},isSearch(){be(()=>{ve.replace()})}},computed:{client_id(){return Ee.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 be(()=>{ve.replace()}),this.list.filter(t=>t.checkBoxValue==!0)}}},YGe=Object.assign(ZGe,{__name:"DiscussionsView",setup(t){return Jr(()=>{AVe()}),ye.defaults.baseURL="/",(e,n)=>(k(),C(Re,null,[ue(Ts,{name:"fade-and-fly"},{default:Ne(()=>[e.isReady?P("",!0):(k(),C("div",TVe,[c("div",MVe,[c("div",OVe,[c("div",RVe,[NVe,c("div",DVe,[c("p",LVe,"Lord of Large Language Models v "+H(e.version),1),IVe])]),PVe,FVe,BVe,$Ve])])]))]),_:1}),e.isReady?(k(),C("button",{key:0,onClick:n[0]||(n[0]=(...s)=>e.togglePanel&&e.togglePanel(...s)),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"},[se(c("div",null,jVe,512),[[Ye,e.panelCollapsed]]),se(c("div",null,qVe,512),[[Ye,!e.panelCollapsed]])])):P("",!0),ue(Ts,{name:"slide-right"},{default:Ne(()=>[e.showPanel?(k(),C("div",HVe,[c("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:n[19]||(n[19]=de(s=>e.setDropZoneDiscussion(),["stop","prevent"]))},[c("div",VVe,[c("div",GVe,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:n[1]||(n[1]=s=>e.createNewDiscussion())},WVe),c("button",{class:Me(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:n[2]||(n[2]=s=>e.isCheckbox=!e.isCheckbox)},YVe,2),JVe,QVe,c("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:n[3]||(n[3]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},null,544),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:n[4]||(n[4]=de(s=>e.$refs.fileDialog.click(),["stop"]))},eGe),e.isOpen?(k(),C("div",tGe,[c("button",{onClick:n[5]||(n[5]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},"LOLLMS"),c("button",{onClick:n[6]||(n[6]=(...s)=>e.importChatGPT&&e.importChatGPT(...s))},"ChatGPT")])):P("",!0),c("button",{class:Me(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isSearch?"text-secondary":""]),title:"Filter discussions",type:"button",onClick:n[7]||(n[7]=s=>e.isSearch=!e.isSearch)},sGe,2),e.showConfirmation?P("",!0):(k(),C("button",{key:1,title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:n[8]||(n[8]=s=>e.showConfirmation=!0)},rGe)),e.showConfirmation?(k(),C("div",iGe,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:n[9]||(n[9]=de(s=>e.showConfirmation=!1,["stop"]))},lGe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:n[10]||(n[10]=de(s=>e.save_configuration(),["stop"]))},dGe)])):P("",!0),e.loading?(k(),C("div",uGe,fGe)):P("",!0)]),e.isSearch?(k(),C("div",pGe,[c("div",gGe,[c("div",mGe,[_Ge,c("div",bGe,[c("div",{class:Me(["hover:text-secondary duration-75 active:scale-90",e.filterTitle?"visible":"invisible"]),title:"Clear",onClick:n[11]||(n[11]=s=>e.filterTitle="")},vGe,2)]),se(c("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":n[12]||(n[12]=s=>e.filterTitle=s),onInput:n[13]||(n[13]=s=>e.filterDiscussions())},null,544),[[Oe,e.filterTitle]])])])])):P("",!0),e.isCheckbox?(k(),C("hr",wGe)):P("",!0),e.isCheckbox?(k(),C("div",xGe,[c("div",kGe,[e.selectedDiscussions.length>0?(k(),C("p",EGe,"Selected: "+H(e.selectedDiscussions.length),1)):P("",!0)]),c("div",CGe,[e.selectedDiscussions.length>0?(k(),C("div",AGe,[e.showConfirmation?P("",!0):(k(),C("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:n[14]||(n[14]=de(s=>e.showConfirmation=!0,["stop"]))},TGe)),e.showConfirmation?(k(),C("div",MGe,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:n[15]||(n[15]=de((...s)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...s),["stop"]))},RGe),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:n[16]||(n[16]=de(s=>e.showConfirmation=!1,["stop"]))},DGe)])):P("",!0)])):P("",!0),c("div",LGe,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a file",type:"button",onClick:n[17]||(n[17]=de((...s)=>e.exportDiscussions&&e.exportDiscussions(...s),["stop"]))},PGe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:n[18]||(n[18]=de((...s)=>e.selectAllDiscussions&&e.selectAllDiscussions(...s),["stop"]))},BGe)])])])):P("",!0)]),c("div",$Ge,[ue(bl,{ref:"dragdropDiscussion",onPanelDrop:e.setFileListDiscussion},{default:Ne(()=>[xe("Drop your discussion file here ")]),_:1},8,["onPanelDrop"])]),c("div",zGe,[c("div",{class:Me(["mx-4 flex flex-col flex-grow",e.isDragOverDiscussion?"pointer-events-none":""])},[c("div",{id:"dis-list",class:Me([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow"])},[e.list.length>0?(k(),st(Ut,{key:0,name:"list"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(e.list,(s,o)=>(k(),st(Ug,{key:s.id,id:s.id,title:s.title,selected:e.currentDiscussion.id==s.id,loading:s.loading,isCheckbox:e.isCheckbox,checkBoxValue:s.checkBoxValue,onSelect:r=>e.selectDiscussion(s),onDelete:r=>e.deleteDiscussion(s.id),onEditTitle:e.editTitle,onChecked:e.checkUncheckDiscussion},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","onSelect","onDelete","onEditTitle","onChecked"]))),128))]),_:1})):P("",!0),e.list.length<1?(k(),C("div",jGe,qGe)):P("",!0),HGe],2)],2)])],32)])):P("",!0)]),_:1}),e.isReady?(k(),C("div",{key:1,class:"relative flex flex-col flex-grow",onDragover:n[20]||(n[20]=de(s=>e.setDropZoneChat(),["stop","prevent"]))},[c("div",VGe,[ue(bl,{ref:"dragdropChat",onPanelDrop:e.setFileListChat},null,8,["onPanelDrop"])]),c("div",{id:"messages-list",class:Me(["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":""])},[c("div",GGe,[e.discussionArr.length>0?(k(),st(Ut,{key:0,name:"list"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(e.discussionArr,(s,o)=>(k(),st(qg,{key:s.id,message:s,id:"msg-"+s.id,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(s.sender)},null,8,["message","id","onCopy","onDelete","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","avatar"]))),128))]),_:1})):P("",!0),e.currentDiscussion.id?P("",!0):(k(),st(Vg,{key:1}))]),KGe,e.currentDiscussion.id?(k(),C("div",WGe,[ue(Hg,{ref:"chatBox",onMessageSentEvent:e.sendMsg,loading:e.isGenerating,discussionList:e.discussionArr,onStopGenerating:e.stopGenerating,"on-show-toast-message":e.showToastMessage,"on-talk":e.talk},null,8,["onMessageSentEvent","loading","discussionList","onStopGenerating","on-show-toast-message","on-talk"])])):P("",!0)],2)],32)):P("",!0),ue(Ks,{ref:"toast"},null,512),ue($g,{ref:"messageBox"},null,512)],64))}}),JGe=Ue(YGe,[["__scopeId","data-v-7e498efe"]]),QGe=zy({history:oy("/"),routes:[{path:"/playground/",name:"playground",component:iMe},{path:"/extensions/",name:"extensions",component:mMe},{path:"/help/",name:"help",component:LMe},{path:"/settings/",name:"settings",component:Q$e},{path:"/training/",name:"training",component:yze},{path:"/quantizing/",name:"quantizing",component:Tze},{path:"/",name:"discussions",component:JGe}]});const ki=X1(p2);console.log("Loaded main.js");const XGe=A0({state(){return{ready:!1,settingsChanged:!1,isConnected:!1,config:null,mountedPers:null,mountedPersArr:null,bindingsArr:null,modelsArr:null,models_zoo:null,personalities:null,diskUsage:null,ramUsage:null,vramUsage:null,extensionsZoo:null}},mutations:{setIsConnected(t,e){t.isConnected=e},setConfig(t,e){t.config=e},setPersonalities(t,e){t.personalities=e},setMountedPers(t,e){t.mountedPers=e},setMountedPersArr(t,e){t.mountedPersArr=e},setBindingsArr(t,e){t.bindingsArr=e},setModelsArr(t,e){t.modelsArr=e},setDiskUsage(t,e){t.diskUsage=e},setRamUsage(t,e){t.ramUsage=e},setVramUsage(t,e){t.vramUsage=e},setExtensionsZoo(t,e){t.extensionsZoo=e},setModelsZoo(t,e){t.models_zoo=e}},getters:{getIsConnected(t){return t.isConnected},getConfig(t){return t.config},getPersonalities(t){return t.personalities},getMountedPersArr(t){return t.mountedPersArr},getMountedPers(t){return t.mountedPers},getbindingsArr(t){return t.bindingsArr},getModelsArr(t){return t.modelsArr},getDiskUsage(t){return t.diskUsage},getRamUsage(t){return t.ramUsage},getVramUsage(t){return t.vramUsage},getModelsZoo(t){return t.models_zoo},getExtensionsZoo(t){return t.extensionsZoo}},actions:{async refreshConfig({commit:t}){console.log("Fetching configuration");try{const e=await bn("get_config");let n=e.personalities[e.active_personality_id].split("/");e.personality_category=n[0],e.personality_folder=n[1],console.log("Recovered config"),console.log(e),t("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshPersonalitiesArr({commit:t}){let e=[];const n=await bn("get_all_personalities"),s=Object.keys(n);console.log("Personalities recovered:"+this.state.config.personalities);for(let o=0;o{const d=this.state.config.personalities.includes(r+"/"+l.folder);let u={};return u=l,u.category=r,u.full_path=r+"/"+l.folder,u.isMounted=d,u});e.length==0?e=a:e=e.concat(a)}e.sort((o,r)=>o.name.localeCompare(r.name)),t("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:t}){let e=[];for(let n=0;ni.full_path==s),r=this.state.personalities[o];r?e.push(r):e.push(this.state.personalities[this.state.personalities.findIndex(i=>i.full_path=="generic/lollms")])}console.log("Personalities list",this.state.personalities),t("setMountedPersArr",e),console.log("active_personality_id",this.state.config.active_personality_id),console.log("selected pers",this.state.config.personalities[this.state.config.active_personality_id]),this.state.mountedPers=this.state.personalities[this.state.personalities.findIndex(n=>n.full_path==this.state.config.personalities[this.state.config.active_personality_id])],console.log("selected pers",this.state.mountedPers)},async refreshBindings({commit:t}){let e=await bn("list_bindings");t("setBindingsArr",e)},async refreshModels({commit:t}){let e=await bn("list_models");t("setModelsArr",e)},async refreshExtensionsZoo({commit:t}){let e=await bn("list_extensions");t("setExtensionsZoo",e)},async refreshDiskUsage({commit:t}){this.state.diskUsage=await bn("disk_usage")},async refreshRamUsage({commit:t}){this.state.ramUsage=await bn("ram_usage")},async refreshVramUsage({commit:t}){console.log("getting gpu data");const e=await bn("vram_usage"),n=[];if(e.nb_gpus>0){for(let o=0;o{console.log("found models");let n=e.data;n.sort((s,o)=>s.title.localeCompare(o.title));for(let s=0;si.title==o)==-1){let i={};i.title=o,i.path=o,i.icon="",i.isCustomModel=!0,i.isInstalled=!0,n.push(i)}}n.sort((s,o)=>s.isInstalled&&!o.isInstalled?-1:!s.isInstalled&&o.isInstalled?1:0),n.forEach(s=>{s.title==this.state.config.model_name?s.selected=!0:s.selected=!1}),t("setModelsZoo",n),console.log("Models zoo loaded successfully")}).catch(e=>{console.log(e.message,"fetchModels")})},fetchCustomModels({commit:t}){ye.get("/list_models").then(e=>{}).catch(e=>{console.log(e.message,"fetchCustomModels")})}}});async function bn(t){try{const e=await ye.get("/"+t);if(e)return e.data}catch(e){throw console.log(e.message,"api_get_req"),e}}let jh=!1;ki.mixin({created(){jh||(jh=!0,console.log("Calling"),this.$store.dispatch("refreshConfig").then(()=>{console.log("recovered config"),this.$store.dispatch("refreshPersonalitiesArr").then(()=>{this.$store.dispatch("refreshMountedPersonalities"),this.$store.dispatch("refreshBindings"),this.$store.dispatch("refreshModels"),this.$store.dispatch("refreshDiskUsage"),this.$store.dispatch("refreshRamUsage"),this.$store.dispatch("refreshVramUsage"),this.$store.dispatch("refreshModelsZoo"),this.$store.dispatch("refreshExtensionsZoo"),this.$store.state.ready=!0,console.log("done loading data")})}))},beforeMount(){}});ki.use(QGe);ki.use(XGe);ki.mount("#app"); +`+e.message,4,!1)}this.isDragOverChat=!1},setDropZoneChat(){this.isDragOverChat=!0,this.$refs.dragdropChat.show=!0},async setFileListDiscussion(t){if(t.length>1){this.$refs.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(t[0]);await this.import_multiple_discussions(e)?(this.$refs.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$refs.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1},setDropZoneDiscussion(){this.isDragOverDiscussion=!0,this.$refs.dragdropDiscussion.show=!0}},async created(){for(this.$store.state.isConnected=!1,ye.get("/get_lollms_webui_version",{}).then(t=>{t&&(this.version=t.data.version)}).catch(t=>{console.log("Error: Could not get generation status",t)}),this.$nextTick(()=>{ve.replace()}),Ee.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},Ee.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),Ee.disconnect()},Ee.on("connected",this.socketIOConnected),Ee.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("Setting title"),this.setPageTitle(),console.log("listing discussions"),await this.list_discussions(),console.log("loading last discussion"),this.loadLastUsedDiscussion(),console.log("Discussions view is ready"),Ee.on("notification",this.notify),Ee.on("new_message",this.new_message),Ee.on("update_message",this.streamMessageContent),Ee.on("close_message",this.finalMsgEvent),console.log("Setting events"),Ee.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},mounted(){this.$nextTick(()=>{ve.replace()})},async activated(){await this.getPersonalityAvatars(),this.isCreated&&be(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},components:{Discussion:Ug,Message:qg,ChatBox:Hg,WelcomeComponent:Vg,Toast:Ks,DragDrop:bl},watch:{filterTitle(t){t==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(t){be(()=>{ve.replace()}),t||(this.isSelectAll=!1)},socketConnected(t){console.log("Websocket connected (watch)",t)},showConfirmation(){be(()=>{ve.replace()})},isSearch(){be(()=>{ve.replace()})}},computed:{client_id(){return Ee.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 be(()=>{ve.replace()}),this.list.filter(t=>t.checkBoxValue==!0)}}},ZGe=Object.assign(WGe,{__name:"DiscussionsView",setup(t){return Jr(()=>{CVe()}),ye.defaults.baseURL="/",(e,n)=>(k(),C(Re,null,[ue(Ts,{name:"fade-and-fly"},{default:Ne(()=>[e.isReady?P("",!0):(k(),C("div",SVe,[c("div",TVe,[c("div",MVe,[c("div",OVe,[RVe,c("div",NVe,[c("p",DVe,"Lord of Large Language Models v "+H(e.version),1),LVe])]),IVe,PVe,FVe,BVe])])]))]),_:1}),e.isReady?(k(),C("button",{key:0,onClick:n[0]||(n[0]=(...s)=>e.togglePanel&&e.togglePanel(...s)),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"},[se(c("div",null,zVe,512),[[Ye,e.panelCollapsed]]),se(c("div",null,UVe,512),[[Ye,!e.panelCollapsed]])])):P("",!0),ue(Ts,{name:"slide-right"},{default:Ne(()=>[e.showPanel?(k(),C("div",qVe,[c("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:n[19]||(n[19]=de(s=>e.setDropZoneDiscussion(),["stop","prevent"]))},[c("div",HVe,[c("div",VVe,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"button",onClick:n[1]||(n[1]=s=>e.createNewDiscussion())},KVe),c("button",{class:Me(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isCheckbox?"text-secondary":""]),title:"Edit discussion list",type:"button",onClick:n[2]||(n[2]=s=>e.isCheckbox=!e.isCheckbox)},ZVe,2),YVe,JVe,c("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:n[3]||(n[3]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},null,544),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Import discussions",type:"button",onClick:n[4]||(n[4]=de(s=>e.$refs.fileDialog.click(),["stop"]))},XVe),e.isOpen?(k(),C("div",eGe,[c("button",{onClick:n[5]||(n[5]=(...s)=>e.importDiscussions&&e.importDiscussions(...s))},"LOLLMS"),c("button",{onClick:n[6]||(n[6]=(...s)=>e.importChatGPT&&e.importChatGPT(...s))},"ChatGPT")])):P("",!0),c("button",{class:Me(["text-2xl hover:text-secondary duration-75 active:scale-90",e.isSearch?"text-secondary":""]),title:"Filter discussions",type:"button",onClick:n[7]||(n[7]=s=>e.isSearch=!e.isSearch)},nGe,2),e.showConfirmation?P("",!0):(k(),C("button",{key:1,title:"Save configuration",class:"text-2xl hover:text-secondary duration-75 active:scale-90",onClick:n[8]||(n[8]=s=>e.showConfirmation=!0)},oGe)),e.showConfirmation?(k(),C("div",rGe,[c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel",type:"button",onClick:n[9]||(n[9]=de(s=>e.showConfirmation=!1,["stop"]))},aGe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm save changes",type:"button",onClick:n[10]||(n[10]=de(s=>e.save_configuration(),["stop"]))},cGe)])):P("",!0),e.loading?(k(),C("div",dGe,hGe)):P("",!0)]),e.isSearch?(k(),C("div",fGe,[c("div",pGe,[c("div",gGe,[mGe,c("div",_Ge,[c("div",{class:Me(["hover:text-secondary duration-75 active:scale-90",e.filterTitle?"visible":"invisible"]),title:"Clear",onClick:n[11]||(n[11]=s=>e.filterTitle="")},yGe,2)]),se(c("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":n[12]||(n[12]=s=>e.filterTitle=s),onInput:n[13]||(n[13]=s=>e.filterDiscussions())},null,544),[[Oe,e.filterTitle]])])])])):P("",!0),e.isCheckbox?(k(),C("hr",vGe)):P("",!0),e.isCheckbox?(k(),C("div",wGe,[c("div",xGe,[e.selectedDiscussions.length>0?(k(),C("p",kGe,"Selected: "+H(e.selectedDiscussions.length),1)):P("",!0)]),c("div",EGe,[e.selectedDiscussions.length>0?(k(),C("div",CGe,[e.showConfirmation?P("",!0):(k(),C("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:n[14]||(n[14]=de(s=>e.showConfirmation=!0,["stop"]))},SGe)),e.showConfirmation?(k(),C("div",TGe,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Confirm removal",type:"button",onClick:n[15]||(n[15]=de((...s)=>e.deleteDiscussionMulti&&e.deleteDiscussionMulti(...s),["stop"]))},OGe),c("button",{class:"text-2xl hover:text-red-600 duration-75 active:scale-90",title:"Cancel removal",type:"button",onClick:n[16]||(n[16]=de(s=>e.showConfirmation=!1,["stop"]))},NGe)])):P("",!0)])):P("",!0),c("div",DGe,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90 rotate-90",title:"Export selected to a file",type:"button",onClick:n[17]||(n[17]=de((...s)=>e.exportDiscussions&&e.exportDiscussions(...s),["stop"]))},IGe),c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Select All",type:"button",onClick:n[18]||(n[18]=de((...s)=>e.selectAllDiscussions&&e.selectAllDiscussions(...s),["stop"]))},FGe)])])])):P("",!0)]),c("div",BGe,[ue(bl,{ref:"dragdropDiscussion",onPanelDrop:e.setFileListDiscussion},{default:Ne(()=>[xe("Drop your discussion file here ")]),_:1},8,["onPanelDrop"])]),c("div",$Ge,[c("div",{class:Me(["mx-4 flex flex-col flex-grow",e.isDragOverDiscussion?"pointer-events-none":""])},[c("div",{id:"dis-list",class:Me([e.filterInProgress?"opacity-20 pointer-events-none":"","flex flex-col flex-grow"])},[e.list.length>0?(k(),st(Ut,{key:0,name:"list"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(e.list,(s,o)=>(k(),st(Ug,{key:s.id,id:s.id,title:s.title,selected:e.currentDiscussion.id==s.id,loading:s.loading,isCheckbox:e.isCheckbox,checkBoxValue:s.checkBoxValue,onSelect:r=>e.selectDiscussion(s),onDelete:r=>e.deleteDiscussion(s.id),onEditTitle:e.editTitle,onChecked:e.checkUncheckDiscussion},null,8,["id","title","selected","loading","isCheckbox","checkBoxValue","onSelect","onDelete","onEditTitle","onChecked"]))),128))]),_:1})):P("",!0),e.list.length<1?(k(),C("div",zGe,UGe)):P("",!0),qGe],2)],2)])],32)])):P("",!0)]),_:1}),e.isReady?(k(),C("div",{key:1,class:"relative flex flex-col flex-grow",onDragover:n[20]||(n[20]=de(s=>e.setDropZoneChat(),["stop","prevent"]))},[c("div",HGe,[ue(bl,{ref:"dragdropChat",onPanelDrop:e.setFileListChat},null,8,["onPanelDrop"])]),c("div",{id:"messages-list",class:Me(["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":""])},[c("div",VGe,[e.discussionArr.length>0?(k(),st(Ut,{key:0,name:"list"},{default:Ne(()=>[(k(!0),C(Re,null,Ge(e.discussionArr,(s,o)=>(k(),st(qg,{key:s.id,message:s,id:"msg-"+s.id,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(s.sender)},null,8,["message","id","onCopy","onDelete","onRankUp","onRankDown","onUpdateMessage","onResendMessage","onContinueMessage","avatar"]))),128))]),_:1})):P("",!0),e.currentDiscussion.id?P("",!0):(k(),st(Vg,{key:1}))]),GGe,e.currentDiscussion.id?(k(),C("div",KGe,[ue(Hg,{ref:"chatBox",onMessageSentEvent:e.sendMsg,loading:e.isGenerating,discussionList:e.discussionArr,onStopGenerating:e.stopGenerating,"on-show-toast-message":e.showToastMessage,"on-talk":e.talk},null,8,["onMessageSentEvent","loading","discussionList","onStopGenerating","on-show-toast-message","on-talk"])])):P("",!0)],2)],32)):P("",!0),ue(Ks,{ref:"toast"},null,512),ue($g,{ref:"messageBox"},null,512)],64))}}),YGe=Ue(ZGe,[["__scopeId","data-v-7e498efe"]]),JGe=zy({history:oy("/"),routes:[{path:"/playground/",name:"playground",component:iMe},{path:"/extensions/",name:"extensions",component:mMe},{path:"/help/",name:"help",component:LMe},{path:"/settings/",name:"settings",component:J$e},{path:"/training/",name:"training",component:bze},{path:"/quantizing/",name:"quantizing",component:Sze},{path:"/",name:"discussions",component:YGe}]});const ki=X1(p2);console.log("Loaded main.js");const QGe=A0({state(){return{ready:!1,settingsChanged:!1,isConnected:!1,config:null,mountedPers:null,mountedPersArr:null,bindingsArr:null,modelsArr:null,models_zoo:null,personalities:null,diskUsage:null,ramUsage:null,vramUsage:null,extensionsZoo:null}},mutations:{setIsConnected(t,e){t.isConnected=e},setConfig(t,e){t.config=e},setPersonalities(t,e){t.personalities=e},setMountedPers(t,e){t.mountedPers=e},setMountedPersArr(t,e){t.mountedPersArr=e},setBindingsArr(t,e){t.bindingsArr=e},setModelsArr(t,e){t.modelsArr=e},setDiskUsage(t,e){t.diskUsage=e},setRamUsage(t,e){t.ramUsage=e},setVramUsage(t,e){t.vramUsage=e},setExtensionsZoo(t,e){t.extensionsZoo=e},setModelsZoo(t,e){t.models_zoo=e}},getters:{getIsConnected(t){return t.isConnected},getConfig(t){return t.config},getPersonalities(t){return t.personalities},getMountedPersArr(t){return t.mountedPersArr},getMountedPers(t){return t.mountedPers},getbindingsArr(t){return t.bindingsArr},getModelsArr(t){return t.modelsArr},getDiskUsage(t){return t.diskUsage},getRamUsage(t){return t.ramUsage},getVramUsage(t){return t.vramUsage},getModelsZoo(t){return t.models_zoo},getExtensionsZoo(t){return t.extensionsZoo}},actions:{async refreshConfig({commit:t}){console.log("Fetching configuration");try{const e=await bn("get_config");let n=e.personalities[e.active_personality_id].split("/");e.personality_category=n[0],e.personality_folder=n[1],console.log("Recovered config"),console.log(e),t("setConfig",e)}catch(e){console.log(e.message,"refreshConfig")}},async refreshPersonalitiesArr({commit:t}){let e=[];const n=await bn("get_all_personalities"),s=Object.keys(n);console.log("Personalities recovered:"+this.state.config.personalities);for(let o=0;o{const d=this.state.config.personalities.includes(r+"/"+l.folder);let u={};return u=l,u.category=r,u.full_path=r+"/"+l.folder,u.isMounted=d,u});e.length==0?e=a:e=e.concat(a)}e.sort((o,r)=>o.name.localeCompare(r.name)),t("setPersonalities",e),console.log("Done loading personalities")},refreshMountedPersonalities({commit:t}){let e=[];for(let n=0;ni.full_path==s),r=this.state.personalities[o];r?e.push(r):e.push(this.state.personalities[this.state.personalities.findIndex(i=>i.full_path=="generic/lollms")])}console.log("Personalities list",this.state.personalities),t("setMountedPersArr",e),console.log("active_personality_id",this.state.config.active_personality_id),console.log("selected pers",this.state.config.personalities[this.state.config.active_personality_id]),this.state.mountedPers=this.state.personalities[this.state.personalities.findIndex(n=>n.full_path==this.state.config.personalities[this.state.config.active_personality_id])],console.log("selected pers",this.state.mountedPers)},async refreshBindings({commit:t}){let e=await bn("list_bindings");t("setBindingsArr",e)},async refreshModels({commit:t}){let e=await bn("list_models");t("setModelsArr",e)},async refreshExtensionsZoo({commit:t}){let e=await bn("list_extensions");t("setExtensionsZoo",e)},async refreshDiskUsage({commit:t}){this.state.diskUsage=await bn("disk_usage")},async refreshRamUsage({commit:t}){this.state.ramUsage=await bn("ram_usage")},async refreshVramUsage({commit:t}){console.log("getting gpu data");const e=await bn("vram_usage"),n=[];if(e.nb_gpus>0){for(let o=0;o{console.log("found models");let n=e.data;n.sort((s,o)=>s.title.localeCompare(o.title));for(let s=0;si.title==o)==-1){let i={};i.title=o,i.path=o,i.icon="",i.isCustomModel=!0,i.isInstalled=!0,n.push(i)}}n.sort((s,o)=>s.isInstalled&&!o.isInstalled?-1:!s.isInstalled&&o.isInstalled?1:0),n.forEach(s=>{s.title==this.state.config.model_name?s.selected=!0:s.selected=!1}),t("setModelsZoo",n),console.log("Models zoo loaded successfully")}).catch(e=>{console.log(e.message,"fetchModels")})},fetchCustomModels({commit:t}){ye.get("/list_models").then(e=>{}).catch(e=>{console.log(e.message,"fetchCustomModels")})}}});async function bn(t){try{const e=await ye.get("/"+t);if(e)return e.data}catch(e){throw console.log(e.message,"api_get_req"),e}}let jh=!1;ki.mixin({created(){jh||(jh=!0,console.log("Calling"),this.$store.dispatch("refreshConfig").then(()=>{console.log("recovered config"),this.$store.dispatch("refreshPersonalitiesArr").then(()=>{this.$store.dispatch("refreshMountedPersonalities"),this.$store.dispatch("refreshBindings"),this.$store.dispatch("refreshModels"),this.$store.dispatch("refreshDiskUsage"),this.$store.dispatch("refreshRamUsage"),this.$store.dispatch("refreshVramUsage"),this.$store.dispatch("refreshModelsZoo"),this.$store.dispatch("refreshExtensionsZoo"),this.$store.state.ready=!0,console.log("done loading data")})}))},beforeMount(){}});ki.use(JGe);ki.use(QGe);ki.mount("#app"); diff --git a/web/dist/index.html b/web/dist/index.html index 7259ee0f..ceaf32a0 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,7 +6,7 @@ LoLLMS WebUI - Welcome - + diff --git a/web/src/components/MarkdownRenderer.vue b/web/src/components/MarkdownRenderer.vue index 92597950..7e977dd4 100644 --- a/web/src/components/MarkdownRenderer.vue +++ b/web/src/components/MarkdownRenderer.vue @@ -214,7 +214,12 @@ export default { `; script.async = true; // Set to true if the script should be loaded asynchronously document.body.appendChild(script); - this.renderedMarkdown = markdownIt.render(this.markdownText); + if(this.markdownText){ + this.renderedMarkdown = markdownIt.render(this.markdownText); + } + else{ + this.renderedMarkdown = ""; + } nextTick(() => { feather.replace(); }); diff --git a/web/src/components/PersonalityEntry.vue b/web/src/components/PersonalityEntry.vue index 50cbb19a..1f5fbcfa 100644 --- a/web/src/components/PersonalityEntry.vue +++ b/web/src/components/PersonalityEntry.vue @@ -7,10 +7,10 @@
- + -

+

{{ personality.name }}

@@ -24,22 +24,23 @@ - + +
+ + +
+
-
- - -